Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

JobAd Class Reference

Provides a representation of the job description in the JDL language and the functions for building and manipulating it. Provides a representation of the job description in the JDL language. More...

List of all members.

Public Member Functions

Constructors/Destructor
 JobAd ()
 Instantiates an empty JobAd object.

virtual ~JobAd () throw ()
 JobAd destructor.

 JobAd (const std::string &jdl_string)
 Instantiates a JobAd object from the given ClassAd-jdl string.

 JobAd (const classad::ClassAd &classAd)
 Constructor with a ClassAd instance.

 JobAd (const JobAd &jobad)
 Copy constructor.

void operator= (const JobAd &jobad)
 Operator *.

String and Stream Constructor/Destructor
void fromStream (std::istream &jdl_in)
 Update the JobAd object with the given input stream.

std::string toString ()
 Convert the JobAd Instance into a single line string representation.

std::string toString (const std::string &attr_name)
 Retrieve the string representation of an attribute.

std::string toSubmissionString ()
 Convert the JobAd Instance into a single line string representation ready for submission.

void toFile (const std::string &file_path)
 Put the JobAd Instance as a string into a file.

Insertion Methods
void setDefaultRank (const std::string &attr_value)
 Set the default value for Rank attribute (take in consideration if not specified in JDL).

void setDefaultReq (const std::string &attr_value)
 Set the default value for Requirements attribute (take in consideration if not specified in JDL).

void setAttributeExpr (const std::string &attr_name, const std::string &attr_value)
 Add The specified Expression Attribute to the jdl istance.

Retrieval Methods
std::string getAd (const std::string &attr_name)
 Retreive the value of the specified attribute.

std::string getString (const std::string &attr_name)
 Retreive the value of the specified attribute.

int getInt (const std::string &attr_name)
 Retreive the value of the specified attribute.

double getDouble (const std::string &attr_name)
 Retreive the value of the specified attribute.

bool getBool (const std::string &attr_name)
 Retreive the value of the specified attribute.

Miscellaneous Methods
void checkSyntax (const std::string &attr_name, classad::ExprTree *attr_value)
 Check if the couple attribute/value is admitted.

void checkMultiAttribute (const std::vector< std::string > &multi)
 Check if the Member/isMember expression is properly used in rank and requirements attributes expressions.

classad::ExprTree * delAttribute (const std::string &attr_name)
 Delete an Attribute.

void check (bool restore=true)
 Check the JobAd instance for both syntax and semanthic errors.


Protected Member Functions

virtual void checkInputSandbox (std::vector< std::string > &extracted)
virtual void insertAttribute (const std::string &attr_name, classad::ExprTree *val)
std::vector< std::string > extractFiles (const std::string &attr_name, const std::string &path, std::vector< std::string > &extracted)

Protected Attributes

classad::ClassAd user
 user classAd: calssad containing all the attributes that could be possibly changed by the check method.


Friends

class Job
class ExpDagAd


Detailed Description

Provides a representation of the job description in the JDL language and the functions for building and manipulating it. Provides a representation of the job description in the JDL language.

Basically the JDL is the Condor ClassAd language, so it is legitimate the direct use of the Condor API library for creating, modifying, deleting a job description. However the JobAd class extends the ClassAd class of the Condor ClassAd library additionally providing some helper methods that ease the construction of job descriptions being fully compliant to WP1 WMS specification.

Version:
0.1
Date:
15 April 2002
Author:
Alessandro Maraschini <alessandro.maraschini@datamat.it>


Constructor & Destructor Documentation

JobAd  ) 
 

Instantiates an empty JobAd object.

virtual ~JobAd  )  throw () [virtual]
 

JobAd destructor.

JobAd const std::string &  jdl_string  ) 
 

Instantiates a JobAd object from the given ClassAd-jdl string.

Parameters:
jdl_string A string representig the description of the job
Exceptions:
AdMismatchException - A value is not of the right type for an attribute name in the JobAd
AdFormatException A value is not in the right format for the an attribute name in the JobAd
AdSyntaxException Syntax error catched while trying to add an attribute
AdClassAdException a classAd method raised an error
AdListException A list has been mad with a non-list value attribute

JobAd const classad::ClassAd &  classAd  ) 
 

Constructor with a ClassAd instance.

Parameters:
classAd the ClassAd instance where to build the JobAd from

JobAd const JobAd jobad  ) 
 

Copy constructor.

Parameters:
jobad a JobAd instance to be copied


Member Function Documentation

void check bool  restore = true  ) 
 

Check the JobAd instance for both syntax and semanthic errors.

Exceptions:
AdMismatchException A value is not of the right type for an attribute name in the JobAd
AdFormatException A value is not in the right format for the an attribute name in the JobAd
AdSyntaxException Syntax error catched while trying to add an attribute
AdClassAdException a classAd method raised an error
AdListException A list has been mad with a non-list value attribute

virtual void checkInputSandbox std::vector< std::string > &  extracted  )  [protected, virtual]
 

void checkMultiAttribute const std::vector< std::string > &  multi  ) 
 

Check if the Member/isMember expression is properly used in rank and requirements attributes expressions.

