次の方法で共有


RegistryManager Class

  • java.lang.Object
    • com.microsoft.azure.sdk.iot.service.RegistryManager

public class RegistryManager

Use the RegistryManager class to manage the identity registry in IoT Hubs.

Constructor Summary

Constructor Description
RegistryManager()

Deprecated

As of release 1.22.0, replaced by createFromConnectionString(String connectionString)

Previously was the java default constructor, should not be used.

RegistryManager(String connectionString)

Constructor to create instance from connection string

RegistryManager(String hostName, AzureSasCredential azureSasCredential)

Create a new RegistryManager instance.

RegistryManager(String hostName, AzureSasCredential azureSasCredential, RegistryManagerOptions options)

Create a new RegistryManager instance.

RegistryManager(String hostName, TokenCredential credential)

Create a new RegistryManager instance.

RegistryManager(String hostName, TokenCredential credential, RegistryManagerOptions options)

Create a new RegistryManager instance.

RegistryManager(String connectionString, RegistryManagerOptions options)

Constructor to create instance from connection string

Method Summary

Modifier and Type Method and Description
Configuration addConfiguration(Configuration configuration)

Add configuration using the given Configuration object Return with the response configuration object from IotHub

Device addDevice(Device device)

Add device using the given Device object Return with the response device object from IotHub

java.util.concurrent.CompletableFuture<Device> addDeviceAsync(Device device)

Async wrapper for add() operation

Module addModule(Module module)

Add module using the given Module object Return with the response module object from IotHub

void applyConfigurationContentOnDevice(String deviceId, ConfigurationContent content)

Apply the provided configuration content to the provided device

void close()

Gracefully close running threads, and then shutdown the underlying executor service

static RegistryManager createFromConnectionString(String connectionString)

Deprecated

because this method declares a thrown IOException even though it never throws an IOException. Users are recommended to use RegistryManager(String connectionString) instead since it does not declare this exception even though it constructs the same RegistryManager.

Static constructor to create instance from connection string

static RegistryManager createFromConnectionString(String connectionString, RegistryManagerOptions options)

Deprecated

because this method declares a thrown IOException even though it never throws an IOException. Users are recommended to use RegistryManager(String connectionString, RegistryManagerOptions options) instead since it does not declare this exception even though it constructs the same RegistryManager.

Static constructor to create instance from connection string

JobProperties exportDevices(JobProperties exportDevicesParameters)

Create a bulk export job.

JobProperties exportDevices(String exportBlobContainerUri, Boolean excludeKeys)

Create a bulk export job.

java.util.concurrent.CompletableFuture<JobProperties> exportDevicesAsync(JobProperties exportDevicesParameters)

Async wrapper for exportDevices() operation

java.util.concurrent.CompletableFuture<JobProperties> exportDevicesAsync(String exportBlobContainerUri, Boolean excludeKeys)

Async wrapper for exportDevices() operation

Configuration getConfiguration(String configurationId)

Get configuration by configuration Id from IotHub

java.util.List<Configuration> getConfigurations(Integer maxCount)

Get list of Configuration

Device getDevice(String deviceId)

Get device data by device Id from IotHub

java.util.concurrent.CompletableFuture<Device> getDeviceAsync(String deviceId)

Async wrapper for getDevice() operation

java.lang.String getDeviceConnectionString(Device device)

Return the iothub device connection string for a provided device.

java.util.ArrayList<Device> getDevices(Integer maxCount)

Deprecated

as of release 1.12.0. Please use com.microsoft.azure.sdk.iot.service.devicetwin.DeviceTwin#queryTwin(String sqlQuery, Integer pageSize) to query for all devices.

Get list of devices

java.util.concurrent.CompletableFuture<java.util.ArrayList<Device>> getDevicesAsync(Integer maxCount)

Deprecated

as of release 1.12.0. Please use com.microsoft.azure.sdk.iot.service.devicetwin.DeviceTwin#queryTwin(String sqlQuery, Integer pageSize) to query for all devices.

Async wrapper for getDevices() operation

JobProperties getJob(String jobId)

Get the properties of an existing job.

java.util.concurrent.CompletableFuture<JobProperties> getJobAsync(String jobId)

