com.ibm.wiotp.sdk.devicemgmt

Class CustomActionHandler



  • 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 Detail

      • CustomActionHandler

        public CustomActionHandler()
    • Method Detail

      • handleCustomAction

        public abstract void handleCustomAction(CustomAction action)
        Subclass must implement this method.

        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.

        Parameters:
        action - CustomAction where the device code can set the failure status and message
        See Also:
        CustomAction

Copyright © 2019. All rights reserved.