CloudToDeviceMessageConnectionHandler Class

public class CloudToDeviceMessageConnectionHandler

Instance of the QPID-Proton-J BaseHandler class to override the events what are needed to handle the receive operation Contains and sets connection parameters (path, port, endpoint) Maintains the layers of AMQP protocol (Link, Session, Connection, Transport) Creates and sets SASL authentication for transport

Constructor Summary

Constructor Description
CloudToDeviceMessageConnectionHandler(String hostName, AzureSasCredential azureSasCredential, IotHubServiceClientProtocol protocol, Consumer<ErrorContext> errorProcessor, ProxyOptions proxyOptions, SSLContext sslContext, int keepAliveIntervalSeconds)
CloudToDeviceMessageConnectionHandler(String connectionString, IotHubServiceClientProtocol protocol, Consumer<ErrorContext> errorProcessor, ProxyOptions proxyOptions, SSLContext sslContext, int keepAliveIntervalSeconds)
CloudToDeviceMessageConnectionHandler(String hostName, TokenCredential credential, IotHubServiceClientProtocol protocol, Consumer<ErrorContext> errorProcessor, ProxyOptions proxyOptions, SSLContext sslContext, int keepAliveIntervalSeconds)

Method Summary

Modifier and Type Method and Description
void closeAsync(Runnable onConnectionClosedCallback)
boolean isOpen()
void onAuthenticationSucceeded()
void onReactorFinal(Event event)
void onReceiverLinkRemoteOpen()
void onSenderLinkRemoteOpen()
void sendAsync(String deviceId, String moduleId, Message iotHubMessage, Consumer<SendResult> callback, Object context)

Inherited Members

ErrorLoggingBaseHandler.errorProcessor com.microsoft.azure.sdk.iot.service.transport.amqps.AmqpConnectionHandler.getConnectionId() AmqpConnectionHandler.hostName com.microsoft.azure.sdk.iot.service.transport.amqps.AmqpConnectionHandler.onAuthenticationFailed(IotHubException) com.microsoft.azure.sdk.iot.service.transport.amqps.AmqpConnectionHandler.onConnectionBound(Event) com.microsoft.azure.sdk.iot.service.transport.amqps.AmqpConnectionHandler.onConnectionInit(Event) ErrorLoggingBaseHandlerWithCleanup.onConnectionLocalClose(Event event) ErrorLoggingBaseHandlerWithCleanup.onConnectionLocalOpen(Event event) com.microsoft.azure.sdk.iot.service.transport.amqps.AmqpConnectionHandler.onConnectionRemoteClose(Event) com.microsoft.azure.sdk.iot.service.transport.amqps.AmqpConnectionHandler.onConnectionRemoteOpen(Event) ErrorLoggingBaseHandlerWithCleanup.onLinkLocalClose(Event event) ErrorLoggingBaseHandlerWithCleanup.onLinkLocalOpen(Event event) ErrorLoggingBaseHandlerWithCleanup.onLinkRemoteClose(Event event) com.microsoft.azure.sdk.iot.service.transport.amqps.AmqpConnectionHandler.onLinkRemoteOpen(Event) com.microsoft.azure.sdk.iot.service.transport.amqps.AmqpConnectionHandler.onReactorInit(Event) ErrorLoggingBaseHandlerWithCleanup.onSessionLocalClose(Event event) ErrorLoggingBaseHandlerWithCleanup.onSessionLocalOpen(Event event) ErrorLoggingBaseHandlerWithCleanup.onSessionRemoteClose(Event event) com.microsoft.azure.sdk.iot.service.transport.amqps.AmqpConnectionHandler.onSessionRemoteOpen(Event) ErrorLoggingBaseHandlerWithCleanup.onTransportError(Event event) ErrorLoggingBaseHandler.protonJExceptionParser AmqpConnectionHandler.verifyConnectionWasOpened()

Constructor Details

CloudToDeviceMessageConnectionHandler

public CloudToDeviceMessageConnectionHandler(String hostName, AzureSasCredential azureSasCredential, IotHubServiceClientProtocol protocol, Consumer errorProcessor, ProxyOptions proxyOptions, SSLContext sslContext, int keepAliveIntervalSeconds)

Parameters:

hostName
azureSasCredential
protocol
errorProcessor
proxyOptions
sslContext
keepAliveIntervalSeconds

CloudToDeviceMessageConnectionHandler

public CloudToDeviceMessageConnectionHandler(String connectionString, IotHubServiceClientProtocol protocol, Consumer errorProcessor, ProxyOptions proxyOptions, SSLContext sslContext, int keepAliveIntervalSeconds)

Parameters:

connectionString
protocol
errorProcessor
proxyOptions
sslContext
keepAliveIntervalSeconds

CloudToDeviceMessageConnectionHandler

public CloudToDeviceMessageConnectionHandler(String hostName, TokenCredential credential, IotHubServiceClientProtocol protocol, Consumer errorProcessor, ProxyOptions proxyOptions, SSLContext sslContext, int keepAliveIntervalSeconds)

Parameters:

hostName
credential
protocol
errorProcessor
proxyOptions
sslContext
keepAliveIntervalSeconds

Method Details

closeAsync

public void closeAsync(Runnable onConnectionClosedCallback)

Parameters:

onConnectionClosedCallback

isOpen

public boolean isOpen()

onAuthenticationSucceeded

public void onAuthenticationSucceeded()

onReactorFinal

public void onReactorFinal(Event event)

Parameters:

event

onReceiverLinkRemoteOpen

public void onReceiverLinkRemoteOpen()

onSenderLinkRemoteOpen

public void onSenderLinkRemoteOpen()

sendAsync

public void sendAsync(String deviceId, String moduleId, Message iotHubMessage, Consumer callback, Object context)

Parameters:

deviceId
moduleId
iotHubMessage
callback
context

Applies to