Package org.elasticsearch.transport
Interface TransportConnectionListener
-
- All Known Implementing Classes:
TransportService
public interface TransportConnectionListener
A listener interface that allows to react on transport events. All methods may be executed on network threads. Consumers must fork in the case of long running or blocking operations.
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default void
onConnectionClosed(Transport.Connection connection)
Called once a connection ws closed.default void
onConnectionOpened(Transport.Connection connection)
Called once a connection was openeddefault void
onNodeConnected(DiscoveryNode node)
Called once a node connection is opened and registered.default void
onNodeDisconnected(DiscoveryNode node)
Called once a node connection is closed and unregistered.default void
onRequestReceived(long requestId, java.lang.String action)
Called once a request is receiveddefault void
onRequestSent(DiscoveryNode node, long requestId, java.lang.String action, TransportRequest request, TransportRequestOptions finalOptions)
Called for every request sent to a server after the request has been passed to the underlying network implementationdefault void
onResponseReceived(long requestId, Transport.ResponseContext context)
Called for every response receiveddefault void
onResponseSent(long requestId, java.lang.String action, java.lang.Exception error)
Called for every failed action response after the response has been passed to the underlying network implementation.default void
onResponseSent(long requestId, java.lang.String action, TransportResponse response, TransportResponseOptions finalOptions)
Called for every action response sent after the response has been passed to the underlying network implementation.
-
-
-
Method Detail
-
onRequestReceived
default void onRequestReceived(long requestId, java.lang.String action)
Called once a request is received- Parameters:
requestId
- the internal request IDaction
- the request action
-
onResponseSent
default void onResponseSent(long requestId, java.lang.String action, TransportResponse response, TransportResponseOptions finalOptions)
Called for every action response sent after the response has been passed to the underlying network implementation.- Parameters:
requestId
- the request ID (unique per client)action
- the request actionresponse
- the response sendfinalOptions
- the response options
-
onResponseSent
default void onResponseSent(long requestId, java.lang.String action, java.lang.Exception error)
Called for every failed action response after the response has been passed to the underlying network implementation.- Parameters:
requestId
- the request ID (unique per client)action
- the request actionerror
- the error sent back to the caller
-
onRequestSent
default void onRequestSent(DiscoveryNode node, long requestId, java.lang.String action, TransportRequest request, TransportRequestOptions finalOptions)
Called for every request sent to a server after the request has been passed to the underlying network implementation- Parameters:
node
- the node the request was sent torequestId
- the internal request idaction
- the action namerequest
- the actual requestfinalOptions
- the request options
-
onConnectionOpened
default void onConnectionOpened(Transport.Connection connection)
Called once a connection was opened- Parameters:
connection
- the connection
-
onConnectionClosed
default void onConnectionClosed(Transport.Connection connection)
Called once a connection ws closed.- Parameters:
connection
- the closed connection
-
onResponseReceived
default void onResponseReceived(long requestId, Transport.ResponseContext context)
Called for every response received- Parameters:
requestId
- the request id for this reponsecontext
- the response context or null if the context was already processed ie. due to a timeout.
-
onNodeConnected
default void onNodeConnected(DiscoveryNode node)
Called once a node connection is opened and registered.
-
onNodeDisconnected
default void onNodeDisconnected(DiscoveryNode node)
Called once a node connection is closed and unregistered.
-
-