Class AuthSPrincipal

  • All Implemented Interfaces:
    Serializable, Principal

    public class AuthSPrincipal
    extends Object
    implements Principal, Serializable

    This class implements the Principal interface that represents a user.

    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.

    AuthSPrincipal contains the "set" methods, whereas AuthPrincipal contains just the "get" methods.

    See Also:
    Principal, Subject, AuthPrincipal, Serialized Form
    • Field Detail

      • authMethod

        protected String authMethod
      • authLevel

        protected String authLevel
    • Constructor Detail

      • AuthSPrincipal

        public AuthSPrincipal​(String name)
        Create an AuthSPrincipal with a username.

        Parameters:
        name - the username for this user.
        Throws:
        NullPointerException - if the name is null.
    • Method Detail

      • getName

        public String getName()
        Return the username for this AuthPrincipal.

        Specified by:
        getName in interface Principal
        Returns:
        the username for this AuthPrincipal
      • getAuthMethod

        public String getAuthMethod()
        Return the AuthMethod for this AuthPrincipal.

        Returns:
        the AuthMethod for this AuthPrincipal
      • getAuthLevel

        public String getAuthLevel()
        Return the AuthLevel for this AuthPrincipal.

        Returns:
        the AuthLevel for this AuthPrincipal
      • setAuthMethod

        protected void setAuthMethod​(String auth_method)
        Set the AuthMethod for this AuthPrincipal.

        Parameters:
        auth_method - AuthMethod for this AuthPrincipal
      • setAuthLevel

        protected void setAuthLevel​(String auth_level)
        Set the AuthLevel for this AuthPrincipal.

        Parameters:
        auth_level - AuthLevel for this AuthPrincipal