ServiceClient 类

定义

Use the ServiceClient to send and monitor messages to devices in IoT hubs. It can also be used to know when files have been uploaded by devices.

public class ServiceClient
继承
java.lang.Object
ServiceClient

构造函数

ServiceClient(IotHubConnectionString iotHubConnectionString, IotHubServiceClientProtocol iotHubServiceClientProtocol)

Initialize AMQP sender using given connection string

ServiceClient(IotHubConnectionString iotHubConnectionString, IotHubServiceClientProtocol iotHubServiceClientProtocol, ServiceClientOptions options)

Initialize AMQP sender using given connection string

ServiceClient(String connectionString, IotHubServiceClientProtocol iotHubServiceClientProtocol)

Create ServiceClient from the specified connection string

ServiceClient(String connectionString, IotHubServiceClientProtocol iotHubServiceClientProtocol, ServiceClientOptions options)

Create ServiceClient from the specified connection string

ServiceClient(String hostName, AzureSasCredential azureSasCredential, IotHubServiceClientProtocol iotHubServiceClientProtocol)

Create a ServiceClient instance with an instance of AzureSasCredential.

ServiceClient(String hostName, AzureSasCredential azureSasCredential, IotHubServiceClientProtocol iotHubServiceClientProtocol, ServiceClientOptions options)

Create a ServiceClient instance with an instance of AzureSasCredential.

ServiceClient(String hostName, TokenCredential credential, IotHubServiceClientProtocol iotHubServiceClientProtocol)

Create a ServiceClient instance with a custom TokenCredential to allow for finer grain control of authentication tokens used in the underlying connection.

ServiceClient(String hostName, TokenCredential credential, IotHubServiceClientProtocol iotHubServiceClientProtocol, ServiceClientOptions options)

Create a ServiceClient instance with a custom TokenCredential to allow for finer grain control of authentication tokens used in the underlying connection.

方法

close()

Close AMQP sender

closeAsync()

Provide asynchronous access to close()

createFromConnectionString(String connectionString, IotHubServiceClientProtocol iotHubServiceClientProtocol)

Create ServiceClient from the specified connection string

createFromConnectionString(String connectionString, IotHubServiceClientProtocol iotHubServiceClientProtocol, ServiceClientOptions options)

Create ServiceClient from the specified connection string

getFeedbackReceiver()

Instantiate a new FeedbackReceiver object.

getFeedbackReceiver(String deviceId)

Get FeedbackReceiver object.This API has been deprecated. Use new API without deviceId as an input parameter.

getFileUploadNotificationReceiver()

Instantiate a new FileUploadNotificationReceiver object.

open()

Open AMQP sender

openAsync()

Provide asynchronous access to open()

send(String deviceId, Message message)

Send a one-way message to the specified device. This function is synchronized internally so that only one send operation is allowed at a time. In order to do more send operations at a time, you will need to instantiate another service client instance.

send(String deviceId, String moduleId, Message message)

Send a one-way message to the specified module. This function is synchronized internally so that only one send operation is allowed at a time. In order to do more send operations at a time, you will need to instantiate another service client instance.

sendAsync(String deviceId, Message message)

Provide asynchronous access to send()

适用于