Class SimpleTimeCondition

  • All Implemented Interfaces:
    Condition, Cloneable

    @Deprecated
    public class SimpleTimeCondition
    extends Object
    implements Condition
    Deprecated.
    Use SimpleTimeCondition instead.
    The class SimpleTimeCondition is a plugin implementation of Condition. This lets you define the time range of week days and/or date range during which a policy applies.
    • Field Detail

      • REQUEST_TIME

        public static final String REQUEST_TIME
        Deprecated.
        Key that is used to define current time that is passed in the env parameter while invoking getConditionDecision method of the SimpleTimeCondition. Value for the key should be a Long object whose value is time in milliseconds since epoch. If no value is given for this, it is assumed to be the current system time
        See Also:
        getConditionDecision(SSOToken, Map), Condition.ENFORCEMENT_TIME_ZONE, Constant Field Values
    • Constructor Detail

      • SimpleTimeCondition

        public SimpleTimeCondition()
        Deprecated.
        No argument constructor
    • Method Detail

      • getPropertyNames

        public List getPropertyNames()
        Deprecated.
        Returns a list of property names for the condition.
        Specified by:
        getPropertyNames in interface Condition
        Returns:
        list of property names
      • getPropertySyntax

        public Syntax getPropertySyntax​(String property)
        Deprecated.
        Returns the syntax for a property name
        Specified by:
        getPropertySyntax in interface Condition
        Parameters:
        property - property name
        Returns:
        Syntax for the property name
        See Also:
        Syntax
      • getDisplayName

        public String getDisplayName​(String property,
                                     Locale locale)
                              throws PolicyException
        Deprecated.
        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.
        Specified by:
        getDisplayName in interface Condition
        Parameters:
        property - property name
        locale - locale for which the property name must be customized
        Returns:
        display name for the property name
        Throws:
        PolicyException - is unable to gte the display name.
      • getValidValues

        public Set getValidValues​(String property)
                           throws PolicyException
        Deprecated.
        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.
        Specified by:
        getValidValues in interface Condition
        Parameters:
        property - property name
        Returns:
        Set of valid values for the property.
        Throws:
        PolicyException - if unable to get the Syntax.
      • setProperties

        public void setProperties​(Map properties)
                           throws PolicyException
        Deprecated.
        Sets the properties of the condition. Evaluation of ConditionDecision is influenced by these properties.
        Specified by:
        setProperties in interface Condition
        Parameters:
        properties - the properties of the condition that governs whether a policy applies. This plugin uses the property values defined for keys START_TIME, END_TIME, START_DAY, END_DAY, START_DATE, END_DATE. The properties should have at least one of the keys START_TIME, START_DAY or START_DATE. The values of the keys should be Set where each element is a String that conforms to the format dictated by START_TIME, START_DAY and START_DATE. Each of the above key, if present, should be accompanied by the key END_TIME, END_DAY, END_DATE respectively.
        Throws:
        PolicyException - if properties is null or does not contain keys as described above or does not follow the required pattern
        See Also:
        Condition.START_TIME, Condition.END_TIME, Condition.START_DAY, Condition.END_DAY, Condition.START_DATE, Condition.END_DATE, getConditionDecision(SSOToken, Map)
      • getProperties

        public Map getProperties()
        Deprecated.
        Gets the properties of the condition.
        Specified by:
        getProperties in interface Condition
        Returns:
        unmodifiable map view of properties that govern the evaluation of the condition. Please note that properties is not cloned before returning
        See Also:
        setProperties(Map)
      • clone

        public Object clone()
        Deprecated.
        Returns a copy of this object.
        Specified by:
        clone in interface Condition
        Overrides:
        clone in class Object
        Returns:
        a copy of this object
      • getConditionDecision

        public ConditionDecision getConditionDecision​(SSOToken token,
                                                      Map env)
                                               throws PolicyException,
                                                      SSOException
        Deprecated.
        Gets the decision computed by this condition object, based on the map of environment parameters A policy would be evaluated only if the decision of condition is allow. Please note that this only affects whether a policy is evaluated or not. The decision of condition could be an "allow" and the policy could evaluate to "deny".
        Specified by:
        getConditionDecision in interface Condition
        Parameters:
        token - single sign on token of the user
        env - request specific environment map of key/value pairs SimpleTimeCondition looks for values of keys REQUEST_TIME and REQUEST_TIME_ZONE in the env map. If value is not defined REQUEST_TIME_ZONE, it is assumed to be current system time. REQUEST_TIME_ZONE is used only if ENFORCEMENT_TIME_ZONE is not defined in the condition definition in the policy. If both ENFORCEMENT_TIME_ZONE and REQUEST_TIME_ZONE are not defined default system time zone is used.
        Returns:
        the condition decision. The condition decision encapsulates whether a policy applies for the request and advice messages generated by the condition and a time to live indicating how long this decision is valid
        Throws:
        PolicyException - if the condition has not been initialized with a successful call to setProperties(Map) and/or the value of keys REQUEST_TIME and/or REQUEST_TIME_ZONE are invalid.
        SSOException - if the token is invalid
        See Also:
        setProperties(Map), REQUEST_TIME, Condition.REQUEST_TIME_ZONE, Condition.ENFORCEMENT_TIME_ZONE, ConditionDecision