fix typo from clear_session to clean_session
[platform/core/ml/aitt.git] / common / AittOption.cc
1 /*
2  * Copyright (c) 2022 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #include "AittOption.h"
17
18 #include "aitt_internal.h"
19
20 AittOption::AittOption() : clean_session_(false), use_custom_broker(false)
21 {
22 }
23
24 AittOption::AittOption(bool clean_session, bool use_custom_mqtt_broker)
25       : clean_session_(clean_session), use_custom_broker(use_custom_mqtt_broker)
26 {
27 }
28
29 void AittOption::SetCleanSession(bool val)
30 {
31     clean_session_ = val;
32 }
33
34 bool AittOption::GetCleanSession() const
35 {
36     return clean_session_;
37 }
38
39 void AittOption::SetUseCustomMqttBroker(bool val)
40 {
41     use_custom_broker = val;
42 }
43
44 bool AittOption::GetUseCustomMqttBroker() const
45 {
46     return use_custom_broker;
47 }
48
49 void AittOption::SetServiceID(const std::string& id)
50 {
51     RET_IF(false == use_custom_broker);
52     service_id = id;
53 }
54
55 const char* AittOption::GetServiceID() const
56 {
57     return service_id.c_str();
58 }
59
60 void AittOption::SetLocationID(const std::string& id)
61 {
62     RET_IF(false == use_custom_broker);
63     location_id = id;
64 }
65
66 const char* AittOption::GetLocationID() const
67 {
68     return location_id.c_str();
69 }
70
71 void AittOption::SetRootCA(const std::string& ca)
72 {
73     RET_IF(false == use_custom_broker);
74     root_ca = ca;
75 }
76
77 const char* AittOption::GetRootCA() const
78 {
79     return root_ca.c_str();
80 }
81
82 void AittOption::SetCustomRWFile(const std::string& file)
83 {
84     RET_IF(false == use_custom_broker);
85     custom_rw_file = file;
86 }
87
88 const char* AittOption::GetCustomRWFile() const
89 {
90     return custom_rw_file.c_str();
91 }