com.ibm.security.auth
Class UsernamePrincipal
- java.lang.Object
-
- com.ibm.security.auth.UsernamePrincipal
-
- All Implemented Interfaces:
- java.io.Serializable, java.security.Principal
public class UsernamePrincipal extends java.lang.Object implements java.security.Principal, java.io.SerializableThis class implements the
Principalinterface and represents an OS/390 user.Principals such as this
UsernamePrincipalmay be associated with a particularSubjectto augment thatSubjectwith an additional identity. Refer to theSubjectclass for more information on how to achieve this. Authorization decisions can then be based on the Principals associated with aSubject.- See Also:
Principal,Subject, Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description UsernamePrincipal(java.lang.String name)Create anUsernamePrincipalwith an OS/390 username.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleanequals(java.lang.Object o)Compares the specified Object with thisUsernamePrincipalfor equality.java.lang.StringgetName()Return the OS/390 username for thisUsernamePrincipal.inthashCode()Return a hash code for thisUsernamePrincipal.java.lang.StringtoString()Return a string representation of thisUsernamePrincipal.
-
-
-
Constructor Detail
-
UsernamePrincipal
public UsernamePrincipal(java.lang.String name)
Create anUsernamePrincipalwith an OS/390 username.- Parameters:
name- the OS/390 username for this user.- Throws:
java.lang.NullPointerException- if thenameisnull.java.lang.RuntimeException- if thenamehas zero length.
-
-
Method Detail
-
getName
public java.lang.String getName()
Return the OS/390 username for thisUsernamePrincipal.- Specified by:
getNamein interfacejava.security.Principal- Returns:
- the OS/390 username for this
UsernamePrincipal.
-
toString
public java.lang.String toString()
Return a string representation of thisUsernamePrincipal.- Specified by:
toStringin interfacejava.security.Principal- Overrides:
toStringin classjava.lang.Object- Returns:
- a string representation of this
UsernamePrincipal.
-
equals
public boolean equals(java.lang.Object o)
Compares the specified Object with thisUsernamePrincipalfor equality. Returns true if the given object is also aUsernamePrincipaland the two UsernamePrincipals have the same name.- Specified by:
equalsin interfacejava.security.Principal- Overrides:
equalsin classjava.lang.Object- Parameters:
o- Object to be compared for equality with thisUsernamePrincipal.- Returns:
- true if the specified Object is equal equal to this
UsernamePrincipal.
-
hashCode
public int hashCode()
Return a hash code for thisUsernamePrincipal.- Specified by:
hashCodein interfacejava.security.Principal- Overrides:
hashCodein classjava.lang.Object- Returns:
- a hash code for this
UsernamePrincipal.
-
-