ARC SDK
Public Member Functions | Static Public Attributes
Arc::UserConfig Class Reference

User configuration class More...

#include <arc/UserConfig.h>

Public Member Functions

 UserConfig (initializeCredentialsType initializeCredentials=initializeCredentialsType())
 Create a UserConfig object. More...
 
 UserConfig (const std::string &conffile, initializeCredentialsType initializeCredentials=initializeCredentialsType(), bool loadSysConfig=true)
 Create a UserConfig object. More...
 
 UserConfig (const std::string &conffile, const std::string &jfile, initializeCredentialsType initializeCredentials=initializeCredentialsType(), bool loadSysConfig=true)
 Create a UserConfig object. More...
 
 UserConfig (const long int &ptraddr)
 Language binding constructor. More...
 
bool InitializeCredentials (initializeCredentialsType initializeCredentials)
 Initialize user credentials. More...
 
bool CredentialsFound () const
 Validate credential location. More...
 
bool LoadConfigurationFile (const std::string &conffile, bool ignoreJobListFile=true)
 Load specified configuration file. More...
 
bool SaveToFile (const std::string &filename) const
 Save to INI file. More...
 
void ApplyToConfig (BaseConfig &ccfg) const
 Apply credentials to BaseConfig. More...
 
 operator bool () const
 Check for validity. More...
 
bool operator! () const
 Check for non-validity. More...
 
bool JobListFile (const std::string &path)
 Set path to job list file. More...
 
const std::string & JobListFile () const
 Get a reference to the path of the job list file. More...
 
bool Timeout (int newTimeout)
 Set timeout. More...
 
int Timeout () const
 Get timeout. More...
 
bool Verbosity (const std::string &newVerbosity)
 Set verbosity. More...
 
const std::string & Verbosity () const
 Get the user selected level of verbosity. More...
 
bool Broker (const std::string &name)
 Set broker to use in target matching. More...
 
bool Broker (const std::string &name, const std::string &argument)
 Set broker to use in target matching. More...
 
const std::pair< std::string,
std::string > & 
Broker () const
 Get the broker and corresponding arguments. More...
 
bool Bartender (const std::vector< URL > &urls)
 Set bartenders, used to contact Chelonia. More...
 
void AddBartender (const URL &url)
 Set bartenders, used to contact Chelonia. More...
 
const std::vector< URL > & Bartender () const
 Get bartenders. More...
 
bool VOMSESPath (const std::string &path)
 Set path to file containing VOMS configuration. More...
 
const std::string & VOMSESPath ()
 Get path to file containing VOMS configuration. More...
 
bool UserName (const std::string &name)
 Set user-name for SLCS. More...
 
const std::string & UserName () const
 Get user-name. More...
 
bool Password (const std::string &newPassword)
 Set password. More...
 
const std::string & Password () const
 Get password. More...
 
bool ProxyPath (const std::string &newProxyPath)
 Set path to user proxy. More...
 
const std::string & ProxyPath () const
 Get path to user proxy. More...
 
bool CertificatePath (const std::string &newCertificatePath)
 Set path to certificate. More...
 
const std::string & CertificatePath () const
 Get path to certificate. More...
 
bool KeyPath (const std::string &newKeyPath)
 Set path to key. More...
 
const std::string & KeyPath () const
 Get path to key. More...
 
bool KeyPassword (const std::string &newKeyPassword)
 Set password for generated key. More...
 
const std::string & KeyPassword () const
 Get password for generated key. More...
 
bool KeySize (int newKeySize)
 Set key size. More...
 
int KeySize () const
 Get key size. More...
 
bool CACertificatePath (const std::string &newCACertificatePath)
 Set CA-certificate path. More...
 
const std::string & CACertificatePath () const
 Get path to CA-certificate. More...
 
bool CACertificatesDirectory (const std::string &newCACertificatesDirectory)
 Set path to CA-certificate directory. More...
 
const std::string & CACertificatesDirectory () const
 Get path to CA-certificate directory. More...
 
bool CertificateLifeTime (const Period &newCertificateLifeTime)
 Set certificate life time. More...
 
const PeriodCertificateLifeTime () const
 Get certificate life time. More...
 
bool SLCS (const URL &newSLCS)
 Set the URL to the Short Lived Certificate Service (SLCS). More...
 
const URLSLCS () const
 Get the URL to the Short Lived Certificate Service (SLCS). More...
 
bool StoreDirectory (const std::string &newStoreDirectory)
 Set store directory. More...
 
const std::string & StoreDirectory () const
 Get store diretory. More...
 
bool JobDownloadDirectory (const std::string &newDownloadDirectory)
 Set download directory. More...
 
const std::string & JobDownloadDirectory () const
 Get download directory. More...
 
bool IdPName (const std::string &name)
 Set IdP name. More...
 
const std::string & IdPName () const
 Get IdP name. More...
 
bool OverlayFile (const std::string &path)
 Set path to configuration overlay file. More...
 
const std::string & OverlayFile () const
 Get path to configuration overlay file. More...
 
bool UtilsDirPath (const std::string &dir)
 Set path to directory storing utility files for DataPoints. More...
 
const std::string & UtilsDirPath () const
 Get path to directory storing utility files for DataPoints. More...
 
void SetUser (const User &u)
 Set User for filesystem access. More...
 
const UserGetUser () const
 Get User for filesystem access. More...
 
bool InfoInterface (const std::string &infointerface_)
 Set the default local information system interface. More...
 
const std::string & InfoInterface () const
 Get the default local information system interface. More...
 
bool SubmissionInterface (const std::string &submissioninterface_)
 Set the default submission interface. More...
 
const std::string & SubmissionInterface () const
 Get the default submission interface. More...
 
const std::list< std::string > & RejectDiscoveryURLs () const
 Get the list of rejected service discovery URLs. More...
 
void AddRejectDiscoveryURLs (const std::list< std::string > &urls)
 Add list of URLs to ignored at service discovery. More...
 
void ClearRejectDiscoveryURLs ()
 Clear the rejected service discovery URLs. More...
 
const std::list< std::string > & RejectManagementURLs () const
 Get the list of rejected job managmenet URLs. More...
 
ConfigEndpoint GetService (const std::string &alias)
 Get the ConfigEndpoint for the service with the given alias. More...
 
std::list< ConfigEndpointGetServicesInGroup (const std::string &group, ConfigEndpoint::Type type=ConfigEndpoint::ANY)
 Get the services in a given group filtered by type. More...
 
std::list< ConfigEndpointGetDefaultServices (ConfigEndpoint::Type type=ConfigEndpoint::ANY)
 Get the services flagged as default filtered by type. More...
 
std::list< ConfigEndpointGetServices (const std::string &groupOrAlias, ConfigEndpoint::Type type=ConfigEndpoint::ANY)
 Get one or more service with the given alias or in the given group filtered by type. More...
 
std::map< std::string,
ConfigEndpoint
GetAllConfiguredServices ()
 Get all services.
 

Static Public Attributes

static const std::string ARCUSERDIRECTORY
 Path to ARC user home directory. More...
 
static const std::string SYSCONFIG
 Path to system configuration. More...
 
static const std::string SYSCONFIGARCLOC
 Path to system configuration at ARC location. More...
 
static const std::string DEFAULTCONFIG
 Path to default configuration file. More...
 
static const std::string EXAMPLECONFIG
 Path to example configuration. More...
 
static const int DEFAULT_TIMEOUT = 20
 Default timeout in seconds. More...
 
static const std::string DEFAULT_BROKER
 Default broker. More...
 

Detailed Description

User configuration class

This class provides a container for a selection of various attributes/parameters which can be configured to needs of the user, and can be read by implementing instances or programs. The class can be used in two ways. One can create a object from a configuration file, or simply set the desired attributes by using the setter method, associated with every setable attribute. The list of attributes which can be configured in this class are:

where the first term is the name of the attribute used in the configuration file, and the second term is the associated setter method (for more information about a given attribute see the description of the setter method).

The configuration file should have a INI-style format and the IniConfig class will thus be used to parse the file. The above mentioned attributes should be placed in the common section.

Besides the options above, the configuration file can contain information about services (service registries and computing elements). Each service has to be put in its on section. Each service has an alias, which is a short name. The name of the section consists of the word registry for service registries and computing for computing elements, then contains a slash and the alias of the service. e.g. [registry/index1] or [computing/testce] In a service section the possible options are the following:

For computing elements the following additional options exist:

For a service registry the following additional option exist:

These services can be accessed by the GetService, GetServices, GetDefaultServices, GetServicesInGroup methods, which return ConfigEndpoint object(s). The ConfigEndpoint objects contain the URL and the InterfaceNames of the services.

The UserConfig class also provides a method InitializeCredentials() for locating user credentials by searching in different standard locations. The CredentialsFound() method can be used to test if locating the credentials succeeded.

Constructor & Destructor Documentation

Arc::UserConfig::UserConfig ( initializeCredentialsType  initializeCredentials = initializeCredentialsType())

Create a UserConfig object.

The UserConfig object created by this constructor initializes only default values, and if specified by the initializeCredentials boolean credentials will be tried initialized using the InitializeCredentials() method. The object is only non-valid if initialization of credentials fails which can be checked with the operator bool() method.

Parameters
initializeCredentialsis a optional boolean indicating if the InitializeCredentials() method should be invoked, the default is true.
See Also
InitializeCredentials()
operator bool()
Arc::UserConfig::UserConfig ( const std::string &  conffile,
initializeCredentialsType  initializeCredentials = initializeCredentialsType(),
bool  loadSysConfig = true 
)

Create a UserConfig object.

The UserConfig object created by this constructor will, if specified by the loadSysConfig boolean, first try to load the system configuration file by invoking the LoadConfigurationFile() method, and if this fails a WARNING is reported. Then the configuration file passed will be tried loaded using the before mentioned method, and if this fails an ERROR is reported, and the created object will be non-valid. Note that if the passed file path is empty the example configuration will be tried copied to the default configuration file path specified by DEFAULTCONFIG. If the example file cannot be copied one or more WARNING messages will be reported and no configration will be loaded. If loading the configurations file succeeded and if initializeCredentials is true then credentials will be initialized using the InitializeCredentials() method, and if no valid credentials are found the created object will be non-valid.

