*/
int Config::load_config_from_files(string config_path)
{
- fs::path full_config_path = fs::system_complete(fs::path(config_path));
+/* fs::path full_config_path = fs::system_complete(fs::path(config_path));
if( fs::exists(full_config_path) && fs::is_directory(full_config_path))
{
return 4;
}
-
+*/
// then load all service definition files in config path
// TODO: code to load service definition files in config path
- return -1;
+ return 0;
}
-//
-// C++ Implementation: dhs
-//
-// Description:
-//
-//
-// Author: Bjoern Sikora <bjoern.sikora@intra2net.com>, (C) 2009
-//
-// Copyright: See COPYING file that comes with this distribution
-//
-//
+/** @file
+ * @brief DHS Service class implementation. This class represents the DHS service.
+ *
+ *
+ *
+ * @copyright Intra2net AG
+ * @license GPLv2
+*/
+
#include "dhs.h"
-DHS::DHS(string _hostname, string login, string password)
+
+/**
+ * Default constructor.
+ */
+DHS::DHS()
+{
+}
+
+
+/**
+ * Constructor.
+ * @param _hostname The hostname to update
+ * @param _login The login name.
+ * @param _password The corresponding password.
+ */
+DHS::DHS(string _hostname, string _login, string _password)
{
- // Vielleicht: Hostname = _hostname;
- this->hostname = _hostname;
- this->login = login;
- this->password = password;
+ Hostname = _hostname;
+ Login = _login;
+ Password = _password;
}
+
+/**
+ * Default destructor
+ */
DHS::~DHS()
{
}
-void DHS::update(string)
+
+/**
+ * Service update method which should implement the corresponding service protocol.
+ * @param ip The new ip to set for the hostname.
+ */
+void DHS::update(string ip)
{
cout << "Running Update for Service DHS" << endl;
- cout << "Hostname: " << this->hostname << endl;
- cout << "Login: " << this->login << endl;
- cout << "Password: " << this->password << endl;
+ cout << "Hostname: " << Hostname << endl;
+ cout << "Login: " << Login << endl;
+ cout << "Password: " << Password << endl;
}
-//
-// C++ Interface: dhs
-//
-// Description:
-//
-//
-// Author: Bjoern Sikora <bjoern.sikora@intra2net.com>, (C) 2009
-//
-// Copyright: See COPYING file that comes with this distribution
-//
-//
+/** @file
+ * @brief DHS Service class header. This class represents the DHS service.
+ *
+ *
+ *
+ * @copyright Intra2net AG
+ * @license GPLv2
+*/
+
#ifndef DHS_H
#define DHS_H
using namespace std;
-/**
- @author Bjoern Sikora <bjoern.sikora@intra2net.com>
-*/
-class DHS : public Service {
+class DHS : public Service
+{
private:
- string hostname;
- string login;
- string password;
+ string Hostname;
+ string Login;
+ string Password;
public:
+ DHS();
+
DHS(string,string,string);
~DHS();
+/** @file
+ * @brief The main function.
+ *
+ *
+ *
+ * @copyright Intra2net AG
+ * @license GPLv2
+*/
#ifdef HAVE_CONFIG_H
#include <config.h>
using namespace std;
/**
- * @brief the main part.
- * @param argc number of arguments
- * @param argv command line arguments
- * @return exit code for the process.
+ * @brief The main part.
+ * @param argc Number of arguments
+ * @param argv Command line arguments
+ * @return 0 if all is fine.
*/
int main(int argc, char *argv[])
{
-//
-// C++ Implementation: ods
-//
-// Description:
-//
-//
-// Author: Bjoern Sikora <bjoern.sikora@intra2net.com>, (C) 2009
-//
-// Copyright: See COPYING file that comes with this distribution
-//
-//
+/** @file
+ * @brief ODS Service class implementation. This class represents the ODS service.
+ *
+ *
+ *
+ * @copyright Intra2net AG
+ * @license GPLv2
+*/
+
#include "ods.h"
-ODS::ODS(string hostname, string login, string password)
+/**
+ * Default constructor.
+ */
+ODS::ODS()
{
- this->hostname = hostname;
- this->login = login;
- this->password = password;
}
-ODS::~ODS()
+
+/**
+ * Constructor.
+ * @param _hostname The hostname to update
+ * @param _login The login name.
+ * @param _password The corresponding password.
+ */
+ODS::ODS(string _hostname, string _login, string _password)
{
+ Hostname = _hostname;
+ Login = _login;
+ Password = _password;
}
-void ODS::update(string)
+
+/**
+ * Default destructor.
+ */
+ODS::~ODS()
{
- // Service protocol definition should start here
+}
+
+/**
+ * Service update method which should implement the corresponding service protocol.
+ * @param ip The new ip to set for the hostname.
+ */
+void ODS::update(string ip)
+{
cout << "Running Update for Service ODS" << endl;
- cout << "Hostname: " << this->hostname << endl;
- cout << "Login: " << this->login << endl;
- cout << "Password: " << this->password << endl;
+ cout << "Hostname: " << Hostname << endl;
+ cout << "Login: " << Login << endl;
+ cout << "Password: " << Password << endl;
}
-//
-// C++ Interface: ods
-//
-// Description:
-//
-//
-// Author: Bjoern Sikora <bjoern.sikora@intra2net.com>, (C) 2009
-//
-// Copyright: See COPYING file that comes with this distribution
-//
-//
+/** @file
+ * @brief ODS Service class header. This class represents the ODS service.
+ *
+ *
+ *
+ * @copyright Intra2net AG
+ * @license GPLv2
+*/
+
#ifndef ODS_H
#define ODS_H
using namespace std;
-/**
- @author Bjoern Sikora <bjoern.sikora@intra2net.com>
-*/
class ODS : public Service
{
private:
- string hostname;
- string login;
- string password;
+ string Hostname;
+ string Login;
+ string Password;
public:
+ ODS();
+
ODS(string,string,string);
~ODS();
-//
-// C++ Implementation: service
-//
-// Description:
-//
-//
-// Author: Bjoern Sikora <bjoern.sikora@intra2net.com>, (C) 2009
-//
-// Copyright: See COPYING file that comes with this distribution
-//
-//
+/** @file
+ * @brief The abstract service interface. This class represents all services.
+ *
+ *
+ *
+ * @copyright Intra2net AG
+ * @license GPLv2
+*/
+
#include "service.h"
Service::Service()
-//
-// C++ Interface: service
-//
-// Description:
-//
-//
-// Author: Bjoern Sikora <bjoern.sikora@intra2net.com>, (C) 2009
-//
-// Copyright: See COPYING file that comes with this distribution
-//
-//
+/** @file
+ * @brief The abstract service interface. This class represents all services.
+ *
+ *
+ *
+ * @copyright Intra2net AG
+ * @license GPLv2
+*/
+
#ifndef SERVICE_H
#define SERVICE_H
using namespace std;
-/**
- @author Bjoern Sikora <bjoern.sikora@intra2net.com>
-*/
class Service
{
public:
-//
-// C++ Implementation: updater
-//
-// Description:
-//
-//
-// Author: Bjoern Sikora <bjoern.sikora@intra2net.com>, (C) 2009
-//
-// Copyright: See COPYING file that comes with this distribution
-//
-//
+/** @file
+ * @brief The updater class implementation. This class implements the updater logic.
+ *
+ *
+ *
+ * @copyright Intra2net AG
+ * @license GPLv2
+*/
+
#include "updater.h"
#include <boost/foreach.hpp>
+/**
+ * Default constructor which initializes the member Conf.
+ */
Updater::Updater()
- : conf(NULL)
+ : Conf(NULL)
{
}
-Updater::Updater(Config* conf)
+/**
+ * Constructor.
+ * @param _conf A pointer to a Config object.
+ */
+Updater::Updater(Config* _conf)
{
- this->conf = conf;
+ Conf = _conf;
}
+/**
+ * Default destructor.
+ */
Updater::~Updater()
{
conf = NULL;
}
-void Updater::set_config(Config* conf)
+/**
+ * Setter for member Conf.
+ * @param _conf
+ */
+void Updater::set_config(Config* _conf)
{
- this->conf = conf;
+ Conf = _conf;
}
+/**
+ * Getter for member Conf.
+ * @return Conf.
+ */
Config* Updater::get_config()
{
- return this->conf;
+ return Conf;
}
+/**
+ * Update all configured services.
+ */
void Updater::update_services()
{
list<Service*> services = this->conf->get_services();
{
service->update(ip);
}
-}
\ No newline at end of file
+}
-//
-// C++ Interface: updater
-//
-// Description:
-//
-//
-// Author: Bjoern Sikora <bjoern.sikora@intra2net.com>, (C) 2009
-//
-// Copyright: See COPYING file that comes with this distribution
-//
-//
+/** @file
+ * @brief The updater class header. This class represents the updater logic.
+ *
+ *
+ *
+ * @copyright Intra2net AG
+ * @license GPLv2
+*/
+
#ifndef UPDATER_H
#define UPDATER_H
class Updater
{
private:
- Config* conf;
+ Config* Conf;
public:
Updater();