public interface IotHubListener
| Modifier and Type | Method and Description |
|---|---|
void |
onConnectionEstablished(java.lang.String connectionId)
Callback to be fired when the connection has been successfully established
|
void |
onConnectionLost(TransportException e,
java.lang.String connectionId)
Callback to be fired when connection has been lost
|
void |
onMessageReceived(IotHubTransportMessage transportMessage,
TransportException e)
Callback to be fired when a transport message has been received.
|
void |
onMessageSent(Message message,
java.lang.String deviceId,
TransportException e)
Callback to be fired when a message that the transport client sent has been acknowledged by Iot Hub
|
void |
onMultiplexedDeviceSessionEstablished(java.lang.String connectionId,
java.lang.String deviceId)
Callback to be fired when the multiplexed connection establishes a new device session.
|
void |
onMultiplexedDeviceSessionLost(TransportException e,
java.lang.String connectionId,
java.lang.String deviceId,
boolean shouldReconnect)
Callback to be fired when the multiplexed connection loses a device session.
|
void |
onMultiplexedDeviceSessionRegistrationFailed(java.lang.String connectionId,
java.lang.String deviceId,
java.lang.Exception e)
Callback to be fired when the multiplexed connection fails to register a device session.
|
void onMessageSent(Message message, java.lang.String deviceId, TransportException e)
message - The message that was acknowledgeddeviceId - The device that the message was sent frome - Null if the message was successfully acknowledged. Otherwise, this exception communicates if the message
should be resent at allvoid onMessageReceived(IotHubTransportMessage transportMessage, TransportException e)
transportMessage - The message that was received. May be null if e is not nulle - the exception that was encountered while receiving messages. May be null if transportMessage
is not nullvoid onConnectionLost(TransportException e, java.lang.String connectionId)
e - the cause of the connection lossconnectionId - the id of the connection this update is relevant tovoid onConnectionEstablished(java.lang.String connectionId)
connectionId - the id of the connection this update is relevant tovoid onMultiplexedDeviceSessionEstablished(java.lang.String connectionId,
java.lang.String deviceId)
connectionId - the Id of the connection, used to identify which of possible many reconnection attempts
this event belongs to.deviceId - the Id of the device that the session belongs tovoid onMultiplexedDeviceSessionLost(TransportException e, java.lang.String connectionId, java.lang.String deviceId, boolean shouldReconnect)
e - The exception that caused the connection to be lost.connectionId - the Id of the connection, used to identify which of possible many reconnection attempts
this event belongs to.deviceId - the Id of the device that the session belongs toshouldReconnect - false if the disconnect was desired by the users, and true if it is the consequence of an
issue where the SDK should retry.void onMultiplexedDeviceSessionRegistrationFailed(java.lang.String connectionId,
java.lang.String deviceId,
java.lang.Exception e)
connectionId - the Id of the connection, used to identify which of possible many reconnection attempts
this event belongs to.deviceId - the Id of the device that the session belongs toe - the throwable that explains why the registration failed.Copyright © 2023. All rights reserved.