public class SearchService 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 |
|---|
SearchService(SearchServiceConfig 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.
|
Stream<InternalEndpointDiagnostics> |
internalDiagnostics() |
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 SearchService(SearchServiceConfig config, CoreContext context, String hostname, int port)
protected Endpoint createEndpoint()
protected EndpointSelectionStrategy selectionStrategy()
public ServiceType type()
Serviceprotected ServiceContext serviceContext()
ServiceContext for implementations to use.protected Duration idleTimeCheckInterval()
public <R extends Request<? extends Response>> void send(R request)
ServiceService.
Note that there is no guarantee that the request will actually dispatched, based on the state this service is in.
public void connect()
ServiceService 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()
ServiceService 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 Servicepublic ServiceContext context()
Servicepublic ServiceState state()
Statefulstate in interface Stateful<ServiceState>public Flux<ServiceState> states()
Statefulstates in interface Stateful<ServiceState>public Stream<EndpointDiagnostics> diagnostics()
Servicediagnostics in interface Servicepublic Stream<InternalEndpointDiagnostics> internalDiagnostics()
internalDiagnostics in interface ServiceCopyright © 2024 Couchbase, Inc.. All rights reserved.