CernVM-FS  2.12.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
publish::SettingsBuilder Class Reference

#include <settings.h>

Inheritance diagram for publish::SettingsBuilder:
Collaboration diagram for publish::SettingsBuilder:

Public Member Functions

 SettingsBuilder ()
 
 ~SettingsBuilder ()
 
 SettingsBuilder (const std::string &c)
 
SettingsRepository CreateSettingsRepository (const std::string &ident)
 
SettingsPublisherCreateSettingsPublisher (const std::string &ident, bool needs_managed=false)
 
OptionsManageroptions_mgr () const
 
bool IsManagedRepository () const
 
void ApplyOptionsFromServerPath (const OptionsManager &options_mgr_, SettingsPublisher *settings_publisher)
 
void SetConfigPath (const std::string &config_path)
 

Private Member Functions

std::string GetSingleAlias ()
 
std::map< std::string,
std::string > 
GetSessionEnvironment ()
 
SettingsPublisherCreateSettingsPublisherFromSession ()
 
- Private Member Functions inherited from SingleCopy
 SingleCopy ()
 

Private Attributes

std::string config_path_
 
OptionsManageroptions_mgr_
 

Detailed Description

Create Settings objects from the system configuration in /etc/cvmfs/repositories.d

Definition at line 488 of file settings.h.

Constructor & Destructor Documentation

publish::SettingsBuilder::SettingsBuilder ( )
inline

Definition at line 490 of file settings.h.

publish::SettingsBuilder::~SettingsBuilder ( )

Definition at line 384 of file settings.cc.

publish::SettingsBuilder::SettingsBuilder ( const std::string &  c)
inlineexplicit

Used in unit tests.

Definition at line 498 of file settings.h.

Member Function Documentation

void publish::SettingsBuilder::ApplyOptionsFromServerPath ( const OptionsManager options_mgr_,
SettingsPublisher settings_publisher 
)

Get the values from the server configuration and set them to the publisher settings.

Definition at line 536 of file settings.cc.

Referenced by CreateSettingsPublisher().

Here is the call graph for this function:

Here is the caller graph for this function:

SettingsPublisher * publish::SettingsBuilder::CreateSettingsPublisher ( const std::string &  ident,
bool  needs_managed = false 
)

If ident is a url, creates a generic settings object inferring the fqrn from the url. Otherwise, looks in the config files in /etc/cvmfs/repositories.d/<alias>/ If alias is an empty string, the command still succeeds iff there is a single repository under /etc/cvmfs/repositories.d If needs_managed is true, remote repositories are rejected In an "enter environment" (see cmd_enter), the spool area of the enter environment is applied.

Definition at line 594 of file settings.cc.

Referenced by publish::CmdAbort::Main(), publish::CmdCommit::Main(), publish::CmdEnter::Main(), publish::CmdTransaction::Main(), and publish::CmdDiff::Main().

Here is the call graph for this function:

Here is the caller graph for this function:

SettingsPublisher * publish::SettingsBuilder::CreateSettingsPublisherFromSession ( )
private

Create settings from an ephermal writable shell

Definition at line 500 of file settings.cc.

Referenced by CreateSettingsPublisher().

Here is the call graph for this function:

Here is the caller graph for this function:

SettingsRepository publish::SettingsBuilder::CreateSettingsRepository ( const std::string &  ident)

If ident is a url, creates a generic settings object inferring the fqrn from the url. Otherwise, looks in the config files in /etc/cvmfs/repositories.d/<alias>/ If alias is an empty string, the command still succeeds iff there is a single repository under /etc/cvmfs/repositories.d

Definition at line 438 of file settings.cc.

Referenced by CreateSettingsPublisher(), publish::CmdInfo::Main(), and publish::CmdDiff::Main().

Here is the call graph for this function:

Here is the caller graph for this function:

std::map< std::string, std::string > publish::SettingsBuilder::GetSessionEnvironment ( )
private

If in a ephemeral writable shell, parse $session_dir/env.conf Otherwise return an empty map. A non-empty map has at least CVMFS_FQRN set.

Definition at line 389 of file settings.cc.

Referenced by CreateSettingsPublisher(), CreateSettingsPublisherFromSession(), and GetSingleAlias().

Here is the call graph for this function:

Here is the caller graph for this function:

std::string publish::SettingsBuilder::GetSingleAlias ( )
private

Returns the name of the one and only repository under kConfigPath Throws an exception if there are none or multiple repositories. The alias is usually the fqrn except for a replica with an explicit alias set different from the fqrn (e.g. if Stratum 0 and 1 are hosted) on the same node.

Definition at line 415 of file settings.cc.

Referenced by CreateSettingsPublisher(), and CreateSettingsRepository().

Here is the call graph for this function:

Here is the caller graph for this function:

bool publish::SettingsBuilder::IsManagedRepository ( ) const
inline

Definition at line 524 of file settings.h.

Referenced by CreateSettingsPublisher(), and publish::CmdInfo::Main().

Here is the caller graph for this function:

OptionsManager* publish::SettingsBuilder::options_mgr ( ) const
inline

Definition at line 523 of file settings.h.

Referenced by publish::CmdInfo::Main().

Here is the caller graph for this function:

void publish::SettingsBuilder::SetConfigPath ( const std::string &  config_path)
inline

Definition at line 532 of file settings.h.

Referenced by publish::CmdAbort::Main(), publish::CmdCommit::Main(), and publish::CmdEnter::Main().

Here is the caller graph for this function:

Member Data Documentation

std::string publish::SettingsBuilder::config_path_
private

For non locally managed repositories, a configuration file should be provided in order to publish from the ephemeral shell through the gateway

Definition at line 541 of file settings.h.

Referenced by CreateSettingsPublisher(), CreateSettingsRepository(), GetSingleAlias(), and SetConfigPath().

OptionsManager* publish::SettingsBuilder::options_mgr_
private

For locally managed repositories, the options manager is non NULL and contains the configuration after a call to CreateSettingsRepository()

Definition at line 547 of file settings.h.

Referenced by CreateSettingsPublisher(), CreateSettingsRepository(), IsManagedRepository(), options_mgr(), and ~SettingsBuilder().


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