| 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 | |
| 10 | #ifndef UPDATER_H |
| 11 | #define UPDATER_H |
| 12 | |
| 13 | #include "config.hpp" |
| 14 | #include "ip_addr_helper.hpp" |
| 15 | #include "httphelper.hpp" |
| 16 | #include "logger.hpp" |
| 17 | #include "serviceholder.hpp" |
| 18 | |
| 19 | #include <boost/shared_ptr.hpp> |
| 20 | |
| 21 | |
| 22 | class Updater |
| 23 | { |
| 24 | |
| 25 | private: |
| 26 | |
| 27 | Config::Ptr Conf; |
| 28 | IPAddrHelper::Ptr IPAddrHelp; |
| 29 | HTTPHelper::Ptr HTTPHelp; |
| 30 | Logger::Ptr Log; |
| 31 | Serviceholder::Ptr ServiceHolder; |
| 32 | |
| 33 | public: |
| 34 | |
| 35 | typedef boost::shared_ptr<Updater> Ptr; |
| 36 | |
| 37 | Updater(); |
| 38 | |
| 39 | ~Updater(); |
| 40 | |
| 41 | void update_services(bool changed_to_online) const; |
| 42 | |
| 43 | int init_config_from_cmd(int argc, char *argv[]) const; |
| 44 | |
| 45 | int init_config_from_files() const; |
| 46 | |
| 47 | Config::Ptr get_config() const; |
| 48 | |
| 49 | Logger::Ptr get_logger() const; |
| 50 | |
| 51 | Serviceholder::Ptr get_service_holder() const; |
| 52 | |
| 53 | int load_config(int argc, char *argv[]); |
| 54 | |
| 55 | int reload_config(); |
| 56 | |
| 57 | int init_helper_classes(); |
| 58 | |
| 59 | void init_log_facility() const; |
| 60 | |
| 61 | int init_ip_helper(); |
| 62 | |
| 63 | int init_http_helper(); |
| 64 | }; |
| 65 | |
| 66 | #endif |