DirectMethodsClient Class
- java.
lang. Object - com.
microsoft. azure. sdk. iot. service. methods. DirectMethodsClient
- com.
public class DirectMethodsClient
The client to directly invoke direct methods on devices and modules in IoT hub.
Constructor Summary
Constructor | Description |
---|---|
DirectMethodsClient(String connectionString) |
Create a DirectMethodsClient instance from the information in the connection string. |
DirectMethodsClient(String hostName, AzureSasCredential azureSasCredential) |
Create a new DirectMethodsClient instance. |
DirectMethodsClient(String hostName, 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, TokenCredential credential) |
Create a new DirectMethodsClient instance. |
DirectMethodsClient(String hostName, TokenCredential credential, DirectMethodsClientOptions options) |
Create a new DirectMethodsClient instance. |
Method Summary
Modifier and Type | Method and Description |
---|---|
Direct |
invoke(String deviceId, String methodName)
Directly invokes a method on the device and return its result. |
Direct |
invoke(String deviceId, String methodName, DirectMethodRequestOptions options)
Directly invokes a method on the device and return its result. |
Direct |
invoke(String deviceId, String moduleId, String methodName)
Directly invokes a method on the module and return its result. |
Direct |
invoke(String deviceId, String moduleId, String methodName, DirectMethodRequestOptions options)
Directly invokes a method on the module and return its result. |
Constructor Details
DirectMethodsClient
public DirectMethodsClient(String connectionString)
Create a DirectMethodsClient instance from the information in the connection string.
Parameters:
DirectMethodsClient
public DirectMethodsClient(String hostName, AzureSasCredential azureSasCredential)
Create a new DirectMethodsClient instance.
Parameters:
DirectMethodsClient
public DirectMethodsClient(String hostName, AzureSasCredential azureSasCredential, DirectMethodsClientOptions options)
Create a new DirectMethodsClient instance.
Parameters:
DirectMethodsClient
public DirectMethodsClient(String connectionString, DirectMethodsClientOptions options)
Create a DirectMethodsClient instance from the information in the connection string.
Parameters:
DirectMethodsClient
public DirectMethodsClient(String hostName, TokenCredential credential)
Create a new DirectMethodsClient instance.
Parameters:
DirectMethodsClient
public DirectMethodsClient(String hostName, TokenCredential credential, DirectMethodsClientOptions options)
Create a new DirectMethodsClient instance.
Parameters:
Method Details
invoke
public DirectMethodResponse invoke(String deviceId, String methodName)
Directly invokes a method on the device and return its result.
Parameters:
Returns:
Throws:
invoke
public DirectMethodResponse invoke(String deviceId, String methodName, DirectMethodRequestOptions options)
Directly invokes a method on the device and return its result.
Parameters:
Returns:
Throws:
invoke
public DirectMethodResponse invoke(String deviceId, String moduleId, String methodName)
Directly invokes a method on the module and return its result.
Parameters:
Returns:
Throws:
invoke
public DirectMethodResponse invoke(String deviceId, String moduleId, String methodName, DirectMethodRequestOptions options)
Directly invokes a method on the module and return its result.
Parameters:
Returns:
Throws:
Applies to
Azure SDK for Java