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 "RemoteEnrollee.h"
33 #include "ESException.h"
36 #include "JniEsUtils.h"
37 #include "JniProvisioningStatusListener.h"
38 #include "JniEsListenerManager.h"
40 using namespace OIC::Service;
43 * @class JniRemoteEnrollee
44 * @brief This class contains all the APIs for RemoteEnrollee
46 * NOTE: JNI APIs internally call the APIs of this class.
48 class JniRemoteEnrollee
55 JniRemoteEnrollee(std::shared_ptr< RemoteEnrollee> remoteEnrollee);
62 // ***** JNI APIs internally call the APIs of this class ***** //
64 void startProvisioning(JNIEnv *env);
65 void stopProvisioning(JNIEnv *env);
66 void registerProvisioningHandler(JNIEnv *env, jobject jListener);
68 JniProvisioningStatusListener *addProvisioningStatusListener(JNIEnv *env, jobject jListener);
69 void removeProvisioningStatusListener(JNIEnv *env, jobject jListener);
71 static JniRemoteEnrollee *getJniRemoteEnrollee(JNIEnv *env, jobject thiz);
74 JniEsListenerManager<JniProvisioningStatusListener> m_provisioingStatus;
75 std::shared_ptr<RemoteEnrollee> m_sharedResource;
85 * API for starting the provisioning process.
87 JNIEXPORT void JNICALL
88 Java_org_iotivity_service_easysetup_mediator_RemoteEnrollee_nativeStartProvision
89 (JNIEnv *env, jobject jClass);
92 * API for stopping the provisioning process.
94 JNIEXPORT void JNICALL
95 Java_org_iotivity_service_easysetup_mediator_RemoteEnrollee_nativeStopProvision
96 (JNIEnv *env, jobject jClass);
99 * API for setting the lisener for recieiving provisioning status.
101 * @param provisiongListener - Provisioning listener [callback from native layer will be passing to this listener]
103 JNIEXPORT void JNICALL
104 Java_org_iotivity_service_easysetup_mediator_RemoteEnrollee_nativeRegisterProvisioningHandler
105 (JNIEnv *env, jobject jClass, jobject provisiongListener);
110 #endif // __JNI_ES_REMOTEENROLLEE_H