public final class DirectMethodsClient extends Object
| Constructor and Description |
|---|
DirectMethodsClient(String connectionString)
Create a DirectMethodsClient instance from the information in the connection string.
|
DirectMethodsClient(String hostName,
com.azure.core.credential.AzureSasCredential azureSasCredential)
Create a new DirectMethodsClient instance.
|
DirectMethodsClient(String hostName,
com.azure.core.credential.AzureSasCredential azureSasCredential,
DirectMethodsClientOptions options)
Create a new DirectMethodsClient instance.
|
DirectMethodsClient(String connectionString,
DirectMethodsClientOptions options)
Create a DirectMethodsClient instance from the information in the connection string.
|
DirectMethodsClient(String hostName,
com.azure.core.credential.TokenCredential credential)
Create a new DirectMethodsClient instance.
|
DirectMethodsClient(String hostName,
com.azure.core.credential.TokenCredential credential,
DirectMethodsClientOptions options)
Create a new DirectMethodsClient instance.
|
| Modifier and Type | Method and Description |
|---|---|
DirectMethodResponse |
invoke(String deviceId,
String methodName)
Directly invokes a method on the device and return its result.
|
DirectMethodResponse |
invoke(String deviceId,
String methodName,
DirectMethodRequestOptions options)
Directly invokes a method on the device and return its result.
|
DirectMethodResponse |
invoke(String deviceId,
String moduleId,
String methodName)
Directly invokes a method on the module and return its result.
|
DirectMethodResponse |
invoke(String deviceId,
String moduleId,
String methodName,
DirectMethodRequestOptions options)
Directly invokes a method on the module and return its result.
|
public DirectMethodsClient(String connectionString)
connectionString - is the IoTHub connection string.public DirectMethodsClient(String connectionString, DirectMethodsClientOptions options)
connectionString - is the IoTHub connection string.options - the configurable options for each operation on this client. May not be null.public DirectMethodsClient(String hostName, com.azure.core.credential.TokenCredential credential)
hostName - The hostname of your IoT Hub instance (For instance, "your-iot-hub.azure-devices.net")credential - The custom TokenCredential that will provide authentication tokens to
this library when they are needed. The provided tokens must be Json Web Tokens.public DirectMethodsClient(String hostName, com.azure.core.credential.TokenCredential credential, DirectMethodsClientOptions options)
hostName - The hostname of your IoT Hub instance (For instance, "your-iot-hub.azure-devices.net")credential - The custom TokenCredential that will provide authentication tokens to
this library when they are needed. The provided tokens must be Json Web Tokens.options - The connection options to use when connecting to the service.public DirectMethodsClient(String hostName, com.azure.core.credential.AzureSasCredential azureSasCredential)
hostName - The hostname of your IoT Hub instance (For instance, "your-iot-hub.azure-devices.net")azureSasCredential - The SAS token provider that will be used for authentication.public DirectMethodsClient(String hostName, com.azure.core.credential.AzureSasCredential azureSasCredential, DirectMethodsClientOptions options)
hostName - The hostname of your IoT Hub instance (For instance, "your-iot-hub.azure-devices.net")azureSasCredential - The SAS token provider that will be used for authentication.options - The connection options to use when connecting to the service.public DirectMethodResponse invoke(String deviceId, String methodName) throws IotHubException, IOException
deviceId - is the device where the sendHttpRequest is send to.methodName - is the name of the method that shall be invoked on the device.IotHubException - This exception is thrown if the response verification failed.IOException - This exception is thrown if the IO operation failed.public DirectMethodResponse invoke(String deviceId, String methodName, DirectMethodRequestOptions options) throws IotHubException, IOException
deviceId - is the device where the sendHttpRequest is send to.methodName - is the name of the method that shall be invoked on the device.options - the optional parameters for this request, including the method's payload. May not be null.IotHubException - This exception is thrown if the response verification failed.IOException - This exception is thrown if the IO operation failed.public DirectMethodResponse invoke(String deviceId, String moduleId, String methodName) throws IotHubException, IOException
deviceId - is the device where the module is related to.moduleId - is the module where the sendHttpRequest is sent to.methodName - is the name of the method that shall be invoked on the device.IotHubException - This exception is thrown if the response verification failed.IOException - This exception is thrown if the IO operation failed.public DirectMethodResponse invoke(String deviceId, String moduleId, String methodName, DirectMethodRequestOptions options) throws IotHubException, IOException
deviceId - is the device where the module is related to.moduleId - is the module where the sendHttpRequest is sent to.methodName - is the name of the method that shall be invoked on the device.options - the optional parameters for this request, including the method's payload. May not be null.IotHubException - This exception is thrown if the response verification failed.IOException - This exception is thrown if the IO operation failed.Copyright © 2024. All rights reserved.