Imported Upstream version 1.0.0
[platform/upstream/iotivity.git] / service / things-manager / sdk / java / jni / tm / inc / jni_things_maintenance_callbacks.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 ThingsMaintenanceCallbacks class.
24  */
25
26 #ifndef JNI_THINGS_MAINTENANCE_CALLBACKS_H_
27 #define JNI_THINGS_MAINTENANCE_CALLBACKS_H_
28
29 #include <string>
30
31 #include "ThingsMaintenance.h"
32
33 /**
34  * This class provides a set of callback functions for things maintenance.
35  */
36 class ThingsMaintenanceCallbacks
37 {
38
39     public:
40         ThingsMaintenanceCallbacks() {}
41         virtual ~ThingsMaintenanceCallbacks() {}
42
43         /**
44          * This callback method is called when a response for the reboot request
45          * just arrives.
46          *
47          * @param headerOptions - It comprises of optionID and optionData as members.
48          * @param rep           - Configuration parameters are carried as a pair of attribute key and value
49          *                        in a form of OCRepresentation instance.
50          * @param eCode         - error code.
51          */
52         static void onRebootResponse(const OC::HeaderOptions &headerOptions,
53                                      const OC::OCRepresentation &rep,
54                                      const int eCode);
55
56         /**
57          * This callback method is called when a response for the factoryReset request
58          * just arrives.
59          *
60          * @param headerOptions - It comprises of optionID and optionData as members.
61          * @param rep           - Configuration parameters are carried as a pair of attribute key and value
62          *                        in a form of OCRepresentation instance.
63          * @param eCode         - error code.
64          */
65         static void onFactoryResetResponse(const OC::HeaderOptions &headerOptions,
66                                            const OC::OCRepresentation &rep,
67                                            const int eCode);
68
69         /**
70          * This method invokes the Callback function with particular name and signature.
71          *
72          * @param headerOptions - It comprises of optionID and optionData as members.
73          * @param rep           - Configuration parameters are carried as a pair of attribute key and value
74          *                        in a form of OCRepresentation instance.
75          * @param eCode         - error code.
76          * @param callbackName  - callbackName to be invoked.
77          * @param signature     - Signature of the callback method to be called.
78          */
79         static void invokeCallback(const OC::HeaderOptions &headerOptions,
80                                    const OC::OCRepresentation &rep, const int eCode,
81                                    const char *callbackName, const char *signature);
82 };
83 #endif //JNI_THINGS_MAINTENANCE_CALLBACKS_H_