Commit | Line | Data |
---|---|---|
b1be615b BS |
1 | /** @file |
2 | * @brief The updater class header. This class represents the updater logic. | |
3 | * | |
4 | * | |
5 | * | |
6 | * @copyright Intra2net AG | |
7 | * @license GPLv2 | |
8 | */ | |
9 | ||
4545a371 BS |
10 | #ifndef UPDATER_H |
11 | #define UPDATER_H | |
12 | ||
4de6a9b8 BS |
13 | #include "config.hpp" |
14 | #include "ip_addr_helper.hpp" | |
15 | #include "httphelper.hpp" | |
16 | #include "logger.hpp" | |
17 | #include "serviceholder.hpp" | |
4545a371 | 18 | |
88a594e8 BS |
19 | #include <boost/shared_ptr.hpp> |
20 | ||
85a0abf9 | 21 | |
4248e8ca TJ |
22 | class Updater |
23 | { | |
88a594e8 | 24 | |
4545a371 | 25 | private: |
88a594e8 BS |
26 | |
27 | Config::Ptr Conf; | |
ad0e5016 | 28 | IPAddrHelper::Ptr IPAddrHelp; |
efbde536 | 29 | HTTPHelper::Ptr HTTPHelp; |
e0080b78 BS |
30 | Logger::Ptr Log; |
31 | Serviceholder::Ptr ServiceHolder; | |
4545a371 BS |
32 | |
33 | public: | |
88a594e8 BS |
34 | |
35 | typedef boost::shared_ptr<Updater> Ptr; | |
36 | ||
4545a371 BS |
37 | Updater(); |
38 | ||
4545a371 BS |
39 | ~Updater(); |
40 | ||
d55e13a6 | 41 | void update_services(bool changed_to_online) const; |
38060291 | 42 | |
08a5a621 | 43 | int init_config_from_cmd(int argc, char *argv[]) const; |
38060291 | 44 | |
08a5a621 | 45 | int init_config_from_files() const; |
3434b35f | 46 | |
b38684ce | 47 | Config::Ptr get_config() const; |
3434b35f | 48 | |
b38684ce | 49 | Logger::Ptr get_logger() const; |
c5675c01 | 50 | |
e0080b78 BS |
51 | Serviceholder::Ptr get_service_holder() const; |
52 | ||
efbde536 BS |
53 | int load_config(int argc, char *argv[]); |
54 | ||
667c672c | 55 | int reload_config(); |
8bca3c5d | 56 | |
efbde536 BS |
57 | int init_helper_classes(); |
58 | ||
c730deea | 59 | void init_log_facility() const; |
0665b239 BS |
60 | |
61 | int init_ip_helper(); | |
efbde536 BS |
62 | |
63 | int init_http_helper(); | |
4545a371 BS |
64 | }; |
65 | ||
66 | #endif |