configuration_manager Class Reference

Keep up with configuration settings for RVM and it's jobs. More...

#include <rconfig.h>

Collaboration diagram for configuration_manager:

Collaboration graph
[legend]
List of all members.

Public Types

typedef std::pair< cfgfile_type,
std::string > 
cfgfile_element
typedef std::vector< cfgfile_elementcfgfiles_type
typedef std::vector< jobjobs_type
typedef std::vector< std::string > vaults_type
enum  action_type {
  action_help, action_version, action_archive, action_relink,
  action_check_config
}
enum  cfgfile_type { config_file, job_file }
enum  overflow_type { overflow_quit, overflow_delete_oldest, overflow_delete_until_free }
enum  selection_type { selection_round_robin, selection_max_free }
enum  logging_type { logging_manager, logging_child, logging_rsync }

Public Member Functions

void clear (void)
 Reset configuration to default settings.

 configuration_manager ()
 C'tor.

void init (int argc, char *argv[])
 Initialize the configuration manager from rvm's command line options.

void check (void) const
 Perform sanity checks on configuration settings.

const bool initialized (void) const
 Return the initialized state of the configuration manager.

const action_type action (void) const
 Return the action rvm is to take.

const bool use_default (void) const
 Return whether or not rvm is to try to read it's default configuration file.

void default_file (const std::string &a_path)
 Set the default configuration filename.

const std::string & default_file (void) const
 Return the default configuration filename.

void default_logdir (const std::string &a_path)
 Return the default log-dir.

const class timestamptimestamp (void) const
 Return the timestamp of this instance of rvm.

const std::string & link_catalog_dir (void) const
 Return the link-catalog-dir path.

const std::string & log_dir (void) const
 Return the log-dir path.

const std::string & rsync_local_path (void) const
 Return the rsync-local-path.

const uint16 & rsync_parallel (void) const
 Return the rsync-parallel.

const uint16 & io_poll_interval (void) const
 Return the number of seconds to sleep between polling for I/O.

const timestamp::resolution_type timestamp_resolution (void) const
 Return the timestamp-resolution.

const vaults_typevaults (void) const
 Return the vaults.

const overflow_typevault_overflow_behavior (void) const
 Return the vault-overflow-behavior.

const uint16 & vault_overflow_blocks (void) const
 Return the vault-overflow-blocks.

const uint16 & vault_overflow_inodes (void) const
 Return the vault-overflow-inodes.

const selection_typevault_selection_behavior (void) const
 Return the vault-selection-behavior.

const jobdefault_job (void) const
 Return the default job configuration.

const jobs_typejobs (void) const
 Return a list of jobs.

const logging_typelogging_level (void) const
 Return the logging-level.


Private Member Functions

void read_config (const std::string &a_path)
 Read a configuration file.

void read_job (const std::string &a_path)
 Read a job configuration file.


Private Attributes

bool m_initialized
uint16 m_configs_read
std::string m_default_file
action_type m_action
bool m_default
timestamp m_timestamp
cfgfiles_type m_cfgfiles
std::string m_link_catalog_dir
std::string m_log_dir
std::string m_rsync_local_path
uint16 m_rsync_parallel
uint16 m_io_poll_interval
std::vector< std::string > m_vaults
overflow_type m_vault_overflow_behavior
uint16 m_vault_overflow_blocks
uint16 m_vault_overflow_inodes
selection_type m_vault_selection_behavior
job m_default_job
jobs_type m_jobs
logging_type m_logging_level

Friends

class global_parser
class job_parser

Detailed Description

Keep up with configuration settings for RVM and it's jobs.

Definition at line 195 of file rconfig.h.


Member Typedef Documentation

typedef std::pair<cfgfile_type, std::string> configuration_manager::cfgfile_element
 

Definition at line 223 of file rconfig.h.

typedef std::vector<cfgfile_element> configuration_manager::cfgfiles_type
 

Definition at line 224 of file rconfig.h.

typedef std::vector<job> configuration_manager::jobs_type
 

Definition at line 225 of file rconfig.h.

Referenced by default_job().

