resource: Add test for ConstructResourceObject without coap scheme
[platform/upstream/iotivity.git] / service / things-manager / sdk / java / jni / tm / inc / jni_group_synchronization.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 Synchronization APIs
24  * for JNI implementation.
25  */
26
27 #ifndef JNI_GROUP_SYNCHRONIZATION_H_
28 #define JNI_GROUP_SYNCHRONIZATION_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 finding a specific remote group when a resource tries to join a group.
42  * Callback is called when a group is found or not.
43  *
44  * @param resourceTypes  - resource types of a group to find and join
45  *
46  * @return OCStackResult - return value of this API.
47  *                         It returns OC_STACK_OK if success.
48  *
49  * NOTE: It return OC_STACK ERROR when It was finding a group.
50  *       You should call this api when the group finding process has stopped.
51  *       OCStackResult is defined in ocstack.h.
52  */
53
54 JNIEXPORT jint JNICALL JNIGroupSynchronizationFindGroup
55 (JNIEnv *env, jobject interfaceObject, jobject resourceTypes);
56
57 /**
58  * API for creating a new group.
59  *
60  * @param resourceType   - resource type of a group to create
61  *
62  * @return OCStackResult - return value of this API.
63  *                         It returns OC_STACK_OK if success.
64  *
65  * NOTE: OCStackResult is defined in ocstack.h.
66  */
67 JNIEXPORT jint JNICALL JNIGroupSynchronizationCreateGroup
68 (JNIEnv *env, jobject interfaceObject, jstring resourceType);
69
70 /**
71  * API for joining a group. This API is used when a resource that has a group tries
72  * to find a specific remote resource and makes it join a group
73  *
74  * @param resourceType   - resource type of a group to join.
75  * @param resourceHandle - resource handle to join a group.
76  *
77  * @return OCStackResult - return value of this API.
78  *                         It returns OC_STACK_OK if success.
79  *
80  * NOTE: If you want to join the resource in the remote(other) process, use the API
81  *       jniThingsManagerJoinGroupObject instead of this.
82  *       OCStackResult is defined in ocstack.h.
83  */
84 JNIEXPORT jint JNICALL JNIGroupSynchronizationJoinGroupString
85 (JNIEnv *env, jobject interfaceObject, jstring resourceType, jobject resourceHandle);
86
87 /**
88  * API for joining a group. This API is used when a resource that
89  * doesn't have a group tries to find and join a specific remote group.
90  *
91  * @param resource       - group resource pointer to join.
92  * @param resourceHandle - resource handle to join a group.
93  *
94  * @return OCStackResult - return value of this API.
95  *                         It returns OC_STACK_OK if success.
96  *
97  * NOTE: NOTE: If you want to join the resource in the same process, use the API
98  *       jniThingsManagerJoinGroupString instead of this.
99  *       OCStackResult is defined in ocstack.h.
100  */
101 JNIEXPORT jint JNICALL JNIGroupSynchronizationJoinGroupObject
102 (JNIEnv *env, jobject interfaceObject, jobject resource, jobject resourceHandle);
103
104 /**
105  * API for leaving a joined group.
106  *
107  * @param resourceType   - resource type of a group to leave.
108  * @param resourceHandle - resource handle to join a group.
109  *
110  * @return OCStackResult - return value of this API.
111  *                         It returns OC_STACK_OK if success.
112  *
113  * NOTE: OCStackResult is defined in ocstack.h.
114  */
115 JNIEXPORT jint JNICALL JNIGroupSynchronizationLeaveGroup
116 (JNIEnv *env, jobject interfaceObject, jstring resourceType, jobject resourceHandle);
117
118 /**
119  * API for leaving a joined group.
120  *
121  * @param resource       - resource of a group to leave.
122  * @param resourceType   - resource type of a group to leave.
123  * @param resourceHandle - resource handle to join a group.
124  *
125  * @return OCStackResult - return value of this API.
126  *                         It returns OC_STACK_OK if success.
127  *
128  * NOTE: OCStackResult is defined in ocstack.h.
129  */
130 JNIEXPORT jint JNICALL JNIGroupSynchronizationLeaveGroupForResource
131 (JNIEnv *env, jobject interfaceObject, jobject resource, jstring resourceType,
132  jobject resourceHandle);
133
134 /**
135  * API for deleting a group.
136  *
137  * @param collectionResourceType - resource type of a group to delete.
138  *
139  * @return void
140  */
141 JNIEXPORT void JNICALL JNIGroupSynchronizationDeleteGroup
142 (JNIEnv *env, jobject interfaceObject, jstring collectionResourceType);
143
144 /**
145  * API for getting a list of joined groups.
146  *
147  * @return std::map - return value of this API.
148  *                  It returns group resource type and group resource handle as a map type.
149  */
150 JNIEXPORT jobject JNICALL JNIGroupSynchronizationGetGroupList
151 (JNIEnv *env, jobject interfaceObject);
152
153 #ifdef __cplusplus
154 }
155 #endif
156 #endif //JNI_GROUP_SYNCHRONIZATION_H_