Package org.apache.cassandra.auth
Class CassandraPrincipal
- java.lang.Object
-
- org.apache.cassandra.auth.CassandraPrincipal
-
- All Implemented Interfaces:
java.io.Serializable,java.security.Principal
public class CassandraPrincipal extends java.lang.Object implements java.security.Principal, java.io.SerializableThis class implements the
Principalinterface and represents a user.Principals such as this
CassPrincipalmay be associated with a particularSubjectto augment thatSubjectwith an additional identity. Refer to theSubjectclass for more information on how to achieve this. Authorization decisions can then be based upon the Principals associated with aSubject.- See Also:
Principal,Subject, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CassandraPrincipal(java.lang.String name)Create a CassPrincipal with a username.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)Compares the specified Object with thisCassPrincipalfor equality.java.lang.StringgetName()Return the username for thisCassPrincipal.inthashCode()Return a hash code for thisCassPrincipal.java.lang.StringtoString()Return a string representation of thisCassPrincipal.
-
-
-
Method Detail
-
getName
public java.lang.String getName()
Return the username for thisCassPrincipal.- Specified by:
getNamein interfacejava.security.Principal- Returns:
- the username for this
CassPrincipal
-
toString
public java.lang.String toString()
Return a string representation of thisCassPrincipal.- Specified by:
toStringin interfacejava.security.Principal- Overrides:
toStringin classjava.lang.Object- Returns:
- a string representation of this
CassPrincipal.
-
equals
public boolean equals(java.lang.Object o)
Compares the specified Object with thisCassPrincipalfor equality. Returns true if the given object is also aCassPrincipaland the two CassPrincipals have the same username.- Specified by:
equalsin interfacejava.security.Principal- Overrides:
equalsin classjava.lang.Object- Parameters:
o- Object to be compared for equality with thisCassPrincipal.- Returns:
- true if the specified Object is equal equal to this
CassPrincipal.
-
hashCode
public int hashCode()
Return a hash code for thisCassPrincipal.- Specified by:
hashCodein interfacejava.security.Principal- Overrides:
hashCodein classjava.lang.Object- Returns:
- a hash code for this
CassPrincipal.
-
-