typedef std::vector<std::string> configuration_manager::vaults_type
 

Definition at line 226 of file rconfig.h.

Referenced by timestamp_resolution().


Member Enumeration Documentation

enum configuration_manager::action_type
 

Enumeration values:
action_help 
action_version 
action_archive 
action_relink 
action_check_config 

Definition at line 198 of file rconfig.h.

enum configuration_manager::cfgfile_type
 

Enumeration values:
config_file 
job_file 

Definition at line 205 of file rconfig.h.

enum configuration_manager::logging_type
 

Enumeration values:
logging_manager 
logging_child 
logging_rsync 

Definition at line 218 of file rconfig.h.

Referenced by jobs().

enum configuration_manager::overflow_type
 

Enumeration values:
overflow_quit 
overflow_delete_oldest 
overflow_delete_until_free 

Definition at line 209 of file rconfig.h.

Referenced by vaults().

enum configuration_manager::selection_type
 

Enumeration values:
selection_round_robin 
selection_max_free 

Definition at line 214 of file rconfig.h.

Referenced by vault_overflow_inodes().


Constructor & Destructor Documentation

configuration_manager::configuration_manager  ) 
 

C'tor.

Definition at line 975 of file rconfig.cc.


Member Function Documentation

const configuration_manager::action_type configuration_manager::action void   )  const
 

Return the action rvm is to take.

Definition at line 1187 of file rconfig.cc.

References initialized(), and INTERNAL_ERROR.

Referenced by log_manager::init(), and main().

Here is the call graph for this function:

void configuration_manager::check void   )  const
 

Perform sanity checks on configuration settings.

Definition at line 1146 of file rconfig.cc.

References ERROR, and m_log_dir.

void configuration_manager::clear void   ) 
 

Reset configuration to default settings.

Definition at line 947 of file rconfig.cc.

References m_cfgfiles, m_link_catalog_dir, m_rsync_local_path, and m_timestamp.

Referenced by test_rvm().

const std::string & configuration_manager::default_file void   )  const
 

Return the default configuration filename.

Definition at line 1211 of file rconfig.cc.

References m_log_dir, and TRY_nomem.

void configuration_manager::default_file const std::string &  a_path  ) 
 

Set the default configuration filename.

Definition at line 1205 of file rconfig.cc.

References initialized(), INTERNAL_ERROR, and m_default_file.

Referenced by test(), test_rvm(), and test_vaulter().

Here is the call graph for this function:

const job & configuration_manager::default_job void   )  const
 

Return the default job configuration.

Definition at line 1334 of file rconfig.cc.

References initialized(), INTERNAL_ERROR, and jobs_type.

Referenced by test().

Here is the call graph for this function:

void configuration_manager::default_logdir const std::string &  a_path  ) 
 

Return the default log-dir.

Definition at line 1220 of file rconfig.cc.

References initialized(), INTERNAL_ERROR, and m_timestamp.

Referenced by test().

Here is the call graph for this function:

void configuration_manager::init int  argc,
char *  argv[]
 

Initialize the configuration manager from rvm's command line options.

Definition at line 985 of file rconfig.cc.

Referenced by main(), test(), test_rvm(), and test_vaulter().

const bool configuration_manager::initialized void   )  const
 

Return the initialized state of the configuration manager.

Definition at line 1180 of file rconfig.cc.

References INTERNAL_ERROR, and m_action.

Referenced by action(), default_file(), default_job(), default_logdir(), report_manager::init(), io_poll_interval(), jobs(), link_catalog_dir(), log_dir(), main(), rsync_local_path(), rsync_parallel(), timestamp(), timestamp_resolution(), vault_overflow_behavior(), vault_overflow_blocks(), vault_overflow_inodes(), vault_selection_behavior(), and vaults().

const uint16 & configuration_manager::io_poll_interval void   )  const
 

Return the number of seconds to sleep between polling for I/O.

Definition at line 1271 of file rconfig.cc.

References initialized(), INTERNAL_ERROR, m_timestamp, and timestamp::resolution().

