public class IotManager
extends java.lang.Object
implements android.arch.lifecycle.LifecycleObserver
IotManager class collects all of the APIs related to IoT device management. IoT
device management includes processes such as adding an IoT device, getting IoT information,
updating IoT information, and deleting an IoT device from the user account. Each account is tied
to a single user. All of these methods will be executed on a background thread and return the
result on the main thread. To receive the result, you are expected to pass a corresponding
SingleCallback or CompleteCallback.| Constructor and Description |
|---|
IotManager(android.support.v7.app.AppCompatActivity appCompatActivity)
Constructor for an
IotManager object with the lifecycle set. |
IotManager(android.support.v4.app.Fragment fragment)
Constructor for an
IotManager object with the lifecycle set. |
IotManager(android.arch.lifecycle.Lifecycle lifecycle)
Constructor for an
IotManager object with the lifecycle set. |
| Modifier and Type | Method and Description |
|---|---|
void |
addIotDevice(IotParam iotParam,
CompleteCallback callback)
Returns a
CompleteCallback after adding an IoT device to a user account. |
void |
deleteIotDevice(java.lang.String iotUuid,
CompleteCallback callback)
Returns a
CompleteCallback after deleting an IoT device from a user account. |
void |
listIotDevices(SingleCallback<java.util.List<IotDeviceEntity>> callback)
Returns the
List of IotDeviceEntity objects for a user account. |
void |
listSecondaryDriverByIotId(java.lang.String iotId,
SingleCallback<java.util.List<OwnerEntity>> callback)
Returns the
List of secondary OwnerEntity objects for a IoT device. |
void |
updateIotDevice(java.lang.String iotUuid,
java.lang.String iotName,
CompleteCallback callback)
Returns a
CompleteCallback after updating an IoT device for a user account. |
public IotManager(android.arch.lifecycle.Lifecycle lifecycle)
IotManager object with the lifecycle set.lifecycle - See Lifecyclepublic IotManager(android.support.v7.app.AppCompatActivity appCompatActivity)
IotManager object with the lifecycle set.appCompatActivity - See AppCompatActivitypublic IotManager(android.support.v4.app.Fragment fragment)
IotManager object with the lifecycle set.fragment - See Fragmentpublic void addIotDevice(IotParam iotParam, CompleteCallback callback)
CompleteCallback after adding an IoT device to a user account.iotParam - the parameters for the IoT device addition. See IotParamcallback - the callback to receive the result of adding an IoT device to a user accountpublic void deleteIotDevice(@Nonnull
java.lang.String iotUuid,
CompleteCallback callback)
CompleteCallback after deleting an IoT device from a user account.iotUuid - the universally unique identifier (UUID) of the IoT devicecallback - the callback to receive the result of deleting an IoT device from a user
accountpublic void listIotDevices(SingleCallback<java.util.List<IotDeviceEntity>> callback)
List of IotDeviceEntity objects for a user account.callback - the callback to receive the List of IotDeviceEntity objectspublic void listSecondaryDriverByIotId(@Nonnull
java.lang.String iotId,
SingleCallback<java.util.List<OwnerEntity>> callback)
List of secondary OwnerEntity objects for a IoT device.iotId - the identification number of the IoT devicecallback - the callback to receive the secondary List of OwnerEntity
objects for an IoT devicepublic void updateIotDevice(@Nonnull
java.lang.String iotUuid,
java.lang.String iotName,
CompleteCallback callback)
CompleteCallback after updating an IoT device for a user account.iotUuid - the universally unique identification number (UUID) of the updated IoT deviceiotName - the name of the updated IoT devicecallback - the callback to receive the result of updating an IoT device for a user
account