com.ibm.wiotp.sdk.devicemgmt.internal

Class ConcreteCustomAction

  • All Implemented Interfaces:
    CustomAction


    public class ConcreteCustomAction
    extends Object
    implements CustomAction
    This class encapsulates the custom device actions like reboot and factory reset.
    • Constructor Detail

      • ConcreteCustomAction

        public ConcreteCustomAction(String typeId,
                                    String deviceId)
    • Method Detail

      • setBundleId

        public void setBundleId(String bundleId)
      • setActionId

        public void setActionId(String actionId)
      • setReqId

        public void setReqId(String reqId)
      • setStatus

        public void setStatus(CustomAction.Status status)

        Set the failure status of the current device action
        The Device Action handler must use this method to report the failure status back to IBM Watson IoT Platform whenever there is a failure.

        Specified by:
        setStatus in interface CustomAction
        Parameters:
        status - Failure status of the current device action
      • setStatus

        public void setStatus(CustomAction.Status status,
                              String message)

        Set the failure status of the current device action
        The Device Action handler must use this method to report the failure status back to IBM Watson IoT Platform whenever there is a failure.

        Specified by:
        setStatus in interface CustomAction
        Parameters:
        status - Failure status of the current device action
        message - Failure message to be reported
      • getPayload

        public com.google.gson.JsonObject getPayload()
        Specified by:
        getPayload in interface CustomAction
      • fireEvent

        public void fireEvent(String event)
        Trigger the notification message - This method should only be used by the library code
        Parameters:
        event - event to be fired
      • addPropertyChangeListener

        public void addPropertyChangeListener(PropertyChangeListener listener)
        Add a new listener to be notified when device action status is changed.
        Parameters:
        listener - PropertyChangeListener
      • clearListener

        public void clearListener()
      • toJsonObject

        public com.google.gson.JsonObject toJsonObject()
        Return the JsonObject representation of the Listener Response object.
        Returns:
        JsonObject object
      • toString

        public String toString()
        Return the JSON string of the Listener Response object.
        Overrides:
        toString in class Object
      • getStatus

        public int getStatus()
      • setPayload

        public void setPayload(com.google.gson.JsonObject payload)

Copyright © 2019. All rights reserved.