Parameters
conffileis the path to a INI-configuration file.
initializeCredentialsis a boolean indicating if credentials should be initialized, the default is true.
loadSysConfigis a boolean indicating if the system configuration file should be loaded aswell, the default is true.
See Also
LoadConfigurationFile(const std::string&, bool)
InitializeCredentials()
operator bool()
SYSCONFIG
EXAMPLECONFIG
Arc::UserConfig::UserConfig ( const std::string &  conffile,
const std::string &  jfile,
initializeCredentialsType  initializeCredentials = initializeCredentialsType(),
bool  loadSysConfig = true 
)

Create a UserConfig object.

The UserConfig object created by this constructor does only differ from the UserConfig(const std::string&, bool, bool) constructor in that it is possible to pass the path of the job list file directly to this constructor. If the job list file joblistfile is empty, the behaviour of this constructor is exactly the same as the before mentioned, otherwise the job list file will be initilized by invoking the setter method JobListFile(const std::string&). If it fails the created object will be non-valid, otherwise the specified configuration file conffile will be loaded with the ignoreJobListFile argument set to true.

Parameters
conffileis the path to a INI-configuration file
jfileis the path to a (non-)existing job list file.
initializeCredentialsis a boolean indicating if credentials should be initialized, the default is true.
loadSysConfigis a boolean indicating if the system configuration file should be loaded aswell, the default is true.
See Also
JobListFile(const std::string&)
LoadConfigurationFile(const std::string&, bool)
InitializeCredentials()
operator bool()
Arc::UserConfig::UserConfig ( const long int &  ptraddr)

Language binding constructor.

The passed long int should be a pointer address to a UserConfig object, and this address is then casted into this UserConfig object.

Parameters
ptraddris an memory address to a UserConfig object.

Member Function Documentation

void Arc::UserConfig::AddBartender ( const URL url)
inline

Set bartenders, used to contact Chelonia.

Takes as input a Bartender URL and adds this to the list of bartenders.

Parameters
urlis a URL to be added to the list of bartenders.
See Also
Bartender(const std::list<URL>&)
Bartender() const
void Arc::UserConfig::AddRejectDiscoveryURLs ( const std::list< std::string > &  urls)
inline

Add list of URLs to ignored at service discovery.

The passed list of strings will be added to the internal reject list and they should represent URLs which should be ignored when doing service discovery.

Parameters
urlslist of string representing URLs to ignore at service discovery
void Arc::UserConfig::ApplyToConfig ( BaseConfig ccfg) const

Apply credentials to BaseConfig.

This methods sets the BaseConfig credentials to the credentials contained in this object. It also passes user defined configuration overlay if any.

See Also
InitializeCredentials()
CredentialsFound()
BaseConfig
Parameters
ccfga BaseConfig object which will configured with the credentials of this object.
bool Arc::UserConfig::Bartender ( const std::vector< URL > &  urls)
inline

Set bartenders, used to contact Chelonia.

Takes as input a vector of Bartender URLs.

The attribute associated with this setter method is 'bartender'.

Parameters
urlsis a list of URL object to be set as bartenders.
Returns
This method always returns true.
See Also
AddBartender(const URL&)
Bartender() const
const std::vector<URL>& Arc::UserConfig::Bartender ( ) const
inline

Get bartenders.

Returns a list of Bartender URLs

Returns
The list of bartender URL objects is returned.
See Also
Bartender(const std::list<URL>&)
AddBartender(const URL&)
bool Arc::UserConfig::Broker ( const std::string &  name)

Set broker to use in target matching.

The string passed to this method should be in the format:

\[<name>[:<argument>]\]

where the <name> is the name of the broker and cannot contain any ':', and the optional <argument> should contain arguments which should be passed to the broker.

Two attributes are associated with this setter method 'brokername' and 'brokerarguments'.

Parameters
namethe broker name and argument specified in the format given above.
Returns
This method allways returns true.
See Also
Broker
Broker(const std::string&, const std::string&)
Broker() const
DEFAULT_BROKER
bool Arc::UserConfig::Broker ( const std::string &  name,
const std::string &  argument 
)
inline

Set broker to use in target matching.

As opposed to the Broker(const std::string&) method this method sets broker name and arguments directly from the passed two arguments.

Two attributes are associated with this setter method 'brokername' and 'brokerarguments'.

Parameters
nameis the name of the broker.
argumentis the arguments of the broker.
Returns
This method always returns true.
See Also
Broker
Broker(const std::string&)
Broker() const
DEFAULT_BROKER
const std::pair<std::string, std::string>& Arc::UserConfig::Broker ( ) const
inline

Get the broker and corresponding arguments.

The returned pair contains the broker name as the first component and the argument as the second.

See Also
Broker(const std::string&)
Broker(const std::string&, const std::string&)
DEFAULT_BROKER
bool Arc::UserConfig::CACertificatePath ( const std::string &  newCACertificatePath)
inline

