com.ibm.security.auth
Class JAASPrincipal

java.lang.Object
  |
  +--com.ibm.security.auth.JAASPrincipal
All Implemented Interfaces:
java.security.Principal, java.io.Serializable
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 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 upon the Principals associated with a Subject.

Author:
D. Kent Soper, Andrew Gotte
See Also:
Principal, Subject, Serialized Form

Constructor Summary
java.lang.String)">JAASPrincipal(java.lang.String name)
          Create a JAASPrincipal with an identifying name.
 
Method Summary
 boolean java.lang.Object)">equals(java.lang.Object o)
          Compares the specified Object with this JAASPrincipal for equality.
 java.lang.String getName()
          Return a string name of this JAASPrincipal.
 int hashCode()
          Return a hash code for this JAASPrincipal.
 java.lang.String toString()
          Return a string representation of this JAASPrincipal.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail
java.lang.String)">

JAASPrincipal

public JAASPrincipal(java.lang.String name)
Create a JAASPrincipal with an identifying name.

Parameters:
name - the identifying name.

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

getName

public java.lang.String getName()
Return a string name of this JAASPrincipal.

Specified by:
getName in interface java.security.Principal
Returns:
a string name of this JAASPrincipal

toString

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

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

java.lang.Object)">

equals

public boolean equals(java.lang.Object o)
Compares the specified Object with this JAASPrincipal for equality. Returns true if the given object is also a JAASPrincipal and the two JAASPrincipals have the same String representation.

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 JAASPrincipal.
Returns:
true if the specified Object is equal to this JAASPrincipal.

hashCode

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

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