Referenced by job_archiver::mf_process_child_io(), and job_archiver::mf_process_rsync_io().

Here is the call graph for this function:

const configuration_manager::jobs_type & configuration_manager::jobs void   )  const
 

Return a list of jobs.

Definition at line 1343 of file rconfig.cc.

References initialized(), INTERNAL_ERROR, logging_type, and m_logging_level.

Referenced by archive_manager::archive(), test(), and test_rvm().

Here is the call graph for this function:

const std::string & configuration_manager::link_catalog_dir void   )  const
 

Return the link-catalog-dir path.

Definition at line 1235 of file rconfig.cc.

References initialized(), INTERNAL_ERROR, and m_log_dir.

Referenced by catalog_manager::catalog(), catalog_manager::erase(), and test().

Here is the call graph for this function:

const std::string & configuration_manager::log_dir void   )  const
 

Return the log-dir path.

Definition at line 1244 of file rconfig.cc.

References initialized(), INTERNAL_ERROR, and m_rsync_local_path.

Referenced by report_manager::file_report(), log_manager::init(), test(), and test_rvm().

Here is the call graph for this function:

const configuration_manager::logging_type & configuration_manager::logging_level void   )  const
 

Return the logging-level.

Definition at line 1352 of file rconfig.cc.

Referenced by log_manager::write().

void configuration_manager::read_config const std::string &  a_path  )  [private]
 

Read a configuration file.

Definition at line 1361 of file rconfig.cc.

References ERROR, and TRY_nomem.

void configuration_manager::read_job const std::string &  a_path  )  [private]
 

Read a job configuration file.

Definition at line 1382 of file rconfig.cc.

References ERROR, and TRY_nomem.

const std::string & configuration_manager::rsync_local_path void   )  const
 

Return the rsync-local-path.

Definition at line 1253 of file rconfig.cc.

References initialized(), INTERNAL_ERROR, and m_rsync_parallel.

Referenced by job_archiver::mf_do_chores(), and test().

Here is the call graph for this function:

const uint16 & configuration_manager::rsync_parallel void   )  const
 

Return the rsync-parallel.

Definition at line 1262 of file rconfig.cc.

References initialized(), INTERNAL_ERROR, and m_io_poll_interval.

Referenced by archive_manager::archive(), and test().

Here is the call graph for this function:

const class timestamp & configuration_manager::timestamp void   )  const
 

Return the timestamp of this instance of rvm.

Definition at line 1226 of file rconfig.cc.

References initialized(), INTERNAL_ERROR, and m_link_catalog_dir.

Referenced by archive_manager::archive_path(), vault_manager::delete_oldest_archive(), report_manager::file_report(), vault_report::format_synopsis(), log_manager::init(), archive_manager::init(), job_archiver::mf_do_chores(), vault_manager::select(), test(), and test_rvm().

Here is the call graph for this function:

const timestamp::resolution_type configuration_manager::timestamp_resolution void   )  const
 

Return the timestamp-resolution.

Definition at line 1280 of file rconfig.cc.

References initialized(), INTERNAL_ERROR, m_vaults, and vaults_type.

Referenced by test().

Here is the call graph for this function:

const bool configuration_manager::use_default void   )  const
 

Return whether or not rvm is to try to read it's default configuration file.

Definition at line 1196 of file rconfig.cc.

References m_default_file, and TRY_nomem.

const configuration_manager::overflow_type & configuration_manager::vault_overflow_behavior void   )  const
 

Return the vault-overflow-behavior.

Definition at line 1298 of file rconfig.cc.

References initialized(), INTERNAL_ERROR, and m_vault_overflow_blocks.

Referenced by vault_manager::prepare(), and test().

Here is the call graph for this function:

const uint16 & configuration_manager::vault_overflow_blocks void   )  const
 

Return the vault-overflow-blocks.

Definition at line 1307 of file rconfig.cc.

References initialized(), INTERNAL_ERROR, and m_vault_overflow_inodes.

Referenced by vault_manager::overflow(), and test().

Here is the call graph for this function:

const uint16 & configuration_manager::vault_overflow_inodes void   )  const
 

