Class KeyValueService
java.lang.Object
com.couchbase.client.core.service.KeyValueService
- All Implemented Interfaces:
Service
,Stateful<ServiceState>
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Duration
The interval when to check if idle sockets are to be cleaned up. -
Constructor Summary
ConstructorDescriptionKeyValueService
(ServiceConfig serviceConfig, CoreContext coreContext, String hostname, int port, Optional<String> bucketName, Authenticator authenticator) -
Method Summary
Modifier and TypeMethodDescriptionvoid
connect()
Instruct thisService
to connect.context()
Returns the underlying contextual metadata for this service.protected Endpoint
Subclass implements this method to create new endpoints.Returns diagnostics information for this service.void
Instruct thisService
to disconnect.protected Duration
Can be overridden for unit tests.protected EndpointSelectionStrategy
Subclass implements this method to pick their selection strategy of choice.send
(R request) Sends the request into thisService
.protected ServiceContext
Returns the createdServiceContext
for implementations to use.state()
Returns the current state of the stateful component.states()
Returns a stream of states for this component as they change.type()
Represents the service type for this service.
-
Field Details
-
DEFAULT_IDLE_TIME_CHECK_INTERVAL
The interval when to check if idle sockets are to be cleaned up.
-
-
Constructor Details
-
KeyValueService
public KeyValueService(ServiceConfig serviceConfig, CoreContext coreContext, String hostname, int port, Optional<String> bucketName, Authenticator authenticator)
-
-
Method Details
-
createEndpoint
Subclass implements this method to create new endpoints.- Returns:
- the created endpoint.
-
selectionStrategy
Subclass implements this method to pick their selection strategy of choice.- Returns:
- the selection strategy.
-
type
Description copied from interface:Service
Represents the service type for this service. -
serviceContext
Returns the createdServiceContext
for implementations to use. -
idleTimeCheckInterval
Can be overridden for unit tests. -
send
Description copied from interface:Service
Sends the request into thisService
.Note that there is no guarantee that the request will actually dispatched, based on the state this service is in.
-
connect
public void connect()Description copied from interface:Service
Instruct thisService
to connect.This method is async and will return immediately. Use the other methods available to inspect the current state of the service, signaling potential successful connection attempts.
-
disconnect
public void disconnect()Description copied from interface:Service
Instruct thisService
to disconnect.This method is async and will return immediately. Use the other methods available to inspect the current state of the service, signaling potential successful disconnection attempts.
- Specified by:
disconnect
in interfaceService
-
context
Description copied from interface:Service
Returns the underlying contextual metadata for this service. -
state
Description copied from interface:Stateful
Returns the current state of the stateful component.- Specified by:
state
in interfaceStateful<ServiceState>
-
states
Description copied from interface:Stateful
Returns a stream of states for this component as they change.- Specified by:
states
in interfaceStateful<ServiceState>
-
diagnostics
Description copied from interface:Service
Returns diagnostics information for this service.- Specified by:
diagnostics
in interfaceService
-
internalDiagnostics
- Specified by:
internalDiagnostics
in interfaceService
-