Class ClientContext
- java.lang.Object
-
- org.apache.accumulo.core.client.impl.ClientContext
-
public class ClientContext extends Object
This class represents any essential configuration and credentials needed to initiate RPC operations throughout the code. It is intended to represent a shared object that contains these things from when the client was first constructed. It is not public API, and is only an internal representation of the context in which a client is executing RPCs. If additional parameters are added to the public API that need to be used in the internals of Accumulo, they should be added to this object for later retrieval, rather than as a separate parameter. Any state in this object should be available at the time of its construction.
-
-
Constructor Summary
Constructors Constructor Description ClientContext(Instance instance, Credentials credentials, ClientConfiguration clientConf)
Instantiate a client contextClientContext(Instance instance, Credentials credentials, AccumuloConfiguration serverConf)
Instantiate a client context from an existingAccumuloConfiguration
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static AccumuloConfiguration
convertClientConfig(org.apache.commons.configuration.Configuration config)
A utility method for converting client configuration to a standard configuration object for use internally.SslConnectionParams
getClientSslParams()
Retrieve SSL/TLS configuration to initiate an RPC connection to a serverlong
getClientTimeoutInMillis()
Retrieve the universal RPC client timeout from the configurationAccumuloConfiguration
getConfiguration()
Retrieve the configuration used to construct this contextConnector
getConnector()
Retrieve a connectorCredentials
getCredentials()
Retrieve the credentials used to construct this contextInstance
getInstance()
Retrieve the instance used to construct this contextSaslConnectionParams
getSaslParams()
Retrieve SASL configuration to initiate an RPC connection to a serverTCredentials
rpcCreds()
Serialize the credentials just before initiating the RPC callvoid
setCredentials(Credentials newCredentials)
Update the credentials in the current context after changing the current user's password or other auth token
-
-
-
Constructor Detail
-
ClientContext
public ClientContext(Instance instance, Credentials credentials, ClientConfiguration clientConf)
Instantiate a client context
-
ClientContext
public ClientContext(Instance instance, Credentials credentials, AccumuloConfiguration serverConf)
Instantiate a client context from an existingAccumuloConfiguration
. This is primarily intended for subclasses and testing.
-
-
Method Detail
-
getInstance
public Instance getInstance()
Retrieve the instance used to construct this context
-
getCredentials
public Credentials getCredentials()
Retrieve the credentials used to construct this context
-
setCredentials
public void setCredentials(Credentials newCredentials)
Update the credentials in the current context after changing the current user's password or other auth token
-
getConfiguration
public AccumuloConfiguration getConfiguration()
Retrieve the configuration used to construct this context
-
getClientTimeoutInMillis
public long getClientTimeoutInMillis()
Retrieve the universal RPC client timeout from the configuration
-
getClientSslParams
public SslConnectionParams getClientSslParams()
Retrieve SSL/TLS configuration to initiate an RPC connection to a server
-
getSaslParams
public SaslConnectionParams getSaslParams()
Retrieve SASL configuration to initiate an RPC connection to a server
-
getConnector
public Connector getConnector() throws AccumuloException, AccumuloSecurityException
Retrieve a connector
-
rpcCreds
public TCredentials rpcCreds()
Serialize the credentials just before initiating the RPC call
-
convertClientConfig
public static AccumuloConfiguration convertClientConfig(org.apache.commons.configuration.Configuration config)
A utility method for converting client configuration to a standard configuration object for use internally.- Parameters:
config
- the originalClientConfiguration
- Returns:
- the client configuration presented in the form of an
AccumuloConfiguration
-
-