public class ServiceClient extends Object
| Modifier and Type | Field and Description |
|---|---|
protected IotHubConnectionString |
iotHubConnectionString |
| Modifier | Constructor and Description |
|---|---|
protected |
ServiceClient(IotHubConnectionString iotHubConnectionString,
IotHubServiceClientProtocol iotHubServiceClientProtocol)
Initialize AMQP sender using given connection string
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close AMQP sender
|
CompletableFuture<Void> |
closeAsync()
Provide asynchronous access to close()
|
static ServiceClient |
createFromConnectionString(String connectionString,
IotHubServiceClientProtocol iotHubServiceClientProtocol)
Create ServiceClient from the specified connection string
|
FeedbackReceiver |
getFeedbackReceiver()
Get FeedbackReceiver object.
|
FeedbackReceiver |
getFeedbackReceiver(String deviceId)
Deprecated.
As of release 1.1.15, replaced by
getFeedbackReceiver() |
FileUploadNotificationReceiver |
getFileUploadNotificationReceiver()
Get FileUploadNotificationReceiver object.
|
void |
open()
Open AMQP sender
|
CompletableFuture<Void> |
openAsync()
Provide asynchronous access to open()
|
void |
send(String deviceId,
Message message)
Send a one-way message to the specified device
|
CompletableFuture<Void> |
sendAsync(String deviceId,
Message message)
Provide asynchronous access to send()
|
protected IotHubConnectionString iotHubConnectionString
protected ServiceClient(IotHubConnectionString iotHubConnectionString, IotHubServiceClientProtocol iotHubServiceClientProtocol)
iotHubConnectionString - The ConnectionString object for the IotHubiotHubServiceClientProtocol - protocol to usepublic static ServiceClient createFromConnectionString(String connectionString, IotHubServiceClientProtocol iotHubServiceClientProtocol) throws IOException
iotHubServiceClientProtocol - protocol to useconnectionString - The connection string for the IotHubIOException - This exception is thrown if the object creation failedpublic void open()
throws IOException
IOException - This exception is thrown if the AmqpSender object is not initializedpublic void close()
throws IOException
IOException - This exception is thrown if the AmqpSender object is not initializedpublic void send(String deviceId, Message message) throws IOException, IotHubException
deviceId - The device identifier for the target devicemessage - The message for the deviceIOException - This exception is thrown if the AmqpSender object is not initializedIotHubException - This exception is thrown if IotHub rejects the message for any reasonpublic CompletableFuture<Void> openAsync()
public CompletableFuture<Void> closeAsync()
public CompletableFuture<Void> sendAsync(String deviceId, Message message)
deviceId - The device identifier for the target devicemessage - The message for the device@Deprecated public FeedbackReceiver getFeedbackReceiver(String deviceId)
getFeedbackReceiver()deviceId - The device identifier for the target devicepublic FeedbackReceiver getFeedbackReceiver()
public FileUploadNotificationReceiver getFileUploadNotificationReceiver()
Copyright © 2017. All rights reserved.