@ProviderType
public interface Connectable
| Modifier and Type | Method and Description |
|---|---|
Connectable |
addReconnectionAttemptListener(MessagingService.ReconnectionAttemptListener listener)
Registers the callback to receive reconnection attempt notifications.
|
Connectable |
addReconnectionListener(MessagingService.ReconnectionListener listener)
Registers the callback to receive reconnection notifications.
|
Connectable |
connect()
Connects synchronously with a PubSub+ event broker.
|
void |
disconnect()
Disconnects with a PubSub+ event broker.
|
boolean |
isConnected()
Determines if the messaging service is operational and that the
connect() method was
previously called successfully. |
Connectable |
removeReconnectionAttemptListener(MessagingService.ReconnectionAttemptListener listener)
Unregisters the callback that listens for reconnection attempts notifications.
|
Connectable |
removeReconnectionListener(MessagingService.ReconnectionListener listener)
Unregisters the callback that was used to receive reconnection notifications.
|
Connectable connect() throws PubSubPlusClientException, IllegalStateException
This method is idempotent when no other connect/disconnect operation is ongoing.
PubSubPlusClientException - if the messaging service can't be put in serviceIllegalStateException - if another disconnect operation is on-going or finishedboolean isConnected()
connect() method was
previously called successfully. This method will continue to return true even
if the underlying connection is temporarily lost and the API is attempting to reconnect.false if there is no connection or active attempt of reconnection to a PubSub+ event broker,
otherwise truevoid disconnect()
throws PubSubPlusClientException,
IllegalStateException
This method is idempotent when no other connect()/disconnect() operation is
ongoing.
PubSubPlusClientException - if the messaging service cannot be disconnected; it is
recommended to use isConnected() to check if
messaging service is still connected even though this
exception is thrownIllegalStateException - if a service is in an inappropriate state to perform a
disconnectConnectable addReconnectionListener(MessagingService.ReconnectionListener listener)
listener - the callback to listen for reconnectionConnectable removeReconnectionListener(MessagingService.ReconnectionListener listener)
listener - the callback to unregisterConnectable addReconnectionAttemptListener(MessagingService.ReconnectionAttemptListener listener)
listener - the callback to listen for reconnection attemptsConnectable removeReconnectionAttemptListener(MessagingService.ReconnectionAttemptListener listener)
listener - the callback to listen for reconnection attemptsCopyright 2019-2025 Solace Corporation. All rights reserved.