Imported Upstream version 1.0.0
[platform/upstream/iotivity.git] / service / things-manager / sdk / java / jni / tm / inc / jni_group_manager.h
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
23  * This file contains the declaration of Group Manager APIs
24  * for JNI implementation.
25  */
26
27 #ifndef JNI_GROUP_MANAGER_H_
28 #define JNI_GROUP_MANAGER_H_
29
30 #include <stdio.h>
31 #include <string.h>
32
33 #include <jni.h>
34 #include <jni_string.h>
35
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39
40 /**
41  * API for discoverying candidate resources.
42  *
43  * @param resourceTypes  - required resource types(called "candidate")
44  * @param waitSec        - Delay time in seconds to add before starting to find the resources in network.
45  *
46  * @return OCStackResult - return value of this API.
47  *                         It returns OC_STACK_OK if success.
48  *
49  * NOTE: OCStackResult is defined in ocstack.h.
50  */
51 JNIEXPORT jint JNICALL JNIGroupManagerFindCandidateResource
52 (JNIEnv *env, jobject interfaceObject, jobject resourceTypes, jint waitSec);
53
54 /**
55  * API for subscribing child's state.
56  *
57  * @param resource       - collection resource for subscribing presence of all child resources.
58  *
59  * @return OCStackResult - return value of this API.
60  *                         It returns OC_STACK_OK if success.
61  *
62  * NOTE: OCStackResult is defined in ocstack.h.
63  */
64 JNIEXPORT jint JNICALL JNIGroupManagerSubscribeCollectionPresence
65 (JNIEnv *env, jobject interfaceObject, jobject resource);
66
67
68 /**
69  * API for register and bind resource to group.
70  *
71  * @param resource         - resource for register and bind to group. It has all data.
72  * @param collectionHandle - collection resource handle. It will be added child resource.
73  *
74  * @return childHandle     - child resource handle.
75  *
76  * NOTE: OCStackResult is defined in ocstack.h.
77  */
78 JNIEXPORT jobject JNICALL JNIGroupManagerBindResourceToGroup
79 (JNIEnv *env, jobject interfaceObject, jobject resource, jobject collectionHandle);
80
81 /**
82  * API for adding an Action Set.
83  *
84  * @param resource       - resource type representing the target group
85  * @param newActionSet   - list of Action Set to be added
86  *
87  * @return OCStackResult - return value of this API.
88  *                         It returns OC_STACK_OK if success.
89  *
90  * NOTE: OCStackResult is defined in ocstack.h.
91  */
92
93 JNIEXPORT jint JNICALL JNIGroupManagerAddActionSet
94 (JNIEnv *env, jobject interfaceObject, jobject resource, jobject newActionSet);
95
96 /**
97  * API for executing the Action Set.
98  *
99  * @param resource       - resource type representing the target group
100  * @param actionSetName  - Action Set name for executing the Action set
101  *
102  * @return OCStackResult - return value of this API.
103  *                         It returns OC_STACK_OK if success.
104  *
105  * NOTE: OCStackResult is defined in ocstack.h.
106  */
107 JNIEXPORT jint JNICALL JNIGroupManagerExecuteActionSet
108 (JNIEnv *env, jobject interfaceObject, jobject resource, jstring actionSetName);
109
110 /**
111  * API for executing the Action Set.
112  *
113  * @param resource       - resource type representing the target group
114  * @param actionSetName  - Action Set name for executing the Action set
115  * @param delay          - waiting time for until action set run.
116  *
117  * @return OCStackResult - return value of this API.
118  *                         It returns OC_STACK_OK if success.
119  *
120  * NOTE: OCStackResult is defined in ocstack.h.
121  */
122 JNIEXPORT jint JNICALL JNIGroupManagerExecuteActionSetWithDelay
123 (JNIEnv *env, jobject interfaceObject, jobject resource, jstring actionSetName, jlong delay);
124
125 /**
126  * API for cancelling the Action Set.
127  *
128  * @param resource       - resource type representing the target group
129  * @param actionSetName  - Action Set name for cancelling the Action set
130  *
131  * @return OCStackResult - return value of this API.
132  *                         It returns OC_STACK_OK if success.
133  *
134  * NOTE: OCStackResult is defined in ocstack.h.
135  */
136 JNIEXPORT jint JNICALL JNIGroupManagerCancelActionSet
137 (JNIEnv *env, jobject interfaceObject, jobject resource, jstring actionSetName);
138
139
140 /**
141  * API for reading the Action Set.
142  *
143  * @param resource       - resource type representing the target group
144  * @param actionSetName  - Action Set name for reading the Action set
145  *
146  * @return OCStackResult - return value of this API.
147  *                         It returns OC_STACK_OK if success.
148  *
149  * NOTE: OCStackResult is defined in ocstack.h.
150  */
151 JNIEXPORT jint JNICALL JNIGroupManagerGetActionSet
152 (JNIEnv *env, jobject interfaceObject, jobject resource, jstring actionSetName);
153
154 /**
155  * API for removing the Action Set.
156  *
157  * @param resource       - resource type representing the target group
158  * @param actionSetName  - Action Set name for removing the Action set
159  *
160  * @return OCStackResult - return value of this API.
161  *                         It returns OC_STACK_OK if success.
162  *
163  * NOTE: OCStackResult is defined in ocstack.h.
164  */
165 JNIEXPORT jint JNICALL JNIGroupManagerDeleteActionSet
166 (JNIEnv *env, jobject interfaceObject, jobject resource, jstring actionSetName);
167
168 #ifdef __cplusplus
169 }
170 #endif
171 #endif //JNI_GROUP_MANAGER_H_