1 //******************************************************************
3 // Copyright 2014 Intel Corporation All Rights Reserved.
4 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
6 package com.oc.ub.sample;
8 import com.oc.OCObserver;
9 import com.oc.annotations.OCInterface;
10 import com.oc.annotations.OCProperty;
13 * APPLICATION NOTE: This interface is exposed to via the framework because of the @OCInterface
14 * annotation. Without the annotation, this interface would be ignored by the framework.
16 * APPLICATION NOTE: This interface needs to be accessible on the client and the server as the
17 * contract for operation.
21 public interface LightControl {
23 * APPLICATION NOTE: This is a synchronous request. It will throw immediately if the stack is down
24 * or the network is otherwise not available. It may throw is the remote side does not responds or
27 * @param powered - The new power state of this implemented interface.
29 @OCProperty(name = "powered")
30 void setPowered(boolean powered);
33 * APPLICATION NOTE: This is a synchronous request. It will throw immediately if the stack is down
34 * or the network is otherwise not available. It may throw is the remote side does not responds or
37 * @return Returns power state of this implemented interface.
39 @OCProperty(name = "powered")
43 * APPLICATION NOTE: It is the objects responsibility to throw an exception (TBD) if it cannot
44 * handle an additional observers which will in turn return an error to the requestor.
46 * @param observer the observer that will be notified when a change to the power property has
49 @OCProperty(name = "powered")
50 void addPoweredObserver(OCObserver<Boolean> observer);
53 * APPLICATION NOTE: Even properties (or methods) that are not annotated are exposed, by default,
54 * via the framework. Getter and setter methods are assumed to be properties unless annotated
57 * @param level - Sets the power level of this implemented interface.
59 void setLevel(int level);
64 * APPLICATION NOTE: This is an example of a method. The annotation is not required except to
65 * override the defaults.