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

com.ibm.iotf.devicemgmt.DeviceActionHandler 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;

/**
 * 

If a Gateway or Device supports device actions like reboot and factory reset, * this abstract class DeviceActionHandler * should be extended by the Gateway or Device code.

* *

The {@link com.ibm.iotf.devicemgmt.DeviceActionHandler#handleReboot} and * {@link com.ibm.iotf.devicemgmt.DeviceActionHandler#handleFactoryReset} * must be implemented by the subclass to handle the actions sent by the IBM Watson IoT Platform.

* */ public abstract class DeviceActionHandler { /** * Subclass must implement this method. *

If the device supports reboot, subclass must add logic to reboot the * device. *
*
* If reboot attempt fails, the "rc" is set to 500 and the "message" * field should be set accordingly, if the reboot is not supported, * set "rc" to 501 and optionally set "message" accordingly

* *

Gateway must use the class {@link com.ibm.iotf.devicemgmt.DeviceAction} to retrieve the * DeviceType and DeviceId for which the reboot request is received and act accordingly.

* * @param action DeviceAction where the device code can set the failure status and message * @see DeviceAction */ public abstract void handleReboot(DeviceAction action); /** * Subclass must implement this method. *

If the device supports factory reset, subclass must add logic to reset the * device to factory settings *
*
* If the factory reset attempt fails, the "rc" should be 500 and the "message" * field should be set accordingly, if the factory reset action is not supported, * set "rc" to 501 and optionally set "message" accordingly.

* *

Gateway must use the class {@link com.ibm.iotf.devicemgmt.DeviceAction} to retrieve the * DeviceType and DeviceId for which the Factory reset request is received and act accordingly.

* * @param action DeviceAction where the device code can set the failure status and message * @see DeviceAction */ public abstract void handleFactoryReset(DeviceAction action); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy