1 /******************************************************************
3 * Copyright 2016 Samsung Electronics All Rights Reserved.
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 /** @file JniRemoteEnrollee.h
23 * @brief This file contains the JniRemoteEnrollee class
24 * & declaration of RemoteEnrollee APIs for JNI implementation
27 #ifndef __JNI_ES_REMOTEENROLLEE_H
28 #define __JNI_ES_REMOTEENROLLEE_H
30 #include "ESRichCommon.h"
31 #include "ESException.h"
32 #include "RemoteEnrollee.h"
35 #include "JniEsUtils.h"
36 #include "JniGetEnrolleeStatusListener.h"
37 #include "JniGetConfigurationStatusListener.h"
38 #include "JniSecurityStatusListener.h"
39 #include "JniDevicePropProvisioningStatusListener.h"
40 #include "JniCloudPropProvisioningStatusListener.h"
41 #include "JniEsListenerManager.h"
43 using namespace OIC::Service;
46 * @class JniRemoteEnrollee
47 * @brief This class contains all the APIs for RemoteEnrollee
49 * NOTE: JNI APIs internally call the APIs of this class.
51 class JniRemoteEnrollee
58 JniRemoteEnrollee(std::shared_ptr< RemoteEnrollee> remoteEnrollee);
65 // ***** JNI APIs internally call the APIs of this class ***** //
66 void getStatus(JNIEnv *env, jobject jListener);
67 void getConfiguration(JNIEnv *env, jobject jListener);
68 void provisionSecurity(JNIEnv *env, jobject jListener);
69 void provisionDeviceProperties(JNIEnv *env, jobject jRepresentation, jobject jListener);
70 void provisionCloudProperties(JNIEnv *env, jobject jRepresentation,
75 static JniRemoteEnrollee *getJniRemoteEnrollee(JNIEnv *env, jobject thiz);
78 T *addStatusListener(JNIEnv *env, jobject jListener)
80 return JniEsListenerManager<T>().addListener(env, jListener, this);
84 void removeStatusListener(JNIEnv *env, jobject jListener)
86 JniEsListenerManager<T>().removeListener(env, jListener);
90 std::shared_ptr<RemoteEnrollee> m_sharedResource;
99 * API for starting the Request Enrollee status process.
101 JNIEXPORT void JNICALL
102 Java_org_iotivity_service_easysetup_mediator_RemoteEnrollee_nativeGetStatus
103 (JNIEnv *env, jobject jClass, jobject jListener);
106 * API for starting the Request EnrolleeConf process.
108 JNIEXPORT void JNICALL
109 Java_org_iotivity_service_easysetup_mediator_RemoteEnrollee_nativeGetConfiguration
110 (JNIEnv *env, jobject jClass, jobject jListener);
113 * API for starting the Sequrity provisioning process.
115 JNIEXPORT void JNICALL
116 Java_org_iotivity_service_easysetup_mediator_RemoteEnrollee_nativeProvisionSecurity
117 (JNIEnv *env, jobject jClass, jobject jListener);
120 * API for starting the Data provisioning process.
122 JNIEXPORT void JNICALL
123 Java_org_iotivity_service_easysetup_mediator_RemoteEnrollee_nativeProvisionDeviceProperties
124 (JNIEnv *env, jobject jClass, jobject jRepresentation, jobject jListener);
127 * API for starting the cloud provisioning process.
129 JNIEXPORT void JNICALL
130 Java_org_iotivity_service_easysetup_mediator_RemoteEnrollee_nativeProvisionCloudProperties
131 (JNIEnv *env, jobject jClass, jobject jRepresentation, jstring jCloudID, jint jCredID, jobject jListener);
136 #endif // __JNI_ES_REMOTEENROLLEE_H