com.cafesoft.cams.auth
Class CSRolePrincipal

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

public class CSRolePrincipal
extends Object
implements Principal, Serializable

CSRolePrincipal represents a Cafesoft Security System Role Principal.

A Role may be a Group of Principals or an identity that can be assumed by Users. For example, for purposed of access control, it may be useful to define the following Roles:

Principals such as this CSRolePrincipal 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
CSRolePrincipal(String name)
          Create a CSRolePrincipal with the specified role name.
 
Method Summary
 boolean equals(Object o)
          Compares the specified Object with this CSRolePrincipal for equality.
 String getName()
          Return the role name for this CSRolePrincipal.
 int hashCode()
          Return a hash code for this CSRolePrincipal.
 String toString()
          Return a string representation of this CSRolePrincipal.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CSRolePrincipal

public CSRolePrincipal(String name)
Create a CSRolePrincipal with the specified role name.

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

getName

public String getName()
Return the role name for this CSRolePrincipal.

Specified by:
getName in interface Principal
Returns:
the role name for this CSRolePrincipal

toString

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

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

equals

public boolean equals(Object o)
Compares the specified Object with this CSRolePrincipal for equality. Returns true if the given object is also a CSRolePrincipal and the two CSRolePrincipals have the same role name.

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

hashCode

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

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


Generated on 8:41:50 AM June 06, 2005, © 1996-2005 Cafésoft LLC. All rights reserved.