Async wrapper for getJob() operation

Module getModule(String deviceId, String moduleId)

Get module data by device Id and module Id from IotHub

java.util.List<Module> getModulesOnDevice(String deviceId)

Get modules data by device Id from IotHub

RegistryStatistics getStatistics()

Get device statistics

java.util.concurrent.CompletableFuture<RegistryStatistics> getStatisticsAsync()

Async wrapper for getStatistics() operation

JobProperties importDevices(JobProperties importDevicesParameters)

Create a bulk import job.

JobProperties importDevices(String importBlobContainerUri, String outputBlobContainerUri)

Create a bulk import job.

java.util.concurrent.CompletableFuture<JobProperties> importDevicesAsync(JobProperties importParameters)

Async wrapper for importDevices() operation

java.util.concurrent.CompletableFuture<JobProperties> importDevicesAsync(String importBlobContainerUri, String outputBlobContainerUri)

Async wrapper for importDevices() operation

void open()

Deprecated

as of release 1.13.0 this API is no longer supported and open is done implicitly by the respective APIs Opens this registry manager's executor service after it has been closed.
void removeConfiguration(Configuration config)

Send remove configuration request and verify response

void removeConfiguration(String configurationId)

Send remove configuration request and verify response

void removeDevice(Device device)

Remove device

void removeDevice(String deviceId)

Remove device

java.util.concurrent.CompletableFuture<java.lang.Boolean> removeDeviceAsync(String deviceId)

Async wrapper for removeDevice() operation

void removeModule(Module module)

Remove module

void removeModule(String deviceId, String moduleId)

Remove module

Configuration updateConfiguration(Configuration configuration)

Update configuration not forced

Configuration updateConfiguration(Configuration configuration, Boolean forceUpdate)

Deprecated

the forceUpdate argument does nothing so this method will always behave the same as @link #updateConfiguration(Configuration)}

Update configuration with forceUpdate input parameter

Device updateDevice(Device device)

Update device not forced

Device updateDevice(Device device, Boolean forceUpdate)

Deprecated

The forceUpdate argument does nothing so this method will always behave the same as updateDevice(Device device)

Update device with forceUpdate input parameter

java.util.concurrent.CompletableFuture<Device> updateDeviceAsync(Device device)

Async wrapper for updateDevice() operation

java.util.concurrent.CompletableFuture<Device> updateDeviceAsync(Device device, Boolean forceUpdate)

Deprecated

The forceUpdate argument does nothing so this method will always behave the same as updateDeviceAsync(Device device)

Async wrapper for forced updateDevice() operation

Module updateModule(Module module)

Update module not forced

Module updateModule(Module module, Boolean forceUpdate)

Deprecated

The forceUpdate argument does nothing so this method will always behave the same as @link #updateModule(Module)}

Update module with forceUpdate input parameter

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Constructor Details

RegistryManager


public RegistryManager()

Deprecated

As of release 1.22.0, replaced by createFromConnectionString(String connectionString)

Previously was the java default constructor, should not be used.

RegistryManager

public RegistryManager(String connectionString)

Constructor to create instance from connection string

Parameters:

connectionString - The iot hub connection string

RegistryManager

public RegistryManager(String hostName, AzureSasCredential azureSasCredential)

Create a new RegistryManager instance.

Parameters:

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.

RegistryManager

public RegistryManager(String hostName, AzureSasCredential azureSasCredential, RegistryManagerOptions options)

Create a new RegistryManager instance.

Parameters:

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.

RegistryManager

public RegistryManager(String hostName, TokenCredential credential)

Create a new RegistryManager instance.

Parameters:

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.

RegistryManager

public RegistryManager(String hostName, TokenCredential credential, RegistryManagerOptions options)

Create a new RegistryManager instance.

Parameters:

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.

RegistryManager

public RegistryManager(String connectionString, RegistryManagerOptions options)

Constructor to create instance from connection string

Parameters:

connectionString - The iot hub connection string
options - The connection options to use when connecting to the service.

Method Details

addConfiguration

public Configuration addConfiguration(Configuration configuration)

Add configuration using the given Configuration object Return with the response configuration object from IotHub

