Fawkes API  Fawkes Development Version
MongoDBThread::ClientConf Class Reference

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...
 

Detailed Description

Client configuration.

Definition at line 32 of file mongodb_thread.cpp.

Member Enumeration Documentation

◆ ConnectionMode

Connection mode enumeration.

Enumerator
CONNECTION 

connect to single node

REPLICA_SET 

connect to replica set

Definition at line 36 of file mongodb_thread.cpp.

Constructor & Destructor Documentation

◆ ClientConf()

MongoDBThread::ClientConf::ClientConf ( fawkes::Configuration config,
fawkes::Logger logger,
std::string  cfgname,
std::string  prefix 
)

Constructor.

This will read the given configuration.

Parameters
configconfiguration to query
loggerlogger for info messages
cfgnameconfiguration name
prefixconfiguration 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().

Member Function Documentation

◆ create_client()

mongo::DBClientBase * MongoDBThread::ClientConf::create_client ( )

Create MongoDB client for this configuration.

Returns
MongoDB client

Definition at line 298 of file mongodb_thread.cpp.

◆ is_active()

bool MongoDBThread::ClientConf::is_active ( ) const
inline

Check if configuration is active.

Returns
true if configuration is active, false otherwise

Definition at line 48 of file mongodb_thread.cpp.

Referenced by MongoDBThread::init().

◆ log()

void MongoDBThread::ClientConf::log ( Logger logger,
const char *  component,
const char *  indent 
)

Write client configuration information to log.

Parameters
loggerlogger to write to
componentcomponent to pass to logger
indentindentation to put before each string

Definition at line 354 of file mongodb_thread.cpp.

References fawkes::Logger::log_info().

Referenced by MongoDBThread::init().


The documentation for this class was generated from the following file: