EntitlementCondition
@Deprecated public interface Condition extends Cloneable
Condition
defines an interface
to allow pluggable condition. These are used to control
policy decisions based on parameters such as time,
authentication level of the user session and IP address from which
the user is making the request.
A condition computes a ConditionDecision
based on the state
of condition object as set by setProperties
method call and the environment passed in a map of key/value pairs.
ConditionDecision
encapsulates whether a Policy
applies for the request and Advice
messages generated by
the condition.
The following Condition implementation are provided with the
Policy framework:
ConditionDecision
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Deprecated.
Returns a copy of this object.
|
ConditionDecision |
getConditionDecision(SSOToken token,
Map<String,Set<String>> env)
Deprecated.
Gets the decision computed by this condition object, based on the
Map of environment parameters |
String |
getDisplayName(String property,
Locale locale)
Deprecated.
Gets the display name for the property name.
|
Map<String,Set<String>> |
getProperties()
Deprecated.
Gets the properties of the condition
|
List<String> |
getPropertyNames()
Deprecated.
Returns a list of property names for the condition.
|
Syntax |
getPropertySyntax(String property)
Deprecated.
Returns the syntax for a property name
|
Set<String> |
getValidValues(String property)
Deprecated.
Returns a set of valid values given the property name.
|
void |
setProperties(Map<String,Set<String>> properties)
Deprecated.
Sets the properties of the condition.
|
List<String> getPropertyNames()
Syntax getPropertySyntax(String property)
property
- property nameSyntax
for the property nameSyntax
String getDisplayName(String property, Locale locale) throws PolicyException
locale
variable could be used by the plugin to
customize the display name for the given locale.
The locale
variable could be null
, in which
case the plugin must use the default locale.property
- property namelocale
- locale for which the property name must be customizedPolicyException
- If the display name could not be retrieved.Set<String> getValidValues(String property) throws PolicyException
property
- property namePolicyException
- if unable to get the Syntax.void setProperties(Map<String,Set<String>> properties) throws PolicyException
ConditionDecision
that would be
computed by a call to method getConditionDecision(Map)
and
the Advice
messages generated included in the
ConditionDecision
.
ConditionDecision
encapsulates whether a policy applies for
the request and advice messages generated by the condition.
For example, for a SimpleTimeCondition
, the properties
would define StartTime
and EndTime
, to define
the time range during which the policy appliesproperties
- the properties of the condition
that would influence the ConditionDecision
returned
by a call to method getConditionDecision(Map)
.
Keys of the properties have to be String.
Value corresponding to each key have to be a Set
of
String
elements. Each implementation of Condition
could add further restrictions on the keys and values of this
Map
.PolicyException
- for any abnormal conditionConditionDecision
Map<String,Set<String>> getProperties()
Condition.setProperties(java.util.Map<java.lang.String, java.util.Set<java.lang.String>>)
ConditionDecision getConditionDecision(SSOToken token, Map<String,Set<String>> env) throws PolicyException, SSOException
Map
of environment parameterstoken
- single-sign-on SSOToken
of the userenv
- request specific environment Map
of key/value
pairs For example this would contain IP address of remote
client for an IPCondition
.Policy
applies for the request and advice
messages
generated by the condition.
Policy framework continues evaluating a Policy
only if it
applies to the request as indicated by the
ConditionDecision
.
Otherwise, further evaluation of the Policy
is skipped.
However, the Advice
messages encapsulated in the
ConditionDecision
are aggregated and passed up,
encapsulated in the PolicyDecision
.PolicyException
- if the decision could not be computedSSOException
- if SSO token is not validConditionDecision
Object clone()
Copyright © 2010-2018, ForgeRock All Rights Reserved.