Parameters:

configuration - The configuration object to add

Returns:

The configuration object for the requested operation

Throws:

java.io.IOException - This exception is thrown if the IO operation failed
IotHubException - This exception is thrown if the IO operation failed
com.google.gson.JsonSyntaxException - This exception is thrown if the IO operation failed

addDevice

public Device addDevice(Device device)

Add device using the given Device object Return with the response device object from IotHub

Parameters:

device - The device object to add

Returns:

The future object for the requested operation

Throws:

java.io.IOException - This exception is thrown if the IO operation failed
IotHubException - This exception is thrown if the IO operation failed
com.google.gson.JsonSyntaxException - This exception is thrown if the IO operation failed

addDeviceAsync

public CompletableFuture addDeviceAsync(Device device)

Async wrapper for add() operation

Parameters:

device - The device object to add

Returns:

The future object for the requested operation

Throws:

java.io.IOException - This exception is thrown if the IO operation failed
IotHubException - This exception is thrown if the IO operation failed

addModule

public Module addModule(Module module)

Add module using the given Module object Return with the response module object from IotHub

Parameters:

module - The module object to add

Returns:

The module object for the requested operation

Throws:

java.io.IOException - This exception is thrown if the IO operation failed
IotHubException - This exception is thrown if the IO operation failed
com.google.gson.JsonSyntaxException - This exception is thrown if the IO operation failed

applyConfigurationContentOnDevice

public void applyConfigurationContentOnDevice(String deviceId, ConfigurationContent content)

Apply the provided configuration content to the provided device

Parameters:

deviceId - The device to apply the configuration to
content - The configuration content to apply to the device

Throws:

java.io.IOException - If the iot hub cannot be reached
IotHubException - If the iot hub cannot be reached

close

public void close()

Gracefully close running threads, and then shutdown the underlying executor service

createFromConnectionString


public static RegistryManager createFromConnectionString(String connectionString)

Deprecated

because this method declares a thrown IOException even though it never throws an IOException. Users are recommended to use RegistryManager(String connectionString) instead since it does not declare this exception even though it constructs the same RegistryManager.

Static constructor to create instance from connection string

Parameters:

connectionString - The iot hub connection string

Returns:

The instance of RegistryManager

Throws:

java.io.IOException - This exception is never thrown.

createFromConnectionString


public static RegistryManager createFromConnectionString(String connectionString, RegistryManagerOptions options)

Deprecated

because this method declares a thrown IOException even though it never throws an IOException. Users are recommended to use RegistryManager(String connectionString, RegistryManagerOptions options) instead since it does not declare this exception even though it constructs the same RegistryManager.

Static constructor to create instance from connection string

Parameters:

connectionString - The iot hub connection string
options - The connection options to use when connecting to the service.

Returns:

The instance of RegistryManager

Throws:

java.io.IOException - This exception is never thrown.

exportDevices

public JobProperties exportDevices(JobProperties exportDevicesParameters)

Create a bulk export job.

Parameters:

exportDevicesParameters - A JobProperties object containing input parameters for export Devices job This API also supports identity based storage authentication, identity authentication support is currently available in limited regions. If a user wishes to try it out, they will need to set an Environment Variable of "EnabledStorageIdentity" and set it to "1" otherwise default key based authentication is used for storage More details here

Returns:

A JobProperties object for the newly created bulk export job

Throws:

java.lang.IllegalArgumentException - This exception is thrown if the exportBlobContainerUri or excludeKeys parameters are null
java.io.IOException - This exception is thrown if the exportBlobContainerUri or excludeKeys parameters are null
IotHubException - This exception is thrown if the exportBlobContainerUri or excludeKeys parameters are null
com.google.gson.JsonSyntaxException - This exception is thrown if the exportBlobContainerUri or excludeKeys parameters are null

exportDevices

public JobProperties exportDevices(String exportBlobContainerUri, Boolean excludeKeys)

Create a bulk export job.

Parameters:

exportBlobContainerUri - URI containing SAS token to a blob container where export data will be placed
excludeKeys - Whether the devices keys should be excluded from the exported data or not

Returns:

A JobProperties object for the newly created bulk export job