Set CA-certificate path.

The path to the file containing CA-certificate will be set when calling this method. This configuration parameter is deprecated - use CACertificatesDirectory instead. Only arcslcs uses it.

The attribute associated with this setter method is 'cacertificatepath'.

Parameters
newCACertificatePathis the path to the CA-certificate.
Returns
This method always returns true.
See Also
CACertificatePath() const
const std::string& Arc::UserConfig::CACertificatePath ( ) const
inline

Get path to CA-certificate.

Retrieve the path to the file containing CA-certificate. This configuration parameter is deprecated.

Returns
The path to the CA-certificate is returned.
See Also
CACertificatePath(const std::string&)
bool Arc::UserConfig::CACertificatesDirectory ( const std::string &  newCACertificatesDirectory)
inline

Set path to CA-certificate directory.

The path to the directory containing CA-certificates will be set when calling this method. Note that the InitializeCredentials() method will also try to set this path, by searching in different locations.

The attribute associated with this setter method is 'cacertificatesdirectory'.

Parameters
newCACertificatesDirectoryis the path to the CA-certificate directory.
Returns
This method always returns true.
See Also
InitializeCredentials()
CredentialsFound() const
CACertificatesDirectory() const
const std::string& Arc::UserConfig::CACertificatesDirectory ( ) const
inline

Get path to CA-certificate directory.

Retrieve the path to the CA-certificate directory.

Returns
The path to the CA-certificate directory is returned.
See Also
InitializeCredentials()
CredentialsFound() const
CACertificatesDirectory(const std::string&)
bool Arc::UserConfig::CertificateLifeTime ( const Period newCertificateLifeTime)
inline

Set certificate life time.

Sets lifetime of user certificate which will be obtained from Short Lived Credentials Service.

The attribute associated with this setter method is 'certificatelifetime'.

Parameters
newCertificateLifeTimeis the life time of a certificate, as a Period object.
Returns
This method always returns true.
See Also
CertificateLifeTime() const
const Period& Arc::UserConfig::CertificateLifeTime ( ) const
inline

Get certificate life time.

Gets lifetime of user certificate which will be obtained from Short Lived Credentials Service.

Returns
The certificate life time is returned as a Period object.
See Also
CertificateLifeTime(const Period&)
bool Arc::UserConfig::CertificatePath ( const std::string &  newCertificatePath)
inline

Set path to certificate.

The path to user certificate will be set by this method. The path to the correcsponding key can be set with the KeyPath(const std::string&) method. Note that the InitializeCredentials() method will also try to set this path, by searching in different locations.

The attribute associated with this setter method is 'certificatepath'.

Parameters
newCertificatePathis the path to the new certificate.
Returns
This method always returns true.
See Also
InitializeCredentials()
CredentialsFound() const
CertificatePath() const
KeyPath(const std::string&)
const std::string& Arc::UserConfig::CertificatePath ( ) const
inline

Get path to certificate.

The path to the cerficate is returned when invoking this method.

Returns
The certificate path is returned.
See Also
InitializeCredentials()
CredentialsFound() const
CertificatePath(const std::string&)
KeyPath() const
void Arc::UserConfig::ClearRejectDiscoveryURLs ( )
inline

Clear the rejected service discovery URLs.

Clears the list of strings representing URLs which should be ignored during service discovery.

bool Arc::UserConfig::CredentialsFound ( ) const
inline

Validate credential location.

Valid credentials consists of a combination of a path to existing CA-certificate directory and either a path to existing proxy or a path to existing user key/certificate pair. If valid credentials are found this method returns true, otherwise false is returned.

Returns
true if valid credentials are found, otherwise false.
See Also
InitializeCredentials()
std::list<ConfigEndpoint> Arc::UserConfig::GetDefaultServices ( ConfigEndpoint::Type  type = ConfigEndpoint::ANY)

Get the services flagged as default filtered by type.

Return all the services which had default=yes in their configuration, if they have the given type.

Parameters
[in]typeis REGISTRY or COMPUTING if only those services are needed, or ANY if all
Returns
a list of ConfigEndpoint objects, the default services, empty list if there are no default service, or no services matched the filter
ConfigEndpoint Arc::UserConfig::GetService ( const std::string &  alias)

Get the ConfigEndpoint for the service with the given alias.

Each service in the configuration file has its own section, and the name of the section contains the type of the service (registry or computing), and the alias of the service (separated by a slash).

Parameters
[in]aliasis the alias of the service
Returns
the ConfigEndpoint generated from the service with the given alias.
std::list<ConfigEndpoint> Arc::UserConfig::GetServices ( const std::string &  groupOrAlias,
ConfigEndpoint::Type  type = ConfigEndpoint::ANY 
)

Get one or more service with the given alias or in the given group filtered by type.

This is a convenience method for querying the configured services by both the name of a group or an alias of a service. If the name is a name of a group then all the services in the group will be returned (filtered by type). If there is no such group, then a service with the given alias is returned in a single item list (but only if it matches the filter).

