Class AuthPrincipal

  • All Implemented Interfaces:
    Serializable, Principal

    public class AuthPrincipal
    extends AuthSPrincipal

    This class extends the AuthSPrincipal class.

    Principals such as this AuthPrincipal may be associated with a particular Subject to augment that Subject with an additional identity. Refer to the Subject class for more information on how to achieve this. Authorization decisions can then be based upon the Principals associated with a Subject.

    See Also:
    Principal, Subject, Serialized Form
    • Constructor Detail

      • AuthPrincipal

        public AuthPrincipal​(String name)
        Create an AuthPrincipal with a user name.
        Parameters:
        name - the name for this user.
        Throws:
        NullPointerException - if the name is null.
    • Method Detail

      • getName

        public String getName()
        Return the user name for this AuthPrincipal.
        Specified by:
        getName in interface Principal
        Overrides:
        getName in class AuthSPrincipal
        Returns:
        the user name for this AuthPrincipal
      • getAuthMethod

        public String getAuthMethod()
        Return the AuthMethod for this AuthPrincipal.
        Overrides:
        getAuthMethod in class AuthSPrincipal
        Returns:
        the AuthMethod for this AuthPrincipal
      • getAuthLevel

        public String getAuthLevel()
        Return the AuthLevel for this AuthPrincipal.
        Overrides:
        getAuthLevel in class AuthSPrincipal
        Returns:
        the AuthLevel for this AuthPrincipal
      • toString

        public String toString()
        Return a string representation of this AuthPrincipal.
        Specified by:
        toString in interface Principal
        Overrides:
        toString in class Object
        Returns:
        a string representation of this AuthPrincipal.
      • equals

        public boolean equals​(Object o)
        Compares the specified object with this AuthPrincipal for equality. Returns true if the given object is also an AuthPrincipal and the two AuthPrincipals have the same user name.
        Specified by:
        equals in interface Principal
        Overrides:
        equals in class Object
        Parameters:
        o - Object to be compared for equality with this AuthPrincipal.
        Returns:
        true if the specified Object is equal to this AuthPrincipal.
      • hashCode

        public int hashCode()
        Return a hash code for this AuthPrincipal.
        Specified by:
        hashCode in interface Principal
        Overrides:
        hashCode in class Object
        Returns:
        a hash code for this AuthPrincipal.