com.sun.identity.policy.interfaces
Interface Condition

All Superinterfaces:
java.lang.Cloneable

public interface Condition
extends java.lang.Cloneable

The class 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: AuthLevelCondition, AuthSchemeCondition, IPCondition, TimeCondition All condition implementations should have a public no argument constructor.

See Also:
ConditionDecision

Method Summary
 java.lang.Object clone()
          Returns a copy of this object.
 ConditionDecision getConditionDecision(SSOToken token, java.util.Map env)
          Gets the decision computed by this condition object, based on the map of environment parameters
 java.lang.String getDisplayName(java.lang.String property, java.util.Locale locale)
          Gets the display name for the property name.
 java.util.Map getProperties()
          Gets the properties of the condition
 java.util.List getPropertyNames()
          Returns a list of property names for the condition.
 Syntax getPropertySyntax(java.lang.String property)
          Returns the syntax for a property name
 java.util.Set getValidValues(java.lang.String property)
          Returns a set of valid values given the property name.
 void setProperties(java.util.Map properties)
          Sets the properties of the condition.
 

Method Detail

getPropertyNames

public java.util.List getPropertyNames()
Returns a list of property names for the condition.
Returns:
list of property names

getPropertySyntax

public Syntax getPropertySyntax(java.lang.String property)
Returns the syntax for a property name
Parameters:
property - property name
Returns:
Syntax for the property name
See Also:
Syntax

getDisplayName

public java.lang.String getDisplayName(java.lang.String property,
                                       java.util.Locale locale)
                                throws PolicyException
Gets the display name for the property name. The 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.
Parameters:
property - property name
locale - locale for which the property name must be customized
Returns:
display name for the property name.
Throws:
PolicyException -  

getValidValues

public java.util.Set getValidValues(java.lang.String property)
                             throws PolicyException
Returns a set of valid values given the property name. This method is called if the property Syntax is either the SINGLE_CHOICE or MULTIPLE_CHOICE.
Parameters:
property - property name
Returns:
Set of valid values for the property.
Throws:
PolicyException - if unable to get the Syntax.

setProperties

public void setProperties(java.util.Map properties)
                   throws PolicyException
Sets the properties of the condition. This influences the 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 TimeCondition, the properties would define StartTime and EndTime, to define the time range during which the policy applies
Parameters:
properties - 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.
Throws:
PolicyException - for any abnormal condition
See Also:
ConditionDecision

getProperties

public java.util.Map getProperties()
Gets the properties of the condition
Returns:
properties of the condition
See Also:
setProperties(java.util.Map)

getConditionDecision

public ConditionDecision getConditionDecision(SSOToken token,
                                              java.util.Map env)
                                       throws PolicyException,
                                              SSOException
Gets the decision computed by this condition object, based on the map of environment parameters
Parameters:
token - single-sign-on token of the user
env - request specific environment map of key/value pairs For example this would contain IP address of remote client for an IPCondition.
Returns:
the condition decision. The condition decision encapsulates whether a 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 policy decision.
Throws:
PolicyException - if the decision could not be computed
SSOException - if SSO token is not valid
See Also:
ConditionDecision

clone

public java.lang.Object clone()
Returns a copy of this object.
Returns:
a copy of this object


Copyright 2005 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.