org.apache.hadoop.hbase.security.token
Class TokenProvider

java.lang.Object
  extended by org.apache.hadoop.hbase.coprocessor.BaseEndpointCoprocessor
      extended by org.apache.hadoop.hbase.security.token.TokenProvider
All Implemented Interfaces:
Coprocessor, CoprocessorProtocol, VersionedProtocol, AuthenticationProtocol

public class TokenProvider
extends BaseEndpointCoprocessor
implements AuthenticationProtocol

Provides a service for obtaining authentication tokens via the AuthenticationProtocol coprocessor protocol.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.hadoop.hbase.Coprocessor
Coprocessor.State
 
Field Summary
static long VERSION
           
 
Fields inherited from interface org.apache.hadoop.hbase.Coprocessor
PRIORITY_HIGHEST, PRIORITY_LOWEST, PRIORITY_SYSTEM, PRIORITY_USER
 
Constructor Summary
TokenProvider()
           
 
Method Summary
 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.
 
Methods inherited from class org.apache.hadoop.hbase.coprocessor.BaseEndpointCoprocessor
getEnvironment, getProtocolSignature, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.hadoop.hbase.ipc.VersionedProtocol
getProtocolSignature
 

Field Detail

VERSION

public static final long VERSION
See Also:
Constant Field Values
Constructor Detail

TokenProvider

public TokenProvider()
Method Detail

start

public void start(CoprocessorEnvironment env)
Specified by:
start in interface Coprocessor
Overrides:
start in class BaseEndpointCoprocessor

getAuthenticationToken

public org.apache.hadoop.security.token.Token<AuthenticationTokenIdentifier> getAuthenticationToken()
                                                                                             throws IOException
Description copied from interface: AuthenticationProtocol
Obtains a token capable of authenticating as the current user for future connections.

Specified by:
getAuthenticationToken in interface AuthenticationProtocol
Returns:
an authentication token for the current user
Throws:
IOException - If obtaining a token is denied or encounters an error

whoami

public String whoami()
Description copied from interface: AuthenticationProtocol
Returns the currently authenticated username.

Specified by:
whoami in interface AuthenticationProtocol

getProtocolVersion

public long getProtocolVersion(String protocol,
                               long clientVersion)
                        throws IOException
Description copied from interface: VersionedProtocol
Return protocol version corresponding to protocol interface.

Specified by:
getProtocolVersion in interface VersionedProtocol
Overrides:
getProtocolVersion in class BaseEndpointCoprocessor
Parameters:
protocol - The classname of the protocol interface
clientVersion - The version of the protocol that the client speaks
Returns:
the version that the server will speak
Throws:
IOException - if any IO error occurs


Copyright © 2015 The Apache Software Foundation. All Rights Reserved.