Parameters
[in]groupOrAliasis either a name of a group or an alias of a service
[in]typeis REGISTRY or COMPUTING if only those services are needed, or ANY if all
Returns
a list of ConfigEndpoint objects, the found services, empty list if no such group and no such alias or no services matched the filter
std::list<ConfigEndpoint> Arc::UserConfig::GetServicesInGroup ( const std::string &  group,
ConfigEndpoint::Type  type = ConfigEndpoint::ANY 
)

Get the services in a given group filtered by type.

All services of the given group are returned if they match the type filter.

Parameters
[in]groupis the name of the group
[in]typeis REGISTRY or COMPUTING if only those services are needed, or ANY if all
Returns
a list of ConfigEndpoint objects, the services in the group, empty list if no such group, or no services matched the filter
const User& Arc::UserConfig::GetUser ( ) const
inline

Get User for filesystem access.

Returns
The user identity to use for file system access
See Also
SetUser(const User&)
bool Arc::UserConfig::IdPName ( const std::string &  name)
inline

Set IdP name.

Sets Identity Provider name (Shibboleth) to which user belongs. It is used for contacting Short Lived Certificate Service.

The attribute associated with this setter method is 'idpname'.

Parameters
nameis the new IdP name.
Returns
This method always returns true.
See Also
const std::string& Arc::UserConfig::IdPName ( ) const
inline

Get IdP name.

Gets Identity Provider name (Shibboleth) to which user belongs.

Returns
The IdP name
See Also
IdPName(const std::string&)
bool Arc::UserConfig::InfoInterface ( const std::string &  infointerface_)
inline

Set the default local information system interface.

For services which does not specify a local information system interface, this default will be used.

If a local information system interface is given, the computing element will be only queried using this interface.

Parameters
infointerface_is a string specifying a GLUE2 InterfaceName
Returns
This method always returns true.
const std::string& Arc::UserConfig::InfoInterface ( ) const
inline

Get the default local information system interface.

Returns
the GLUE2 InterfaceName string specifying the default local information system interface
See Also
InfoInterface(const std::string&)
bool Arc::UserConfig::InitializeCredentials ( initializeCredentialsType  initializeCredentials)

Initialize user credentials.

The location of the user credentials will be tried located when calling this method and stored internally when found. The method searches in different locations. Depending on value of initializeCredentials this method behaves differently. Following is an explanation for RequireCredentials. For less strict values see information below. First the user proxy or the user key/certificate pair is tried located in the following order:

  • Proxy path specified by the environment variable X509_USER_PROXY. If value is set and corresponding file does not exist it considered to be an error and no other locations are tried. If found no more proxy paths are tried.
  • Current proxy path as passed to the contructor, explicitly set using the setter method ProxyPath(const std::string&) or read from configuration by constructor or LoadConfiguartionFile() method. If value is set and corresponding file does not exist it considered to be an error and no other locations are tried. If found no more proxy paths are tried.
  • Proxy path made of x509up_u token concatenated with the user numerical ID located in the OS temporary directory. It is NOT an error if corresponding file does not exist and processing continues.
  • Key/certificate paths specified by the environment variables X509_USER_KEY and X509_USER_CERT. If values are set and corresponding files do not exist it considered to be an error and no other locations are tried. Error message is supressed if proxy was previously found.
  • Current key/certificate paths passed to the contructor or explicitly set using the setter methods KeyPath(const std::string&) and CertificatePath(const std::string&) or read from configuration by constructor or LoadConfiguartionFile() method. If values are set and corresponding files do not exist it is an error and no other locations are tried. Error message is supressed if proxy was previously found.
  • Key/certificate paths ~/.arc/usercert.pem and ~/.arc/userkey.pem respectively are tried. It is not an error if not found.
  • Key/certificate paths ~/.globus/usercert.pem and ~/.globus/userkey.pem respectively are tried. It is not an error if not found.
  • Key/certificate paths created by concatenation of ARC installation location and /etc/arc/usercert.pem and /etc/arc/userkey.pem respectively are tried. It is not an error if not found.
  • Key/certificate located in current working directory are tried.
  • If neither proxy nor key/certificate files are found this is considered to be an error.

Along with the proxy and key/certificate pair, the path of the directory containing CA certificates is also located. The presence of directory will be checked in the following order and first found is accepted:

  • Path specified by the X509_CERT_DIR environment variable. It is an error if value is set and directory does not exist.
  • Current path explicitly specified by using the setter method CACertificatesDirectory() or read from configuration by constructor or LoadConfiguartionFile() method. It is an error if value is set and directory does not exist.
  • Path ~/.globus/certificates. It is not an error if it does not exist.
  • Path created by concatenating the ARC installation location and /etc/certificates. It is not an error if it does not exist.
  • Path created by concatenating the ARC installation location and /share/certificates. It is not an error if it does not exist.
  • Path /etc/grid-security/certificates.

It is an error if none of the directories above exist.

In case of initializeCredentials == TryCredentials method behaves same way like in case RequireCredentials except it does not report errors through its Logger object and does not return false.

If NotTryCredentials is used method does not check for presence of credentials. It behaves like if corresponding files are always present.

And in case of SkipCredentials method does nothing.

