@FunctionalInterface public interface GatewayObserver
Modifier and Type | Field and Description |
---|---|
static ConnectionObserver.State |
CONNECTED
Propagated when a gateway connection has been established.
|
static ConnectionObserver.State |
DISCONNECTED
Propagated when a gateway connection has been fully closed.
|
static ConnectionObserver.State |
DISCONNECTED_RESUME
Propagated when a gateway connection has been closed but is still open for a RESUME attempt.
|
static GatewayObserver |
NOOP_LISTENER |
static ConnectionObserver.State |
RETRY_FAILED
Propagated when a reconnection attempt has failed.
|
static ConnectionObserver.State |
RETRY_RESUME_STARTED
Propagated when a reconnection attempt with RESUME has started.
|
static ConnectionObserver.State |
RETRY_STARTED
Propagated when a reconnection attempt with IDENTIFY has started.
|
static ConnectionObserver.State |
RETRY_SUCCEEDED
Propagated when a reconnection attempt has succeeded.
|
static ConnectionObserver.State |
SEQUENCE
Propagated when the current session sequence value has updated.
|
Modifier and Type | Method and Description |
---|---|
static GatewayObserver |
emptyListener() |
void |
onStateChange(ConnectionObserver.State newState,
GatewayClient client)
React on websocket state change.
|
default GatewayObserver |
then(GatewayObserver other)
Chain together another
GatewayObserver . |
static final GatewayObserver NOOP_LISTENER
static final ConnectionObserver.State CONNECTED
static final ConnectionObserver.State DISCONNECTED
static final ConnectionObserver.State DISCONNECTED_RESUME
static final ConnectionObserver.State RETRY_RESUME_STARTED
static final ConnectionObserver.State RETRY_STARTED
static final ConnectionObserver.State RETRY_SUCCEEDED
static final ConnectionObserver.State RETRY_FAILED
static final ConnectionObserver.State SEQUENCE
static GatewayObserver emptyListener()
void onStateChange(ConnectionObserver.State newState, GatewayClient client)
newState
- the new stateclient
- the gateway client observing this changedefault GatewayObserver then(GatewayObserver other)
GatewayObserver
.other
- the next GatewayObserver
GatewayObserver