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 491 of file settings.h.

Constructor & Destructor Documentation

publish::SettingsBuilder::SettingsBuilder ( )
inline

Definition at line 493 of file settings.h.

publish::SettingsBuilder::~SettingsBuilder ( )

Definition at line 388 of file settings.cc.

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

Used in unit tests.

Definition at line 501 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 540 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 602 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 504 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 442 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 393 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 419 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 527 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 526 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 535 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 544 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 550 of file settings.h.

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


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