Changed the folder structure and changed the shared library to static library
[platform/upstream/iotivity.git] / service / easy-setup / sdk / mediator / android / EasySetupCore / src / org / iotivity / service / easysetup / mediator / EasySetupCallbackHandler.java
1 /******************************************************************\r
2  *\r
3  * Copyright 2015 Samsung Electronics All Rights Reserved.\r
4  *\r
5  *\r
6  *\r
7  * Licensed under the Apache License, Version 2.0 (the "License");\r
8  * you may not use this file except in compliance with the License.\r
9  * You may obtain a copy of the License at\r
10  *\r
11  *      http://www.apache.org/licenses/LICENSE-2.0\r
12  *\r
13  * Unless required by applicable law or agreed to in writing, software\r
14  * distributed under the License is distributed on an "AS IS" BASIS,\r
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
16  * See the License for the specific language governing permissions and\r
17  * limitations under the License.\r
18  *\r
19  ******************************************************************/\r
20 package org.iotivity.service.easysetup.mediator;\r
21 \r
22 import android.util.Log;\r
23 \r
24 public class EasySetupCallbackHandler {\r
25     private static final String             TAG = "EasySetupCallbackHandler";\r
26     ProvisionEnrollee                       provisioningListener;\r
27 \r
28     private static EasySetupCallbackHandler easySetupCallbackHandlerObj;\r
29 \r
30     public static synchronized EasySetupCallbackHandler getInstance() {\r
31         if (null == easySetupCallbackHandlerObj) {\r
32             easySetupCallbackHandlerObj = new EasySetupCallbackHandler();\r
33         }\r
34         return easySetupCallbackHandlerObj;\r
35     }\r
36 \r
37     public void ProvisioningStatusCallBack(int statuscode) {\r
38         // TODO Auto-generated method stub\r
39         Log.d(TAG,\r
40                 "onFinishProvisioning() inside Android Java application. statuscode - "\r
41                         + statuscode);\r
42         if (this.provisioningListener != null) {\r
43             this.provisioningListener.ProvisioningStatusCallBack(statuscode);\r
44         } else {\r
45             Log.e(TAG, "provisioningListener is not registered");\r
46         }\r
47     }\r
48 \r
49     public void registerProvisioningHandler(\r
50             ProvisionEnrollee provisioningListener) {\r
51         this.provisioningListener = provisioningListener;\r
52     }\r
53 }\r