Class DNOrIPAddressListTokenRestriction

    • Constructor Detail

      • DNOrIPAddressListTokenRestriction

        public DNOrIPAddressListTokenRestriction()
        Default constructor for InternalSession deserialization.
      • DNOrIPAddressListTokenRestriction

        public DNOrIPAddressListTokenRestriction​(String dn,
                                                 Set<String> hostNames,
                                                 ServiceSchemaManager serviceSchemaManager)
                                          throws UnknownHostException
        Constructs DNOrIPAddressListTokenRestriction object based on the DN and list of host names to be restricted.
        Parameters:
        dn - the DN of the user
        hostNames - list of host names.
        serviceSchemaManager - the service's schema manager.
        Throws:
        UnknownHostException - if the host cannot be resolved.
    • Method Detail

      • toString

        public String toString()
        This method returns the restriction as a string.
        Overrides:
        toString in class Object
        Returns:
        A SHA-1 hash of the concatenated string of DN and/or Host Name/IP Address.
      • hashCode

        public int hashCode()
        Returns a hash code for this object.
        Specified by:
        hashCode in interface TokenRestriction
        Overrides:
        hashCode in class Object
        Returns:
        a hash code value for this object.
      • isSatisfied

        public boolean isSatisfied​(Object context)
                            throws Exception
        Returns a true if the restriction matches the context for which it was set.
        Specified by:
        isSatisfied in interface TokenRestriction
        Parameters:
        context - The context from which the restriction needs to be checked. The context can be any from the following - the Single Sign on token of the Application against which the restriction is being compared - the IP Address/Host Name of the Application against which the restriction is being compared
        Returns:
        true if the restriction is satisfied.
        Throws:
        Exception - is thrown if the there was an error.
      • equals

        public boolean equals​(Object other)
        Returns true of other meets these criteria.
        1. it is not null
        2. it is an instance of DNOrIPAddressListTokenRestriction
        3. it has the same distinguished name as this object and
        4. it has the same set of IP addresses as this object.
        Specified by:
        equals in interface TokenRestriction
        Overrides:
        equals in class Object
        Parameters:
        other - the object to be used for comparison.
        Returns:
        true if other meets the above criteria.