Fawkes API
Fawkes Development Version
|
Client configuration. More...
Public Types | |
enum | ConnectionMode { CONNECTION, REPLICA_SET } |
Connection mode enumeration. More... | |
Public Member Functions | |
ClientConf (fawkes::Configuration *config, fawkes::Logger *logger, std::string cfgname, std::string prefix) | |
Constructor. More... | |
mongo::DBClientBase * | create_client () |
Create MongoDB client for this configuration. More... | |
bool | is_active () const |
Check if configuration is active. More... | |
void | log (Logger *logger, const char *component, const char *indent) |
Write client configuration information to log. More... | |
Client configuration.
Definition at line 32 of file mongodb_thread.cpp.
Connection mode enumeration.
Enumerator | |
---|---|
CONNECTION | connect to single node |
REPLICA_SET | connect to replica set |
Definition at line 36 of file mongodb_thread.cpp.
MongoDBThread::ClientConf::ClientConf | ( | fawkes::Configuration * | config, |
fawkes::Logger * | logger, | ||
std::string | cfgname, | ||
std::string | prefix | ||
) |
Constructor.
This will read the given configuration.
config | configuration to query |
logger | logger for info messages |
cfgname | configuration name |
prefix | configuration path prefix |
Definition at line 250 of file mongodb_thread.cpp.
References fawkes::Configuration::get_bool(), fawkes::Configuration::ValueIterator::get_string(), fawkes::Configuration::get_string(), fawkes::Configuration::ValueIterator::is_string(), fawkes::Logger::log_info(), fawkes::Configuration::ValueIterator::next(), and fawkes::Configuration::search().
mongo::DBClientBase * MongoDBThread::ClientConf::create_client | ( | ) |
Create MongoDB client for this configuration.
Definition at line 298 of file mongodb_thread.cpp.
|
inline |
Check if configuration is active.
Definition at line 48 of file mongodb_thread.cpp.
Referenced by MongoDBThread::init().
void MongoDBThread::ClientConf::log | ( | Logger * | logger, |
const char * | component, | ||
const char * | indent | ||
) |
Write client configuration information to log.
logger | logger to write to |
component | component to pass to logger |
indent | indentation to put before each string |
Definition at line 354 of file mongodb_thread.cpp.
References fawkes::Logger::log_info().
Referenced by MongoDBThread::init().