com.cafesoft.cams.auth
Class CSUserPrincipal

java.lang.Object
  |
  +--com.cafesoft.cams.auth.CSUserPrincipal
All Implemented Interfaces:
Principal, Serializable

public class CSUserPrincipal
extends Object
implements Principal, Serializable

Represents a Cafesoft Security System User Principal.

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

Since:
6/6/02
See Also:
Principal, Subject, Serialized Form

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

Constructor Detail

CSUserPrincipal

public CSUserPrincipal(String name)
Create a CSUserPrincipal with the specified username.

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

getName

public String getName()
Return the username for this CSUserPrincipal.

Specified by:
getName in interface Principal
Returns:
the username for this CSUserPrincipal

toString

public String toString()
Return a string representation of this CSUserPrincipal.

Specified by:
toString in interface Principal
Overrides:
toString in class Object
Returns:
a string representation of this CSUserPrincipal

equals

public boolean equals(Object o)
Compares the specified Object with this CSUserPrincipal for equality. Returns true if the given object is also a CSUserPrincipal and the two CSUserPrincipals have the same username.

Specified by:
equals in interface Principal
Overrides:
equals in class Object
Parameters:
o - Object to be compared for equality with this CSUserPrincipal
Returns:
true if the specified Object is equal equal to this CSUserPrincipal

hashCode

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

Specified by:
hashCode in interface Principal
Overrides:
hashCode in class Object
Returns:
a hash code for this CSUserPrincipal which is unique based on the Principal name and this class.


Generated on 10:40:31 AM September 10, 2003, © 1996-2003 Cafésoft LLC. All rights reserved.