jdl-api-cpp-3.4.4
|
Provides a representation of the job description in the JDL language. More...
#include <glite/jdl/JobAd.h>
Public Member Functions | |
Constructors/Destructor | |
JobAd () | |
virtual | ~JobAd () throw () |
JobAd (const std::string &jdl_string) | |
JobAd (const classad::ClassAd &classAd) | |
JobAd (const JobAd &jobad) | |
void | operator= (const JobAd &jobad) |
void | fromClassAd (const classad::ClassAd &classAd) |
void | fromJobAd (const JobAd &jobad) |
String and Stream Constructor/Destructor | |
std::string | toSubmissionString () |
void | toFile (const std::string &file_path) |
Insertion Methods | |
void | setLocalAccess (bool lookInto) |
void | setDefaultRank (const std::string &attr_value) |
void | setDefaultReq (const std::string &attr_value) |
void | setDefaultRank (classad::ExprTree *attr_value) |
void | setDefaultReq (classad::ExprTree *attr_value) |
void | setAllowedProtocols (const std::vector< std::string > &attr_value) |
const std::vector< std::string > | getAllowedProtocols () |
void | setAttributeExpr (const std::string &attr_name, const std::string &attr_value) |
void | setAttributeExpr (const std::string &attr_name, ExprTree *attr_value) |
Retrieval Methods | |
Ad | getAd (const std::string &attr_name) |
std::string | getString (const std::string &attr_name) |
int | getInt (const std::string &attr_name) |
double | getDouble (const std::string &attr_name) |
bool | getBool (const std::string &attr_name) |
bool | gettoBretrieved () |
ExtractedAd * | getExtractedAd () |
Miscellaneous Methods | |
virtual void | checkSyntax (const std::string &attr_name, classad::ExprTree *attr_value) |
virtual void | checkSyntax (const std::string &attr_name, classad::Value attr_value) |
void | checkMultiAttribute (const std::vector< std::string > &multi) |
classad::ExprTree * | delAttribute (const std::string &attr_name) |
void | check (const bool &restore=true) |
![]() | |
Ad () | |
virtual | ~Ad () throw () |
Ad (const classad::ClassAd &classAd) | |
Ad (const std::string &jdl_string) | |
Ad (const Ad &jobad) | |
virtual void | operator= (const Ad &jobad) |
void | fromString (const std::string &jdl_string, std::string jdl_file="") |
void | fromFile (const std::string &jdl_file) |
void | fromStream (std::istream &jdl_in) |
virtual std::string | toString () |
virtual std::string | toString (const std::string &attr_name) |
virtual std::string | toLines () |
bool | isSet () |
void | clear () |
classad::ClassAd *const | ad () |
bool | hasAttribute (const std::string &attr_name) |
void | remAttribute (const std::string &attr_name) |
virtual classad::ExprTree * | lookUp (const std::string &attr_name) |
bool | hasAttribute (const std::string &attr_name, const std::string &attr_value) |
std::vector< std::string > | attributes () |
void | merge (Ad source, bool overwrite=true) |
bool | hasWarnings () |
std::vector< std::string > | getWarnings () |
void | addWarning (const std::string &msg) |
int | getType (const std::string &attr_name) |
void | addAttribute (const std::string &attr_name, int attr_value) |
void | addAttribute (const std::string &attr_name, double attr_value) |
void | addAttribute (const std::string &attr_name, bool attr_value) |
void | addAttribute (const std::string &attr_name, const std::string &attr_value) |
void | addAttribute (const std::string &attr_name, const char *attr_value) |
void | addAttribute (const std::string &attr_name, Ad *attr_value) |
virtual void | setAttribute (const std::string &attr_name, int attr_value) |
virtual void | setAttribute (const std::string &attr_name, const std::string &attr_value) |
virtual void | setAttribute (const std::string &attr_name, const char *attr_value) |
virtual void | setAttribute (const std::string &attr_name, double attr_value) |
virtual void | setAttribute (const std::string &attr_name, bool attr_value) |
virtual void | setAttribute (const std::string &attr_name, Ad *attr_value) |
virtual void | setAttributeExpr (const std::string &attr_name, classad::ExprTree *attr_value) |
virtual std::string | getAttributeExpr (const std::string &attr_name) |
std::vector< int > | getIntValue (const std::string &attr_name) |
std::vector< double > | getDoubleValue (const std::string &attr_name) |
std::vector< bool > | getBoolValue (const std::string &attr_name) |
virtual std::vector< std::string > | getStringValue (const std::string &attr_name) |
std::vector< std::vector < std::string > > | getStringList (const std::string &attr_name) |
Protected Member Functions | |
virtual void | checkInputSandbox (std::vector< std::string > &extracted) |
virtual void | checkRankReq () |
virtual void | insertAttribute (const std::string &attr_name, classad::ExprTree *val) |
![]() | |
virtual void | addAttribute (std::string attr_name, classad::Value val) |
virtual void | appendValue (classad::ExprTree *tree, const classad::Value &val, const std::string &attr_name) |
virtual void | insertAttribute (const std::string &attr_name, classad::Value val) |
virtual classad::Value | getTypeValue (const std::string &attr_name) |
bool | hasAttribute (classad::ExprTree *tree, const std::string &attr_value) |
Protected Attributes | |
classad::ClassAd | user |
checkType | lookInto_b |
bool | checking |
bool | toBretrieved |
boost::scoped_ptr< ExtractedAd > | extractedAd |
![]() | |
std::vector< std::string > | warning_messages_v |
Friends | |
class | Job |
class | ExpDagAd |
Provides a representation of the job description in the JDL language.
Provides a representation of the job description in the JDL language and the functions for building and manipulating it. 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.
glite::jdl::JobAd::JobAd | ( | ) |
Instantiates an empty JobAd object
|
virtual |
JobAd destructor
glite::jdl::JobAd::JobAd | ( | const std::string & | jdl_string | ) |
Instantiates a JobAd object from the given ClassAd-jdl string
jdl_string | A string representig the description of the job |
glite::jdl::JobAd::JobAd | ( | const classad::ClassAd & | classAd | ) |
Constructor with a ClassAd instance
classAd | the ClassAd instance where to build the JobAd from |
glite::jdl::JobAd::JobAd | ( | const JobAd & | jobad | ) |
Copy constructor
jobad | a JobAd instance to be copied from |
void glite::jdl::JobAd::check | ( | const bool & | restore = true | ) |
Check the JobAd instance for both syntax and semanthic errors
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 |
|
protectedvirtual |
check values inside inputsanbox attribute and if necessar/y extrapolate them. Could be inherited to change check
extracted | a vector containing all the found values |
Reimplemented in glite::jdl::NodeAd, and glite::jdl::ParametricAd.
void glite::jdl::JobAd::checkMultiAttribute | ( | const std::vector< std::string > & | multi | ) |
Check if the Member/isMember expression is properly used in rank and requirements attributes expressions
multi | a vector containing all the attributes that could be of multiple value type |
AdSyntaxException | when the Member/IsMember expression is badly used |
|
protectedvirtual |
Check and control Rank and Requirements attribute. could be inherited to change check
|
virtual |
Check if the couple attribute/value is admitted
attr_name | the name of the attribute |
attr_value | a pointer to an ExprTree representing the value to be checkted |
AdMismatchException | The type of value is not allowed for the specified attribute name |
|
virtual |
Reimplemented in glite::jdl::NodeAd, and glite::jdl::ParametricAd.
|
virtual |
Delete an Attribute. It fails if the attribute doesn't exist
attr_name | The name of the attibute to be deleted |
AdEmptyException | The attribute has not been set yet |
Reimplemented from glite::jdl::Ad.
|
virtual |
Constructor with a ClassAd instance
classAd | the ClassAd instance where to build the JobAd from |
Reimplemented from glite::jdl::Ad.
Referenced by glite::jdl::NodeAd::NodeAd(), and glite::jdl::ParametricAd::ParametricAd().
void glite::jdl::JobAd::fromJobAd | ( | const JobAd & | jobad | ) |
|
virtual |
Retreive the value of the specified attribute
attr_name | The name of the attribute name to be retrieved |
AdEmptyException | The checked attribute has not been set yet |
AdMismatchException | The type of retrieved value is not allowed for the specified attribute name |
Reimplemented from glite::jdl::Ad.
const std::vector<std::string> glite::jdl::JobAd::getAllowedProtocols | ( | ) |
Retrieve the list of all allowed protocols for inputsandbox URL format
|
virtual |
Retreive the value of the specified attribute
attr_name | The name of the attribute name to be retrieved |
AdEmptyException | The checked attribute has not been set yet |
AdMismatchException | The type of retrieved value is not allowed for the specified attribute name |
Reimplemented from glite::jdl::Ad.
|
virtual |
Retreive the value of the specified attribute
attr_name | The name of the attribute name to be retrieved |
AdEmptyException | The checked attribute has not been set yet |
AdMismatchException | The type of retrieved value is not allowed for the specified attribute name |
Reimplemented from glite::jdl::Ad.
ExtractedAd* glite::jdl::JobAd::getExtractedAd | ( | ) |
Retrieve the local files to be for the current instance
|
virtual |
Retreive the value of the specified attribute
attr_name | The name of the attribute name to be retrieved |
AdEmptyException | The checked attribute has not been set yet |
AdMismatchException | The type of retrieved value is not allowed for the specified attribute name |
Reimplemented from glite::jdl::Ad.
|
virtual |
Retreive the value of the specified attribute
attr_name | The name of the attribute name to be retrieved |
AdEmptyException | The checked attribute has not been set yet |
AdMismatchException | The type of retrieved value is not allowed for the specified attribute name |
Reimplemented from glite::jdl::Ad.
|
inline |
Return wheter are there any files to be retrieved This value has significant meaning only after a previous check
References toBretrieved.
|
protectedvirtual |
Evaluate the specified expression and set is as the value of the specified attribute
attr_name | the name of the attribute to be set |
val | the expression for the value to be set |
Reimplemented from glite::jdl::Ad.
Reimplemented in glite::jdl::NodeAd, and glite::jdl::ParametricAd.
void glite::jdl::JobAd::operator= | ( | const JobAd & | jobad | ) |
Operator "=" performs a deep copy of the JobAd instance
void glite::jdl::JobAd::setAllowedProtocols | ( | const std::vector< std::string > & | attr_value | ) |
Add a list of protocols to the set of allowed inputsandbox protocols
attr_value | the list of protocol to be allowed for inputsandbox URL values |
|
virtual |
Add The specified Expression Attribute to the jdl istance
attr_name | The Name of the attribute to be added |
attr_value | The string expression of the attribute to be added |
AdMismatchException | The type of value is not allowed for the specified attribute name |
AdClassAdException | a classAd method raised an error |
Reimplemented from glite::jdl::Ad.
void glite::jdl::JobAd::setAttributeExpr | ( | const std::string & | attr_name, |
ExprTree * | attr_value | ||
) |
Add The specified Expression Attribute to the jdl istance
attr_name | The Name of the attribute to be added |
attr_value | The string expression of the attribute to be added |
AdMismatchException | The type of value is not allowed for the specified attribute name |
AdClassAdException | a classAd method raised an error |
void glite::jdl::JobAd::setDefaultRank | ( | const std::string & | attr_value | ) |
Set the default value for Rank attribute (take in consideration if not specified in JDL)
attr_value | the value to be set to the default rank |
void glite::jdl::JobAd::setDefaultRank | ( | classad::ExprTree * | attr_value | ) |
Set the default value for Rank attribute (take in consideration if not specified in JDL)
attr_value | the value to be set to the default rank |
void glite::jdl::JobAd::setDefaultReq | ( | const std::string & | attr_value | ) |
Set the default value for Requirements attribute (take in consideration if not specified in JDL)
attr_value | the value to be set to the default requirements |
void glite::jdl::JobAd::setDefaultReq | ( | classad::ExprTree * | attr_value | ) |
Set the default value for Requirements attribute (take in consideration if not specified in JDL)
attr_value | the value to be set to the default requirements |
void glite::jdl::JobAd::setLocalAccess | ( | bool | lookInto | ) |
If JobAd is used by a remove machine, it is impossible to look into the local hard-disk by default this parameter is set to true
lookInto | allow all the check methods to access to the local hard disk (true) or skip the check (false) |
void glite::jdl::JobAd::toFile | ( | const std::string & | file_path | ) |
std::string glite::jdl::JobAd::toSubmissionString | ( | ) |
Convert the JobAd Instance into a single line string representation ready for submission
|
friend |
|
friend |
|
protected |
|
protected |
extracted local files
|
protected |
decide whether to check file extistence (EXISTENCE) or not (WMPROXY)
|
protected |
Referenced by gettoBretrieved().
|
protected |
Analise a path and resolve the wildcards (if present) on it check the existence of (at least one file) the path. Leave URI/URL address unchanged
attr_name | the attribute to be checked (generally Sandbox values) |
path | the path to be checked (could contain wildcards) |
extracted | vector containing the extracted values |
wmpUri | the WMProxyBaseUri attribute value |
isbUri | an option parameter specifying the base path for non-local files |
void extractFiles(const std::string& attr_name,const std::string& path,std::vector<std::string> &extracted, const std::string &wmpUri="", const std::string &isbUri="") ; user classAd: classad 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