All options with SkipCA* prefix behaves similar to those without prefix except the path of the directory containing CA certificates is completely ignored.

See Also
CredentialsFound()
ProxyPath(const std::string&)
KeyPath(const std::string&)
CertificatePath(const std::string&)
CACertificatesDirectory(const std::string&)
bool Arc::UserConfig::JobDownloadDirectory ( const std::string &  newDownloadDirectory)
inline

Set download directory.

Sets directory which will be used to download the job directory using arcget command.

The attribute associated with this setter method is 'jobdownloaddirectory'.

Parameters
newDownloadDirectoryis the path to the download directory.
Returns
This method always returns true.
See Also
const std::string& Arc::UserConfig::JobDownloadDirectory ( ) const
inline

Get download directory.

returns directory which will be used to download the job directory using arcget command.

The attribute associated with the method is 'jobdownloaddirectory'.

Returns
This method returns the job download directory.
See Also
bool Arc::UserConfig::JobListFile ( const std::string &  path)

Set path to job list file.

The method takes a path to a file which will be used as the job list file for storing and reading job information. If the specified path path does not exist a empty job list file will be tried created. If creating the job list file in any way fails false will be returned and a ERROR message will be reported. Otherwise true is returned. If the directory containing the file does not exist, it will be tried created. The method will also return false if the file is not a regular file.

The attribute associated with this setter method is 'joblist'.

Parameters
paththe path to the job list file.
Returns
If the job list file is a regular file or if it can be created true is returned, otherwise false is returned.
See Also
JobListFile() const
const std::string& Arc::UserConfig::JobListFile ( ) const
inline

Get a reference to the path of the job list file.

The job list file is used to store and fetch information about submitted computing jobs to computing services. This method will return the path to the specified job list file.

Returns
The path to the job list file is returned.
See Also
JobListFile(const std::string&)
bool Arc::UserConfig::KeyPassword ( const std::string &  newKeyPassword)
inline

Set password for generated key.

Set password to be used to encode private key of credentials obtained from Short Lived Credentials Service.

The attribute associated with this setter method is 'keypassword'.

Parameters
newKeyPasswordis the new password to the key.
Returns
This method always returns true.
See Also
KeyPassword() const
KeyPath(const std::string&)
KeySize(int)
const std::string& Arc::UserConfig::KeyPassword ( ) const
inline

Get password for generated key.

Get password to be used to encode private key of credentials obtained from Short Lived Credentials Service.

Returns
The key password is returned.
See Also
KeyPassword(const std::string&)
KeyPath() const
KeySize() const
bool Arc::UserConfig::KeyPath ( const std::string &  newKeyPath)
inline

Set path to key.

The path to user key will be set by this method. The path to the corresponding certificate can be set with the CertificatePath(const std::string&) method. Note that the InitializeCredentials() method will also try to set this path, by searching in different locations.

The attribute associated with this setter method is 'keypath'.

Parameters
newKeyPathis the path to the new key.
Returns
This method always returns true.
See Also
InitializeCredentials()
CredentialsFound() const
KeyPath() const
CertificatePath(const std::string&)
KeyPassword(const std::string&)
KeySize(int)
const std::string& Arc::UserConfig::KeyPath ( ) const
inline

Get path to key.

The path to the key is returned when invoking this method.

Returns
The path to the user key is returned.
See Also
InitializeCredentials()
CredentialsFound() const
KeyPath(const std::string&)
CertificatePath() const
KeyPassword() const
KeySize() const
bool Arc::UserConfig::KeySize ( int  newKeySize)
inline

Set key size.

Set size/strengt of private key of credentials obtained from Short Lived Credentials Service.

The attribute associated with this setter method is 'keysize'.

Parameters
newKeySizeis the size, an an integer, of the key.
Returns
This method always returns true.
See Also
KeySize() const
KeyPath(const std::string&)
KeyPassword(const std::string&)
int Arc::UserConfig::KeySize ( ) const
inline

Get key size.

Get size/strengt of private key of credentials obtained from Short Lived Credentials Service.

Returns
The key size, as an integer, is returned.
See Also
KeySize(int)
KeyPath() const
KeyPassword() const
bool Arc::UserConfig::LoadConfigurationFile ( const std::string &  conffile,
bool  ignoreJobListFile = true 
)

Load specified configuration file.

The configuration file passed is parsed by this method by using the IniConfig class. If the parsing is unsuccessful a WARNING is reported.

The format of the configuration file should follow that of INI, and every attribute present in the file is only allowed once (except the rejectmanagement and rejectdiscovery attributes), otherwise a WARNING will be reported. For the list of allowed attributes see the detailed description of UserConfig.

Parameters
conffileis the path to the configuration file.
ignoreJobListFileis a optional boolean which indicates whether the joblistfile attribute in the configuration file should be ignored. Default is to ignored it (true).
Returns
If loading the configuration file succeeds true is returned, otherwise false is returned.
See Also
SaveToFile()
Arc::UserConfig::operator bool ( void  ) const
inline

Check for validity.

The validity of an object created from this class can be checked using this casting operator. An object is valid if the constructor did not encounter any errors.

