Interface TokenRestriction

  • All Superinterfaces:
    Serializable
    All Known Implementing Classes:
    DNOrIPAddressListTokenRestriction, NoOpTokenRestriction, PrincipalTokenRestriction

    public interface TokenRestriction
    extends Serializable
    Interface to handle the different token restriction(s). TokenRestrictions are serialized and deserialized during session failover and recovery as they are stored within InternalSession objcets. The JsonTypeInfo annotation makes sure of saving type information as part of the serialized JSON, and provides a default implementation in case the type information is missing (e.g. with old tokens that were generated without type info).
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean equals​(Object other)
      Implements standard equals() semantics as mandated by Object.
      int hashCode()
      Returns a hash code for this object.
      boolean isSatisfied​(Object context)
      Returns a true if the restriction matches the context for which it was set, otherwise it returns false.
    • Method Detail

      • equals

        boolean equals​(Object other)
        Implements standard equals() semantics as mandated by Object.
        Overrides:
        equals in class Object
        Parameters:
        other - The object to be used for comparison.
        Returns:
        true if this object is the same as the other argument; false otherwise.
      • hashCode

        int hashCode()
        Returns a hash code for this object.
        Overrides:
        hashCode in class Object
        Returns:
        A hash code value for this object.
      • isSatisfied

        boolean isSatisfied​(Object context)
                     throws Exception
        Returns a true if the restriction matches the context for which it was set, otherwise it returns false.
        Parameters:
        context - The context from which the restriction needs to be checked.
        Returns:
        boolean true if the restriction is satisfied, false otherwise.
        Throws:
        Exception - If the there was an error.