com.ibm.wiotp.sdk.devicemgmt.internal

Class ConcreteDeviceAction

  • All Implemented Interfaces:
    DeviceAction


    public class ConcreteDeviceAction
    extends Object
    implements DeviceAction
    This class encapsulates the device action like reboot and factory reset.
    • Constructor Detail

      • ConcreteDeviceAction

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

      • setStatus

        public void setStatus(DeviceAction.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 DeviceAction
        Parameters:
        status - Failure status of the current device action
      • setStatus

        public void setStatus(DeviceAction.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 DeviceAction
        Parameters:
        status - Failure status of the current device action
        message - Failure message to be reported
      • getMessage

        public String getMessage()
      • 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()

Copyright © 2019. All rights reserved.