Throws:

java.lang.IllegalArgumentException - This exception is thrown if the exportBlobContainerUri or excludeKeys parameters are null
java.io.IOException - This exception is thrown if the exportBlobContainerUri or excludeKeys parameters are null
IotHubException - This exception is thrown if the exportBlobContainerUri or excludeKeys parameters are null
com.google.gson.JsonSyntaxException - This exception is thrown if the exportBlobContainerUri or excludeKeys parameters are null

exportDevicesAsync

public CompletableFuture exportDevicesAsync(JobProperties exportDevicesParameters)

Async wrapper for exportDevices() operation

Parameters:

exportDevicesParameters - A JobProperties object containing input parameters for export Devices job This API also supports identity based storage authentication, identity authentication support is currently available in limited regions. If a user wishes to try it out, they will need to set an Environment Variable of "EnabledStorageIdentity" and set it to "1" otherwise default key based authentication is used for storage More details here

Returns:

The future object for the requested operation

Throws:

java.lang.IllegalArgumentException - This exception is thrown if the exportBlobContainerUri or excludeKeys parameters are null
java.io.IOException - This exception is thrown if the exportBlobContainerUri or excludeKeys parameters are null
IotHubException - This exception is thrown if the exportBlobContainerUri or excludeKeys parameters are null
com.google.gson.JsonSyntaxException - This exception is thrown if the exportBlobContainerUri or excludeKeys parameters are null

exportDevicesAsync

public CompletableFuture exportDevicesAsync(String exportBlobContainerUri, Boolean excludeKeys)

Async wrapper for exportDevices() operation

Parameters:

exportBlobContainerUri - the blob storage container URI to store at.
excludeKeys - if to exclude keys or not

Returns:

The future object for the requested operation

Throws:

java.lang.IllegalArgumentException - This exception is thrown if the exportBlobContainerUri or excludeKeys parameters are null
java.io.IOException - This exception is thrown if the exportBlobContainerUri or excludeKeys parameters are null
IotHubException - This exception is thrown if the exportBlobContainerUri or excludeKeys parameters are null
com.google.gson.JsonSyntaxException - This exception is thrown if the exportBlobContainerUri or excludeKeys parameters are null

getConfiguration

public Configuration getConfiguration(String configurationId)

Get configuration by configuration Id from IotHub

Parameters:

configurationId - The id of requested configuration

Returns:

The configuration object of requested configuration on the specific device

Throws:

java.io.IOException - This exception is thrown if the IO operation failed
IotHubException - This exception is thrown if the IO operation failed
com.google.gson.JsonSyntaxException - This exception is thrown if the IO operation failed

getConfigurations

public List getConfigurations(Integer maxCount)

Get list of Configuration

Parameters:

maxCount - The requested count of configurations

Returns:

The array of requested configuration objects

Throws:

java.io.IOException - This exception is thrown if the IO operation failed
IotHubException - This exception is thrown if the IO operation failed
com.google.gson.JsonSyntaxException - This exception is thrown if the IO operation failed

getDevice

public Device getDevice(String deviceId)

Get device data by device Id from IotHub

Parameters:

deviceId - The id of requested device

Returns:

The device object of requested device

Throws:

java.io.IOException - This exception is thrown if the IO operation failed
IotHubException - This exception is thrown if the IO operation failed
com.google.gson.JsonSyntaxException - This exception is thrown if the IO operation failed

getDeviceAsync

public CompletableFuture getDeviceAsync(String deviceId)

Async wrapper for getDevice() operation

Parameters:

deviceId - The id of requested device

Returns:

The future object for the requested operation

Throws:

java.io.IOException - This exception is thrown if the IO operation failed
IotHubException - This exception is thrown if the IO operation failed

getDeviceConnectionString

public String getDeviceConnectionString(Device device)

Return the iothub device connection string for a provided device.

Parameters:

device - The device object to get the connectionString

Returns:

The iothub device connection string

getDevices


public ArrayList getDevices(Integer maxCount)

Deprecated

as of release 1.12.0. Please use com.microsoft.azure.sdk.iot.service.devicetwin.DeviceTwin#queryTwin(String sqlQuery, Integer pageSize) to query for all devices.

