public static class Client.Environment extends Object
Client.Environment is responsible to carry various configuration and
state information throughout the lifecycle.| Modifier and Type | Field and Description |
|---|---|
static Duration |
DEFAULT_BOOTSTRAP_TIMEOUT |
static Duration |
DEFAULT_CONFIG_REFRESH_INTERVAL |
static reactor.util.retry.Retry |
DEFAULT_DCP_CHANNELS_RECONNECT_DELAY |
static int |
DEFAULT_DCP_CHANNELS_RECONNECT_MAX_ATTEMPTS |
static long |
DEFAULT_SOCKET_CONNECT_TIMEOUT |
| Modifier and Type | Method and Description |
|---|---|
Authenticator |
authenticator()
The authenticator for the connection
|
Duration |
bootstrapTimeout()
Time in milliseconds to wait for first configuration during bootstrap.
|
String |
bucket()
Name of the bucket used.
|
int |
bufferAckWatermark()
The watermark in percent for buffer acknowledgements.
|
List<HostAndPort> |
clusterAt()
Lists the bootstrap nodes.
|
Set<Long> |
collectionIds()
Collection IDs to filter on, or empty for all collections.
|
Set<String> |
collectionNames()
Collection names to filter on, or empty for all collections.
|
boolean |
collectionsAware()
Whether the client should operate in collections-aware mode
|
Duration |
configRefreshInterval()
Polling interval when server does not support clustermap change notifications.
|
Set<OpenConnectionFlag> |
connectionFlags()
Returns the flags to use when opening a DCP connection.
|
ConnectionNameGenerator |
connectionNameGenerator()
Returns the name generator used to identify DCP sockets.
|
ControlEventHandler |
controlEventHandler()
Returns the current attached control event handler.
|
DataEventHandler |
dataEventHandler()
Returns the currently attached data event handler.
|
int |
dcpChannelsReconnectMaxAttempts() |
DcpControl |
dcpControl()
Returns all DCP control params set, may be empty.
|
EventBus |
eventBus()
Returns the event bus where events are broadcasted on and can be published to.
|
io.netty.channel.EventLoopGroup |
eventLoopGroup()
Returns the currently attached event loop group for IO process.ing.
|
NetworkResolution |
networkResolution()
Returns the configured hostname selection strategy.
|
PersistedSeqnos |
persistedSeqnos()
Returns the bookkeeper for observed seqno persistence.
|
boolean |
persistencePollingEnabled()
Returns true if and only if rollback mitigation / persistence polling is enabled.
|
long |
persistencePollingIntervalMillis()
Returns the interval between observeSeqno requests.
|
boolean |
poolBuffers()
If buffer pooling is enabled.
|
OptionalLong |
scopeId()
Scope to filter on, or empty to filter by collection IDs.
|
Optional<String> |
scopeName()
Scope to filter on, or empty to filter by collection IDs.
|
SecurityConfig |
securityConfig()
Returns the TLS configuration
|
void |
setControlEventHandler(ControlEventHandler controlEventHandler)
Set/Override the control event handler.
|
void |
setDataEventHandler(DataEventHandler dataEventHandler)
Set/Override the data event handler.
|
void |
setSystemEventHandler(SystemEventHandler systemEventHandler)
Set/Override the control event handler.
|
reactor.core.publisher.Mono<Void> |
shutdown()
Shut down this stateful environment.
|
long |
socketConnectTimeout()
Socket connect timeout in milliseconds.
|
StreamEventBuffer |
streamEventBuffer()
Returns the stream event buffer used for rollback mitigation.
|
String |
toString() |
public static final Duration DEFAULT_BOOTSTRAP_TIMEOUT
public static final Duration DEFAULT_CONFIG_REFRESH_INTERVAL
public static final long DEFAULT_SOCKET_CONNECT_TIMEOUT
public static final reactor.util.retry.Retry DEFAULT_DCP_CHANNELS_RECONNECT_DELAY
public static final int DEFAULT_DCP_CHANNELS_RECONNECT_MAX_ATTEMPTS
public List<HostAndPort> clusterAt()
public NetworkResolution networkResolution()
public DataEventHandler dataEventHandler()
public StreamEventBuffer streamEventBuffer()
IllegalStateException - if persistence polling / rollback mitigation is disabledpublic PersistedSeqnos persistedSeqnos()
public long persistencePollingIntervalMillis()
public boolean persistencePollingEnabled()
public ControlEventHandler controlEventHandler()
public ConnectionNameGenerator connectionNameGenerator()
public String bucket()
public boolean collectionsAware()
public Set<Long> collectionIds()
public Set<String> collectionNames()
public OptionalLong scopeId()
public Optional<String> scopeName()
public Authenticator authenticator()
public DcpControl dcpControl()
public Set<OpenConnectionFlag> connectionFlags()
public int bufferAckWatermark()
public io.netty.channel.EventLoopGroup eventLoopGroup()
public Duration configRefreshInterval()
public Duration bootstrapTimeout()
public void setDataEventHandler(DataEventHandler dataEventHandler)
public void setControlEventHandler(ControlEventHandler controlEventHandler)
public void setSystemEventHandler(SystemEventHandler systemEventHandler)
public boolean poolBuffers()
public long socketConnectTimeout()
public EventBus eventBus()
public SecurityConfig securityConfig()
public reactor.core.publisher.Mono<Void> shutdown()
Note that it will only release/terminate resources which are owned by the client, especially if a custom event loop group is passed in it needs to be shut down separately.
Mono indicating completion of the shutdown process.public int dcpChannelsReconnectMaxAttempts()
Copyright © 2021 Couchbase, Inc.. All rights reserved.