2 * @brief The updater class implementation. This class implements the updater logic.
6 * @copyright Intra2net AG
12 #include <boost/foreach.hpp>
16 * Default constructor which initializes the member Conf.
21 LoggerPtr _log(new Logger);
25 ConfigPtr _config(new Config(Log));
28 Log->print_constructor_call("Updater");
37 Log->print_destructor_call("Updater");
42 * Parse the command line arguments and initialize corresponding options.
43 * @param argc Number command line arguments.
44 * @param argv[] Array with arguments.
45 * @return 0 if cmd options successfully parsed, 1 if usage or version.
47 int Updater::init_config_from_cmd(int argc, char *argv[])
49 // Load the command line parameters
50 if( Conf->parse_cmd_line( argc, argv ) != 0)
54 Log->print_cmd_parsed();
60 * Load the main config and the service definition files in config path.
61 * @return 0 if all is fine,
63 int Updater::init_config_from_files()
65 // Load the main and service config files in config path
66 if( Conf->load_config_from_files() != 0)
75 * Update all configured services.
77 void Updater::update_services()
79 list<ServicePtr> services = this->Conf->get_services();
81 string ip = "192.168.1.1";
83 BOOST_FOREACH( ServicePtr service, services )