public class AmqpReceive extends org.apache.qpid.proton.engine.BaseHandler implements AmqpFeedbackReceivedEvent
| Constructor and Description |
|---|
AmqpReceive(String hostName,
String userName,
String sasToken,
IotHubServiceClientProtocol iotHubServiceClientProtocol)
Constructor to set up connection parameters
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Invalidate AmqpsReceiveHandler member variable
|
void |
onFeedbackReceived(String feedbackJson)
Handle on feedback received Proton event
Parse received json and save result to a member variable
Release semaphore for wait function
|
void |
onReactorInit(org.apache.qpid.proton.engine.Event event)
Event handler for the reactor init event
|
void |
open()
Create AmqpsReceiveHandler and store it in a member variable
|
FeedbackBatch |
receive(long timeoutMs)
Synchronized call to receive feedback batch
Hide the event based receiving mechanism from the user API
|
add, children, getHandler, getHandler, handle, onConnectionBound, onConnectionFinal, onConnectionInit, onConnectionLocalClose, onConnectionLocalOpen, onConnectionRemoteClose, onConnectionRemoteOpen, onConnectionUnbound, onDelivery, onLinkFinal, onLinkFlow, onLinkInit, onLinkLocalClose, onLinkLocalDetach, onLinkLocalOpen, onLinkRemoteClose, onLinkRemoteDetach, onLinkRemoteOpen, onReactorFinal, onReactorQuiesced, onSelectableError, onSelectableExpired, onSelectableFinal, onSelectableInit, onSelectableReadable, onSelectableUpdated, onSelectableWritable, onSessionFinal, onSessionInit, onSessionLocalClose, onSessionLocalOpen, onSessionRemoteClose, onSessionRemoteOpen, onTimerTask, onTransport, onTransportClosed, onTransportError, onTransportHeadClosed, onTransportTailClosed, onUnhandled, setHandler, setHandlerpublic AmqpReceive(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 onReactorInit(org.apache.qpid.proton.engine.Event event)
onReactorInit in interface org.apache.qpid.proton.engine.CoreHandleronReactorInit in class org.apache.qpid.proton.engine.BaseHandlerevent - The proton event objectpublic void open()
public void close()
public FeedbackBatch receive(long timeoutMs) throws IOException, InterruptedException
timeoutMs - The timeout in milliseconds to wait for the feedbackIOException - This exception is thrown if the input AmqpReceive object is nullInterruptedException - This exception is thrown if the receive process has been interruptedpublic void onFeedbackReceived(String feedbackJson)
onFeedbackReceived in interface AmqpFeedbackReceivedEventfeedbackJson - Received Json string to processCopyright © 2017. All rights reserved.