Parameters:
multi a vector containing all the attributes that could be of multiple value type
Exceptions:
AdSyntaxException when the Member/IsMember expression is badly used

void checkSyntax const std::string &  attr_name,
classad::ExprTree *  attr_value
 

Check if the couple attribute/value is admitted.

Parameters:
attr_name the name of the attribute
attr_value a pointer to an ExprTree representing the value to be checkted
Exceptions:
AdMismatchException The type of value is not allowed for the specified attribute name

classad::ExprTree* delAttribute const std::string &  attr_name  ) 
 

Delete an Attribute.

It fails if the attribute doesn't exist

Parameters:
attr_nam The name of the attibute to be deleted
Exceptions:
AdEmptyException The attribute has not been set yet

std::vector<std::string> extractFiles const std::string &  attr_name,
const std::string &  path,
std::vector< std::string > &  extracted
[protected]
 

void fromStream std::istream &  jdl_in  ) 
 

Update the JobAd object with the given input stream.

Parameters:
jdl_in this is the job description passed in the form of a generic input stream so that it can be taken from a terminal input stream, file input stream, string streams etc.
Exceptions:
AdMismatchException A value is not of the right type for an attribute name in the JobAd
AdFormatException A value is not in the right format for the an attribute name in the JobAd
AdSyntaxException Syntax error catched while trying to add an attribute
AdClassAdException a classAd method raised an error
AdListException A list has been mad with a non-list value attribute

std::string getAd const std::string &  attr_name  ) 
 

Retreive the value of the specified attribute.

Parameters:
attr_name The name of the attribute name to be retrieved
Returns:
the string representng the value of the specified attribute
Exceptions:
AdEmptyException The checked attribute has not been set yet
AdMismatchException The type of retrieved value is not allowed for the specified attribute name

bool getBool const std::string &  attr_name  ) 
 

Retreive the value of the specified attribute.

Parameters:
attr_name The name of the attribute name to be retrieved
Returns:
the value of the specified attribute
Exceptions:
AdEmptyException The checked attribute has not been set yet
AdMismatchException The type of retrieved value is not allowed for the specified attribute name

double getDouble const std::string &  attr_name  ) 
 

Retreive the value of the specified attribute.

Parameters:
attr_name The name of the attribute name to be retrieved
Returns:
the value of the specified attribute
Exceptions:
AdEmptyException The checked attribute has not been set yet
AdMismatchException The type of retrieved value is not allowed for the specified attribute name

int getInt const std::string &  attr_name  ) 
 

Retreive the value of the specified attribute.

Parameters:
attr_name The name of the attribute name to be retrieved
Returns:
the value of the specified attribute
Exceptions:
AdEmptyException The checked attribute has not been set yet
AdMismatchException The type of retrieved value is not allowed for the specified attribute name

std::string getString const std::string &  attr_name  ) 
 

Retreive the value of the specified attribute.

Parameters:
attr_name The name of the attribute name to be retrieved
Returns:
the value of the specified attribute
Exceptions:
AdEmptyException The checked attribute has not been set yet
AdMismatchException The type of retrieved value is not allowed for the specified attribute name

virtual void insertAttribute const std::string &  attr_name,
classad::ExprTree *  val
[protected, virtual]
 

void operator= const JobAd jobad  ) 
 

Operator *.

void setAttributeExpr const std::string &  attr_name,
const std::string &  attr_value
 

Add The specified Expression Attribute to the jdl istance.

Parameters:
attr_name The Name of the attribute to be added
attr_value The string expression of the attribute to be added
Exceptions:
AdMismatchException The type of value is not allowed for the specified attribute name
AdClassAdException a classAd method raised an error

void setDefaultRank const std::string &  attr_value  ) 
 

Set the default value for Rank attribute (take in consideration if not specified in JDL).

Parameters:
attr_value the value to be set to the default rank

void setDefaultReq const std::string &  attr_value  ) 
 

Set the default value for Requirements attribute (take in consideration if not specified in JDL).

Parameters:
attr_value the value to be set to the default requirements

void toFile const std::string &  file_path  ) 
 

Put the JobAd Instance as a string into a file.

Parameters:
file_path the string representation of the file where to copy the JobAd to

std::string toString const std::string &  attr_name  ) 
 

Retrieve the string representation of an attribute.

Parameters:
attr_name the attribute to be retrieved
Returns:
the string representation of the attribute

std::string toString  ) 
 

Convert the JobAd Instance into a single line string representation.

std::string toSubmissionString  ) 
 

Convert the JobAd Instance into a single line string representation ready for submission.

Returns:
the string reoresentation that goes to the NetworkServer


Friends And Related Function Documentation

friend class ExpDagAd [friend]
 

friend class Job [friend]
 


Member Data Documentation

classad::ClassAd user [protected]
 

user classAd: calssad containing all the attributes that could be possibly changed by the check method.

This member is utilized in order to ripristinate (restore method ) the old classad situation


The documentation for this class was generated from the following file:
Generated on Wed Mar 1 00:37:56 2006 for COMMON API - configuration, jobid, ldif2classadi, logger, process, requestad, socket++i, task, utilities by doxygen 1.3.5