public class Credentials extends Object
Connector
can be destroyed, invalidating future RPC operations from that Connector
.
See ACCUMULO-1312
Constructor and Description |
---|
Credentials(String principal,
AuthenticationToken token)
Creates a new credentials object.
|
Modifier and Type | Method and Description |
---|---|
static Credentials |
deserialize(String serializedForm)
Converts the serialized form to an instance of
Credentials . |
boolean |
equals(Object obj) |
static Credentials |
fromThrift(org.apache.accumulo.core.security.thrift.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() |
org.apache.accumulo.core.security.thrift.TCredentials |
toThrift(Instance instance)
Converts the current object to the relevant thrift type.
|
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 verifiedpublic String getPrincipal()
public AuthenticationToken getToken()
public org.apache.accumulo.core.security.thrift.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 instanceRuntimeException
- if the authentication token has been destroyed (expired)public static Credentials fromThrift(org.apache.accumulo.core.security.thrift.TCredentials serialized)
serialized
- a Thrift encoded set of credentialspublic 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 credentialsCopyright © 2011–2016 The Apache Software Foundation. All rights reserved.