Get list of devices

Parameters:

maxCount - The requested count of devices

Returns:

The array of requested device objects

Throws:

java.io.IOException - This exception is thrown if the IO operation failed
IotHubException - This exception is thrown if the IO operation failed
com.google.gson.JsonSyntaxException - This exception is thrown if the IO operation failed

getDevicesAsync


public CompletableFuture> getDevicesAsync(Integer maxCount)

Deprecated

as of release 1.12.0. Please use com.microsoft.azure.sdk.iot.service.devicetwin.DeviceTwin#queryTwin(String sqlQuery, Integer pageSize) to query for all devices.

Async wrapper for getDevices() operation

Parameters:

maxCount - The requested count of devices

Returns:

The future object for the requested operation

Throws:

java.io.IOException - This exception is thrown if the IO operation failed
IotHubException - This exception is thrown if the IO operation failed

getJob

public JobProperties getJob(String jobId)

Get the properties of an existing job.

Parameters:

jobId - The id of the job to be retrieved.

Returns:

A JobProperties object for the requested job id

Throws:

java.lang.IllegalArgumentException - This exception is thrown if the jobId parameter is null
java.io.IOException - This exception is thrown if the jobId parameter is null
IotHubException - This exception is thrown if the jobId parameter is null
com.google.gson.JsonSyntaxException - This exception is thrown if the jobId parameter is null

getJobAsync

public CompletableFuture getJobAsync(String jobId)

Async wrapper for getJob() operation

Parameters:

jobId - jobID as String

Returns:

The future object for the requested operation

Throws:

java.lang.IllegalArgumentException - This exception is thrown if the jobId parameter is null
java.io.IOException - This exception is thrown if the jobId parameter is null
IotHubException - This exception is thrown if the jobId parameter is null

getModule

public Module getModule(String deviceId, String moduleId)

Get module data by device Id and module Id from IotHub

Parameters:

deviceId - The id of requested device
moduleId - The id of requested module

Returns:

The module object of requested module on the specific device

Throws:

java.io.IOException - This exception is thrown if the IO operation failed
IotHubException - This exception is thrown if the IO operation failed
com.google.gson.JsonSyntaxException - This exception is thrown if the IO operation failed

getModulesOnDevice

public List getModulesOnDevice(String deviceId)

Get modules data by device Id from IotHub

Parameters:

deviceId - The id of requested device

Returns:

The module objects on the specific device

Throws:

java.io.IOException - This exception is thrown if the IO operation failed
IotHubException - This exception is thrown if the IO operation failed
com.google.gson.JsonSyntaxException - This exception is thrown if the IO operation failed

getStatistics

public RegistryStatistics getStatistics()

Get device statistics

Returns:

RegistryStatistics object containing the requested data

Throws:

java.io.IOException - This exception is thrown if the IO operation failed
IotHubException - This exception is thrown if the IO operation failed
com.google.gson.JsonSyntaxException - This exception is thrown if the IO operation failed

getStatisticsAsync

public CompletableFuture getStatisticsAsync()

Async wrapper for getStatistics() operation

Returns:

The future object for the requested operation

Throws:

java.io.IOException - This exception is thrown if the IO operation failed
IotHubException - This exception is thrown if the IO operation failed

importDevices

public JobProperties importDevices(JobProperties importDevicesParameters)

Create a bulk import job.

Parameters:

importDevicesParameters - A JobProperties object containing input parameters for import Devices job This API also supports identity based storage authentication, identity authentication support is currently available in limited regions. If a user wishes to try it out, they will need to set an Environment Variable of "EnabledStorageIdentity" and set it to "1" otherwise default key based authentication is used for storage More details here

Returns:

A JobProperties object for the newly created bulk import job

Throws:

java.lang.IllegalArgumentException - This exception is thrown if the importBlobContainerUri or outputBlobContainerUri parameters are null
java.io.IOException - This exception is thrown if the importBlobContainerUri or outputBlobContainerUri parameters are null
IotHubException - This exception is thrown if the importBlobContainerUri or outputBlobContainerUri parameters are null
com.google.gson.JsonSyntaxException - This exception is thrown if the importBlobContainerUri or outputBlobContainerUri parameters are null

