ifw-core 5.0.1
|
#include <config.hpp>
Public Member Functions | |
Config () | |
bool | ParseOptions (int argc, char *argv[]) override |
void | LoadConfig (const std::string &filename="", bool reset=false) override |
virtual | ~Config ()=default |
const std::string | GetServerId () const override |
const std::string | GetMsgReplierEndpoint () const override |
const std::string | GetMsgPubEndpoint () const override |
const timeval | GetDbTimeout () const override |
const unsigned int | GetDbConnTimeout () const override |
const unsigned int | GetDbTaskPeriod () const override |
const std::string | GetSmScxmlFilename () const override |
const std::string | GetConfigFilename () const override |
const std::string | GetLogProperties () const override |
const std::string | GetLogLevel () const override |
const unsigned int | GetReqTout () const override |
Get the command timeout. | |
const unsigned int | GetMonTout () const override |
Get the wait timeout. | |
const std::string | GetOldbPrefix () const |
Get OLDB prefix. | |
const std::string | GetFitsPrefix () const |
Get FITS prefix. | |
const std::string | GetConfigAsString () const override |
Get the actual configuration as a string. | |
void | SetConfigAsString (const std::string &config) override |
Load a configuration as string. | |
std::string | GetResolvedFilename (const std::string &config) |
Resolve file name. | |
const elt::configng::CiiConfigInstanceNamespace & | GetInstance () const |
Merges an existing configuration with another config document. | |
core::dit::did::Did & | GetDid () |
virtual void | GetConfigList (DbVector &cfg_list) |
CliConfig & | GetCliCfg () |
void | SetConfigFilename (const std::string cfg_file) |
const std::string | GetVersion () const |
GetVersion. | |
virtual bool | ParseOptions (int argc, char *argv[])=0 |
virtual void | LoadConfig (const std::string &filename="", bool reset=false)=0 |
virtual const std::string | GetServerId () const =0 |
virtual const std::string | GetMsgReplierEndpoint () const =0 |
virtual const std::string | GetMsgPubEndpoint () const =0 |
virtual const timeval | GetDbTimeout () const =0 |
virtual const unsigned int | GetDbConnTimeout () const =0 |
virtual const unsigned int | GetDbTaskPeriod () const =0 |
virtual const std::string | GetSmScxmlFilename () const =0 |
virtual const std::string | GetConfigFilename () const =0 |
virtual const std::string | GetLogProperties () const =0 |
virtual const std::string | GetLogLevel () const =0 |
virtual const unsigned int | GetMonTout () const =0 |
GetMonTout. | |
virtual const unsigned int | GetReqTout () const =0 |
GetReqTout. | |
virtual const std::string | GetConfigAsString () const =0 |
Get the actual configuration as a string. | |
virtual void | SetConfigAsString (const std::string &config)=0 |
Protected Member Functions | |
void | MergeConfig (const elt::configng::CiiConfigDocument &doc, bool check=true) |
Merges a configuration file. | |
void | CheckConfig (const elt::configng::CiiConfigDocument &doc) const |
Validates the document configuration. | |
Protected Attributes | |
std::unique_ptr< elt::configng::CiiConfigDocument > | m_config_doc |
Internal configuration document object. | |
CliConfig | m_cli_config |
Command line parameters. | |
boost::posix_time::ptime | m_file_utc |
std::string | m_config_filename |
core::dit::did::Did | m_did |
log4cplus::Logger | m_logger |
This class provide access to the command line options and the configuration parameters stored in a configuration file.
It uses the new CII Config service.
The basic schema for the configuration is found in file definitions.yaml.
The supported command line parameters are:
Options: -h [ –help ] Print help messages -i [ –server-id ] arg Server ID -l [ –log-level ] arg Log level: ERROR, INFO, DEBUG, TRACE -p [ –log-prop-file ] arg Log property filename -c [ –config ] arg Configuration filename -r [ –req-endpoint ] arg Req/Rep endpoint (zpb.rr://<ipaddr>:<port>/) -d [ –db-endpoint ] arg Redis DB endpoint (<ipaddr>:<port>)
utils::bat::Config::Config | ( | ) |
Default constructor.
Initialize application configuration attributes by
|
virtualdefault |
Default destructor.
|
protected |
Validates the document configuration.
doc | Config document object to be validated |
std::runtime_error | in case check reported issues. |
|
overridevirtual |
Get the actual configuration as a string.
Implements utils::bat::IConfig.
|
overridevirtual |
Implements utils::bat::IConfig.
|
virtual |
|
overridevirtual |
Implements utils::bat::IConfig.
|
overridevirtual |
Implements utils::bat::IConfig.
|
overridevirtual |
Implements utils::bat::IConfig.
core::dit::did::Did & utils::bat::Config::GetDid | ( | ) |
const std::string utils::bat::Config::GetFitsPrefix | ( | ) | const |
Get FITS prefix.
const elt::configng::CiiConfigInstanceNamespace & utils::bat::Config::GetInstance | ( | ) | const |
Merges an existing configuration with another config document.
doc | Config document object to be merged |
check | Flag to perform a check once is merged. |
std::runtime_error | in case merge reported issues. |
Get object document instance
|
overridevirtual |
Implements utils::bat::IConfig.
|
overridevirtual |
Implements utils::bat::IConfig.
|
overridevirtual |
|
overridevirtual |
Implements utils::bat::IConfig.
|
overridevirtual |
Implements utils::bat::IConfig.
const std::string utils::bat::Config::GetOldbPrefix | ( | ) | const |
Get OLDB prefix.
|
overridevirtual |
std::string utils::bat::Config::GetResolvedFilename | ( | const std::string & | config = "" | ) |
Resolve file name.
config | Configurtion filename |
standard | exception if file cannot be found. |
|
overridevirtual |
Implements utils::bat::IConfig.
|
overridevirtual |
Implements utils::bat::IConfig.
const std::string utils::bat::Config::GetVersion | ( | ) | const |
GetVersion.
|
overridevirtual |
This method load from a configuration file the application configuration overriding the initialization done in the constructor and the command line options.
[in] | filename | Application configuration filename. |
Implements utils::bat::IConfig.
|
protected |
Merges a configuration file.
doc | Config document object to be validated. |
check | Flag to verify after the merge. |
std::runtime_error | in case check reported issues. |
|
overridevirtual |
This method parses the command line parameters overriding the initialization done in the constructor.
[in] | argc | Number of command line options. |
[in] | argv | Pointer to the array of command line options. |
Implements utils::bat::IConfig.
|
overridevirtual |
Load a configuration as string.
config | configuration as string to be loaded. |
Implements utils::bat::IConfig.
void utils::bat::Config::SetConfigFilename | ( | const std::string | cfg_file | ) |
Set the internal configuration filename.
|
protected |
Command line parameters.
|
protected |
Internal configuration document object.
|
protected |
|
protected |
|
protected |
|
protected |