Package org.apache.cassandra.auth
Class CassandraPrincipal
java.lang.Object
org.apache.cassandra.auth.CassandraPrincipal
- All Implemented Interfaces:
Serializable,Principal
This class implements the Principal interface
and represents a user.
Principals such as this CassPrincipal
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:
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
CassandraPrincipal
Create a CassPrincipal with a username.- Parameters:
name- the username for this user.- Throws:
NullPointerException- if thenameisnull.
-
-
Method Details
-
getName
Return the username for thisCassPrincipal. -
toString
Return a string representation of thisCassPrincipal. -
equals
Compares the specified Object with thisCassPrincipalfor equality. Returns true if the given object is also aCassPrincipaland the two CassPrincipals have the same username. -
hashCode
public int hashCode()Return a hash code for thisCassPrincipal.
-