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, UsernamePrincipal, WkstationPrincipal
public class JAASPrincipal extends java.lang.Object implements java.security.Principal, java.io.Serializable
This class implements the
Principal
interface and represents general information about a user, group or domain.Principals such as this
JAASPrincipal
may be associated with a particularSubject
to augment thatSubject
with an additional identity. Refer to theSubject
class 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 aJAASPrincipal
with an identifying name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description boolean
equals(java.lang.Object o)
Compares the specified Object with thisJAASPrincipal
for equality.java.lang.String
getName()
Return a string name of thisJAASPrincipal
.int
hashCode()
Return a hash code for thisJAASPrincipal
.java.lang.String
toString()
Return a string representation of thisJAASPrincipal
.
-
-
-
Constructor Detail
-
JAASPrincipal
public JAASPrincipal(java.lang.String name)
Create aJAASPrincipal
with an identifying name.- Parameters:
name
- the identifying name.- Throws:
java.lang.NullPointerException
- if thename
isnull
.java.lang.IllegalArgumentException
- if thename
has zero length.
-
-
Method Detail
-
getName
public java.lang.String getName()
Return a string name of thisJAASPrincipal
.- Specified by:
getName
in interfacejava.security.Principal
- Returns:
- a string name of this
JAASPrincipal
-
toString
public java.lang.String toString()
Return a string representation of thisJAASPrincipal
.- Specified by:
toString
in interfacejava.security.Principal
- Overrides:
toString
in classjava.lang.Object
- Returns:
- a string representation of this
JAASPrincipal
.
-
equals
public boolean equals(java.lang.Object o)
Compares the specified Object with thisJAASPrincipal
for equality. Returns true if the given object is also aJAASPrincipal
and the two JAASPrincipals have the same String representation.- Specified by:
equals
in interfacejava.security.Principal
- Overrides:
equals
in 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:
hashCode
in interfacejava.security.Principal
- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- a hash code for this
JAASPrincipal
.
-
-