Package io.servicetalk.transport.api
Interface ConnectionObserver
-
- All Known Implementing Classes:
NoopTransportObserver.NoopConnectionObserver
public interface ConnectionObserverAn observer interface that provides visibility into events associated with a network connection.Either
connectionClosed()orconnectionClosed(Throwable)will be invoked to signal when connection is closed.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceConnectionObserver.DataObserverAn observer interface that provides visibility into read and write events related to data flow.static interfaceConnectionObserver.MultiplexedObserverAn observer interface that provides visibility into new streams created by a multiplexed connection.static interfaceConnectionObserver.ReadObserverAn observer interface that provides visibility into read events.static interfaceConnectionObserver.SecurityHandshakeObserverAn observer interface that provides visibility into security handshake events.static interfaceConnectionObserver.StreamObserverAn observer interface that provides visibility into stream events.static interfaceConnectionObserver.WriteObserverAn observer interface that provides visibility into write events.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidconnectionClosed()Callback when the connection is closed.voidconnectionClosed(java.lang.Throwable error)Callback when the connection is closed due to anerror.ConnectionObserver.DataObserverconnectionEstablished(ConnectionInfo info)Callback when a non-multiplexed connection is established and ready.ConnectionObserver.MultiplexedObservermultiplexedConnectionEstablished(ConnectionInfo info)Callback when a multiplexed connection is established and ready.voidonDataRead(int size)Callback whensizebytes are read from the connection.voidonDataWrite(int size)Callback whensizebytes are written to the connection.voidonFlush()Callback when previously written data is flushed to the connection.ConnectionObserver.SecurityHandshakeObserveronSecurityHandshake()Callback when a security handshake is initiated.
-
-
-
Method Detail
-
onDataRead
void onDataRead(int size)
Callback whensizebytes are read from the connection.- Parameters:
size- size of the data chunk read
-
onDataWrite
void onDataWrite(int size)
Callback whensizebytes are written to the connection.- Parameters:
size- size of the data chunk written
-
onFlush
void onFlush()
Callback when previously written data is flushed to the connection.
-
onSecurityHandshake
ConnectionObserver.SecurityHandshakeObserver onSecurityHandshake()
Callback when a security handshake is initiated.- Returns:
- a new
ConnectionObserver.SecurityHandshakeObserverthat provides visibility into security handshake events
-
connectionEstablished
ConnectionObserver.DataObserver connectionEstablished(ConnectionInfo info)
Callback when a non-multiplexed connection is established and ready.- Parameters:
info-ConnectionInfofor the established connection- Returns:
- a new
ConnectionObserver.DataObserverthat provides visibility into read and write events
-
multiplexedConnectionEstablished
ConnectionObserver.MultiplexedObserver multiplexedConnectionEstablished(ConnectionInfo info)
Callback when a multiplexed connection is established and ready.- Parameters:
info-ConnectionInfofor the established connection- Returns:
- a new
ConnectionObserver.MultiplexedObserverthat provides visibility into new streams
-
connectionClosed
void connectionClosed(java.lang.Throwable error)
Callback when the connection is closed due to anerror.- Parameters:
error- an occurred error
-
connectionClosed
void connectionClosed()
Callback when the connection is closed.
-
-