See Also
operator!()
bool Arc::UserConfig::operator! ( void  ) const
inline

Check for non-validity.

See operator bool() for a description.

See Also
operator bool()
bool Arc::UserConfig::OverlayFile ( const std::string &  path)
inline

Set path to configuration overlay file.

Content of specified file is a backdoor to configuration XML generated from information stored in this class. The content of file is passed to BaseConfig class in ApplyToConfig(BaseConfig&) then merged with internal configuration XML representation. This feature is meant for quick prototyping/testing/tuning of functionality without rewriting code. It is meant for developers and most users won't need it.

The attribute associated with this setter method is 'overlayfile'.

Parameters
pathis the new overlay file path.
Returns
This method always returns true.
See Also
const std::string& Arc::UserConfig::OverlayFile ( ) const
inline

Get path to configuration overlay file.

Returns
The overlay file path
See Also
OverlayFile(const std::string&)
bool Arc::UserConfig::Password ( const std::string &  newPassword)
inline

Set password.

Set password which is used for requesting credentials from Short Lived Credentials Service.

The attribute associated with this setter method is 'password'.

Parameters
newPasswordis the new password to set.
Returns
This method always returns true.
See Also
Password() const
const std::string& Arc::UserConfig::Password ( ) const
inline

Get password.

Get password which is used for requesting credentials from Short Lived Credentials Service.

Returns
The password is returned.
See Also
Password(const std::string&)
bool Arc::UserConfig::ProxyPath ( const std::string &  newProxyPath)
inline

Set path to user proxy.

This method will set the path of the user proxy. Note that the InitializeCredentials() method will also try to set this path, by searching in different locations.

The attribute associated with this setter method is 'proxypath'

Parameters
newProxyPathis the path to a user proxy.
Returns
This method always returns true.
See Also
InitializeCredentials()
CredentialsFound()
ProxyPath() const
const std::string& Arc::UserConfig::ProxyPath ( ) const
inline

Get path to user proxy.

Retrieve path to user proxy.

Returns
Returns the path to the user proxy.
See Also
ProxyPath(const std::string&)
const std::list<std::string>& Arc::UserConfig::RejectDiscoveryURLs ( ) const
inline

Get the list of rejected service discovery URLs.

This list is populated by the (possibly multiple) rejectdiscovery configuration options. A service registry should not be queried if its URL matches any string in this list.

Returns
a list of rejected service discovery URLs
const std::list<std::string>& Arc::UserConfig::RejectManagementURLs ( ) const
inline

Get the list of rejected job managmenet URLs.

This list is populated by the (possibly multiple) rejectmanagement configuration options. Those jobs should not be managed, that reside on a computing element with a matching URL.

Returns
a list of rejected job management URLs
bool Arc::UserConfig::SaveToFile ( const std::string &  filename) const

Save to INI file.

This method will save the object data as a INI file. The saved file can be loaded with the LoadConfigurationFile method.

Parameters
filenamethe name of the file which the data will be saved to.
Returns
false if unable to get handle on file, otherwise true is returned.
See Also
LoadConfigurationFile()
void Arc::UserConfig::SetUser ( const User u)
inline

Set User for filesystem access.

Sometimes it is desirable to use the identity of another user when accessing the filesystem. This user can be specified through this method. By default this user is the same as the user running the process.

Parameters
uUser identity to use
bool Arc::UserConfig::SLCS ( const URL newSLCS)
inline

Set the URL to the Short Lived Certificate Service (SLCS).

The attribute associated with this setter method is 'slcs'.

Parameters
newSLCSis the URL to the SLCS
Returns
This method always returns true.
See Also
SLCS() const
const URL& Arc::UserConfig::SLCS ( ) const
inline

Get the URL to the Short Lived Certificate Service (SLCS).

Returns
The SLCS is returned.
See Also
SLCS(const URL&)
bool Arc::UserConfig::StoreDirectory ( const std::string &  newStoreDirectory)
inline

Set store directory.

Sets directory which will be used to store credentials obtained from Short Lived Credential Servide.

The attribute associated with this setter method is 'storedirectory'.

Parameters
newStoreDirectoryis the path to the store directory.
Returns
This method always returns true.
See Also
const std::string& Arc::UserConfig::StoreDirectory ( ) const
inline

Get store diretory.

Sets directory which is used to store credentials obtained from Short Lived Credential Servide.

Returns
The path to the store directory is returned.
See Also
StoreDirectory(const std::string&)
bool Arc::UserConfig::SubmissionInterface ( const std::string &  submissioninterface_)
inline

Set the default submission interface.

For services which does not specify a submission interface this default submission interface will be used.

If a submission interface is given, then all the jobs will be submitted to this interface, no other job submission interfaces of the computing element will be tried.

Parameters
submissioninterface_is a string specifying a GLUE2 InterfaceName
Returns
This method always returns true.
const std::string& Arc::UserConfig::SubmissionInterface ( ) const
inline

Get the default submission interface.

Returns
the GLUE2 InterfaceName string specifying the default submission interface
See Also
SubmissionInterface(const std::string&)
bool Arc::UserConfig::Timeout ( int  newTimeout)

