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 aCouchbaseEnvironment. This environment is intended to be reused and passed in acrossAsyncClusterinstances. 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 theDefaultCouchbaseEnvironment.Builderor 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 classDefaultCouchbaseEnvironment.Builder
-
Field Summary
Fields Modifier and Type Field Description protected static StringCLIENT_GIT_VERSIONprotected static StringCLIENT_VERSIONstatic StringSDK_PACKAGE_NAME_AND_VERSIONstatic StringSDK_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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description longanalyticsTimeout()The default timeout for analytics operations, set toANALYTICS_TIMEOUT.static DefaultCouchbaseEnvironment.Builderbuilder()Returns theDefaultCouchbaseEnvironment.Builderto customize environment settings.StringclientBuild()Returns build information on the Couchbase Java SDK client.StringclientVersion()Returns version information on the Couchbase Java SDK client.longconnectTimeout()The default timeout for connect operations, set toCONNECT_TIMEOUT.static DefaultCouchbaseEnvironmentcreate()Creates aCouchbaseEnvironmentwith default settings applied.CryptoManagercryptoManager()Returns the crypto manager set.booleandnsSrvEnabled()Returns whether DNS SRV lookup for the bootstrap nodes is enabled or not.protected StringBuilderdumpParameters(StringBuilder sb)longkvTimeout()The default timeout for binary (key/value) operations, set toKV_TIMEOUT.longmanagementTimeout()The default timeout for management operations, set toMANAGEMENT_TIMEOUT.booleanpropagateParentSpan()If set to true, the code will check if a parent span is available and if so use this implicitly as a parent.longqueryTimeout()The default timeout for query operations, set toQUERY_TIMEOUT.longsearchTimeout()The default timeout for search operations, set toSEARCH_TIMEOUT.StringtoString()longviewTimeout()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
-
-
-
-
Method Detail
-
create
public static DefaultCouchbaseEnvironment create()
Creates aCouchbaseEnvironmentwith default settings applied.- Returns:
- a
DefaultCouchbaseEnvironmentwith default settings.
-
builder
public static DefaultCouchbaseEnvironment.Builder builder()
Returns theDefaultCouchbaseEnvironment.Builderto customize environment settings.- Returns:
- the
DefaultCouchbaseEnvironment.Builder.
-
managementTimeout
public long managementTimeout()
Description copied from interface:CouchbaseEnvironmentThe default timeout for management operations, set toMANAGEMENT_TIMEOUT.- Specified by:
managementTimeoutin interfaceCouchbaseEnvironment- Returns:
- the default management timeout.
-
queryTimeout
public long queryTimeout()
Description copied from interface:CouchbaseEnvironmentThe default timeout for query operations, set toQUERY_TIMEOUT.- Specified by:
queryTimeoutin interfaceCouchbaseEnvironment- Returns:
- the default query timeout.
-
viewTimeout
public long viewTimeout()
Description copied from interface:CouchbaseEnvironmentThe default timeout for view operations, set toVIEW_TIMEOUT.- Specified by:
viewTimeoutin interfaceCouchbaseEnvironment- Returns:
- the default view timeout.
-
searchTimeout
public long searchTimeout()
Description copied from interface:CouchbaseEnvironmentThe default timeout for search operations, set toSEARCH_TIMEOUT.- Specified by:
searchTimeoutin interfaceCouchbaseEnvironment- Returns:
- the default search timeout.
-
analyticsTimeout
public long analyticsTimeout()
Description copied from interface:CouchbaseEnvironmentThe default timeout for analytics operations, set toANALYTICS_TIMEOUT.- Specified by:
analyticsTimeoutin interfaceCouchbaseEnvironment- Returns:
- the default analytics timeout.
-
kvTimeout
public long kvTimeout()
Description copied from interface:CouchbaseEnvironmentThe default timeout for binary (key/value) operations, set toKV_TIMEOUT.- Specified by:
kvTimeoutin interfaceCouchbaseEnvironment- Returns:
- the default binary timeout.
-
connectTimeout
public long connectTimeout()
Description copied from interface:CouchbaseEnvironmentThe default timeout for connect operations, set toCONNECT_TIMEOUT.- Specified by:
connectTimeoutin interfaceCouchbaseEnvironment- Returns:
- the default connect timeout.
-
dnsSrvEnabled
public boolean dnsSrvEnabled()
Description copied from interface:CouchbaseEnvironmentReturns whether DNS SRV lookup for the bootstrap nodes is enabled or not.- Specified by:
dnsSrvEnabledin interfaceCouchbaseEnvironment- Returns:
- true if enabled, false otherwise.
-
clientVersion
public String clientVersion()
Description copied from interface:CouchbaseEnvironmentReturns 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:
clientVersionin 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
public String clientBuild()
Description copied from interface:CouchbaseEnvironmentReturns 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:
clientBuildin 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
public CryptoManager cryptoManager()
Description copied from interface:CouchbaseEnvironmentReturns 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:
cryptoManagerin interfaceCouchbaseEnvironment
-
propagateParentSpan
public boolean propagateParentSpan()
Description copied from interface:CouchbaseEnvironmentIf 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:
propagateParentSpanin interfaceCouchbaseEnvironment- Returns:
- if a parent span should be propagated automatically.
-
dumpParameters
protected StringBuilder dumpParameters(StringBuilder sb)
- Overrides:
dumpParametersin classDefaultCoreEnvironment
-
toString
public String toString()
- Overrides:
toStringin classDefaultCoreEnvironment
-
-