gov.nih.nci.caarray.services.security
Class CaArrayPrincipal

java.lang.Object
  extended by gov.nih.nci.caarray.services.security.CaArrayPrincipal
All Implemented Interfaces:
java.io.Serializable, java.security.Principal

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

This class implements the Principal interface and represents a Sample user.

Principals such as this CaArrayPrincipal 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.

See Also:
Principal, Subject, Serialized Form

Constructor Summary
CaArrayPrincipal(java.lang.String name)
          Create a CaArrayPrincipal with a Sample username.
 
Method Summary
 boolean equals(java.lang.Object another)
          Compare this CaArrayPrincipal's name against another Principal
 java.lang.String getName()
          Return the Sample username for this CaArrayPrincipal.
 int hashCode()
           
 java.lang.String toString()
          Return a string representation of this CaArrayPrincipal.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CaArrayPrincipal

public CaArrayPrincipal(java.lang.String name)
Create a CaArrayPrincipal with a Sample username.

Parameters:
name - the Sample username for this user.
Throws:
java.lang.NullPointerException - if the name is null.
Method Detail

getName

public java.lang.String getName()
Return the Sample username for this CaArrayPrincipal.

Specified by:
getName in interface java.security.Principal
Returns:
the Sample username for this CaArrayPrincipal

toString

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

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

equals

public boolean equals(java.lang.Object another)
Compare this CaArrayPrincipal's name against another Principal

Specified by:
equals in interface java.security.Principal
Overrides:
equals in class java.lang.Object
Returns:
true if name equals another.getName();

hashCode

public int hashCode()
Specified by:
hashCode in interface java.security.Principal
Overrides:
hashCode in class java.lang.Object