Imported Upstream version 0.9.1
[platform/upstream/iotivity.git] / service / things-manager / sdk / java / src / org / iotivity / service / tm / IActionListener.java
1 /******************************************************************
2  *
3  * Copyright 2015 Samsung Electronics All Rights Reserved.
4  *
5  *
6  *
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
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  ******************************************************************/
20
21 /**
22  * @file   IActionListener.java
23  *
24  * @brief  This file provides interface for receiving the callback for the GET, PUT and POST requested
25  *        actions.
26  *
27  */
28
29 package org.iotivity.service.tm;
30
31 import java.util.Vector;
32
33 import org.iotivity.base.OcHeaderOption;
34 import org.iotivity.base.OcRepresentation;
35
36 /**
37  * Provides interface for receiving the callback for the GET, PUT and
38  * POST requested actions.
39  */
40 public interface IActionListener {
41     /**
42      * This callback method is called when a asynchronous response for the getActionSet
43      * request is received.
44      *
45      * @param headerOptions
46      *            It comprises of optionID and optionData as members.
47      * @param rep
48      *            Configuration parameters are carried as a pair of attribute
49      *            key and value in a form of OCRepresentation instance.
50      * @param errorValue
51      *            error code.
52      *
53      */
54     public void onGetResponseCallback(Vector<OcHeaderOption> headerOptions,
55             OcRepresentation rep, int errorValue);
56
57     /**
58      * This callback method is called when a asynchronous response for the addActionSet
59      * request is received.
60      *
61      * @param headerOptions
62      *            It comprises of optionID and optionData as members.
63      * @param rep
64      *            Configuration parameters are carried as a pair of attribute
65      *            key and value in a form of OCRepresentation instance.
66      * @param errorValue
67      *            error code.
68      *
69      */
70     public void onPutResponseCallback(Vector<OcHeaderOption> headerOptions,
71             OcRepresentation rep, int errorValue);
72
73     /**
74      * This callback method is called when a asynchronous response for the executeActionSet
75      * or deleteActionSet request is received.
76      *
77      * @param headerOptions
78      *            It comprises of optionID and optionData as members.
79      * @param rep
80      *            Configuration parameters are carried as a pair of attribute
81      *            key and value in a form of OCRepresentation instance.
82      * @param errorValue
83      *            error code.
84      *
85      */
86     public void onPostResponseCallback(Vector<OcHeaderOption> headerOptions,
87             OcRepresentation rep, int errorValue);
88 }