Set timeout.

When communicating with a service the timeout specifies how long, in seconds, the communicating instance should wait for a response. If the response have not been recieved before this period in time, the connection is typically dropped, and an error will be reported.

This method will set the timeout to the specified integer. If the passed integer is less than or equal to 0 then false is returned and the timeout will not be set, otherwise true is returned and the timeout will be set to the new value.

The attribute associated with this setter method is 'timeout'.

Parameters
newTimeoutthe new timeout value in seconds.
Returns
false in case newTimeout <= 0, otherwise true.
See Also
Timeout() const
DEFAULT_TIMEOUT
int Arc::UserConfig::Timeout ( ) const
inline

Get timeout.

Returns the timeout in seconds.

Returns
timeout in seconds.
See Also
Timeout(int)
DEFAULT_TIMEOUT
bool Arc::UserConfig::UserName ( const std::string &  name)
inline

Set user-name for SLCS.

Set username which is used for requesting credentials from Short Lived Credentials Service.

The attribute associated with this setter method is 'username'.

Parameters
nameis the name of the user.
Returns
This method always return true.
See Also
UserName() const
const std::string& Arc::UserConfig::UserName ( ) const
inline

Get user-name.

Get username which is used for requesting credentials from Short Lived Credentials Service.

Returns
The username is returned.
See Also
UserName(const std::string&)
bool Arc::UserConfig::UtilsDirPath ( const std::string &  dir)

Set path to directory storing utility files for DataPoints.

Some DataPoints can store information on remote services in local files. This method sets the path to the directory containing these files. For example arc* tools set it to ARCUSERDIRECTORY and A-REX sets it to the control directory. The directory is created if it does not exist.

Parameters
diris the new utils dir path.
Returns
This method always returns true.
const std::string& Arc::UserConfig::UtilsDirPath ( ) const
inline

Get path to directory storing utility files for DataPoints.

Returns
The utils dir path
See Also
UtilsDirPath(const std::string&)
bool Arc::UserConfig::Verbosity ( const std::string &  newVerbosity)

Set verbosity.

The verbosity will be set when invoking this method. If the string passed cannot be parsed into a corresponding LogLevel, using the function a WARNING is reported and false is returned, otherwise true is returned.

The attribute associated with this setter method is 'verbosity'.

Returns
true in case the verbosity could be set to a allowed LogLevel, otherwise false.
See Also
Verbosity() const
const std::string& Arc::UserConfig::Verbosity ( ) const
inline

Get the user selected level of verbosity.

The string representation of the verbosity level specified by the user is returned when calling this method. If the user have not specified the verbosity level the empty string will be referenced.

Returns
the verbosity level, or empty if it has not been set.
See Also
Verbosity(const std::string&)
bool Arc::UserConfig::VOMSESPath ( const std::string &  path)
inline

Set path to file containing VOMS configuration.

Set path to file which contians list of VOMS services and associated configuration parameters needed to contact those services. It is used by arcproxy.

The attribute associated with this setter method is 'vomsserverpath'.

Parameters
paththe path to VOMS configuration file
Returns
This method always return true.
See Also
VOMSESPath() const
const std::string& Arc::UserConfig::VOMSESPath ( )

Get path to file containing VOMS configuration.

Get path to file which contians list of VOMS services and associated configuration parameters.

Returns
The path to VOMS configuration file is returned.
See Also
VOMSESPath(const std::string&)

Field Documentation

const std::string Arc::UserConfig::ARCUSERDIRECTORY
static

Path to ARC user home directory.

The ARCUSERDIRECTORY variable is the path to the ARC home directory of the current user. This path is created using the User::Home() method.

See Also
User::Home()
const std::string Arc::UserConfig::DEFAULT_BROKER
static

Default broker.

The DEFAULT_BROKER specifies the name of the broker which should be used in case no broker is explicitly chosen.

See Also
Broker
Broker(const std::string&)
Broker(const std::string&, const std::string&)
Broker() const
const int Arc::UserConfig::DEFAULT_TIMEOUT = 20
static

Default timeout in seconds.

The DEFAULT_TIMEOUT specifies interval which will be used in case no timeout interval have been explicitly specified. For a description about timeout see Timeout(int).

See Also
Timeout(int)
Timeout() const
const std::string Arc::UserConfig::DEFAULTCONFIG
static

Path to default configuration file.

The DEFAULTCONFIG variable is the path to the default configuration file used in case no configuration file have been specified. The path is created from the ARCUSERDIRECTORY object.

const std::string Arc::UserConfig::EXAMPLECONFIG
static

Path to example configuration.

The EXAMPLECONFIG variable is the path to the example configuration file.

const std::string Arc::UserConfig::SYSCONFIG
static

Path to system configuration.

The SYSCONFIG variable is the path to the system configuration file. This variable is only equal to SYSCONFIGARCLOC if ARC is installed in the root (highly unlikely).

const std::string Arc::UserConfig::SYSCONFIGARCLOC
static

Path to system configuration at ARC location.

The SYSCONFIGARCLOC variable is the path to the system configuration file which reside at the ARC installation location.


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