|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.accumulo.core.security.Credentials
public class Credentials
A wrapper for internal use. This class carries the instance, principal, and authentication token for use in the public API, in a non-serialized form. This is
important, so that the authentication token carried in a Connector
can be destroyed, invalidating future RPC operations from that Connector
.
See ACCUMULO-1312
Constructor Summary | |
---|---|
Credentials(String principal,
AuthenticationToken token)
Creates a new credentials object. |
Method Summary | |
---|---|
static Credentials |
deserialize(String serializedForm)
Converts the serialized form to an instance of Credentials . |
boolean |
equals(Object obj)
|
static Credentials |
fromThrift(TCredentials serialized)
Converts a given thrift object to our internal Credentials representation. |
String |
getPrincipal()
Gets the principal. |
AuthenticationToken |
getToken()
Gets the authentication token. |
int |
hashCode()
|
String |
serialize()
Converts the current object to a serialized form. |
String |
toString()
|
TCredentials |
toThrift(Instance instance)
Converts the current object to the relevant thrift type. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Credentials(String principal, AuthenticationToken token)
principal
- unique identifier for the entity (e.g. a user or service) authorized for these credentialstoken
- authentication token used to prove that the principal for these credentials has been properly verifiedMethod Detail |
---|
public String getPrincipal()
public AuthenticationToken getToken()
public TCredentials toThrift(Instance instance)
AuthenticationToken
, so this should be used just before placing on the wire, and references to it should be tightly controlled.
instance
- client instance
RuntimeException
- if the authentication token has been destroyed (expired)public static Credentials fromThrift(TCredentials serialized)
serialized
- a Thrift encoded set of credentials
public final String serialize()
AuthenticationToken
, so
references to it should be tightly controlled.
public static final Credentials deserialize(String serializedForm)
Credentials
. The original serialized form will not be affected.
serializedForm
- serialized form of credentials
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |