public final class RegistryClient extends Object
TwinClient.| Constructor and Description |
|---|
RegistryClient(String connectionString)
Constructor to create instance from connection string
|
RegistryClient(String hostName,
com.azure.core.credential.AzureSasCredential azureSasCredential)
Create a new RegistryClient instance.
|
RegistryClient(String hostName,
com.azure.core.credential.AzureSasCredential azureSasCredential,
RegistryClientOptions options)
Create a new RegistryClient instance.
|
RegistryClient(String connectionString,
RegistryClientOptions options)
Constructor to create instance from connection string
|
RegistryClient(String hostName,
com.azure.core.credential.TokenCredential credential)
Create a new RegistryClient instance.
|
RegistryClient(String hostName,
com.azure.core.credential.TokenCredential credential,
RegistryClientOptions options)
Create a new RegistryClient instance.
|
| Modifier and Type | Method and Description |
|---|---|
Device |
addDevice(Device device)
Add device using the given Device object
Return with the response device object from IotHub
|
Module |
addModule(Module module)
Add module using the given Module object
Return with the response module object from IotHub
|
RegistryJob |
exportDevices(RegistryJob exportDevicesParameters)
Create a bulk export job.
|
RegistryJob |
exportDevices(String exportBlobContainerUri,
boolean excludeKeys)
Create a bulk export job.
|
Device |
getDevice(String deviceId)
Get device data by device Id from IotHub
|
RegistryJob |
getJob(String jobId)
Get the properties of an existing job.
|
Module |
getModule(String deviceId,
String moduleId)
Get module data by device Id and module Id from IotHub
|
List<Module> |
getModulesOnDevice(String deviceId)
Get modules data by device Id from IotHub
|
RegistryStatistics |
getStatistics()
Get device statistics
|
RegistryJob |
importDevices(RegistryJob importDevicesParameters)
Create a bulk import job.
|
RegistryJob |
importDevices(String importBlobContainerUri,
String outputBlobContainerUri)
Create a bulk import job.
|
void |
removeDevice(Device device)
Remove device
|
void |
removeDevice(String deviceId)
Remove device
|
void |
removeModule(Module module)
Remove module
|
void |
removeModule(String deviceId,
String moduleId)
Remove module
|
Device |
updateDevice(Device device)
Update device not forced
|
Module |
updateModule(Module module)
Update module not forced
|
public RegistryClient(String connectionString)
connectionString - The iot hub connection stringpublic RegistryClient(String connectionString, RegistryClientOptions options)
connectionString - The iot hub connection stringoptions - The connection options to use when connecting to the service.public RegistryClient(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 RegistryClient(String hostName, com.azure.core.credential.TokenCredential credential, RegistryClientOptions 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 RegistryClient(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 RegistryClient(String hostName, com.azure.core.credential.AzureSasCredential azureSasCredential, RegistryClientOptions 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 Device addDevice(Device device) throws IOException, IotHubException
device - The device object to addIOException - This exception is thrown if the IO operation failedIotHubException - This exception is thrown if the response verification failedpublic Device getDevice(String deviceId) throws IOException, IotHubException
deviceId - The id of requested deviceIOException - This exception is thrown if the IO operation failedIotHubException - This exception is thrown if the response verification failedpublic Device updateDevice(Device device) throws IOException, IotHubException
device - The device object containing updated dataIOException - This exception is thrown if the IO operation failedIotHubException - This exception is thrown if the response verification failedpublic void removeDevice(String deviceId) throws IOException, IotHubException
deviceId - The device name to removeIOException - This exception is thrown if the IO operation failedIotHubException - This exception is thrown if the response verification failedpublic void removeDevice(Device device) throws IOException, IotHubException
device - The device name to removeIOException - This exception is thrown if the IO operation failedIotHubException - This exception is thrown if the response verification failedpublic RegistryStatistics getStatistics() throws IOException, IotHubException
IOException - This exception is thrown if the IO operation failedIotHubException - This exception is thrown if the response verification failedpublic Module addModule(Module module) throws IOException, IotHubException
module - The module object to addIOException - This exception is thrown if the IO operation failedIotHubException - This exception is thrown if the response verification failedpublic Module getModule(String deviceId, String moduleId) throws IOException, IotHubException
deviceId - The id of requested devicemoduleId - The id of requested moduleIOException - This exception is thrown if the IO operation failedIotHubException - This exception is thrown if the response verification failedpublic List<Module> getModulesOnDevice(String deviceId) throws IOException, IotHubException
deviceId - The id of requested deviceIOException - This exception is thrown if the IO operation failedIotHubException - This exception is thrown if the response verification failedpublic Module updateModule(Module module) throws IOException, IotHubException
module - The module object containing updated dataIOException - This exception is thrown if the IO operation failedIotHubException - This exception is thrown if the response verification failedpublic void removeModule(String deviceId, String moduleId) throws IOException, IotHubException
deviceId - The device name associated with the module to be removedmoduleId - The module name to be removedIOException - This exception is thrown if the IO operation failedIotHubException - This exception is thrown if the response verification failedpublic void removeModule(Module module) throws IOException, IotHubException
module - The module to be removedIOException - This exception is thrown if the IO operation failedIotHubException - This exception is thrown if the response verification failedpublic RegistryJob exportDevices(String exportBlobContainerUri, boolean excludeKeys) throws IOException, IotHubException
exportBlobContainerUri - URI containing SAS token to a blob container where export data will be placedexcludeKeys - Whether the devices keys should be excluded from the exported data or notIOException - This exception is thrown if the IO operation failedIotHubException - This exception is thrown if the response verification failedpublic RegistryJob exportDevices(RegistryJob exportDevicesParameters) throws IOException, IotHubException
exportDevicesParameters - A RegistryJob 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 IOException - This exception is thrown if the IO operation failedIotHubException - This exception is thrown if the response verification failedpublic RegistryJob importDevices(String importBlobContainerUri, String outputBlobContainerUri) throws IOException, IotHubException
importBlobContainerUri - URI containing SAS token to a blob container that contains registry data to syncoutputBlobContainerUri - URI containing SAS token to a blob container where the result of the bulk import operation will be placedIOException - This exception is thrown if the IO operation failedIotHubException - This exception is thrown if the response verification failedpublic RegistryJob importDevices(RegistryJob importDevicesParameters) throws IOException, IotHubException
importDevicesParameters - A RegistryJob 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 IOException - This exception is thrown if the IO operation failedIotHubException - This exception is thrown if the response verification failedpublic RegistryJob getJob(String jobId) throws IOException, IotHubException
jobId - The id of the import/export job to be retrieved.IOException - This exception is thrown if the IO operation failedIotHubException - This exception is thrown if the response verification failedCopyright © 2024. All rights reserved.