Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound 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 Methods

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. More...

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

 JobAd::JobAd (const JobAd &jobad)
 Copy constructor. More...

void JobAd::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. More...

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. More...

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

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

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

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

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

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

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

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

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

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

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

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

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

void check ()
 Check the JobAd instance for both syntax and semanthic errors. More...


Protected Attributes

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


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 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


Member Function Documentation

void check  
 

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

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

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

JobAd::JobAd const JobAd &    jobad
 

Copy constructor.

Parameters:
jobad  a JobAd instance to be copied

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 toSubmissionString  
 

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

Returns:
the string reoresentation that goes to the NetworkServer


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 Fri May 14 14:18:26 2004 for COMMON API - configuration, jobid, ldif2classadi, logger, process, requestad, socket++i, task, utilities by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002