public class RegistryManager extends Object
| Constructor and Description |
|---|
RegistryManager() |
| 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
|
CompletableFuture<Device> |
addDeviceAsync(Device device)
Async wrapper for add() operation
|
void |
close()
Placeholder for close registry operations
|
static RegistryManager |
createFromConnectionString(String connectionString)
Static constructor to create instance from connection string
|
JobProperties |
exportDevices(String exportBlobContainerUri,
Boolean excludeKeys)
Create a bulk export job.
|
CompletableFuture<JobProperties> |
exportDevicesAsync(String exportBlobContainerUri,
Boolean excludeKeys)
Async wrapper for exportDevices() operation
|
Device |
getDevice(String deviceId)
Get device data by device Id from IotHub
|
CompletableFuture<Device> |
getDeviceAsync(String deviceId)
Async wrapper for getDevice() operation
|
String |
getDeviceConnectionString(Device device)
Return the iothub device connection string for a provided device.
|
ArrayList<Device> |
getDevices(Integer maxCount)
Get list of devices
|
CompletableFuture<ArrayList<Device>> |
getDevicesAsync(Integer maxCount)
Async wrapper for getDevices() operation
|
JobProperties |
getJob(String jobId)
Get the properties of an existing job.
|
CompletableFuture<JobProperties> |
getJobAsync(String jobId)
Async wrapper for getJob() operation
|
RegistryStatistics |
getStatistics()
Get device statistics
|
CompletableFuture<RegistryStatistics> |
getStatisticsAsync()
Async wrapper for getStatistics() operation
|
JobProperties |
importDevices(String importBlobContainerUri,
String outputBlobContainerUri)
Create a bulk import job.
|
CompletableFuture<JobProperties> |
importDevicesAsync(String importBlobContainerUri,
String outputBlobContainerUri)
Async wrapper for importDevices() operation
|
void |
open()
Placeholder for open registry operations
|
void |
removeDevice(String deviceId)
Remove device
|
CompletableFuture<Boolean> |
removeDeviceAsync(String deviceId)
Async wrapper for removeDevice() operation
|
Device |
updateDevice(Device device)
Update device not forced
|
Device |
updateDevice(Device device,
Boolean forceUpdate)
Update device with forceUpdate input parameter
|
CompletableFuture<Device> |
updateDeviceAsync(Device device)
Async wrapper for updateDevice() operation
|
CompletableFuture<Device> |
updateDeviceAsync(Device device,
Boolean forceUpdate)
Async wrapper for forced updateDevice() operation
|
public static RegistryManager createFromConnectionString(String connectionString) throws IOException
connectionString - The iot hub connection stringIOException - This exception is thrown if the object creation failedpublic void open()
public void close()
public Device addDevice(Device device) throws IOException, IotHubException, com.google.gson.JsonSyntaxException
device - The device object to addIOException - This exception is thrown if the IO operation failedIotHubException - This exception is thrown if the response verification failedcom.google.gson.JsonSyntaxExceptionpublic CompletableFuture<Device> addDeviceAsync(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, com.google.gson.JsonSyntaxException
deviceId - The id of requested deviceIOException - This exception is thrown if the IO operation failedIotHubException - This exception is thrown if the response verification failedcom.google.gson.JsonSyntaxExceptionpublic CompletableFuture<Device> getDeviceAsync(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 ArrayList<Device> getDevices(Integer maxCount) throws IOException, IotHubException, com.google.gson.JsonSyntaxException
maxCount - The requested count of devicesIOException - This exception is thrown if the IO operation failedIotHubException - This exception is thrown if the response verification failedcom.google.gson.JsonSyntaxExceptionpublic CompletableFuture<ArrayList<Device>> getDevicesAsync(Integer maxCount) throws IOException, IotHubException
maxCount - The requested count of devicesIOException - This exception is thrown if the IO operation failedIotHubException - This exception is thrown if the response verification failedpublic String getDeviceConnectionString(Device device)
device - The device object to get the connectionStringpublic 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 Device updateDevice(Device device, Boolean forceUpdate) throws IOException, IotHubException, com.google.gson.JsonSyntaxException
device - The device object containing updated dataforceUpdate - True if the update has to be forced regardless of the device stateIOException - This exception is thrown if the IO operation failedIotHubException - This exception is thrown if the response verification failedcom.google.gson.JsonSyntaxExceptionpublic CompletableFuture<Device> updateDeviceAsync(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 CompletableFuture<Device> updateDeviceAsync(Device device, Boolean forceUpdate) throws IOException, IotHubException
device - The device object containing updated dataforceUpdate - True is the update has to be forced regardless if the device stateIOException - 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 CompletableFuture<Boolean> removeDeviceAsync(String deviceId) throws IOException, IotHubException
deviceId - The device object 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, com.google.gson.JsonSyntaxException
IOException - This exception is thrown if the IO operation failedIotHubException - This exception is thrown if the response verification failedcom.google.gson.JsonSyntaxExceptionpublic CompletableFuture<RegistryStatistics> getStatisticsAsync() throws IOException, IotHubException
IOException - This exception is thrown if the IO operation failedIotHubException - This exception is thrown if the response verification failedpublic JobProperties exportDevices(String exportBlobContainerUri, Boolean excludeKeys) throws IllegalArgumentException, IOException, IotHubException, com.google.gson.JsonSyntaxException
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 notIllegalArgumentException - This exception is thrown if the exportBlobContainerUri or excludeKeys parameters are nullIOException - This exception is thrown if the IO operation failedIotHubException - This exception is thrown if the response verification failedcom.google.gson.JsonSyntaxExceptionpublic CompletableFuture<JobProperties> exportDevicesAsync(String exportBlobContainerUri, Boolean excludeKeys) throws IllegalArgumentException, IOException, IotHubException, com.google.gson.JsonSyntaxException
excludeKeys - if to exclude keys or notexportBlobContainerUri - the blob storage container URI to store at.IllegalArgumentException - This exception is thrown if the exportBlobContainerUri or excludeKeys parameters are nullIOException - This exception is thrown if the IO operation failedIotHubException - This exception is thrown if the response verification failedcom.google.gson.JsonSyntaxExceptionpublic JobProperties importDevices(String importBlobContainerUri, String outputBlobContainerUri) throws IllegalArgumentException, IOException, IotHubException, com.google.gson.JsonSyntaxException
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 placedIllegalArgumentException - This exception is thrown if the importBlobContainerUri or outputBlobContainerUri parameters are nullIOException - This exception is thrown if the IO operation failedIotHubException - This exception is thrown if the response verification failedcom.google.gson.JsonSyntaxExceptionpublic CompletableFuture<JobProperties> importDevicesAsync(String importBlobContainerUri, String outputBlobContainerUri) throws IllegalArgumentException, IOException, IotHubException, com.google.gson.JsonSyntaxException
importBlobContainerUri - Uri for importBlobContaineroutputBlobContainerUri - Uri for outputBlobContainerIllegalArgumentException - This exception is thrown if the exportBlobContainerUri or excludeKeys parameters are nullIOException - This exception is thrown if the IO operation failedIotHubException - This exception is thrown if the response verification failedcom.google.gson.JsonSyntaxExceptionpublic JobProperties getJob(String jobId) throws IllegalArgumentException, IOException, IotHubException, com.google.gson.JsonSyntaxException
jobId - The id of the job to be retrieved.IllegalArgumentException - This exception is thrown if the jobId parameter is nullIOException - This exception is thrown if the IO operation failedIotHubException - This exception is thrown if the response verification failedcom.google.gson.JsonSyntaxExceptionpublic CompletableFuture<JobProperties> getJobAsync(String jobId) throws IllegalArgumentException, IOException, IotHubException
jobId - jobID as StringIllegalArgumentException - This exception is thrown if the jobId parameter is nullIOException - This exception is thrown if the IO operation failedIotHubException - This exception is thrown if the response verification failedCopyright © 2017. All rights reserved.