importDevices

public JobProperties importDevices(String importBlobContainerUri, String outputBlobContainerUri)

Create a bulk import job.

Parameters:

importBlobContainerUri - URI containing SAS token to a blob container that contains registry data to sync
outputBlobContainerUri - URI containing SAS token to a blob container where the result of the bulk import operation will be placed

Returns:

A JobProperties object for the newly created bulk import job

Throws:

java.lang.IllegalArgumentException - This exception is thrown if the importBlobContainerUri or outputBlobContainerUri parameters are null
java.io.IOException - This exception is thrown if the importBlobContainerUri or outputBlobContainerUri parameters are null
IotHubException - This exception is thrown if the importBlobContainerUri or outputBlobContainerUri parameters are null
com.google.gson.JsonSyntaxException - This exception is thrown if the importBlobContainerUri or outputBlobContainerUri parameters are null

importDevicesAsync

public CompletableFuture importDevicesAsync(JobProperties importParameters)

Async wrapper for importDevices() operation

Parameters:

importParameters - A JobProperties object containing input parameters for import Devices job This API also supports identity based storage authentication, identity authentication support is currently available in limited regions. If a user wishes to try it out, they will need to set an Environment Variable of "EnabledStorageIdentity" and set it to "1" otherwise default key based authentication is used for storage More details here

Returns:

The future object for the requested operation

Throws:

java.lang.IllegalArgumentException - This exception is thrown if the exportBlobContainerUri or excludeKeys parameters are null
java.io.IOException - This exception is thrown if the exportBlobContainerUri or excludeKeys parameters are null
IotHubException - This exception is thrown if the exportBlobContainerUri or excludeKeys parameters are null
com.google.gson.JsonSyntaxException - This exception is thrown if the exportBlobContainerUri or excludeKeys parameters are null

importDevicesAsync

public CompletableFuture importDevicesAsync(String importBlobContainerUri, String outputBlobContainerUri)

Async wrapper for importDevices() operation

Parameters:

importBlobContainerUri - Uri for importBlobContainer
outputBlobContainerUri - Uri for outputBlobContainer

Returns:

The future object for the requested operation

Throws:

java.lang.IllegalArgumentException - This exception is thrown if the exportBlobContainerUri or excludeKeys parameters are null
java.io.IOException - This exception is thrown if the exportBlobContainerUri or excludeKeys parameters are null
IotHubException - This exception is thrown if the exportBlobContainerUri or excludeKeys parameters are null
com.google.gson.JsonSyntaxException - This exception is thrown if the exportBlobContainerUri or excludeKeys parameters are null

open


public void open()

Deprecated

as of release 1.13.0 this API is no longer supported and open is done implicitly by the respective APIs Opens this registry manager's executor service after it has been closed.

removeConfiguration

public void removeConfiguration(Configuration config)

Send remove configuration request and verify response

Parameters:

config - The configuration to be removed

Throws:

java.io.IOException - This exception is thrown if the IO operation failed
IotHubException - This exception is thrown if the IO operation failed
java.lang.IllegalArgumentException - This exception is thrown if the IO operation failed

removeConfiguration

public void removeConfiguration(String configurationId)

Send remove configuration request and verify response

Parameters:

configurationId - The configuration to be removed

Throws:

java.io.IOException - This exception is thrown if the IO operation failed
IotHubException - This exception is thrown if the IO operation failed

removeDevice

public void removeDevice(Device device)

Remove device

Parameters:

device - The device name to remove

Throws:

java.io.IOException - This exception is thrown if the IO operation failed
IotHubException - This exception is thrown if the IO operation failed
java.lang.IllegalArgumentException - This exception is thrown if the IO operation failed

removeDevice

public void removeDevice(String deviceId)

Remove device

Parameters:

deviceId - The device name to remove

Throws:

java.io.IOException - This exception is thrown if the IO operation failed
IotHubException - This exception is thrown if the IO operation failed

removeDeviceAsync

public CompletableFuture removeDeviceAsync(String deviceId)

Async wrapper for removeDevice() operation

Parameters:

deviceId - The device object to remove

