#include <rconfig.h>
Collaboration diagram for configuration_manager:
Public Types | |
typedef std::pair< cfgfile_type, std::string > | cfgfile_element |
typedef std::vector< cfgfile_element > | cfgfiles_type |
typedef std::vector< job > | jobs_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 timestamp & | timestamp (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 bool | delete_old_log_files (void) const |
Return the value of delete-old-log-files. | |
const bool | delete_old_report_files (void) const |
Return the value of delete-old-report-files. | |
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_type & | vaults (void) const |
Return the vaults. | |
const overflow_type & | vault_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_type & | vault_selection_behavior (void) const |
Return the vault-selection-behavior. | |
const bool | vault_locking (void) const |
Return the vault-locking selection. | |
const job & | default_job (void) const |
Return the default job configuration. | |
const jobs_type & | jobs (void) const |
Return a list of jobs. | |
const logging_type & | logging_level (void) const |
Return the logging-level. | |
const logging_type & | error_logging_level (void) const |
Return the error-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 |
bool | m_vault_locking |
bool | m_delete_old_log_files |
bool | m_delete_old_report_files |
job | m_default_job |
jobs_type | m_jobs |
logging_type | m_logging_level |
logging_type | m_error_logging_level |
Friends | |
class | global_parser |
class | job_parser |
Definition at line 196 of file rconfig.h.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
C'tor.
Definition at line 1028 of file rconfig.cc. References clear(), config, and INTERNAL_ERROR. Here is the call graph for this function: |
|
Return the action rvm is to take.
Definition at line 1264 of file rconfig.cc. References initialized(), INTERNAL_ERROR, and m_action. Referenced by log_manager::init(), and main(). Here is the call graph for this function: |
|
Perform sanity checks on configuration settings.
Definition at line 1199 of file rconfig.cc. References ERROR, initialized(), INTERNAL_ERROR, jobs(), m_log_dir, m_rsync_local_path, m_vaults, filestatus::path(), subdirectory::path(), error::push_back(), TRY, TRY_instead, and TRY_nomem. Referenced by init(). Here is the call graph for this function: |
|
Reset configuration to default settings.
Definition at line 996 of file rconfig.cc. References action_help, job::clear(), CONFIGFILE, LOCAL_RSYNC, LOGDIR, logging_child, logging_rsync, m_action, m_cfgfiles, m_configs_read, m_default, m_default_file, m_default_job, m_delete_old_log_files, m_delete_old_report_files, m_error_logging_level, m_initialized, m_io_poll_interval, m_jobs, m_link_catalog_dir, m_log_dir, m_logging_level, m_rsync_local_path, m_rsync_parallel, m_timestamp, m_vault_locking, m_vault_overflow_behavior, m_vault_overflow_blocks, m_vault_overflow_inodes, m_vault_selection_behavior, m_vaults, overflow_quit, selection_round_robin, timestamp::set(), and TRY_nomem. Referenced by configuration_manager(), test(), test_rvm(), and test_vaulter(). Here is the call graph for this function: |
|
Return the default configuration filename.
Definition at line 1288 of file rconfig.cc. References initialized(), INTERNAL_ERROR, and m_default_file. Here is the call graph for this function: |
|
Set the default configuration filename.
Definition at line 1282 of file rconfig.cc. References m_default_file, and TRY_nomem. Referenced by test(), test_rvm(), test_vaulter(), test_vaulter1(), test_vaulter2(), and test_vaulter3(). |
|
Return the default job configuration.
Definition at line 1438 of file rconfig.cc. References initialized(), INTERNAL_ERROR, and m_default_job. Referenced by test(). Here is the call graph for this function: |
|
Return the default log-dir.
Definition at line 1297 of file rconfig.cc. References m_log_dir, and TRY_nomem. Referenced by test(). |
|
Return the value of delete-old-log-files.
Definition at line 1330 of file rconfig.cc. References initialized(), INTERNAL_ERROR, and m_delete_old_log_files. Referenced by vault_manager::delete_oldest_archive(), and test(). Here is the call graph for this function: |
|
Return the value of delete-old-report-files.
Definition at line 1339 of file rconfig.cc. References initialized(), INTERNAL_ERROR, and m_delete_old_report_files. Referenced by vault_manager::delete_oldest_archive(), and test(). Here is the call graph for this function: |
|
Return the error-logging-level.
Definition at line 1465 of file rconfig.cc. References initialized(), INTERNAL_ERROR, and m_error_logging_level. Referenced by log_manager::write(). Here is the call graph for this function: |
|
Initialize the configuration manager from rvm's command line options.
Definition at line 1038 of file rconfig.cc. References action_archive, action_check_config, action_help, action_relink, action_version, timestamp::assign(), check(), config_file, err_unknown, ERROR, ERROR_INSTANCE, job_file, m_action, m_cfgfiles, m_configs_read, m_default, m_default_file, m_initialized, m_timestamp, directory::path(), error::push_back(), read_config(), read_job(), TRY, TRY_nomem, and use_default(). Referenced by main(), test(), test_rvm(), test_vaulter(), test_vaulter1(), test_vaulter2(), and test_vaulter3(). Here is the call graph for this function: |
|
Return the initialized state of the configuration manager.
Definition at line 1257 of file rconfig.cc. References m_initialized. Referenced by action(), check(), default_file(), default_job(), delete_old_log_files(), delete_old_report_files(), error_logging_level(), report_manager::init(), io_poll_interval(), jobs(), link_catalog_dir(), log_dir(), logging_level(), main(), rsync_local_path(), rsync_parallel(), timestamp(), timestamp_resolution(), use_default(), vault_locking(), vault_overflow_behavior(), vault_overflow_blocks(), vault_overflow_inodes(), vault_selection_behavior(), and vaults(). |
|
Return the number of seconds to sleep between polling for I/O.
Definition at line 1366 of file rconfig.cc. References initialized(), INTERNAL_ERROR, and m_io_poll_interval. Referenced by job_archiver::mf_process_child_io(), and job_archiver::mf_process_rsync_io(). Here is the call graph for this function: |
|
Return a list of jobs.
Definition at line 1447 of file rconfig.cc. References initialized(), INTERNAL_ERROR, and m_jobs. Referenced by archive_manager::archive(), check(), job::check(), test(), and test_rvm(). Here is the call graph for this function: |
|
Return the link-catalog-dir path.
Definition at line 1312 of file rconfig.cc. References initialized(), INTERNAL_ERROR, and m_link_catalog_dir. Referenced by catalog_manager::catalog(), catalog_manager::erase(), and test(). Here is the call graph for this function: |
|
Return the log-dir path.
Definition at line 1321 of file rconfig.cc. References initialized(), INTERNAL_ERROR, and m_log_dir. Referenced by vault_manager::delete_oldest_archive(), report_manager::file_report(), log_manager::init(), test(), and test_rvm(). Here is the call graph for this function: |
|
Return the logging-level.
Definition at line 1456 of file rconfig.cc. References initialized(), INTERNAL_ERROR, and m_logging_level. Referenced by log_manager::write(). Here is the call graph for this function: |
|
Read a configuration file.
Definition at line 1474 of file rconfig.cc. References ERROR, global_parser, m_configs_read, and TRY_nomem. Referenced by init(). |
|
Read a job configuration file.
Definition at line 1495 of file rconfig.cc. References job::check(), ERROR, job_parser, m_default_job, and TRY_nomem. Referenced by init(). Here is the call graph for this function: |
|
Return the rsync-local-path.
Definition at line 1348 of file rconfig.cc. References initialized(), INTERNAL_ERROR, and m_rsync_local_path. Referenced by job_archiver::mf_do_chores(), and test(). Here is the call graph for this function: |
|
Return the rsync-parallel.
Definition at line 1357 of file rconfig.cc. References initialized(), INTERNAL_ERROR, and m_rsync_parallel. Referenced by archive_manager::archive(), and test(). Here is the call graph for this function: |
|
Return the timestamp of this instance of rvm.
Definition at line 1303 of file rconfig.cc. References initialized(), INTERNAL_ERROR, and m_timestamp. 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: |
|
Return the timestamp-resolution.
Definition at line 1375 of file rconfig.cc. References initialized(), INTERNAL_ERROR, m_timestamp, and timestamp::resolution(). Referenced by test(). Here is the call graph for this function: |
|
Return whether or not rvm is to try to read it's default configuration file.
Definition at line 1273 of file rconfig.cc. References initialized(), INTERNAL_ERROR, and m_default. Referenced by init(). Here is the call graph for this function: |
|
Return the vault-locking selection.
Definition at line 1429 of file rconfig.cc. References initialized(), INTERNAL_ERROR, and m_vault_locking. Referenced by vault_manager::select(), and test(). Here is the call graph for this function: |
|
Return the vault-overflow-behavior.
Definition at line 1393 of file rconfig.cc. References initialized(), INTERNAL_ERROR, and m_vault_overflow_behavior. Referenced by vault_manager::prepare(), and test(). Here is the call graph for this function: |
|
Return the vault-overflow-blocks.
Definition at line 1402 of file rconfig.cc. References initialized(), INTERNAL_ERROR, and m_vault_overflow_blocks. Referenced by vault_manager::overflow(), and test(). Here is the call graph for this function: |
|
Return the vault-overflow-inodes.
Definition at line 1411 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: |
|
Return the vault-selection-behavior.
Definition at line 1420 of file rconfig.cc. References initialized(), INTERNAL_ERROR, and m_vault_selection_behavior. Referenced by vault_manager::select(), and test(). Here is the call graph for this function: |
|
Return the vaults.
Definition at line 1384 of file rconfig.cc. References initialized(), INTERNAL_ERROR, and m_vaults. Referenced by catalog_manager::catalog(), vault_manager::select(), and test(). Here is the call graph for this function: |
|
Definition at line 288 of file rconfig.h. Referenced by read_config(). |
|
Definition at line 289 of file rconfig.h. Referenced by read_job(). |
|
|
|
|
|
Definition at line 264 of file rconfig.h. Referenced by clear(), init(), global_parser::read_config(), and read_config(). |
|
Definition at line 267 of file rconfig.h. Referenced by clear(), init(), and use_default(). |
|
Definition at line 265 of file rconfig.h. Referenced by clear(), default_file(), and init(). |
|
Definition at line 283 of file rconfig.h. Referenced by clear(), default_job(), global_parser::parse_default(), global_parser::parse_include_job(), global_parser::parse_job(), and read_job(). |
|
Definition at line 281 of file rconfig.h. Referenced by clear(), delete_old_log_files(), and global_parser::parse_delete_old_log_files(). |
|
Definition at line 282 of file rconfig.h. Referenced by clear(), delete_old_report_files(), and global_parser::parse_delete_old_report_files(). |
|
Definition at line 286 of file rconfig.h. Referenced by clear(), error_logging_level(), and global_parser::parse_error_logging_level(). |
|
Definition at line 263 of file rconfig.h. Referenced by clear(), init(), and initialized(). |
|
Definition at line 274 of file rconfig.h. Referenced by clear(), io_poll_interval(), and global_parser::parse_io_poll_interval(). |
|
Definition at line 284 of file rconfig.h. Referenced by clear(), jobs(), global_parser::parse_include_job(), and global_parser::parse_job(). |
|
Definition at line 270 of file rconfig.h. Referenced by clear(), link_catalog_dir(), and global_parser::parse_link_catalog_dir(). |
|
Definition at line 271 of file rconfig.h. Referenced by check(), clear(), default_logdir(), log_dir(), and global_parser::parse_log_dir(). |
|
Definition at line 285 of file rconfig.h. Referenced by clear(), logging_level(), and global_parser::parse_logging_level(). |
|
Definition at line 272 of file rconfig.h. Referenced by check(), clear(), global_parser::parse_rsync_local_path(), and rsync_local_path(). |
|
Definition at line 273 of file rconfig.h. Referenced by clear(), global_parser::parse_rsync_parallel(), and rsync_parallel(). |
|
Definition at line 268 of file rconfig.h. Referenced by clear(), init(), global_parser::parse_timestamp_resolution(), timestamp(), and timestamp_resolution(). |
|
Definition at line 280 of file rconfig.h. Referenced by clear(), global_parser::parse_vault_locking(), and vault_locking(). |
|
Definition at line 276 of file rconfig.h. Referenced by clear(), global_parser::parse_vault_overflow_behavior(), and vault_overflow_behavior(). |
|
Definition at line 277 of file rconfig.h. Referenced by clear(), global_parser::parse_vault_overflow_blocks(), and vault_overflow_blocks(). |
|
Definition at line 278 of file rconfig.h. Referenced by clear(), global_parser::parse_vault_overflow_inodes(), and vault_overflow_inodes(). |
|
Definition at line 279 of file rconfig.h. Referenced by clear(), global_parser::parse_vault_selection_behavior(), and vault_selection_behavior(). |
|
Definition at line 275 of file rconfig.h. Referenced by check(), clear(), global_parser::parse_vault(), and vaults(). |