public class AmqpSendHandler
extends org.apache.qpid.proton.engine.BaseHandler
| Modifier and Type | Field and Description |
|---|---|
static String |
DEVICE_PATH_FORMAT |
static String |
ENDPOINT |
protected String |
hostName |
protected IotHubServiceClientProtocol |
iotHubServiceClientProtocol |
protected String |
sasToken |
static String |
SEND_PORT_AMQPS |
static String |
SEND_PORT_AMQPS_WS |
static String |
SEND_TAG |
protected String |
userName |
static String |
WEBSOCKET_PATH |
static String |
WEBSOCKET_SUB_PROTOCOL |
protected String |
webSocketHostName |
| Constructor and Description |
|---|
AmqpSendHandler(String hostName,
String userName,
String sasToken,
IotHubServiceClientProtocol iotHubServiceClientProtocol)
Constructor to set up connection parameters and initialize handshaker for transport
|
| Modifier and Type | Method and Description |
|---|---|
void |
createProtonMessage(String deviceId,
Message message)
Create Proton message from deviceId and content string
|
void |
onConnectionBound(org.apache.qpid.proton.engine.Event event)
Event handler for the connection bound event
|
void |
onConnectionInit(org.apache.qpid.proton.engine.Event event)
Event handler for the connection init event
|
void |
onDelivery(org.apache.qpid.proton.engine.Event event) |
void |
onLinkFlow(org.apache.qpid.proton.engine.Event event)
Event handler for the link flow event
|
void |
onLinkInit(org.apache.qpid.proton.engine.Event event)
Event handler for the link init event
|
void |
onTransportError(org.apache.qpid.proton.engine.Event event)
Event handler for the transport error event.
|
void |
sendComplete() |
add, children, getHandler, getHandler, handle, onConnectionFinal, onConnectionLocalClose, onConnectionLocalOpen, onConnectionRemoteClose, onConnectionRemoteOpen, onConnectionUnbound, onLinkFinal, onLinkLocalClose, onLinkLocalDetach, onLinkLocalOpen, onLinkRemoteClose, onLinkRemoteDetach, onLinkRemoteOpen, onReactorFinal, onReactorInit, onReactorQuiesced, onSelectableError, onSelectableExpired, onSelectableFinal, onSelectableInit, onSelectableReadable, onSelectableUpdated, onSelectableWritable, onSessionFinal, onSessionInit, onSessionLocalClose, onSessionLocalOpen, onSessionRemoteClose, onSessionRemoteOpen, onTimerTask, onTransport, onTransportClosed, onTransportHeadClosed, onTransportTailClosed, onUnhandled, setHandler, setHandlerpublic static final String SEND_TAG
public static final String SEND_PORT_AMQPS
public static final String SEND_PORT_AMQPS_WS
public static final String ENDPOINT
public static final String DEVICE_PATH_FORMAT
public static final String WEBSOCKET_PATH
public static final String WEBSOCKET_SUB_PROTOCOL
protected final String hostName
protected final String userName
protected final String sasToken
protected final IotHubServiceClientProtocol iotHubServiceClientProtocol
protected final String webSocketHostName
public AmqpSendHandler(String hostName, String userName, String sasToken, IotHubServiceClientProtocol iotHubServiceClientProtocol)
hostName - The address string of the service (example: AAA.BBB.CCC)userName - The username string to use SASL authentication (example: user@sas.service)sasToken - The SAS token stringiotHubServiceClientProtocol - protocol to usepublic void createProtonMessage(String deviceId, Message message)
deviceId - The device name stringmessage - The message to be sentpublic 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.BaseHandlerevent - The proton event objectpublic 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.BaseHandlerevent - The proton event objectpublic 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.BaseHandlerevent - The Proton Event object.public void onLinkInit(org.apache.qpid.proton.engine.Event event)
onLinkInit in interface org.apache.qpid.proton.engine.CoreHandleronLinkInit in class org.apache.qpid.proton.engine.BaseHandlerevent - The proton event objectpublic void onLinkFlow(org.apache.qpid.proton.engine.Event event)
onLinkFlow in interface org.apache.qpid.proton.engine.CoreHandleronLinkFlow in class org.apache.qpid.proton.engine.BaseHandlerevent - The proton event objectpublic void onDelivery(org.apache.qpid.proton.engine.Event event)
onDelivery in interface org.apache.qpid.proton.engine.CoreHandleronDelivery in class org.apache.qpid.proton.engine.BaseHandlerpublic void sendComplete()
throws IotHubException,
IOException
IotHubExceptionIOExceptionCopyright © 2017. All rights reserved.