Class UsernamePrincipal

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

    public class UsernamePrincipal
    extends java.lang.Object
    implements java.security.Principal, java.io.Serializable

    This class implements the Principal interface and represents an OS/390 user.

    Principals such as this UsernamePrincipal 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 on the Principals associated with a Subject.

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

      Constructors 
      Constructor Description
      UsernamePrincipal​(java.lang.String name)
      Create an UsernamePrincipal with an OS/390 username.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)
      Compares the specified Object with this UsernamePrincipal for equality.
      java.lang.String getName()
      Return the OS/390 username for this UsernamePrincipal.
      int hashCode()
      Return a hash code for this UsernamePrincipal.
      java.lang.String toString()
      Return a string representation of this UsernamePrincipal.
      • 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

      • UsernamePrincipal

        public UsernamePrincipal​(java.lang.String name)
        Create an UsernamePrincipal with an OS/390 username.

        Parameters:
        name - the OS/390 username for this user.

        Throws:
        java.lang.NullPointerException - if the name is null.
        java.lang.RuntimeException - if the name has zero length.
    • Method Detail

      • getName

        public java.lang.String getName()
        Return the OS/390 username for this UsernamePrincipal.

        Specified by:
        getName in interface java.security.Principal
        Returns:
        the OS/390 username for this UsernamePrincipal.
      • toString

        public java.lang.String toString()
        Return a string representation of this UsernamePrincipal.

        Specified by:
        toString in interface java.security.Principal
        Overrides:
        toString in class java.lang.Object
        Returns:
        a string representation of this UsernamePrincipal.
      • equals

        public boolean equals​(java.lang.Object o)
        Compares the specified Object with this UsernamePrincipal for equality. Returns true if the given object is also a UsernamePrincipal and the two UsernamePrincipals have the same name.

        Specified by:
        equals in interface java.security.Principal
        Overrides:
        equals in class java.lang.Object
        Parameters:
        o - Object to be compared for equality with this UsernamePrincipal.
        Returns:
        true if the specified Object is equal equal to this UsernamePrincipal.
      • hashCode

        public int hashCode()
        Return a hash code for this UsernamePrincipal.

        Specified by:
        hashCode in interface java.security.Principal
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        a hash code for this UsernamePrincipal.