public class FeedbackReceiver extends Receiver
Constructor and Description |
---|
FeedbackReceiver(String hostName,
String userName,
String sasToken,
IotHubServiceClientProtocol iotHubServiceClientProtocol)
Constructor to verify initialization parameters
Create instance of AmqpReceive
|
FeedbackReceiver(String hostName,
String userName,
String sasToken,
IotHubServiceClientProtocol iotHubServiceClientProtocol,
ProxyOptions proxyOptions)
Constructor to verify initialization parameters
Create instance of AmqpReceive
|
FeedbackReceiver(String hostName,
String userName,
String sasToken,
IotHubServiceClientProtocol iotHubServiceClientProtocol,
ProxyOptions proxyOptions,
SSLContext sslContext)
Constructor to verify initialization parameters
Create instance of AmqpReceive
|
FeedbackReceiver(String hostName,
String userName,
String sasToken,
IotHubServiceClientProtocol iotHubServiceClientProtocol,
String deviceId)
Deprecated.
As of release 1.1.15, replaced by
FeedbackReceiver(String hostName, String userName, String sasToken, IotHubServiceClientProtocol iotHubServiceClientProtocol) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close AmqpReceive object
|
CompletableFuture<Void> |
closeAsync()
Async wrapper for close() operation
|
void |
open()
Open AmqpReceive object
|
CompletableFuture<Void> |
openAsync()
Async wrapper for open() operation
|
FeedbackBatch |
receive()
Receive FeedbackBatch with default timeout
This function is synchronized internally so that only one receive operation is allowed at a time.
|
FeedbackBatch |
receive(long timeoutMs)
Receive FeedbackBatch with specific timeout
This function is synchronized internally so that only one receive operation is allowed at a time.
|
CompletableFuture<FeedbackBatch> |
receiveAsync()
Async wrapper for receive() operation with default timeout
|
CompletableFuture<FeedbackBatch> |
receiveAsync(long timeoutMs)
Async wrapper for receive() operation with specific timeout
|
@Deprecated public FeedbackReceiver(String hostName, String userName, String sasToken, IotHubServiceClientProtocol iotHubServiceClientProtocol, String deviceId)
FeedbackReceiver(String hostName, String userName, String sasToken, IotHubServiceClientProtocol iotHubServiceClientProtocol)
hostName
- The iot hub host nameuserName
- The iot hub user namesasToken
- The iot hub SAS token for the given deviceiotHubServiceClientProtocol
- The iot hub protocol namedeviceId
- The device id (not used)public FeedbackReceiver(String hostName, String userName, String sasToken, IotHubServiceClientProtocol iotHubServiceClientProtocol)
hostName
- The iot hub host nameuserName
- The iot hub user namesasToken
- The iot hub SAS token for the given deviceiotHubServiceClientProtocol
- protocol to be usedpublic FeedbackReceiver(String hostName, String userName, String sasToken, IotHubServiceClientProtocol iotHubServiceClientProtocol, ProxyOptions proxyOptions)
hostName
- The iot hub host nameuserName
- The iot hub user namesasToken
- The iot hub SAS token for the given deviceiotHubServiceClientProtocol
- protocol to be usedproxyOptions
- the proxy options to tunnel through, if a proxy should be used.public FeedbackReceiver(String hostName, String userName, String sasToken, IotHubServiceClientProtocol iotHubServiceClientProtocol, ProxyOptions proxyOptions, SSLContext sslContext)
hostName
- The iot hub host nameuserName
- The iot hub user namesasToken
- The iot hub SAS token for the given deviceiotHubServiceClientProtocol
- protocol to be usedproxyOptions
- 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 void open() throws IOException
IOException
- This exception is thrown if the input AmqpReceive object is nullpublic void close() throws IOException
IOException
- This exception is thrown if the input AmqpReceive object is nullpublic FeedbackBatch receive() throws IOException, InterruptedException
IOException
- This exception is thrown if the input AmqpReceive object is nullInterruptedException
- This exception is thrown if the receive process has been interruptedpublic FeedbackBatch receive(long timeoutMs) throws IOException, InterruptedException
timeoutMs
- The timeout in millisecondsIOException
- This exception is thrown if the input AmqpReceive object is nullInterruptedException
- This exception is thrown if the receive process has been interruptedpublic CompletableFuture<Void> openAsync()
public CompletableFuture<Void> closeAsync()
closeAsync
in class Receiver
public CompletableFuture<FeedbackBatch> receiveAsync()
receiveAsync
in class Receiver
public CompletableFuture<FeedbackBatch> receiveAsync(long timeoutMs)
receiveAsync
in class Receiver
Copyright © 2021. All rights reserved.