All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.ibm.iotf.devicemgmt.DeviceAction Maven / Gradle / Ivy

Go to download

IBM Watson IoT client library to simplify device/gateway/application interactions with the IoT Platform

The newest version!
/**
 *****************************************************************************
 Copyright (c) 2015-16 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:
 Mike Tran - Initial Contribution
 Sathiskumar Palaniappan - Initial Contribution
 *****************************************************************************
 *
 */

package com.ibm.iotf.devicemgmt;

/**
 * This class encapsulates the device action like reboot and factory reset.
 * 
 */
public interface DeviceAction {
	/**
	 * 

Status of the DeviceAction when there is a failure,

*
    *
  • 500 - if the operation fails for some reason
  • *
  • 501 - if the operation is not supported
  • *
*/ public enum Status { ACCEPTED(202), 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 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.

* * @param status Failure status of the current device action */ public void setStatus(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.

* * @param status Failure status of the current device action * @param message Failure message to be reported */ public void setStatus(Status status, String message); public String getTypeId(); public String getDeviceId(); public void setMessage(String message); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy