public class AnalyticsService extends Object
Modifier and Type | Field and Description |
---|---|
static Duration |
DEFAULT_IDLE_TIME_CHECK_INTERVAL
The interval when to check if idle sockets are to be cleaned up.
|
Constructor and Description |
---|
AnalyticsService(AnalyticsServiceConfig config,
CoreContext context,
String hostname,
int port) |
Modifier and Type | Method and Description |
---|---|
void |
connect()
Instruct this
Service to connect. |
ServiceContext |
context()
Returns the underlying contextual metadata for this service.
|
protected Endpoint |
createEndpoint()
Subclass implements this method to create new endpoints.
|
Stream<EndpointDiagnostics> |
diagnostics()
Returns diagnostics information for this service.
|
void |
disconnect()
Instruct this
Service to disconnect. |
protected Duration |
idleTimeCheckInterval()
Can be overridden for unit tests.
|
protected EndpointSelectionStrategy |
selectionStrategy()
Subclass implements this method to pick their selection strategy of choice.
|
<R extends Request<? extends Response>> |
send(R request)
Sends the request into this
Service . |
protected ServiceContext |
serviceContext()
Returns the created
ServiceContext for implementations to use. |
ServiceState |
state()
Returns the current state of the stateful component.
|
Flux<ServiceState> |
states()
Returns a stream of states for this component as they change.
|
ServiceType |
type()
Represents the service type for this service.
|
public static final Duration DEFAULT_IDLE_TIME_CHECK_INTERVAL
public AnalyticsService(AnalyticsServiceConfig config, CoreContext context, String hostname, int port)
protected Endpoint createEndpoint()
protected EndpointSelectionStrategy selectionStrategy()
public ServiceType type()
Service
protected ServiceContext serviceContext()
ServiceContext
for implementations to use.protected Duration idleTimeCheckInterval()
public <R extends Request<? extends Response>> void send(R request)
Service
Service
.
Note that there is no guarantee that the request will actually dispatched, based on the state this service is in.
public void connect()
Service
Service
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.
public void disconnect()
Service
Service
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.
disconnect
in interface Service
public ServiceContext context()
Service
public ServiceState state()
Stateful
state
in interface Stateful<ServiceState>
public Flux<ServiceState> states()
Stateful
states
in interface Stateful<ServiceState>
public Stream<EndpointDiagnostics> diagnostics()
Service
diagnostics
in interface Service
Copyright © 2021 Couchbase, Inc.. All rights reserved.