Return the vault-overflow-inodes.

Definition at line 1316 of file rconfig.cc.

References initialized(), INTERNAL_ERROR, m_vault_selection_behavior, and selection_type.

Referenced by vault_manager::overflow(), and test().

Here is the call graph for this function:

const configuration_manager::selection_type & configuration_manager::vault_selection_behavior void   )  const
 

Return the vault-selection-behavior.

Definition at line 1325 of file rconfig.cc.

References initialized(), INTERNAL_ERROR, and m_default_job.

Referenced by vault_manager::select(), and test().

Here is the call graph for this function:

const configuration_manager::vaults_type & configuration_manager::vaults void   )  const
 

Return the vaults.

Definition at line 1289 of file rconfig.cc.

References initialized(), INTERNAL_ERROR, m_vault_overflow_behavior, and overflow_type.

Referenced by catalog_manager::catalog(), vault_manager::select(), and test().

Here is the call graph for this function:


Friends And Related Function Documentation

friend class global_parser [friend]
 

Definition at line 279 of file rconfig.h.

friend class job_parser [friend]
 

Definition at line 280 of file rconfig.h.


Member Data Documentation

action_type configuration_manager::m_action [private]
 

Definition at line 261 of file rconfig.h.

Referenced by initialized().

class cfgfiles_type configuration_manager::m_cfgfiles [private]
 

Definition at line 264 of file rconfig.h.

Referenced by clear().

uint16 configuration_manager::m_configs_read [private]
 

Definition at line 259 of file rconfig.h.

bool configuration_manager::m_default [private]
 

Definition at line 262 of file rconfig.h.

std::string configuration_manager::m_default_file [private]
 

Definition at line 260 of file rconfig.h.

Referenced by default_file(), and use_default().

job configuration_manager::m_default_job [private]
 

Definition at line 275 of file rconfig.h.

Referenced by vault_selection_behavior().

bool configuration_manager::m_initialized [private]
 

Definition at line 258 of file rconfig.h.

uint16 configuration_manager::m_io_poll_interval [private]
 

Definition at line 269 of file rconfig.h.

Referenced by rsync_parallel().

jobs_type configuration_manager::m_jobs [private]
 

Definition at line 276 of file rconfig.h.

std::string configuration_manager::m_link_catalog_dir [private]
 

Definition at line 265 of file rconfig.h.

Referenced by clear(), and timestamp().

std::string configuration_manager::m_log_dir [private]
 

Definition at line 266 of file rconfig.h.

Referenced by check(), default_file(), and link_catalog_dir().

logging_type configuration_manager::m_logging_level [private]
 

Definition at line 277 of file rconfig.h.

Referenced by jobs().

std::string configuration_manager::m_rsync_local_path [private]
 

Definition at line 267 of file rconfig.h.

Referenced by clear(), and log_dir().

uint16 configuration_manager::m_rsync_parallel [private]
 

Definition at line 268 of file rconfig.h.

Referenced by rsync_local_path().

class timestamp configuration_manager::m_timestamp [private]
 

Definition at line 263 of file rconfig.h.

Referenced by clear(), default_logdir(), and io_poll_interval().

overflow_type configuration_manager::m_vault_overflow_behavior [private]
 

Definition at line 271 of file rconfig.h.

Referenced by vaults().

uint16 configuration_manager::m_vault_overflow_blocks [private]
 

Definition at line 272 of file rconfig.h.

Referenced by vault_overflow_behavior().

uint16 configuration_manager::m_vault_overflow_inodes [private]
 

Definition at line 273 of file rconfig.h.

Referenced by vault_overflow_blocks().

selection_type configuration_manager::m_vault_selection_behavior [private]
 

Definition at line 274 of file rconfig.h.

Referenced by vault_overflow_inodes().

std::vector<std::string> configuration_manager::m_vaults [private]
 

Definition at line 270 of file rconfig.h.

Referenced by timestamp_resolution().


The documentation for this class was generated from the following files:
Generated on Mon Jul 12 12:09:27 2004 for rvm by doxygen 1.3.6