public class ConcreteCustomAction extends Object implements CustomAction
CustomAction.Status| Modifier and Type | Field and Description |
|---|---|
static String |
DEVICE_ACTION_STATUS_UPDATE |
| Constructor and Description |
|---|
ConcreteCustomAction(String typeId,
String deviceId) |
| Modifier and Type | Method and Description |
|---|---|
void |
addPropertyChangeListener(PropertyChangeListener listener)
Add a new listener to be notified when device action status is changed.
|
void |
clearListener() |
void |
fireEvent(String event)
Trigger the notification message - This method should only be used by the library code
|
String |
getActionId() |
String |
getBundleId() |
String |
getDeviceId() |
com.google.gson.JsonObject |
getPayload() |
String |
getReqId() |
int |
getStatus() |
String |
getTypeId() |
void |
setActionId(String actionId) |
void |
setBundleId(String bundleId) |
void |
setPayload(com.google.gson.JsonObject payload) |
void |
setReqId(String reqId) |
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. |
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. |
com.google.gson.JsonObject |
toJsonObject()
Return the
JsonObject representation of the Listener Response object. |
String |
toString()
Return the JSON string of the
Listener Response object. |
public static final String DEVICE_ACTION_STATUS_UPDATE
public String getBundleId()
getBundleId in interface CustomActionpublic void setBundleId(String bundleId)
public String getActionId()
getActionId in interface CustomActionpublic void setActionId(String actionId)
public String getReqId()
getReqId in interface CustomActionpublic void setReqId(String reqId)
public String getTypeId()
getTypeId in interface CustomActionpublic String getDeviceId()
getDeviceId in interface CustomActionpublic 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.
setStatus in interface CustomActionstatus - Failure status of the current device actionpublic 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.
setStatus in interface CustomActionstatus - Failure status of the current device actionmessage - Failure message to be reportedpublic com.google.gson.JsonObject getPayload()
getPayload in interface CustomActionpublic void fireEvent(String event)
event - event to be firedpublic void addPropertyChangeListener(PropertyChangeListener listener)
listener - PropertyChangeListenerpublic void clearListener()
public com.google.gson.JsonObject toJsonObject()
JsonObject representation of the Listener Response object.public String toString()
Listener Response object.public int getStatus()
public void setPayload(com.google.gson.JsonObject payload)
Copyright © 2019. All rights reserved.