Package com.couchbase.client.java.env
Class DefaultCouchbaseEnvironment
java.lang.Object
com.couchbase.client.core.env.DefaultCoreEnvironment
com.couchbase.client.java.env.DefaultCouchbaseEnvironment
- All Implemented Interfaces:
ConfigParserEnvironment
,CoreEnvironment
,SecureEnvironment
,CouchbaseEnvironment
public class DefaultCouchbaseEnvironment extends DefaultCoreEnvironment implements CouchbaseEnvironment
The default implementation of a
CouchbaseEnvironment
.
This environment is intended to be reused and passed in across AsyncCluster
instances. It is stateful and needs
to be shut down manually if it was passed in by the user. Some threads it manages are non-daemon threads.
Default settings can be customized through the DefaultCouchbaseEnvironment.Builder
or through the setting of system properties. Latter
ones take always precedence and can be used to override builder settings at runtime too.- Since:
- 2.0
- Author:
- Michael Nitschinger
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DefaultCouchbaseEnvironment.Builder
-
Field Summary
Fields Modifier and Type Field Description protected static String
CLIENT_GIT_VERSION
protected static String
CLIENT_VERSION
static String
SDK_PACKAGE_NAME_AND_VERSION
static String
SDK_USER_AGENT
Fields inherited from class com.couchbase.client.core.env.DefaultCoreEnvironment
ANALYTICS_ENDPOINTS, AUTORELEASE_AFTER, BOOTSTRAP_CARRIER_DIRECT_PORT, BOOTSTRAP_CARRIER_ENABLED, BOOTSTRAP_CARRIER_SSL_PORT, BOOTSTRAP_HTTP_DIRECT_PORT, BOOTSTRAP_HTTP_ENABLED, BOOTSTRAP_HTTP_SSL_PORT, BUFFER_POOLING_ENABLED, CALLBACKS_ON_IO_POOL, CERT_AUTH_ENABLED, COMPRESSION_ENABLED, COMPUTATION_POOL_SIZE, CONFIG_POLL_FLOOR_INTERVAL, CONFIG_POLL_INTERVAL, CONTINUOUS_KEEPALIVE_ENABLED, CORE_GIT_VERSION, CORE_VERSION, DISCONNECT_TIMEOUT, FORCE_SASL_PLAIN, IO_POOL_SIZE, KEEPALIVE_ERROR_THRESHOLD, KEEPALIVE_TIMEOUT, KEEPALIVEINTERVAL, KEYVALUE_ENDPOINTS, MAX_REQUEST_LIFETIME, MEMCACHED_HASHING_STRATEGY, MIN_COMPRESSION_RATIO, MIN_COMPRESSION_SIZE, MUTATION_TOKENS_ENABLED, NETWORK_RESOLUTION, OBSERVE_INTERVAL_DELAY, OPERATION_TRACING_ENABLED, OPERATION_TRACING_SERVER_DUR_ENABLED, ORPHAN_REPORTING_ENABLED, PACKAGE_NAME_AND_VERSION, QUERY_ENDPOINTS, RECONNECT_DELAY, REQUEST_BUFFER_SIZE, RESPONSE_BUFFER_SIZE, RETRY_DELAY, RETRY_STRATEGY, SEARCH_ENDPOINTS, SOCKET_CONNECT_TIMEOUT, SSL_ENABLED, SSL_HOSTNAME_VERIFICATION_ENABLED, SSL_KEYSTORE, SSL_KEYSTORE_FILE, SSL_KEYSTORE_PASSWORD, SSL_TRUSTSTORE, SSL_TRUSTSTORE_FILE, SSL_TRUSTSTORE_PASSWORD, TCP_NODELAY_ENALED, USER_AGENT, VIEW_ENDPOINTS
-
Method Summary
Modifier and Type Method Description long
analyticsTimeout()
The default timeout for analytics operations, set toANALYTICS_TIMEOUT
.static DefaultCouchbaseEnvironment.Builder
builder()
Returns theDefaultCouchbaseEnvironment.Builder
to customize environment settings.String
clientBuild()
Returns build information on the Couchbase Java SDK client.String
clientVersion()
Returns version information on the Couchbase Java SDK client.long
connectTimeout()
The default timeout for connect operations, set toCONNECT_TIMEOUT
.static DefaultCouchbaseEnvironment
create()
Creates aCouchbaseEnvironment
with default settings applied.CryptoManager
cryptoManager()
Returns the crypto manager set.boolean
dnsSrvEnabled()
Returns whether DNS SRV lookup for the bootstrap nodes is enabled or not.protected StringBuilder
dumpParameters(StringBuilder sb)
long
kvTimeout()
The default timeout for binary (key/value) operations, set toKV_TIMEOUT
.long
managementTimeout()
The default timeout for management operations, set toMANAGEMENT_TIMEOUT
.boolean
propagateParentSpan()
If set to true, the code will check if a parent span is available and if so use this implicitly as a parent.long
queryTimeout()
The default timeout for query operations, set toQUERY_TIMEOUT
.long
searchTimeout()
The default timeout for search operations, set toSEARCH_TIMEOUT
.String
toString()
long
viewTimeout()
The default timeout for view operations, set toVIEW_TIMEOUT
.Methods inherited from class com.couchbase.client.core.env.DefaultCoreEnvironment
analyticsIoPool, analyticsServiceConfig, autoreleaseAfter, booleanPropertyOr, bootstrapCarrierDirectPort, bootstrapCarrierEnabled, bootstrapCarrierSslPort, bootstrapHttpDirectPort, bootstrapHttpEnabled, bootstrapHttpSslPort, bufferPoolingEnabled, callbacksOnIoPool, certAuthEnabled, compressionEnabled, compressionMinRatio, compressionMinSize, computationPoolSize, configPollFloorInterval, configPollInterval, continuousKeepAliveEnabled, coreBuild, coreVersion, couchbaseCoreSendHook, disconnectTimeout, doublePropertyOr, eventBus, forceSaslPlain, instanceCounter, intPropertyOr, ioPool, ioPoolSize, keepAliveErrorThreshold, keepAliveInterval, keepAliveTimeout, kvEndpoints, kvIoPool, kvServiceConfig, longPropertyOr, maxAllowedInstances, maxAllowedInstances, maxRequestLifetime, memcachedHashingStrategy, mutationTokensEnabled, networkLatencyMetricsCollector, networkResolution, observeIntervalDelay, operationTracingEnabled, operationTracingServerDurationEnabled, orphanResponseReporter, orphanResponseReportingEnabled, packageNameAndVersion, queryEndpoints, queryIoPool, queryServiceConfig, reconnectDelay, requestBufferSize, requestBufferWaitStrategy, responseBufferSize, retryDelay, retryStrategy, runtimeMetricsCollector, scheduler, searchEndpoints, searchIoPool, searchServiceConfig, shutdown, shutdown, shutdownAsync, socketConnectTimeout, sslEnabled, sslHostnameVerificationEnabled, sslKeystore, sslKeystoreFile, sslKeystorePassword, sslTruststore, sslTruststoreFile, sslTruststorePassword, stringPropertyOr, tcpNodelayEnabled, tracer, userAgent, viewEndpoints, viewIoPool, viewServiceConfig
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.couchbase.client.core.env.ConfigParserEnvironment
memcachedHashingStrategy
Methods inherited from interface com.couchbase.client.core.env.CoreEnvironment
analyticsIoPool, analyticsServiceConfig, autoreleaseAfter, bootstrapCarrierDirectPort, bootstrapCarrierEnabled, bootstrapCarrierSslPort, bootstrapHttpDirectPort, bootstrapHttpEnabled, bootstrapHttpSslPort, bufferPoolingEnabled, callbacksOnIoPool, certAuthEnabled, compressionEnabled, compressionMinRatio, compressionMinSize, computationPoolSize, configPollFloorInterval, configPollInterval, continuousKeepAliveEnabled, coreBuild, coreVersion, couchbaseCoreSendHook, disconnectTimeout, eventBus, forceSaslPlain, ioPool, ioPoolSize, keepAliveErrorThreshold, keepAliveInterval, keepAliveTimeout, kvEndpoints, kvIoPool, kvServiceConfig, maxRequestLifetime, mutationTokensEnabled, networkLatencyMetricsCollector, networkResolution, observeIntervalDelay, operationTracingEnabled, operationTracingServerDurationEnabled, orphanResponseReporter, orphanResponseReportingEnabled, packageNameAndVersion, queryEndpoints, queryIoPool, queryServiceConfig, reconnectDelay, requestBufferSize, requestBufferWaitStrategy, responseBufferSize, retryDelay, retryStrategy, runtimeMetricsCollector, scheduler, searchEndpoints, searchIoPool, searchServiceConfig, shutdown, shutdown, shutdownAsync, socketConnectTimeout, tcpNodelayEnabled, tracer, userAgent, viewEndpoints, viewIoPool, viewServiceConfig
Methods inherited from interface com.couchbase.client.core.env.SecureEnvironment
sslEnabled, sslHostnameVerificationEnabled, sslKeystore, sslKeystoreFile, sslKeystorePassword, sslTruststore, sslTruststoreFile, sslTruststorePassword
-
Field Details
-
CLIENT_VERSION
-
CLIENT_GIT_VERSION
-
SDK_PACKAGE_NAME_AND_VERSION
-
SDK_USER_AGENT
-
-
Method Details
-
create
Creates aCouchbaseEnvironment
with default settings applied.- Returns:
- a
DefaultCouchbaseEnvironment
with default settings.
-
builder
Returns theDefaultCouchbaseEnvironment.Builder
to customize environment settings.- Returns:
- the
DefaultCouchbaseEnvironment.Builder
.
-
managementTimeout
public long managementTimeout()Description copied from interface:CouchbaseEnvironment
The default timeout for management operations, set toMANAGEMENT_TIMEOUT
.- Specified by:
managementTimeout
in interfaceCouchbaseEnvironment
- Returns:
- the default management timeout.
-
queryTimeout
public long queryTimeout()Description copied from interface:CouchbaseEnvironment
The default timeout for query operations, set toQUERY_TIMEOUT
.- Specified by:
queryTimeout
in interfaceCouchbaseEnvironment
- Returns:
- the default query timeout.
-
viewTimeout
public long viewTimeout()Description copied from interface:CouchbaseEnvironment
The default timeout for view operations, set toVIEW_TIMEOUT
.- Specified by:
viewTimeout
in interfaceCouchbaseEnvironment
- Returns:
- the default view timeout.
-
searchTimeout
public long searchTimeout()Description copied from interface:CouchbaseEnvironment
The default timeout for search operations, set toSEARCH_TIMEOUT
.- Specified by:
searchTimeout
in interfaceCouchbaseEnvironment
- Returns:
- the default search timeout.
-
analyticsTimeout
public long analyticsTimeout()Description copied from interface:CouchbaseEnvironment
The default timeout for analytics operations, set toANALYTICS_TIMEOUT
.- Specified by:
analyticsTimeout
in interfaceCouchbaseEnvironment
- Returns:
- the default analytics timeout.
-
kvTimeout
public long kvTimeout()Description copied from interface:CouchbaseEnvironment
The default timeout for binary (key/value) operations, set toKV_TIMEOUT
.- Specified by:
kvTimeout
in interfaceCouchbaseEnvironment
- Returns:
- the default binary timeout.
-
connectTimeout
public long connectTimeout()Description copied from interface:CouchbaseEnvironment
The default timeout for connect operations, set toCONNECT_TIMEOUT
.- Specified by:
connectTimeout
in interfaceCouchbaseEnvironment
- Returns:
- the default connect timeout.
-
dnsSrvEnabled
public boolean dnsSrvEnabled()Description copied from interface:CouchbaseEnvironment
Returns whether DNS SRV lookup for the bootstrap nodes is enabled or not.- Specified by:
dnsSrvEnabled
in interfaceCouchbaseEnvironment
- Returns:
- true if enabled, false otherwise.
-
clientVersion
Description copied from interface:CouchbaseEnvironment
Returns version information on the Couchbase Java SDK client. Version number is in the form MAJOR.MINOR.PATCH, and is the one for the java-client layer.- Specified by:
clientVersion
in interfaceCouchbaseEnvironment
- Returns:
- the version string for the Java client.
- See Also:
for a more specific build information (relevant for tracking the exact version of the code the client was built from)
,for the same information but relative to the core layer.
-
clientBuild
Description copied from interface:CouchbaseEnvironment
Returns build information on the Couchbase Java SDK client. This has a better granularity thanCouchbaseEnvironment.clientVersion()
and thus is more relevant to track the exact version of the code the client was built from. Build information can contain VCS information like commit numbers, tags, etc...- Specified by:
clientBuild
in interfaceCouchbaseEnvironment
- Returns:
- the build string for the Java client.
- See Also:
for more generic version information.
,for the same information but relative to the core layer.
-
cryptoManager
Description copied from interface:CouchbaseEnvironment
Returns the crypto manager set. Note: Use of the Field Level Encryption functionality provided in the com.couchbase.client.encryption namespace provided by Couchbase is subject to the Couchbase Inc. Enterprise Subscription License Agreement at https://www.couchbase.com/ESLA-11132015.- Specified by:
cryptoManager
in interfaceCouchbaseEnvironment
-
propagateParentSpan
public boolean propagateParentSpan()Description copied from interface:CouchbaseEnvironment
If set to true, the code will check if a parent span is available and if so use this implicitly as a parent. This is enabled by default for ease of use but can be disabled in case it causes weird effects to parent spans in trace output.- Specified by:
propagateParentSpan
in interfaceCouchbaseEnvironment
- Returns:
- if a parent span should be propagated automatically.
-
dumpParameters
- Overrides:
dumpParameters
in classDefaultCoreEnvironment
-
toString
- Overrides:
toString
in classDefaultCoreEnvironment
-