AmqpsIotHubConnection Class
- java.
lang. Object - BaseHandler
- com.
microsoft. azure. sdk. iot. device. transport. amqps. AmqpsIotHubConnection
- com.
public class AmqpsIotHubConnection implements IotHubTransportConnection
An AMQPS IotHub connection between a device and an IoTHub or Edgehub. This class is responsible for reacting to connection level and reactor level events. It is also responsible for creating sessions and handlers for those sessions. An instance of this object may be reused after it has been closed. This class is used for both single-plexed and multiplexed connections.
Constructor Summary
Method Summary
Inherited Members
Constructor Details
AmqpsIotHubConnection
public AmqpsIotHubConnection(ClientConfiguration config, String transportUniqueIdentifier)
Parameters:
AmqpsIotHubConnection
public AmqpsIotHubConnection(String hostName, String transportUniqueIdentifier, boolean isWebsocketConnection, SSLContext sslContext, ProxySettings proxySettings, int keepAliveInterval)
Parameters:
Method Details
close
public void close()
Closes the transport connection.
Overrides:
AmqpsIotHubConnection.close()getConnectionId
public String getConnectionId()
Gives the UUID associated with this connection instance. This string is used in conjunction with the callbacks with connection status updates to ensure that all connection status updates are relevant to this connection object
Overrides:
AmqpsIotHubConnection.getConnectionId()Returns:
onAuthenticationFailed
public void onAuthenticationFailed(String deviceId, TransportException transportException)
Parameters:
onAuthenticationSessionOpened
public void onAuthenticationSessionOpened()
onCBSSessionClosedUnexpectedly
public void onCBSSessionClosedUnexpectedly(ErrorCondition errorCondition)
Parameters:
onConnectionBound
public void onConnectionBound(Event event)
Parameters:
onConnectionInit
public void onConnectionInit(Event event)
Parameters:
onConnectionLocalClose
public void onConnectionLocalClose(Event event)
Parameters:
onConnectionLocalOpen
public void onConnectionLocalOpen(Event event)
Parameters:
onConnectionRemoteClose
public void onConnectionRemoteClose(Event event)
Parameters:
onConnectionRemoteOpen
public void onConnectionRemoteOpen(Event event)
Parameters:
onDeviceSessionOpened
public void onDeviceSessionOpened(String deviceId)
Parameters:
onMessageAcknowledged
public void onMessageAcknowledged(Message message, DeliveryState deliveryState, String deviceId)
Parameters:
onMessageReceived
public void onMessageReceived(IotHubTransportMessage message)
Parameters:
onReactorClosedUnexpectedly
public void onReactorClosedUnexpectedly()
onReactorFinal
public void onReactorFinal(Event event)
Parameters:
onReactorInit
public void onReactorInit(Event event)
Parameters:
onSessionClosedAsExpected
public void onSessionClosedAsExpected(String deviceId)
Parameters:
onSessionClosedUnexpectedly
public void onSessionClosedUnexpectedly(ErrorCondition errorCondition, String deviceId)
Parameters:
onTimerTask
public void onTimerTask(Event event)
Parameters:
onTransportError
public void onTransportError(Event event)
Parameters:
open
public void open()
Opens the transport connection object
Overrides:
AmqpsIotHubConnection.open()Throws:
registerMultiplexedDevice
public void registerMultiplexedDevice(ClientConfiguration config)
Parameters:
sendMessage
public IotHubStatusCode sendMessage(com.microsoft.azure.sdk.iot.device.Message message)
Parameters:
sendMessageResult
public boolean sendMessageResult(IotHubTransportMessage message, IotHubMessageResult result)
Send an acknowledgement to the IotHub for a message that the Transport layer received
Overrides:
AmqpsIotHubConnection.sendMessageResult(IotHubTransportMessage message, IotHubMessageResult result)Parameters:
Returns:
Throws:
setListener
public void setListener(IotHubListener listener)
Sets a listener into the Transport Connection object. This listener updates the Transport layer of connection status updates, message arrivals, and message acknowledgements
Overrides:
AmqpsIotHubConnection.setListener(IotHubListener listener)Parameters:
unregisterMultiplexedDevice
public void unregisterMultiplexedDevice(ClientConfiguration config, boolean willReconnect)
Asynchronously unregister a multiplexed device from an active multiplexed connection or synchronously unregister a multiplexed device from a closed multiplexed connection.
Parameters:
Applies to
Azure SDK for Java