Class IPCondition

  • All Implemented Interfaces:
    Condition, Cloneable

    @Deprecated
    public class IPCondition
    extends Object
    implements Condition
    Deprecated.
    The class IPCondition is a plugin implementation of Condition. This lets you define the IP addresses, IP address ranges and DNS name patterns for which the policy applies
    • Constructor Detail

      • IPCondition

        public IPCondition()
        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
      • 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 conditions uses properties START_IP, END_IP, IP_RANGE and DNS_NAME. The properties should have at least one of the keys START_IP, IP_RANGE and DNS_NAME. The values of the keys should be Set where each element is a String that conforms to the format dictated by IP or DNS_NAME. The parameter is not cloned before storing the reference to it.
        Throws:
        PolicyException - if properties is null or does not contain at least one of the keys IP and DNS_NAME and/or their values do not conform to the format dictated by IP and DNS_NAME
        See Also:
        Condition.START_IP, Condition.END_IP, #IP_RANGE, Condition.DNS_NAME, Condition.REQUEST_IP, Condition.REQUEST_DNS_NAME
      • getProperties

        public Map getProperties()
        Deprecated.
        Gets the properties of the condition.
        Specified by:
        getProperties in interface Condition
        Returns:
        unmodifiable map view of the properties that govern the evaluation of the condition. Please note that properties is not cloned before returning
        See Also:
        setProperties(Map)
      • 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
        Specified by:
        getConditionDecision in interface Condition
        Parameters:
        token - single sign on token of the user
        env - request specific environment map of key/value pairs IPCondition looks for values of keys REQUEST_IP and REQUEST_DNS_NAME in the env map. If REQUEST_IP and/or REQUEST_DNS_NAME could not be determined from env, they are obtained from single sign on token of the user.
        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 CondtionDecision. 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 condition has not been initialized with a successful call to setProperties(Map) and/or the value of key REQUEST_IP is not a String or the value of of key REQUEST_DNS_NAME is not a Set of strings.
        SSOException - if the token is invalid
        See Also:
        setProperties(Map), Condition.START_IP, Condition.END_IP, #IP_RANGE, Condition.DNS_NAME, Condition.REQUEST_IP, Condition.REQUEST_DNS_NAME
      • getRequestIp

        public static String getRequestIp​(Map env)
        Deprecated.
        Helper method to extract REQUEST_IP
        Parameters:
        env - map containing environment description. Note that the type of the value corresponding to REQUEST_IP parameter differs depending upon invocation path. It will be a String when invoked by the agents, but it will be a Set when invoked via the DecisionResource (GET ws/1/entitlement/entitlements).
        Returns:
        the IP that was used
      • 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