1 //******************************************************************
3 // Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
7 // Licensed under the Apache License, Version 2.0 (the "License");
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
11 // http://www.apache.org/licenses/LICENSE-2.0
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an "AS IS" BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
19 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
21 package com.oc.ub.sample;
23 import com.oc.OCObserver;
24 import com.oc.annotations.OCInterface;
25 import com.oc.annotations.OCProperty;
28 * APPLICATION NOTE: This interface is exposed to via the framework because of the @OCInterface
29 * annotation. Without the annotation, this interface would be ignored by the framework.
31 * APPLICATION NOTE: This interface needs to be accessible on the client and the server as the
32 * contract for operation.
36 public interface LightControl {
38 * APPLICATION NOTE: This is a synchronous request. It will throw immediately if the stack is down
39 * or the network is otherwise not available. It may throw is the remote side does not responds or
42 * @param powered - The new power state of this implemented interface.
44 @OCProperty(name = "powered")
45 void setPowered(boolean powered);
48 * APPLICATION NOTE: This is a synchronous request. It will throw immediately if the stack is down
49 * or the network is otherwise not available. It may throw is the remote side does not responds or
52 * @return Returns power state of this implemented interface.
54 @OCProperty(name = "powered")
58 * APPLICATION NOTE: It is the objects responsibility to throw an exception (TBD) if it cannot
59 * handle an additional observers which will in turn return an error to the requestor.
61 * @param observer the observer that will be notified when a change to the power property has
64 @OCProperty(name = "powered")
65 void addPoweredObserver(OCObserver<Boolean> observer);
69 * @param observer the observer that will be no longer notified when a change to the power
70 * property has occurred.
72 @OCProperty(name = "powered")
73 void removePoweredObserver(OCObserver<Boolean> observer);
76 * APPLICATION NOTE: Even properties (or methods) that are not annotated are exposed, by default,
77 * via the framework. Getter and setter methods are assumed to be properties unless annotated
80 * @param level - Sets the power level of this implemented interface.
82 void setLevel(int level);
87 * APPLICATION NOTE: This is an example of a method. The annotation is not required except to
88 * override the defaults.