Imported Upstream version 1.2.0
[platform/upstream/iotivity.git] / service / easy-setup / mediator / richsdk / android / EasySetupCore / src / main / jni / JniCloudPropProvisioningStatusListener.h
1 /******************************************************************
2  *
3  * Copyright 2016 Samsung Electronics All Rights Reserved.
4  *
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  *      http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  ******************************************************************/
19 /** @file   JniProvisioningStatusListener.h
20  *
21  *   @brief  This file contains JNI Provisioing status Listener class
22  */
23
24 #ifndef __JNI_ES_CLOUD_PROP_PROVISIONING_STATUS_LISTENER_H_
25 #define __JNI_ES_CLOUD_PROP_PROVISIONING_STATUS_LISTENER_H_
26
27 #include <jni.h>
28
29 #include "RemoteEnrollee.h"
30 #include "ESRichCommon.h"
31
32 #include "JniJvm.h"
33
34 class JniRemoteEnrollee;
35
36 using namespace OIC::Service;
37
38 /**
39  * @class   JniCloudPropProvisioningStatusListener
40  * @brief   This class provides functions for handling the cloud provisioning status callback between the Java and native layer
41  *
42  */
43 class JniCloudPropProvisioningStatusListener
44 {
45     public:
46         /**
47          * @brief constructor
48          */
49         JniCloudPropProvisioningStatusListener(JNIEnv *env, jobject jListener, JniRemoteEnrollee *resource);
50
51         /**
52          * @brief destructor
53         */
54         ~JniCloudPropProvisioningStatusListener();
55
56         /**
57          * @brief callback function that will be passed to Native layer
58         */
59         void onCloudPropProvisioningStatus (std::shared_ptr<CloudPropProvisioningStatus> cloudPropProvisioningStatus);
60
61     private:
62         jweak m_jwListener;
63         JniRemoteEnrollee *m_ownerResource;
64         void checkExAndRemoveListener(JNIEnv *env);
65 };
66
67 #endif //__JNI_ES_CLOUD_PROP_PROVISIONING_STATUS_LISTENER_H_
68