Interface Endpoint
-
- All Superinterfaces:
Stateful<LifecycleState>
- All Known Implementing Classes:
AbstractEndpoint
,AnalyticsEndpoint
,ConfigEndpoint
,KeyValueEndpoint
,QueryEndpoint
,SearchEndpoint
,ViewEndpoint
public interface Endpoint extends Stateful<LifecycleState>
Represents a statefulEndpoint
which abstracts the underlying channel.- Since:
- 1.0
- Author:
- Michael Nitschinger
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description rx.Observable<LifecycleState>
connect()
Connect theEndpoint
to the underlying channel.rx.Single<EndpointHealth>
diagnostics(ServiceType type)
Returns health information for this endpoint.rx.Observable<LifecycleState>
disconnect()
Disconnect theEndpoint
from the underlying channel.boolean
isFree()
If this endpoint is free to take a request.long
lastResponse()
Returns the timestamp of the last response completed.String
remoteAddress()
Returns the remote address as String representation.void
send(CouchbaseRequest request)
Sends aCouchbaseRequest
into the endpoint and eventually returns aCouchbaseResponse
.-
Methods inherited from interface com.couchbase.client.core.state.Stateful
hasSubscribers, isState, state, states
-
-
-
-
Method Detail
-
connect
rx.Observable<LifecycleState> connect()
Connect theEndpoint
to the underlying channel.- Returns:
- a
Observable
with the state after the connect process finishes.
-
disconnect
rx.Observable<LifecycleState> disconnect()
Disconnect theEndpoint
from the underlying channel.- Returns:
- a
Observable
with the state after the disconnect process finishes.
-
send
void send(CouchbaseRequest request)
Sends aCouchbaseRequest
into the endpoint and eventually returns aCouchbaseResponse
.- Parameters:
request
- the request to send.
-
isFree
boolean isFree()
If this endpoint is free to take a request. This is especially important in non-pipelined endpoint cases since if a request is in-flight this will return false.- Returns:
- true if free to accept a request, false otherwise.
-
lastResponse
long lastResponse()
Returns the timestamp of the last response completed.
-
diagnostics
rx.Single<EndpointHealth> diagnostics(ServiceType type)
Returns health information for this endpoint.
-
remoteAddress
String remoteAddress()
Returns the remote address as String representation. Hostname and port separated by colon.
-
-