你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
RegistryManager Class
- java.
lang. Object - com.
microsoft. azure. sdk. iot. service. RegistryManager
- com.
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 Registry |
RegistryManager(String hostName, AzureSasCredential azureSasCredential, RegistryManagerOptions options) |
Create a new Registry |
RegistryManager(String hostName, TokenCredential credential) |
Create a new Registry |
RegistryManager(String hostName, TokenCredential credential, RegistryManagerOptions options) |
Create a new Registry |
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 Iot |
Device |
addDevice(Device device)
Add device using the given Device object Return with the response device object from Iot |
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 Iot |
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
Registry |
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 Registry
Static constructor to create instance from connection string |
static
Registry |
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 Registry
Static constructor to create instance from connection string |
Job |
exportDevices(JobProperties exportDevicesParameters)
Create a bulk export job. |
Job |
exportDevices(String exportBlobContainerUri, Boolean excludeKeys)
Create a bulk export job. |
java.util.concurrent.CompletableFuture<Job |
exportDevicesAsync(JobProperties exportDevicesParameters)
Async wrapper for export |
java.util.concurrent.CompletableFuture<Job |
exportDevicesAsync(String exportBlobContainerUri, Boolean excludeKeys)
Async wrapper for export |
Configuration |
getConfiguration(String configurationId)
Get configuration by configuration Id from Iot |
java.util.List<Configuration> |
getConfigurations(Integer maxCount)
Get list of Configuration |
Device |
getDevice(String deviceId)
Get device data by device Id from Iot |
java.util.concurrent.CompletableFuture<Device> |
getDeviceAsync(String deviceId)
Async wrapper for get |
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 get |
Job |
getJob(String jobId)
Get the properties of an existing job. |
java.util.concurrent.CompletableFuture<Job |
getJobAsync(String jobId)
Async wrapper for get |
Module |
getModule(String deviceId, String moduleId)
Get module data by device Id and module Id from Iot |
java.util.List<Module> |
getModulesOnDevice(String deviceId)
Get modules data by device Id from Iot |
Registry |
getStatistics()
Get device statistics |
java.util.concurrent.CompletableFuture<Registry |
getStatisticsAsync()
Async wrapper for get |
Job |
importDevices(JobProperties importDevicesParameters)
Create a bulk import job. |
Job |
importDevices(String importBlobContainerUri, String outputBlobContainerUri)
Create a bulk import job. |
java.util.concurrent.CompletableFuture<Job |
importDevicesAsync(JobProperties importParameters)
Async wrapper for import |
java.util.concurrent.CompletableFuture<Job |
importDevicesAsync(String importBlobContainerUri, String outputBlobContainerUri)
Async wrapper for import |
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 remove |
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 force
Update configuration with force |
Device |
updateDevice(Device device)
Update device not forced |
Device |
updateDevice(Device device, Boolean forceUpdate)
Deprecated
The force
Update device with force |
java.util.concurrent.CompletableFuture<Device> |
updateDeviceAsync(Device device)
Async wrapper for update |
java.util.concurrent.CompletableFuture<Device> |
updateDeviceAsync(Device device, Boolean forceUpdate)
Deprecated
The force
Async wrapper for forced update |
Module |
updateModule(Module module)
Update module not forced |
Module |
updateModule(Module module, Boolean forceUpdate)
Deprecated
The force
Update module with force |
Methods inherited from java.lang.Object
Constructor Details
RegistryManager
public RegistryManager()
Deprecated
Previously was the java default constructor, should not be used.
RegistryManager
public RegistryManager(String connectionString)
Constructor to create instance from connection string
Parameters:
RegistryManager
public RegistryManager(String hostName, AzureSasCredential azureSasCredential)
Create a new RegistryManager instance.
Parameters:
RegistryManager
public RegistryManager(String hostName, AzureSasCredential azureSasCredential, RegistryManagerOptions options)
Create a new RegistryManager instance.
Parameters:
RegistryManager
public RegistryManager(String hostName, TokenCredential credential)
Create a new RegistryManager instance.
Parameters:
RegistryManager
public RegistryManager(String hostName, TokenCredential credential, RegistryManagerOptions options)
Create a new RegistryManager instance.
Parameters:
RegistryManager
public RegistryManager(String connectionString, RegistryManagerOptions options)
Constructor to create instance from connection string
Parameters:
Method Details
addConfiguration
public Configuration addConfiguration(Configuration configuration)
Add configuration using the given Configuration object Return with the response configuration object from IotHub
Parameters:
Returns:
Throws:
addDevice
public Device addDevice(Device device)
Add device using the given Device object Return with the response device object from IotHub
Parameters:
Returns:
Throws:
addDeviceAsync
public CompletableFuture
Async wrapper for add() operation
Parameters:
Returns:
Throws:
addModule
public Module addModule(Module module)
Add module using the given Module object Return with the response module object from IotHub
Parameters:
Returns:
Throws:
applyConfigurationContentOnDevice
public void applyConfigurationContentOnDevice(String deviceId, ConfigurationContent content)
Apply the provided configuration content to the provided device
Parameters:
Throws:
close
public void close()
Gracefully close running threads, and then shutdown the underlying executor service
createFromConnectionString
public static RegistryManager createFromConnectionString(String connectionString)
Deprecated
Static constructor to create instance from connection string
Parameters:
Returns:
Throws:
createFromConnectionString
public static RegistryManager createFromConnectionString(String connectionString, RegistryManagerOptions options)
Deprecated
Static constructor to create instance from connection string
Parameters:
Returns:
Throws:
exportDevices
public JobProperties exportDevices(JobProperties exportDevicesParameters)
Create a bulk export job.
Parameters:
Returns:
Throws:
exportDevices
public JobProperties exportDevices(String exportBlobContainerUri, Boolean excludeKeys)
Create a bulk export job.
Parameters:
Returns:
Throws:
exportDevicesAsync
public CompletableFuture
Async wrapper for exportDevices() operation
Parameters:
Returns:
Throws:
exportDevicesAsync
public CompletableFuture
Async wrapper for exportDevices() operation
Parameters:
Returns:
Throws:
getConfiguration
public Configuration getConfiguration(String configurationId)
Get configuration by configuration Id from IotHub
Parameters:
Returns:
Throws:
getConfigurations
public List
Get list of Configuration
Parameters:
Returns:
Throws:
getDevice
public Device getDevice(String deviceId)
Get device data by device Id from IotHub
Parameters:
Returns:
Throws:
getDeviceAsync
public CompletableFuture
Async wrapper for getDevice() operation
Parameters:
Returns:
Throws:
getDeviceConnectionString
public String getDeviceConnectionString(Device device)
Return the iothub device connection string for a provided device.
Parameters:
Returns:
getDevices
public ArrayList
Deprecated
Get list of devices
Parameters:
Returns:
Throws:
getDevicesAsync
public CompletableFuture
Deprecated
Async wrapper for getDevices() operation
Parameters:
Returns:
Throws:
getJob
public JobProperties getJob(String jobId)
Get the properties of an existing job.
Parameters:
Returns:
Throws:
getJobAsync
public CompletableFuture
Async wrapper for getJob() operation
Parameters:
Returns:
Throws:
getModule
public Module getModule(String deviceId, String moduleId)
Get module data by device Id and module Id from IotHub
Parameters:
Returns:
Throws:
getModulesOnDevice
public List
Get modules data by device Id from IotHub
Parameters:
Returns:
Throws:
getStatistics
public RegistryStatistics getStatistics()
Get device statistics
Returns:
Throws:
getStatisticsAsync
public CompletableFuture
Async wrapper for getStatistics() operation
Returns:
Throws:
importDevices
public JobProperties importDevices(JobProperties importDevicesParameters)
Create a bulk import job.
Parameters:
Returns:
Throws:
importDevices
public JobProperties importDevices(String importBlobContainerUri, String outputBlobContainerUri)
Create a bulk import job.
Parameters:
Returns:
Throws:
importDevicesAsync
public CompletableFuture
Async wrapper for importDevices() operation
Parameters:
Returns:
Throws:
importDevicesAsync
public CompletableFuture
Async wrapper for importDevices() operation
Parameters:
Returns:
Throws:
open
public void open()
Deprecated
removeConfiguration
public void removeConfiguration(Configuration config)
Send remove configuration request and verify response
Parameters:
Throws:
removeConfiguration
public void removeConfiguration(String configurationId)
Send remove configuration request and verify response
Parameters:
Throws:
removeDevice
public void removeDevice(Device device)
Remove device
Parameters:
Throws:
removeDevice
public void removeDevice(String deviceId)
Remove device
Parameters:
Throws:
removeDeviceAsync
public CompletableFuture
Async wrapper for removeDevice() operation
Parameters:
Returns:
Throws:
removeModule
public void removeModule(Module module)
Remove module
Parameters:
Throws:
removeModule
public void removeModule(String deviceId, String moduleId)
Remove module
Parameters:
Throws:
updateConfiguration
public Configuration updateConfiguration(Configuration configuration)
Update configuration not forced
Parameters:
Returns:
Throws:
updateConfiguration
public Configuration updateConfiguration(Configuration configuration, Boolean forceUpdate)
Deprecated
Update configuration with forceUpdate input parameter
Parameters:
Returns:
Throws:
updateDevice
public Device updateDevice(Device device)
Update device not forced
Parameters:
Returns:
Throws:
updateDevice
public Device updateDevice(Device device, Boolean forceUpdate)
Deprecated
Update device with forceUpdate input parameter
Parameters:
Returns:
Throws:
updateDeviceAsync
public CompletableFuture
Async wrapper for updateDevice() operation
Parameters:
Returns:
Throws:
updateDeviceAsync
public CompletableFuture
Deprecated
Async wrapper for forced updateDevice() operation
Parameters:
Returns:
Throws:
updateModule
public Module updateModule(Module module)
Update module not forced
Parameters:
Returns:
Throws:
updateModule
public Module updateModule(Module module, Boolean forceUpdate)
Deprecated
Update module with forceUpdate input parameter
Parameters:
Returns:
Throws: