Java SDK and Eclipse plugin for simulator.
[platform/upstream/iotivity.git] / service / simulator / java / sdk / src / org / oic / simulator / clientcontroller / IObserveListener.java
1 /*
2  * Copyright 2015 Samsung Electronics All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 package org.oic.simulator.clientcontroller;
18
19 import org.oic.simulator.SimulatorResourceModel;
20
21 /**
22  * Provides interface for getting notification when resource model of an
23  * observed resource gets changed. An IObserveListener can be registered via the
24  * SimulatorRemoteResource observe call. Event listeners are notified
25  * asynchronously.
26  */
27 public interface IObserveListener {
28     /**
29      * This method will be called when there is a change in the resource model
30      * of the remote resource.
31      * 
32      * @param uId
33      *            Unique Id of the resource.
34      * @param representation
35      *            {@link SimulatorResourceModel}.
36      * @param sequenceNumber
37      *            Sequential number for ordering the model change notifications.
38      */
39     public void onObserveCompleted(String uId,
40             SimulatorResourceModel representation, int sequenceNumber);
41
42     /**
43      * Called when there is an error in observe request.
44      * 
45      * @param ex
46      *            Error information.
47      */
48     public void onObserveFailed(Throwable ex);
49 }