Arc::JobDescription Class Reference

#include <JobDescription.h>

Public Member Functions

JobDescriptionResult UnParse (std::string &product, std::string language, const std::string &dialect="") const
const std::string & GetSourceLanguage () const
JobDescriptionResult SaveToStream (std::ostream &out, const std::string &format) const
bool Prepare (const ExecutionTarget &et)

Static Public Member Functions

static JobDescriptionResult Parse (const std::string &source, std::list< JobDescription > &jobdescs, const std::string &language="", const std::string &dialect="")

Data Fields

std::map< std::string,
std::string > 
OtherAttributes

Detailed Description

The JobDescription class is the internal representation of a job description in the ARC-lib. It is structured into a number of other classes/objects which should strictly follow the description given in the job description document <http://svn.nordugrid.org/trac/nordugrid/browser/arc1/trunk/doc/tech_doc/client/job_description.odt>.

The class consist of a parsing method JobDescription::Parse which tries to parse the passed source using a number of different parsers. The parser method is complemented by the JobDescription::UnParse method, a method to generate a job description document in one of the supported formats. Additionally the internal representation is contained in public members which makes it directly accessible and modifiable from outside the scope of the class.


Member Function Documentation

const std::string& Arc::JobDescription::GetSourceLanguage (  )  const [inline]

Get input source language.

If this object was created by a JobDescriptionParser, then this method returns a string which indicates the job description language of the parsed source. If not created by a JobDescripionParser the string returned is empty.

Returns:
const std::string& source langauge of parsed input source.
static JobDescriptionResult Arc::JobDescription::Parse ( const std::string &  source,
std::list< JobDescription > &  jobdescs,
const std::string &  language = "",
const std::string &  dialect = "" 
) [static]

Parse string into JobDescription objects.

The passed string will be tried parsed into the list of JobDescription objects. The available specialized JobDesciptionParser classes will be tried one by one, parsing the string, and if one succeeds the list of JobDescription objects is filled with the parsed contents and true is returned, otherwise false is returned. If no language specified, each JobDescriptionParser will try all its supported languages. On the other hand if a language is specified, only the JobDescriptionParser supporting that language will be tried. A dialect can also be specified, which only has an effect on the parsing if the JobDescriptionParser supports that dialect.

Parameters:
source 
jobdescs 
language 
dialect 
Returns:
true if the passed string can be parsed successfully by any of the available parsers.
bool Arc::JobDescription::Prepare ( const ExecutionTarget et  ) 

Prepare for submission to target.

The Prepare method, is used to check and adapt the JobDescription object to the passed ExecutionTarget object before submitting the job description to the target. This method is normally called by SubmitterPlugin plugin classes, before submitting the job description. First the method checks the DataStaging.InputFiles list, for identical file names, and non-existent local input files. If any of such files are found, the method returns false. Then if the Application.Executable and Application.Input objects are specified as local input files, and they are not among the files in the DataStaging.InputFiles list a existence check will be done and if not found, false will be returned, otherwise they will be added to the list. Likewise if the Application.Output, Application.Error and Application.LogDir attributes have been specified, and is not among the files in the DataStaging.OutputFiles list, they will be added to this list. After the file check, the Resources.RunTimeEnvironment, Resources.CEType and Resources.OperatingSystem SoftwareRequirement objects are respectively resolved against the ExecutionTarget::ApplicationEnvironments, ExecutionTarget::Implementation and ExecutionTarget::OperatingSystem Software objects using the SoftwareRequirement::selectSoftware method. If that method returns false i.e. unable to resolve the requirements false will be returned. After resolving software requirements, the value of the Resources.QueueName attribute will be set to that of the ExecutionTarget::ComputingShareName attribute, and then true is returned.

Parameters:
et ExecutionTarget object which to resolve software requirements against, and to pick up queue name from.
Returns:
false is returned is file checks fails, or if unable to resolve software requirements.
JobDescriptionResult Arc::JobDescription::SaveToStream ( std::ostream &  out,
const std::string &  format 
) const

Print job description to a std::ostream object.

The job description will be written to the passed std::ostream object out in the format indicated by the format parameter. The format parameter should specify the format of one of the job description languages supported by the library. Or by specifying the special "user" or "userlong" format the job description will be written as a attribute/value pair list with respectively less or more attributes.

The mote

Returns:
true if writing the job description to the out object succeeds, otherwise false.
Parameters:
out a std::ostream reference specifying the ostream to write the job description to.
format specifies the format the job description should written in.
JobDescriptionResult Arc::JobDescription::UnParse ( std::string &  product,
std::string  language,
const std::string &  dialect = "" 
) const

Output contents in the specified language.

Parameters:
product 
language 
dialect 
Returns:

Field Documentation

std::map<std::string, std::string> Arc::JobDescription::OtherAttributes

Holds attributes not fitting into this class.

This member is used by JobDescriptionParser classes to store attribute/value pairs not fitting into attributes stored in this class. The form of the attribute (the key in the map) should be as follows: <language>;<attribute-name> E.g.: "nordugrid:xrsl;hostname".


The documentation for this class was generated from the following file:
Generated on Wed Jun 27 11:54:18 2012 for Hosting Environment (Daemon) by  doxygen 1.6.3