@InterfaceAudience.Public public final class ClientTokenUtil extends Object
Modifier and Type | Field and Description |
---|---|
private static com.google.protobuf.ServiceException |
injectedException |
private static org.slf4j.Logger |
LOG |
Modifier | Constructor and Description |
---|---|
private |
ClientTokenUtil() |
Modifier and Type | Method and Description |
---|---|
private static void |
injectFault() |
static void |
obtainAndCacheToken(Connection conn,
User user)
Obtain an authentication token for the given user and add it to the
user's credentials.
|
static org.apache.hadoop.security.token.Token<AuthenticationTokenIdentifier> |
obtainToken(Connection conn)
Obtain and return an authentication token for the current user.
|
(package private) static org.apache.hadoop.security.token.Token<AuthenticationTokenIdentifier> |
obtainToken(Connection conn,
User user)
Obtain and return an authentication token for the given user.
|
(package private) static org.apache.hadoop.security.token.Token<AuthenticationTokenIdentifier> |
toToken(org.apache.hadoop.hbase.protobuf.generated.AuthenticationProtos.Token proto)
Converts a protobuf Token message back into a Token instance.
|
(package private) static org.apache.hadoop.hbase.protobuf.generated.AuthenticationProtos.Token |
toToken(org.apache.hadoop.security.token.Token<AuthenticationTokenIdentifier> token)
Converts a Token instance (with embedded identifier) to the protobuf representation.
|
private static final org.slf4j.Logger LOG
private static com.google.protobuf.ServiceException injectedException
private ClientTokenUtil()
private static void injectFault() throws com.google.protobuf.ServiceException
com.google.protobuf.ServiceException
@InterfaceAudience.Private public static org.apache.hadoop.security.token.Token<AuthenticationTokenIdentifier> obtainToken(Connection conn) throws IOException
conn
- The HBase cluster connectionIOException
- if a remote error or serialization problem occurs.@InterfaceAudience.Private static org.apache.hadoop.hbase.protobuf.generated.AuthenticationProtos.Token toToken(org.apache.hadoop.security.token.Token<AuthenticationTokenIdentifier> token)
token
- the Token instance to copy@InterfaceAudience.Private static org.apache.hadoop.security.token.Token<AuthenticationTokenIdentifier> toToken(org.apache.hadoop.hbase.protobuf.generated.AuthenticationProtos.Token proto)
proto
- the protobuf Token message@InterfaceAudience.Private static org.apache.hadoop.security.token.Token<AuthenticationTokenIdentifier> obtainToken(Connection conn, User user) throws IOException, InterruptedException
conn
- The HBase cluster connectionuser
- The user to obtain a token forIOException
InterruptedException
public static void obtainAndCacheToken(Connection conn, User user) throws IOException, InterruptedException
conn
- The HBase cluster connectionuser
- The user for whom to obtain the tokenIOException
- If making a remote call to the authentication service failsInterruptedException
- If executing as the given user is interruptedCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.