2 ==================================================================================
4 Copyright (c) 2019-2020 AT&T Intellectual Property.
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
10 http://www.apache.org/licenses/LICENSE-2.0
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 ==================================================================================
21 * Mar, 2020 (Shraboni Jana)
36 #include <unordered_map>
37 #include "xapp_rmr.hpp"
38 #include "xapp_sdl.hpp"
39 #include "rapidjson/writer.h"
40 #include "rapidjson/document.h"
41 #include "rapidjson/error/error.h"
43 #include "msgs_proc.hpp"
44 #include "subs_mgmt.hpp"
45 #include "xapp_config.hpp"
47 #include "rnib/rnibreader.h"
50 using namespace std::placeholders;
51 using namespace rapidjson;
57 Xapp(XappSettings &, XappRmr &);
63 void startup(SubscriptionHandler &);
66 void start_xapp_receiver(XappMsgHandler &);
71 Xapp(Xapp const &)=delete;
72 Xapp& operator=(Xapp const &) = delete;
74 void register_handler(XappMsgHandler &fn){
75 _callbacks.emplace_back(fn);
79 void set_rnib_gnblist(void);
80 std::vector<std::string> get_rnib_gnblist(){ return rnib_gnblist; }
83 void startup_subscribe_requests(void );
84 void shutdown_subscribe_deletes(void);
85 void startup_get_policies(void );
89 XappSettings * config_ref;
90 SubscriptionHandler *subhandler_ref;
92 std::mutex *xapp_mutex;
93 std::vector<std::thread> xapp_rcv_thread;
94 std::vector<std::string> rnib_gnblist;
95 std::vector<XappMsgHandler> _callbacks;
99 #endif /* SRC_XAPP_HPP_ */