public abstract class CustomActionHandler extends Object
If a Gateway or Device supports custom actions,
this abstract class CustomActionHandler
should be extended by the Gateway or Device code.
The handleCustomAction(com.ibm.wiotp.sdk.CustomAction)
must be implemented by the subclass to handle the actions sent by the IBM Watson IoT Platform.
| Constructor and Description |
|---|
CustomActionHandler() |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
handleCustomAction(CustomAction action)
Subclass must implement this method.
|
public abstract void handleCustomAction(CustomAction action)
If the device supports custom actions, subclass must add logic to take
the necessary action.
If the action attempt fails, the "rc" is set to 500 and the "message"
field should be set accordingly, if the action is not supported,
set "rc" to 501 and optionally set "message" accordingly
Gateway must use the class CustomAction to retrieve the
DeviceType and DeviceId for which the custom action request is received and act accordingly.
action - CustomAction where the device code can set the failure status and messageCustomActionCopyright © 2019. All rights reserved.