@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 addReconnectionAttemptListener(MessagingService.ReconnectionAttemptListener listener)
listener
- the callback to listen for reconnection attemptsConnectable addReconnectionListener(MessagingService.ReconnectionListener listener)
listener
- the callback to listen for reconnectionConnectable 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 finishedvoid 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
disconnectboolean isConnected()
connect()
method was
previously called successfully.true
if the messaging service is connected to a remote destination, otherwise
false
Connectable removeReconnectionAttemptListener(MessagingService.ReconnectionAttemptListener listener)
listener
- the callback to listen for reconnection attemptsConnectable removeReconnectionListener(MessagingService.ReconnectionListener listener)
listener
- the callback to unregisterCopyright 2019-2024 Solace Corporation. All rights reserved.