Returns:

The future object for the requested operation

Throws:

java.io.IOException - This exception is thrown if the IO operation failed
IotHubException - This exception is thrown if the IO operation failed

removeModule

public void removeModule(Module module)

Remove module

Parameters:

module - The module to be removed

Throws:

java.io.IOException - This exception is thrown if the IO operation failed
IotHubException - This exception is thrown if the IO operation failed
java.lang.IllegalArgumentException - This exception is thrown if the IO operation failed

removeModule

public void removeModule(String deviceId, String moduleId)

Remove module

Parameters:

deviceId - The device name associated with the module to be removed
moduleId - The module name to be removed

Throws:

java.io.IOException - This exception is thrown if the IO operation failed
IotHubException - This exception is thrown if the IO operation failed

updateConfiguration

public Configuration updateConfiguration(Configuration configuration)

Update configuration not forced

Parameters:

configuration - The configuration object containing updated data

Returns:

The updated configuration object

Throws:

java.io.IOException - This exception is thrown if the IO operation failed
IotHubException - This exception is thrown if the IO operation failed

updateConfiguration


public Configuration updateConfiguration(Configuration configuration, Boolean forceUpdate)

Deprecated

the forceUpdate argument does nothing so this method will always behave the same as @link #updateConfiguration(Configuration)}

Update configuration with forceUpdate input parameter

Parameters:

configuration - The configuration object containing updated data
forceUpdate - This value is not used

Returns:

The updated configuration object

Throws:

java.io.IOException - This exception is thrown if the IO operation failed
IotHubException - This exception is thrown if the IO operation failed
com.google.gson.JsonSyntaxException - This exception is thrown if the IO operation failed

updateDevice

public Device updateDevice(Device device)

Update device not forced

Parameters:

device - The device object containing updated data

Returns:

The updated device object

Throws:

java.io.IOException - This exception is thrown if the IO operation failed
IotHubException - This exception is thrown if the IO operation failed

updateDevice


public Device updateDevice(Device device, Boolean forceUpdate)

Deprecated

The forceUpdate argument does nothing so this method will always behave the same as updateDevice(Device device)

Update device with forceUpdate input parameter

Parameters:

device - The device object containing updated data
forceUpdate - This value is not used

Returns:

The updated device object

Throws:

java.io.IOException - This exception is thrown if the IO operation failed
IotHubException - This exception is thrown if the IO operation failed
com.google.gson.JsonSyntaxException - This exception is thrown if the IO operation failed

updateDeviceAsync

public CompletableFuture updateDeviceAsync(Device device)

Async wrapper for updateDevice() operation

Parameters:

device - The device object containing updated data

Returns:

The future object for the requested operation

Throws:

java.io.IOException - This exception is thrown if the IO operation failed
IotHubException - This exception is thrown if the IO operation failed

updateDeviceAsync


public CompletableFuture updateDeviceAsync(Device device, Boolean forceUpdate)

Deprecated

The forceUpdate argument does nothing so this method will always behave the same as updateDeviceAsync(Device device)

Async wrapper for forced updateDevice() operation

Parameters:

device - The device object containing updated data
forceUpdate - True is the update has to be forced regardless if the device state

Returns:

The future object for the requested operation

Throws:

java.io.IOException - This exception is thrown if the IO operation failed
IotHubException - This exception is thrown if the IO operation failed

updateModule

public Module updateModule(Module module)

Update module not forced

Parameters:

module - The module object containing updated data

Returns:

The updated module object

Throws:

java.io.IOException - This exception is thrown if the IO operation failed
IotHubException - This exception is thrown if the IO operation failed

updateModule


public Module updateModule(Module module, Boolean forceUpdate)

Deprecated

The forceUpdate argument does nothing so this method will always behave the same as @link #updateModule(Module)}

Update module with forceUpdate input parameter

Parameters:

module - The module object containing updated data
forceUpdate - This value is not used

Returns:

The updated module object

Throws:

java.io.IOException - This exception is thrown if the IO operation failed
IotHubException - This exception is thrown if the IO operation failed
com.google.gson.JsonSyntaxException - This exception is thrown if the IO operation failed

Applies to