public class AmqpReceive extends Object implements AmqpFeedbackReceivedEvent
| Constructor and Description |
|---|
AmqpReceive(String hostName,
com.azure.core.credential.AzureSasCredential sasTokenProvider,
IotHubServiceClientProtocol iotHubServiceClientProtocol,
ProxyOptions proxyOptions,
SSLContext sslContext) |
AmqpReceive(String hostName,
String userName,
String sasToken,
IotHubServiceClientProtocol iotHubServiceClientProtocol)
Constructor to set up connection parameters
|
AmqpReceive(String hostName,
String userName,
String sasToken,
IotHubServiceClientProtocol iotHubServiceClientProtocol,
ProxyOptions proxyOptions)
Constructor to set up connection parameters
|
AmqpReceive(String hostName,
String userName,
String sasToken,
IotHubServiceClientProtocol iotHubServiceClientProtocol,
ProxyOptions proxyOptions,
SSLContext sslContext)
Constructor to set up connection parameters
|
AmqpReceive(String hostName,
com.azure.core.credential.TokenCredential credential,
IotHubServiceClientProtocol iotHubServiceClientProtocol,
ProxyOptions proxyOptions,
SSLContext sslContext) |
| 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 |
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
|
public 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 AmqpReceive(String hostName, String userName, String sasToken, IotHubServiceClientProtocol iotHubServiceClientProtocol, ProxyOptions proxyOptions)
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 useproxyOptions - the proxy options to tunnel through, if a proxy should be used.public AmqpReceive(String hostName, String userName, String sasToken, IotHubServiceClientProtocol iotHubServiceClientProtocol, ProxyOptions proxyOptions, SSLContext sslContext)
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 useproxyOptions - the proxy options to tunnel through, if a proxy should be used.sslContext - the SSL context to use during the TLS handshake when opening the connection. If null, a default
SSL context will be generated. This default SSLContext trusts the IoT Hub public certificates.public AmqpReceive(String hostName, com.azure.core.credential.TokenCredential credential, IotHubServiceClientProtocol iotHubServiceClientProtocol, ProxyOptions proxyOptions, SSLContext sslContext)
public AmqpReceive(String hostName, com.azure.core.credential.AzureSasCredential sasTokenProvider, IotHubServiceClientProtocol iotHubServiceClientProtocol, ProxyOptions proxyOptions, SSLContext sslContext)
public 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 © 2022. All rights reserved.