public final class AmqpsIotHubConnection extends org.apache.qpid.proton.engine.BaseHandler implements IotHubTransportConnection
| Constructor and Description |
|---|
AmqpsIotHubConnection(ClientConfiguration config,
java.lang.String transportUniqueIdentifier) |
AmqpsIotHubConnection(java.lang.String hostName,
java.lang.String transportUniqueIdentifier,
boolean isWebsocketConnection,
javax.net.ssl.SSLContext sslContext,
ProxySettings proxySettings,
int keepAliveInterval,
int sendInterval,
boolean useIdentifiableThreadNames,
java.lang.String threadNamePrefix,
java.lang.String threadNameSuffix) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the transport connection.
|
java.lang.String |
getConnectionId()
Gives the UUID associated with this connection instance.
|
void |
onAuthenticationFailed(java.lang.String deviceId,
TransportException transportException)
Executed when SAS based authentication fails for a device in this connection
|
void |
onAuthenticationSessionOpened()
Executed when the authentication session has successfully been opened.
|
void |
onCBSSessionClosedUnexpectedly(org.apache.qpid.proton.amqp.transport.ErrorCondition errorCondition)
Executed if the CBS session closes unexpectedly.
|
void |
onConnectionBound(org.apache.qpid.proton.engine.Event event) |
void |
onConnectionInit(org.apache.qpid.proton.engine.Event event) |
void |
onConnectionLocalClose(org.apache.qpid.proton.engine.Event event) |
void |
onConnectionLocalOpen(org.apache.qpid.proton.engine.Event event) |
void |
onConnectionRemoteClose(org.apache.qpid.proton.engine.Event event) |
void |
onConnectionRemoteOpen(org.apache.qpid.proton.engine.Event event) |
void |
onDeviceSessionOpened(java.lang.String deviceId)
Executed when a device's amqp session has successfully been opened.
|
void |
onMessageAcknowledged(Message message,
org.apache.qpid.proton.amqp.transport.DeliveryState deliveryState,
java.lang.String deviceId)
Executed when a message sent in this connection was acknowledged by the service.
|
void |
onMessageReceived(IotHubTransportMessage message)
Executed when a message was received by a session that this connection owns.
|
void |
onReactorClosedUnexpectedly()
Executed when the proton-j reactor closed unexpectedly.
|
void |
onReactorFinal(org.apache.qpid.proton.engine.Event event) |
void |
onReactorInit(org.apache.qpid.proton.engine.Event event) |
void |
onSessionClosedAsExpected(java.lang.String deviceId)
Executed if a session closes, but it was expected.
|
void |
onSessionClosedUnexpectedly(org.apache.qpid.proton.amqp.transport.ErrorCondition errorCondition,
java.lang.String deviceId)
Executed if a session closes unexpectedly.
|
void |
onTimerTask(org.apache.qpid.proton.engine.Event event) |
void |
onTransportError(org.apache.qpid.proton.engine.Event event) |
void |
open()
Opens the transport connection object
|
void |
registerMultiplexedDevice(ClientConfiguration config) |
IotHubStatusCode |
sendMessage(Message message)
Send a single message to the IotHub over the Transport Connection
|
boolean |
sendMessageResult(IotHubTransportMessage message,
IotHubMessageResult result)
Send an acknowledgement to the IotHub for a message that the Transport layer received
|
void |
setListener(IotHubListener listener)
Sets a listener into the Transport Connection object.
|
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.
|
add, children, getHandler, getHandler, handle, onConnectionFinal, onConnectionUnbound, onDelivery, onLinkFinal, onLinkFlow, onLinkInit, onLinkLocalClose, onLinkLocalDetach, onLinkLocalOpen, onLinkRemoteClose, onLinkRemoteDetach, onLinkRemoteOpen, onReactorQuiesced, onSelectableError, onSelectableExpired, onSelectableFinal, onSelectableInit, onSelectableReadable, onSelectableUpdated, onSelectableWritable, onSessionFinal, onSessionInit, onSessionLocalClose, onSessionLocalOpen, onSessionRemoteClose, onSessionRemoteOpen, onTransport, onTransportClosed, onTransportHeadClosed, onTransportTailClosed, onUnhandled, setHandler, setHandlerpublic AmqpsIotHubConnection(ClientConfiguration config, java.lang.String transportUniqueIdentifier)
public AmqpsIotHubConnection(java.lang.String hostName,
java.lang.String transportUniqueIdentifier,
boolean isWebsocketConnection,
javax.net.ssl.SSLContext sslContext,
ProxySettings proxySettings,
int keepAliveInterval,
int sendInterval,
boolean useIdentifiableThreadNames,
java.lang.String threadNamePrefix,
java.lang.String threadNameSuffix)
public void registerMultiplexedDevice(ClientConfiguration config)
public void unregisterMultiplexedDevice(ClientConfiguration config, boolean willReconnect)
config - the config of the device that should be unregistered.willReconnect - true if the device will be re-registered soon because it is reconnecting.public void open()
throws TransportException
IotHubTransportConnectionopen in interface IotHubTransportConnectionTransportException - If any exceptions are encountered while opening the connectionpublic void close()
IotHubTransportConnectionclose in interface IotHubTransportConnectionpublic void onReactorInit(org.apache.qpid.proton.engine.Event event)
onReactorInit in interface org.apache.qpid.proton.engine.CoreHandleronReactorInit in class org.apache.qpid.proton.engine.BaseHandlerpublic void onReactorFinal(org.apache.qpid.proton.engine.Event event)
onReactorFinal in interface org.apache.qpid.proton.engine.CoreHandleronReactorFinal in class org.apache.qpid.proton.engine.BaseHandlerpublic void onConnectionInit(org.apache.qpid.proton.engine.Event event)
onConnectionInit in interface org.apache.qpid.proton.engine.CoreHandleronConnectionInit in class org.apache.qpid.proton.engine.BaseHandlerpublic void onConnectionBound(org.apache.qpid.proton.engine.Event event)
onConnectionBound in interface org.apache.qpid.proton.engine.CoreHandleronConnectionBound in class org.apache.qpid.proton.engine.BaseHandlerpublic void onConnectionLocalOpen(org.apache.qpid.proton.engine.Event event)
onConnectionLocalOpen in interface org.apache.qpid.proton.engine.CoreHandleronConnectionLocalOpen in class org.apache.qpid.proton.engine.BaseHandlerpublic void onConnectionRemoteOpen(org.apache.qpid.proton.engine.Event event)
onConnectionRemoteOpen in interface org.apache.qpid.proton.engine.CoreHandleronConnectionRemoteOpen in class org.apache.qpid.proton.engine.BaseHandlerpublic void onConnectionLocalClose(org.apache.qpid.proton.engine.Event event)
onConnectionLocalClose in interface org.apache.qpid.proton.engine.CoreHandleronConnectionLocalClose in class org.apache.qpid.proton.engine.BaseHandlerpublic void onConnectionRemoteClose(org.apache.qpid.proton.engine.Event event)
onConnectionRemoteClose in interface org.apache.qpid.proton.engine.CoreHandleronConnectionRemoteClose in class org.apache.qpid.proton.engine.BaseHandlerpublic void onTransportError(org.apache.qpid.proton.engine.Event event)
onTransportError in interface org.apache.qpid.proton.engine.CoreHandleronTransportError in class org.apache.qpid.proton.engine.BaseHandlerpublic void onTimerTask(org.apache.qpid.proton.engine.Event event)
onTimerTask in interface org.apache.qpid.proton.engine.CoreHandleronTimerTask in class org.apache.qpid.proton.engine.BaseHandlerpublic void setListener(IotHubListener listener)
IotHubTransportConnectionsetListener in interface IotHubTransportConnectionlistener - the listener for connection status updates, message arrivals, and message acknowledgementspublic IotHubStatusCode sendMessage(Message message)
IotHubTransportConnectionsendMessage in interface IotHubTransportConnectionmessage - the message to sendpublic boolean sendMessageResult(IotHubTransportMessage message, IotHubMessageResult result)
IotHubTransportConnectionsendMessageResult in interface IotHubTransportConnectionmessage - the message to acknowledgeresult - the acknowledgement value to notify the service ofpublic java.lang.String getConnectionId()
IotHubTransportConnectiongetConnectionId in interface IotHubTransportConnectionpublic void onDeviceSessionOpened(java.lang.String deviceId)
deviceId - the id of the device that had its session opened successfullypublic void onAuthenticationSessionOpened()
public void onMessageAcknowledged(Message message, org.apache.qpid.proton.amqp.transport.DeliveryState deliveryState, java.lang.String deviceId)
message - the message that was acknowledged.deliveryState - state information that describes if the message was accepted by the receiver or not.deviceId - the Id of the device whose message was acknowledged.public void onMessageReceived(IotHubTransportMessage message)
message - the message that was received.public void onAuthenticationFailed(java.lang.String deviceId,
TransportException transportException)
deviceId - the Id of the device for which the authentication failed.transportException - the cause of that failure.public void onSessionClosedUnexpectedly(org.apache.qpid.proton.amqp.transport.ErrorCondition errorCondition,
java.lang.String deviceId)
errorCondition - the condition of the session that caused the close if the session closed remotely, or the condition
of the link that closed unexpectedly.deviceId - the device that the session belonged to.public void onCBSSessionClosedUnexpectedly(org.apache.qpid.proton.amqp.transport.ErrorCondition errorCondition)
errorCondition - the condition of the session that caused the close if the session closed remotely, or the condition
of the link that closed unexpectedly.public void onSessionClosedAsExpected(java.lang.String deviceId)
deviceId - the device whose connection closed.public void onReactorClosedUnexpectedly()
Copyright © 2023. All rights reserved.