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 stateful
Endpoint
which abstracts the underlying channel.- Since:
- 1.0
- Author:
- Michael Nitschinger
-
Method Summary
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
lastConnectedAt()
Returns the epoch nano timestamp when the endpoint was last connected successfully.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 Details
-
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
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. -
lastConnectedAt
long lastConnectedAt()Returns the epoch nano timestamp when the endpoint was last connected successfully. If never connected at all, will return 0. -
diagnostics
Returns health information for this endpoint. -
remoteAddress
String remoteAddress()Returns the remote address as String representation. Hostname and port separated by colon.
-