com.ibm.iotf.client.CustomAction Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of watson-iot Show documentation
Show all versions of watson-iot Show documentation
IBM Watson IoT client library to simplify device/gateway/application interactions with the IoT Platform
The newest version!
/**
*****************************************************************************
Copyright (c) 2017 IBM Corporation and other Contributors.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
Contributors:
Michael P Robertson - Initial Contribution
Sathiskumar Palaniappan - Initial Contribution
*****************************************************************************
*
*/
package com.ibm.iotf.client;
import com.google.gson.JsonObject;
/**
* This class encapsulates the custom actions.
*
*/
public interface CustomAction {
/**
* Status of the CustomAction when there is a failure,
*
* - 500 - if the operation fails for some reason
* - 501 - if the operation is not supported
*
*/
public enum Status {
OK(200), FAILED(500), UNSUPPORTED(501);
private final int rc;
private Status(int rc) {
this.rc = rc;
}
public int get() {
return rc;
}
}
/**
* Set the failure status of the current custom action
*
* The Custom Action handler must use this method to report
* the failure status back to IBM Watson IoT Platform whenever
* there is a failure.
*
* @param status Failure status of the current custom action
*/
public void setStatus(Status status) ;
/**
* Set the failure status of the current custom action
*
* The Custom Action handler must use this method to report
* the failure status back to IBM Watson IoT Platform whenever
* there is a failure.
*
* @param status Failure status of the current custom action
* @param message Failure message to be reported
*/
public void setStatus(Status status, String message);
public String getTypeId();
public String getDeviceId();
public String getBundleId();
public JsonObject getPayload();
public String getActionId();
public String getReqId();
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy