Class IPv4Condition

  • All Implemented Interfaces:
    EntitlementCondition

    public class IPv4Condition
    extends EntitlementConditionAdaptor
    An EntitlementCondition that can be used to enable/disable an authorization policy based on the IP address and DNS name of the originating client requesting access to a resource.
    • Field Detail

      • debug

        protected final Debug debug
    • Constructor Detail

      • IPv4Condition

        public IPv4Condition()
        Constructs a new IPv4Condition instance.
    • Method Detail

      • stringToIp

        protected Long stringToIp​(String ip)
                           throws EntitlementException
        Factory method for constructing an IP value from its String representation.
        Parameters:
        ip - A String representation of an IP value.
        Returns:
        An IP value.
        Throws:
        EntitlementException - If argument is not a string representing an IP value understood by this object.
      • setState

        public void setState​(String state)
        Sets state of this object from a JSON string.
        Parameters:
        state - State of the object encoded as a JSON string
      • getStartIp

        public String getStartIp()
      • getEndIp

        public String getEndIp()
      • getState

        public String getState()
        Returns state of the object encoded as a JSON string.
        Returns:
        state of the object encoded as a JSON string.
      • getRequestIp

        public String getRequestIp​(Map env)
        Helper method to extract REQUEST_IP.
        Parameters:
        env - The 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<String> when invoked via the DecisionResource (GET ws/1/entitlement/entitlements).
        Returns:
        The IP that was used, can return null if no IP found.
      • equals

        public boolean equals​(Object obj)
        Description copied from class: EntitlementConditionAdaptor
        Returns true if the passed in object is equal to this object
        Overrides:
        equals in class EntitlementConditionAdaptor
        Parameters:
        obj - object to check for equality
        Returns:
        true if the passed in object is equal to this object