public class ClientConfiguration
extends org.apache.commons.configuration.CompositeConfiguration
| Modifier and Type | Class and Description |
|---|---|
static class |
ClientConfiguration.ClientProperty |
| Modifier and Type | Field and Description |
|---|---|
static String |
GLOBAL_CONF_FILENAME |
static String |
USER_ACCUMULO_DIR_NAME |
static String |
USER_CONF_FILENAME |
| Constructor and Description |
|---|
ClientConfiguration(org.apache.commons.configuration.Configuration... configs)
Iterates through the Configuration objects, populating this object.
|
ClientConfiguration(File configFile) |
ClientConfiguration(List<? extends org.apache.commons.configuration.Configuration> configs) |
ClientConfiguration(String configFile) |
| Modifier and Type | Method and Description |
|---|---|
static ClientConfiguration |
deserialize(String serializedConfig) |
String |
get(ClientConfiguration.ClientProperty prop)
Returns the value for prop, the default value if not present.
|
Map<String,String> |
getAllPropertiesWithPrefix(ClientConfiguration.ClientProperty property)
Gets all properties under the given prefix in this configuration.
|
static ClientConfiguration |
loadDefault()
Attempts to load a configuration file from the system using the default search paths.
|
String |
serialize() |
void |
setProperty(ClientConfiguration.ClientProperty prop,
String value)
Sets the value of property to value
|
ClientConfiguration |
with(ClientConfiguration.ClientProperty prop,
String value)
Same as
setProperty(ClientProperty, String) but returns the ClientConfiguration for chaining purposes |
ClientConfiguration |
withInstance(String instanceName)
Same as
with(ClientProperty, String) for ClientProperty.INSTANCE_NAME |
ClientConfiguration |
withInstance(UUID instanceId)
Same as
with(ClientProperty, String) for ClientProperty.INSTANCE_ID |
ClientConfiguration |
withKeystore(String path)
Same as
withKeystore(String, String, String) with password null and type null |
ClientConfiguration |
withKeystore(String path,
String password,
String type)
Same as
with(ClientProperty, String) for ClientProperty.INSTANCE_RPC_SSL_CLIENT_AUTH, ClientProperty.RPC_SSL_KEYSTORE_PATH,
ClientProperty.RPC_SSL_KEYSTORE_PASSWORD, and ClientProperty.RPC_SSL_KEYSTORE_TYPE |
ClientConfiguration |
withSasl(boolean saslEnabled)
Same as
with(ClientProperty, String) for ClientProperty.INSTANCE_RPC_SASL_ENABLED. |
ClientConfiguration |
withSasl(boolean saslEnabled,
String kerberosServerPrimary)
Same as
with(ClientProperty, String) for ClientProperty.INSTANCE_RPC_SASL_ENABLED and ClientProperty.GENERAL_KERBEROS_PRINCIPAL. |
ClientConfiguration |
withSsl(boolean sslEnabled)
Same as
withSsl(boolean, boolean) with useJsseConfig set to false |
ClientConfiguration |
withSsl(boolean sslEnabled,
boolean useJsseConfig)
Same as
with(ClientProperty, String) for ClientProperty.INSTANCE_RPC_SSL_ENABLED and ClientProperty.RPC_USE_JSSE |
ClientConfiguration |
withTruststore(String path)
Same as
withTruststore(String) with password null and type null |
ClientConfiguration |
withTruststore(String path,
String password,
String type)
Same as
with(ClientProperty, String) for ClientProperty.RPC_SSL_TRUSTORE_PATH, ClientProperty.RPC_SSL_TRUSTORE_PASSWORD, and
ClientProperty.RPC_SSL_TRUSTORE_TYPE |
ClientConfiguration |
withZkHosts(String zooKeepers)
Same as
with(ClientProperty, String) for ClientProperty.INSTANCE_ZK_HOST |
ClientConfiguration |
withZkTimeout(int timeout)
Same as
with(ClientProperty, String) for ClientProperty.INSTANCE_ZK_TIMEOUT |
addConfiguration, addPropertyDirect, clear, clearPropertyDirect, clone, containsKey, getConfiguration, getInMemoryConfiguration, getKeys, getKeys, getList, getNumberOfConfigurations, getProperty, getSource, getStringArray, isEmpty, removeConfiguration, setDelimiterParsingDisabled, setListDelimiteraddErrorLogListener, addProperty, append, clearProperty, copy, createInterpolator, getBigDecimal, getBigDecimal, getBigInteger, getBigInteger, getBoolean, getBoolean, getBoolean, getByte, getByte, getByte, getDefaultListDelimiter, getDelimiter, getDouble, getDouble, getDouble, getFloat, getFloat, getFloat, getInt, getInt, getInteger, getInterpolator, getList, getListDelimiter, getLogger, getLong, getLong, getLong, getProperties, getProperties, getShort, getShort, getShort, getString, getString, getSubstitutor, interpolate, interpolate, interpolatedConfiguration, interpolateHelper, isDelimiterParsingDisabled, isThrowExceptionOnMissing, resolveContainerStore, setDefaultListDelimiter, setDelimiter, setLogger, setProperty, setThrowExceptionOnMissing, subsetaddConfigurationListener, addErrorListener, clearConfigurationListeners, clearErrorListeners, createErrorEvent, createEvent, fireError, fireEvent, getConfigurationListeners, getErrorListeners, isDetailEvents, removeConfigurationListener, removeErrorListener, setDetailEventspublic static final String USER_ACCUMULO_DIR_NAME
public static final String USER_CONF_FILENAME
public static final String GLOBAL_CONF_FILENAME
public ClientConfiguration(String configFile) throws org.apache.commons.configuration.ConfigurationException
org.apache.commons.configuration.ConfigurationExceptionpublic ClientConfiguration(File configFile) throws org.apache.commons.configuration.ConfigurationException
org.apache.commons.configuration.ConfigurationExceptionpublic ClientConfiguration(List<? extends org.apache.commons.configuration.Configuration> configs)
public ClientConfiguration(org.apache.commons.configuration.Configuration... configs)
PropertiesConfiguration,
loadDefault()public static ClientConfiguration loadDefault()
If ACCUMULO_CLIENT_CONF_PATH is not set, uses the following in this order:
A client configuration will then be read from each location using PropertiesConfiguration to construct a configuration. That means the latest item will be the one in the configuration.
PropertiesConfiguration,
File.pathSeparatorpublic static ClientConfiguration deserialize(String serializedConfig)
public String serialize()
public String get(ClientConfiguration.ClientProperty prop)
public Map<String,String> getAllPropertiesWithPrefix(ClientConfiguration.ClientProperty property)
property - prefix property, must be of type PropertyType.PREFIXIllegalArgumentException - if property is not a prefixpublic void setProperty(ClientConfiguration.ClientProperty prop, String value)
public ClientConfiguration with(ClientConfiguration.ClientProperty prop, String value)
setProperty(ClientProperty, String) but returns the ClientConfiguration for chaining purposespublic ClientConfiguration withInstance(String instanceName)
with(ClientProperty, String) for ClientProperty.INSTANCE_NAMEpublic ClientConfiguration withInstance(UUID instanceId)
with(ClientProperty, String) for ClientProperty.INSTANCE_IDpublic ClientConfiguration withZkHosts(String zooKeepers)
with(ClientProperty, String) for ClientProperty.INSTANCE_ZK_HOSTpublic ClientConfiguration withZkTimeout(int timeout)
with(ClientProperty, String) for ClientProperty.INSTANCE_ZK_TIMEOUTpublic ClientConfiguration withSsl(boolean sslEnabled)
withSsl(boolean, boolean) with useJsseConfig set to falsepublic ClientConfiguration withSsl(boolean sslEnabled, boolean useJsseConfig)
with(ClientProperty, String) for ClientProperty.INSTANCE_RPC_SSL_ENABLED and ClientProperty.RPC_USE_JSSEpublic ClientConfiguration withTruststore(String path)
withTruststore(String) with password null and type nullpublic ClientConfiguration withTruststore(String path, String password, String type)
with(ClientProperty, String) for ClientProperty.RPC_SSL_TRUSTORE_PATH, ClientProperty.RPC_SSL_TRUSTORE_PASSWORD, and
ClientProperty.RPC_SSL_TRUSTORE_TYPEpublic ClientConfiguration withKeystore(String path)
withKeystore(String, String, String) with password null and type nullpublic ClientConfiguration withKeystore(String path, String password, String type)
with(ClientProperty, String) for ClientProperty.INSTANCE_RPC_SSL_CLIENT_AUTH, ClientProperty.RPC_SSL_KEYSTORE_PATH,
ClientProperty.RPC_SSL_KEYSTORE_PASSWORD, and ClientProperty.RPC_SSL_KEYSTORE_TYPEpublic ClientConfiguration withSasl(boolean saslEnabled)
with(ClientProperty, String) for ClientProperty.INSTANCE_RPC_SASL_ENABLED.public ClientConfiguration withSasl(boolean saslEnabled, String kerberosServerPrimary)
with(ClientProperty, String) for ClientProperty.INSTANCE_RPC_SASL_ENABLED and ClientProperty.GENERAL_KERBEROS_PRINCIPAL.saslEnabled - Should SASL(kerberos) be enabledkerberosServerPrimary - The 'primary' component of the Kerberos principal Accumulo servers use to login (e.g. 'accumulo' in 'accumulo/_HOST@REALM')Copyright © 2011–2018 The Apache Software Foundation. All rights reserved.