AmqpConnectionHandler Class

Implements

com.microsoft.azure.sdk.iot.service.transport.amqps.CbsSessionStateCallback

public abstract class AmqpConnectionHandler
extends ErrorLoggingBaseHandlerWithCleanup
implements com.microsoft.azure.sdk.iot.service.transport.amqps.CbsSessionStateCallback

Field Summary

Modifier and Type Field and Description
protected org.apache.qpid.proton.engine.Connection connection
protected final java.lang.String hostName
protected IotHubServiceClientProtocol iotHubServiceClientProtocol
protected ProxyOptions proxyOptions
protected java.lang.String sasToken
protected javax.net.ssl.SSLContext sslContext
protected java.lang.String userName

Constructor Summary

Modifier Constructor Description
protected AmqpConnectionHandler(String hostName, AzureSasCredential sasTokenProvider, IotHubServiceClientProtocol iotHubServiceClientProtocol, ProxyOptions proxyOptions, SSLContext sslContext)
protected AmqpConnectionHandler(String hostName, TokenCredential credential, IotHubServiceClientProtocol iotHubServiceClientProtocol, ProxyOptions proxyOptions, SSLContext sslContext)
protected AmqpConnectionHandler(String hostName, String userName, String sasToken, IotHubServiceClientProtocol iotHubServiceClientProtocol, ProxyOptions proxyOptions, SSLContext sslContext)

Method Summary

Modifier and Type Method and Description
void onAuthenticationFailed(IotHubException e)

Executes when the CBS session has failed to authenticate the connection

void onConnectionBound(Event event)

Event handler for the connection bound event

void onConnectionInit(Event event)
void onConnectionRemoteOpen(Event event)
void onLinkRemoteOpen(Event event)
void onReactorInit(Event event)
void onSessionRemoteOpen(Event event)
protected void verifyConnectionWasOpened()

If an exception was encountered while opening the AMQP connection, this function shall throw that saved exception

Methods inherited from ErrorLoggingBaseHandlerWithCleanup

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Methods inherited from org.apache.qpid.proton.engine.BaseHandler

org.apache.qpid.proton.engine.BaseHandler.add org.apache.qpid.proton.engine.BaseHandler.children org.apache.qpid.proton.engine.BaseHandler.getHandler org.apache.qpid.proton.engine.BaseHandler.getHandler org.apache.qpid.proton.engine.BaseHandler.handle org.apache.qpid.proton.engine.BaseHandler.onConnectionBound org.apache.qpid.proton.engine.BaseHandler.onConnectionFinal org.apache.qpid.proton.engine.BaseHandler.onConnectionInit org.apache.qpid.proton.engine.BaseHandler.onConnectionUnbound org.apache.qpid.proton.engine.BaseHandler.onDelivery org.apache.qpid.proton.engine.BaseHandler.onLinkFinal org.apache.qpid.proton.engine.BaseHandler.onLinkFlow org.apache.qpid.proton.engine.BaseHandler.onLinkInit org.apache.qpid.proton.engine.BaseHandler.onLinkLocalDetach org.apache.qpid.proton.engine.BaseHandler.onLinkRemoteDetach org.apache.qpid.proton.engine.BaseHandler.onReactorFinal org.apache.qpid.proton.engine.BaseHandler.onReactorInit org.apache.qpid.proton.engine.BaseHandler.onReactorQuiesced org.apache.qpid.proton.engine.BaseHandler.onSelectableError org.apache.qpid.proton.engine.BaseHandler.onSelectableExpired org.apache.qpid.proton.engine.BaseHandler.onSelectableFinal org.apache.qpid.proton.engine.BaseHandler.onSelectableInit org.apache.qpid.proton.engine.BaseHandler.onSelectableReadable org.apache.qpid.proton.engine.BaseHandler.onSelectableUpdated org.apache.qpid.proton.engine.BaseHandler.onSelectableWritable org.apache.qpid.proton.engine.BaseHandler.onSessionFinal org.apache.qpid.proton.engine.BaseHandler.onSessionInit org.apache.qpid.proton.engine.BaseHandler.onTimerTask org.apache.qpid.proton.engine.BaseHandler.onTransport org.apache.qpid.proton.engine.BaseHandler.onTransportClosed org.apache.qpid.proton.engine.BaseHandler.onTransportHeadClosed org.apache.qpid.proton.engine.BaseHandler.onTransportTailClosed org.apache.qpid.proton.engine.BaseHandler.onUnhandled org.apache.qpid.proton.engine.BaseHandler.setHandler org.apache.qpid.proton.engine.BaseHandler.setHandler

Field Details

connection

protected Connection connection

hostName

protected final String hostName

iotHubServiceClientProtocol

protected IotHubServiceClientProtocol iotHubServiceClientProtocol

proxyOptions

protected ProxyOptions proxyOptions

sasToken

protected String sasToken

sslContext

protected SSLContext sslContext

userName

protected String userName

Constructor Details

AmqpConnectionHandler

protected AmqpConnectionHandler(String hostName, AzureSasCredential sasTokenProvider, IotHubServiceClientProtocol iotHubServiceClientProtocol, ProxyOptions proxyOptions, SSLContext sslContext)

Parameters:

hostName
sasTokenProvider
iotHubServiceClientProtocol
proxyOptions
sslContext

AmqpConnectionHandler

protected AmqpConnectionHandler(String hostName, TokenCredential credential, IotHubServiceClientProtocol iotHubServiceClientProtocol, ProxyOptions proxyOptions, SSLContext sslContext)

Parameters:

hostName
credential
iotHubServiceClientProtocol
proxyOptions
sslContext

AmqpConnectionHandler

protected AmqpConnectionHandler(String hostName, String userName, String sasToken, IotHubServiceClientProtocol iotHubServiceClientProtocol, ProxyOptions proxyOptions, SSLContext sslContext)

Parameters:

hostName
userName
sasToken
iotHubServiceClientProtocol
proxyOptions
sslContext

Method Details

onAuthenticationFailed

public void onAuthenticationFailed(IotHubException e)

Executes when the CBS session has failed to authenticate the connection

Parameters:

e

onConnectionBound

public void onConnectionBound(Event event)

Event handler for the connection bound event

Overrides:

AmqpConnectionHandler.onConnectionBound(Event event)

Parameters:

event - The proton event object

onConnectionInit

public void onConnectionInit(Event event)

Overrides:

AmqpConnectionHandler.onConnectionInit(Event event)

Parameters:

event

onConnectionRemoteOpen

public void onConnectionRemoteOpen(Event event)

Overrides:

AmqpConnectionHandler.onConnectionRemoteOpen(Event event)

Parameters:

event

onLinkRemoteOpen

public void onLinkRemoteOpen(Event event)

Overrides:

AmqpConnectionHandler.onLinkRemoteOpen(Event event)

Parameters:

event

onReactorInit

public void onReactorInit(Event event)

Overrides:

AmqpConnectionHandler.onReactorInit(Event event)

Parameters:

event

onSessionRemoteOpen

public void onSessionRemoteOpen(Event event)

Overrides:

AmqpConnectionHandler.onSessionRemoteOpen(Event event)

Parameters:

event

verifyConnectionWasOpened

protected void verifyConnectionWasOpened()

If an exception was encountered while opening the AMQP connection, this function shall throw that saved exception

Throws:

java.io.IOException - if an exception was encountered while openinging the AMQP connection. The encountered exception will be the inner exception

Applies to