AmqpsIotHubConnection Class
- java.
lang. Object - org.
apache. qpid. proton. engine. BaseHandler - com.
microsoft. azure. sdk. iot. device. transport. amqps. AmqpsIotHubConnection
- com.
- org.
Implements
public final class AmqpsIotHubConnection
extends org.apache.qpid.proton.engine.BaseHandler
implements IotHubTransportConnection, com.microsoft.azure.sdk.iot.device.transport.amqps.AmqpsSessionStateCallback
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.
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the transport connection. |
java.lang.String |
get Gives the UUID associated with this connection instance. |
void |
on Executed when SAS based authentication fails for a device in this connection |
void |
on Executed when the authentication session has successfully been opened. |
void |
on Executed if the CBS session closes unexpectedly. |
void |
on |
void |
on |
void |
on |
void |
on |
void |
on |
void |
on |
void |
on Executed when a device's amqp session has successfully been opened. |
void |
on Executed when a message sent in this connection was acknowledged by the service. |
void |
on Executed when a message was received by a session that this connection owns. |
void |
on |
void |
on |
void |
on Executed if a session closes, but it was expected. |
void |
on Executed if a session closes unexpectedly. |
void |
on |
void |
on |
void |
open()
Opens the transport connection object |
void |
register |
Iot |
send Send a single message to the Iot |
boolean |
send Send an acknowledgement to the Iot |
void |
set Sets a listener into the Transport Connection object. |
void |
unregister |
AmqpsIotHubConnection
public AmqpsIotHubConnection(DeviceClientConfig config, boolean isMultiplexing)
Parameters:
AmqpsIotHubConnection
public AmqpsIotHubConnection(String hostName, boolean isWebsocketConnection, SSLContext sslContext, ProxySettings proxySettings)
Parameters:
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
onAuthenticationFailed
public void onAuthenticationFailed(String deviceId, TransportException transportException)
Executed when SAS based authentication fails for a device in this connection
Parameters:
onAuthenticationSessionOpened
public void onAuthenticationSessionOpened()
Executed when the authentication session has successfully been opened. Never called for x509 auth.
onCBSSessionClosedUnexpectedly
public void onCBSSessionClosedUnexpectedly(ErrorCondition errorCondition)
Executed if the CBS session closes unexpectedly. May be because one of its links closed unexpectedly, or if the session closed unexpectedly.
Parameters:
onConnectionBound
public void onConnectionBound(Event event)
Overrides:
AmqpsIotHubConnection.onConnectionBound(Event event)Parameters:
onConnectionInit
public void onConnectionInit(Event event)
Overrides:
AmqpsIotHubConnection.onConnectionInit(Event event)Parameters:
onConnectionLocalClose
public void onConnectionLocalClose(Event event)
Overrides:
AmqpsIotHubConnection.onConnectionLocalClose(Event event)Parameters:
onConnectionLocalOpen
public void onConnectionLocalOpen(Event event)
Overrides:
AmqpsIotHubConnection.onConnectionLocalOpen(Event event)Parameters:
onConnectionRemoteClose
public void onConnectionRemoteClose(Event event)
Overrides:
AmqpsIotHubConnection.onConnectionRemoteClose(Event event)Parameters:
onConnectionRemoteOpen
public void onConnectionRemoteOpen(Event event)
Overrides:
AmqpsIotHubConnection.onConnectionRemoteOpen(Event event)Parameters:
onDeviceSessionOpened
public void onDeviceSessionOpened(String deviceId)
Executed when a device's amqp session has successfully been opened. For multiplexing scenarios, this callback will be fired once per device.
Parameters:
onMessageAcknowledged
public void onMessageAcknowledged(Message message, DeliveryState deliveryState, String deviceId)
Executed when a message sent in this connection was acknowledged by the service.
Parameters:
onMessageReceived
public void onMessageReceived(IotHubTransportMessage message)
Executed when a message was received by a session that this connection owns. This message should be acknowledged later.
Parameters:
onReactorFinal
public void onReactorFinal(Event event)
Overrides:
AmqpsIotHubConnection.onReactorFinal(Event event)Parameters:
onReactorInit
public void onReactorInit(Event event)
Overrides:
AmqpsIotHubConnection.onReactorInit(Event event)Parameters:
onSessionClosedAsExpected
public void onSessionClosedAsExpected(String deviceId)
Executed if a session closes, but it was expected. Likely due to user calling close on the connection, or unregistering a device from an active multiplexed connection
Parameters:
onSessionClosedUnexpectedly
public void onSessionClosedUnexpectedly(ErrorCondition errorCondition, String deviceId)
Executed if a session closes unexpectedly. May be because one of its links closed unexpectedly, or if the session closed unexpectedly.
Parameters:
onTimerTask
public void onTimerTask(Event event)
Overrides:
AmqpsIotHubConnection.onTimerTask(Event event)Parameters:
onTransportError
public void onTransportError(Event event)
Overrides:
AmqpsIotHubConnection.onTransportError(Event event)Parameters:
open
registerMultiplexedDevice
public void registerMultiplexedDevice(DeviceClientConfig config)
Parameters:
sendMessage
public IotHubStatusCode sendMessage(Message message)
Send a single message to the IotHub over the Transport Connection
Parameters:
sendMessageResult
public boolean sendMessageResult(IotHubTransportMessage message, IotHubMessageResult result)
Send an acknowledgement to the IotHub for a message that the Transport layer received
Parameters:
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
Parameters:
unregisterMultiplexedDevice
public void unregisterMultiplexedDevice(DeviceClientConfig config)
Parameters:
Azure SDK for Java-feedback
Azure SDK for Java is een open source project. Selecteer een koppeling om feedback te geven: