Package com.sun.identity.session.util
Class PrincipalTokenRestriction
- java.lang.Object
-
- com.sun.identity.session.util.PrincipalTokenRestriction
-
- All Implemented Interfaces:
TokenRestriction,Serializable
public class PrincipalTokenRestriction extends Object implements TokenRestriction
This Class represents a PrincipalTokenRestriction implementing the TokenRestriction interface provides methods to check and compare SSOToken restrictions for this DN- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description PrincipalTokenRestriction(String dn)CreatesPrincipalTokenRestrictionobject for the specifieddn
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object other)Compares this DN to the specified object.inthashCode()Returns a hash code for this object.booleanisSatisfied(Object context)Returns a true if the restriction matches the context for which it was set, otherwise it returns false.
-
-
-
Constructor Detail
-
PrincipalTokenRestriction
public PrincipalTokenRestriction(String dn)
CreatesPrincipalTokenRestrictionobject for the specifieddn- Parameters:
dn- the name of the DN.
-
-
Method Detail
-
hashCode
public int hashCode()
Returns a hash code for this object.- Specified by:
hashCodein interfaceTokenRestriction- Overrides:
hashCodein classObject- Returns:
- a hash code value for this object.
-
equals
public boolean equals(Object other)
Compares this DN to the specified object. The result is true if and only if the argument is not null, andotheris the same as this restriction.- Specified by:
equalsin interfaceTokenRestriction- Overrides:
equalsin classObject- Parameters:
other- - the object to compare this restriction against.- Returns:
- true if the restriction object compared as string are equal; false otherwise.
-
isSatisfied
public boolean isSatisfied(Object context) throws Exception
Returns a true if the restriction matches the context for which it was set, otherwise it returns false.- Specified by:
isSatisfiedin interfaceTokenRestriction- Parameters:
context- The context from which the restriction needs to be checked The context can be: - the SSOToken of the Application against which the restriction is being compared- Returns:
- boolean True if the restriction is satisfied, false otherwise
- Throws:
Exception- if the there was an error.
-
-