public class TokenProvider extends BaseEndpointCoprocessor implements AuthenticationProtocol
AuthenticationProtocol
coprocessor protocol.Coprocessor.State
Modifier and Type | Field and Description |
---|---|
static long |
VERSION |
PRIORITY_HIGHEST, PRIORITY_LOWEST, PRIORITY_SYSTEM, PRIORITY_USER
Constructor and Description |
---|
TokenProvider() |
Modifier and Type | Method and Description |
---|---|
org.apache.hadoop.security.token.Token<AuthenticationTokenIdentifier> |
getAuthenticationToken()
Obtains a token capable of authenticating as the current user for future
connections.
|
long |
getProtocolVersion(String protocol,
long clientVersion)
Return protocol version corresponding to protocol interface.
|
void |
start(CoprocessorEnvironment env) |
String |
whoami()
Returns the currently authenticated username.
|
getEnvironment, getProtocolSignature, stop
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getProtocolSignature
public static final long VERSION
public void start(CoprocessorEnvironment env)
start
in interface Coprocessor
start
in class BaseEndpointCoprocessor
public org.apache.hadoop.security.token.Token<AuthenticationTokenIdentifier> getAuthenticationToken() throws IOException
AuthenticationProtocol
getAuthenticationToken
in interface AuthenticationProtocol
IOException
- If obtaining a token is denied or encounters an errorpublic String whoami()
AuthenticationProtocol
whoami
in interface AuthenticationProtocol
public long getProtocolVersion(String protocol, long clientVersion) throws IOException
VersionedProtocol
getProtocolVersion
in interface VersionedProtocol
getProtocolVersion
in class BaseEndpointCoprocessor
protocol
- The classname of the protocol interfaceclientVersion
- The version of the protocol that the client speaksIOException
- if any IO error occursCopyright © 2014 The Apache Software Foundation. All Rights Reserved.