com.ibm.security.auth
Class JAASPrincipal
- java.lang.Object
-
- com.ibm.security.auth.JAASPrincipal
-
- All Implemented Interfaces:
- java.io.Serializable, java.security.Principal
- Direct Known Subclasses:
- DomainIDPrincipal, DomainPrincipal, GroupIDPrincipal, PrimaryGroupIDPrincipal, ServerPrincipal, UserIDPrincipal, WkstationPrincipal
public class JAASPrincipal extends java.lang.Object implements java.security.Principal, java.io.SerializableThis class implements the
Principalinterface and represents general information about a user, group or domain.Principals such as this
JAASPrincipalmay 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 upon the Principals associated with aSubject.- See Also:
Principal,Subject, Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description JAASPrincipal(java.lang.String name)Create aJAASPrincipalwith an identifying name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleanequals(java.lang.Object o)Compares the specified Object with thisJAASPrincipalfor equality.java.lang.StringgetName()Return a string name of thisJAASPrincipal.inthashCode()Return a hash code for thisJAASPrincipal.java.lang.StringtoString()Return a string representation of thisJAASPrincipal.
-
-
-
Constructor Detail
-
JAASPrincipal
public JAASPrincipal(java.lang.String name)
Create aJAASPrincipalwith an identifying name.- Parameters:
name- the identifying name.- Throws:
java.lang.NullPointerException- if thenameisnull.java.lang.IllegalArgumentException- if thenamehas zero length.
-
-
Method Detail
-
getName
public java.lang.String getName()
Return a string name of thisJAASPrincipal.- Specified by:
getNamein interfacejava.security.Principal- Returns:
- a string name of this
JAASPrincipal
-
toString
public java.lang.String toString()
Return a string representation of thisJAASPrincipal.- Specified by:
toStringin interfacejava.security.Principal- Overrides:
toStringin classjava.lang.Object- Returns:
- a string representation of this
JAASPrincipal.
-
equals
public boolean equals(java.lang.Object o)
Compares the specified Object with thisJAASPrincipalfor equality. Returns true if the given object is also aJAASPrincipaland the two JAASPrincipals have the same String representation.- Specified by:
equalsin interfacejava.security.Principal- Overrides:
equalsin classjava.lang.Object- Parameters:
o- Object to be compared for equality with thisJAASPrincipal.- Returns:
- true if the specified Object is equal to this
JAASPrincipal.
-
hashCode
public int hashCode()
Return a hash code for thisJAASPrincipal.- Specified by:
hashCodein interfacejava.security.Principal- Overrides:
hashCodein classjava.lang.Object- Returns:
- a hash code for this
JAASPrincipal.
-
-