Class SimplePrincipal

  • All Implemented Interfaces:
    java.io.Serializable, java.security.Principal

    public class SimplePrincipal
    extends java.lang.Object
    implements java.security.Principal, java.io.Serializable
    Represents a user.
    Principals may be associated with a particular Subject to augment it with an additional identity. Authorization decisions can be based upon the Principals associated with a Subject.
    See Also:
    Principal, Subject, Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      SimplePrincipal​(java.lang.String name, java.lang.String password)
      Create a Principal with the given name.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)  
      java.lang.String getName()
      java.lang.String getPassword()  
      int hashCode()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.security.Principal

        implies
    • Constructor Detail

      • SimplePrincipal

        public SimplePrincipal​(java.lang.String name,
                               java.lang.String password)
        Create a Principal with the given name.
        Parameters:
        name - the username for this user
        password - the password for this user
        Throws:
        java.lang.NullPointerException - if the name is null.
    • Method Detail

      • getName

        public java.lang.String getName()
        Specified by:
        getName in interface java.security.Principal
      • getPassword

        public java.lang.String getPassword()
        Returns:
        the passwd
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface java.security.Principal
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Specified by:
        equals in interface java.security.Principal
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Specified by:
        toString in interface java.security.Principal
        Overrides:
        toString in class java.lang.Object