|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edg.workload.common.jrequestad.Ad | +--edg.workload.common.jrequestad.JobAd
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.
Field Summary |
Fields inherited from class edg.workload.common.jrequestad.Ad |
jobAd, TYPE_AD, TYPE_BOOL, TYPE_EXPRESSION, TYPE_INTEGER, TYPE_REAL, TYPE_STRING, TYPE_UNKNOWN |
Constructor Summary | |
JobAd()
Default Constructor Instantiates an empty JobAd object |
|
JobAd(java.lang.String ad)
Constructor from String: parse the string and create a JobAd |
Method Summary | |
void |
addAttribute(java.lang.String attrName,
Ad attrValue)
Allow adding a value to an already set attribute of the JobAd instance (i.e. it transforms it in a list attribute). if used on a non-set attribute the corresponding setAttribute method is automatically called. |
void |
addAttribute(java.lang.String attrName,
boolean attrValue)
Allow adding a value to an already set attribute of the JobAd instance (i.e. it transforms it in a list attribute). if used on a non-set attribute the corresponding setAttribute method is automatically called. |
void |
addAttribute(java.lang.String attrName,
double attrValue)
Allow adding a value to an already set attribute of the JobAd instance (i.e. it transforms it in a list attribute). if used on a non-set attribute the corresponding setAttribute method is automatically called. |
void |
addAttribute(java.lang.String attrName,
int attrValue)
Allow adding a value to an already set attribute of the JobAd instance (i.e. it transforms it in a list attribute). if used on a non-set attribute the corresponding setAttribute method is automatically called. |
void |
addAttribute(java.lang.String attrName,
java.lang.String attrValue)
Allow adding a value to an already set attribute of the JobAd instance (i.e. it transforms it in a list attribute). if used on a non-set attribute the corresponding setAttribute method is automatically called. |
void |
check(java.lang.String[] attributes)
Check the JobAd instance for both syntax and semanthic errors |
void |
checkAll()
|
void |
checkAll(java.lang.String[] attributes)
|
void |
clear()
Reset the JobAd Instance. |
JobAd |
copy()
Copy all the attributes of the instance into a new JobAd |
static JobAd |
copy(condor.classad.RecordExpr re)
Copy all the attributes of the instance into a new JobAd |
condor.classad.RecordExpr |
copyAd()
Copy the attributes of the classAd into a new Record Expression |
void |
delAttribute(java.lang.String attrName)
Delete an Attribute. |
java.lang.String |
getAttributeExpr(java.lang.String attrName)
Retreive the value of the specified Expression attribute as a string |
boolean |
getBoolean(java.lang.String attrName)
Retrieve the value of the specified attribute, only if it is of non-list type |
double |
getDouble(java.lang.String attrName)
Retrieve the value of the specified attribute, only if it is of non-list type |
int |
getInt(java.lang.String attrName)
Retrieve the value of the specified attribute, only if it is of non-list type |
JobAd |
getJobAdValue(java.lang.String attrName)
Retreive the JobAd value of the specified attribute |
java.lang.String |
getString(java.lang.String attrName)
Retrieve the value of the specified attribute, only if it is of non-list type |
boolean |
hasAttribute(java.lang.String attrName,
java.lang.String attrValue)
Check wheater an atribute has the value between its values. |
boolean |
hasAttribute(java.lang.String attrName,
java.lang.String attrValue,
boolean unsensitive)
Check wheater an atribute has the value between its values. |
void |
setAttribute(java.lang.String attrName,
boolean attrValue)
Add The specified String Attribute to the jdl istance |
void |
setAttribute(java.lang.String attrName,
double attrValue)
Add The specified String Attribute to the jdl istance |
void |
setAttribute(java.lang.String attrName,
condor.classad.Expr attrValue)
Add The specified Expression Attribute to the jdl istance |
void |
setAttribute(java.lang.String attrName,
int attrValue)
Add The specified Integer Attribute to the jdl istance |
void |
setAttribute(java.lang.String attrName,
java.lang.String attrValue)
Add The specified String Attribute to the jdl istance |
void |
setAttributeExpr(java.lang.String attrName,
java.lang.String attrValue)
Add The specified Expression Attribute to the jdl istance |
void |
setDefaultRank(java.lang.String attrValue)
Rank default attribute initialisation |
void |
setDefaultRequirements(java.lang.String attrValue)
Requirements default attribute initialisation |
void |
setLocalAccess(boolean lookInto)
If JobAd is used inside an applet, it is impossible to look into the local hard-disk by default this parameter is set to TRUE |
void |
setSchema(JobAdSchema schema)
Set the JobAd checking attributes utilised schema (Default Schema: Glue) |
void |
toFile(java.lang.String filePath)
Print the JobAd instance into the specified file, with its multi-lines representation |
java.lang.String |
toLines()
Convert the JobAd Instance into its String representation, one line per attribute, multi line for listed attribute active This method is the same as toString ( true , true ) |
java.lang.String |
toString()
Convert the JobAd Instance into a sinlge-line String representation |
java.lang.String |
toString(boolean multiLines,
boolean multiLists)
Convert the JobAd Instance into its String representation, one line per attribute, multi line for listed attribute active |
java.lang.String |
toSubmissionString()
Perform a check over the JobAd instance and if possible convert it into its String representation as it would be ready for a submission |
Methods inherited from class edg.workload.common.jrequestad.Ad |
appendValue, attributes, fromFile, fromRecord, fromString, getAd, getAdValue, getBooleanValue, getConstant, getDoubleValue, getIntValue, getStringValue, getType, getValue, hasAttribute, isSet, lookup, setAttribute, size |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public JobAd()
public JobAd(java.lang.String ad) throws java.text.ParseException, JobAdException
ad
- the JDL string to be parsedMethod Detail |
public static JobAd copy(condor.classad.RecordExpr re) throws JobAdException
JobAdException
- all the error occurred while inserting the attributespublic JobAd copy()
public condor.classad.RecordExpr copyAd()
public boolean hasAttribute(java.lang.String attrName, java.lang.String attrValue)
attrName
- the name of the attribute to be checkedattrValue
- the String value to search for. The case of the seek is unsensitive
public boolean hasAttribute(java.lang.String attrName, java.lang.String attrValue, boolean unsensitive)
attrName
- the name of the attribute to be checkedattrValue
- the String value to search for
public java.lang.String toLines()
toSubmissionString()
,
toString()
public java.lang.String toString(boolean multiLines, boolean multiLists)
toString
in class Ad
multiLines
- one-attribute per line representation enablngmultiLists
- list attributes splitted into multi line representation enablngtoSubmissionString()
,
toString()
public java.lang.String toSubmissionString() throws JobAdException
JobAdException
- - one or more values do not match with jobad semantic ruletoString()
,
toLines()
public java.lang.String toString()
toString
in class Ad
toSubmissionString()
,
toLines()
public void toFile(java.lang.String filePath) throws java.lang.Exception
filePath
- where to write the JobAd
java.io.IOException
- - if unable to write the specified file
java.lang.Exception
toLines()
public void setLocalAccess(boolean lookInto)
lookInto
- allow all the check methods to access to the local hard disk (true) or skip the check (false)public void setAttribute(java.lang.String attrName, condor.classad.Expr attrValue) throws javax.naming.directory.InvalidAttributeValueException, java.lang.IllegalArgumentException
setAttribute
in class Ad
attrName
- - The Name of the attribute to be addedattrValue
- - The Expression of the value to be added
java.lang.IllegalArgumentException
- The type of value is not allowed for the specified attribute name
javax.naming.directory.InvalidAttributeValueException
- The value has not the right format for the specified attributepublic void setAttributeExpr(java.lang.String attrName, java.lang.String attrValue) throws java.lang.IllegalArgumentException, javax.naming.directory.InvalidAttributeValueException
attrName
- - The Name of the attribute to be addedattrValue
- - The value of the attribute to be added
java.lang.IllegalArgumentException
- - The type of value is not allowed for the specified attribute name
javax.naming.directory.InvalidAttributeValueException
- - the value has not the right format for the specifiedattributepublic void setAttribute(java.lang.String attrName, int attrValue) throws java.lang.IllegalArgumentException, javax.naming.directory.InvalidAttributeValueException
setAttribute
in class Ad
attrName
- - The Name of the attribute to be addedattrValue
- - The value of the attribute to be added
java.lang.IllegalArgumentException
- - The type of value is not allowed for the specified attribute name
javax.naming.directory.InvalidAttributeValueException
- - The specified value is out of limits for the specified attributepublic void setAttribute(java.lang.String attrName, java.lang.String attrValue) throws java.lang.IllegalArgumentException, javax.naming.directory.InvalidAttributeValueException
setAttribute
in class Ad
attrName
- - The Name of the attribute to be addedattrValue
- - The value of the attribute to be added
java.lang.IllegalArgumentException
- - The type of value is not allowed for the specified attribute name
javax.naming.directory.InvalidAttributeValueException
- - the value has not the right format for the specified attributepublic void setAttribute(java.lang.String attrName, double attrValue) throws java.lang.IllegalArgumentException, javax.naming.directory.InvalidAttributeValueException
setAttribute
in class Ad
attrName
- - The Name of the attribute to be addedattrValue
- - The value of the attribute to be added
IllegalArgumentException-
- The attribute attrName had been
javax.naming.directory.InvalidAttributeValueException
- - the value is out of limits for the specified attribute
java.lang.IllegalArgumentException
public void setAttribute(java.lang.String attrName, boolean attrValue) throws java.lang.IllegalArgumentException, javax.naming.directory.InvalidAttributeValueException
setAttribute
in class Ad
attrName
- - The Name of the attribute to be addedattrValue
- - The value of the attribute to be added
IllegalArgumentException-
- The attribute attrName had been already set
javax.naming.directory.InvalidAttributeValueException
- - A value has not the right type for an attribute
java.lang.IllegalArgumentException
public void addAttribute(java.lang.String attrName, Ad attrValue) throws java.lang.IllegalArgumentException, javax.naming.directory.InvalidAttributeValueException
addAttribute
in class Ad
attrName
- a String representing the attribute nameattrValue
- - The value of the attribute to be added
IllegalArgumentException-
- The specified value is not allowed for the attribute
javax.naming.directory.InvalidAttributeValueException
- - A value has not the right type for an attribute
java.lang.IllegalArgumentException
public void addAttribute(java.lang.String attrName, int attrValue) throws java.lang.IllegalArgumentException, javax.naming.directory.InvalidAttributeValueException
addAttribute
in class Ad
attrName
- a String representing the attribute nameattrValue
- - The value of the attribute to be added
IllegalArgumentException-
- The specified value is not allowed for the attribute
javax.naming.directory.InvalidAttributeValueException
- - A value has not the right type for an attribute
java.lang.IllegalArgumentException
public void addAttribute(java.lang.String attrName, double attrValue) throws java.lang.IllegalArgumentException, javax.naming.directory.InvalidAttributeValueException
addAttribute
in class Ad
attrName
- a String representing the attribute nameattrValue
- - The value of the attribute to be added
IllegalArgumentException-
- The specified value is not allowed for the attribute
javax.naming.directory.InvalidAttributeValueException
- - the has not the right format for the attribute
java.lang.IllegalArgumentException
public void addAttribute(java.lang.String attrName, boolean attrValue) throws java.lang.IllegalArgumentException, javax.naming.directory.InvalidAttributeValueException
addAttribute
in class Ad
attrName
- a String representing the attribute nameattrValue
- - The value of the attribute to be added
IllegalArgumentException-
- The specified value is not allowed for the attribute
javax.naming.directory.InvalidAttributeValueException
- - the value has not the right format for the attribute
java.lang.IllegalArgumentException
public void addAttribute(java.lang.String attrName, java.lang.String attrValue) throws java.lang.IllegalArgumentException, javax.naming.directory.InvalidAttributeValueException
addAttribute
in class Ad
attrName
- a String representing the attribute nameattrValue
- - The value of the attribute to be added
java.lang.IllegalArgumentException
- The specified type is not allowed for the attribute value
javax.naming.directory.InvalidAttributeValueException
- The value has not the right format for the attributepublic java.lang.String getAttributeExpr(java.lang.String attrName) throws java.lang.Exception
attrName
- The name of the attribute name to be retrieved
javax.naming.directory.InvalidAttributeValueException
- - Not an Expression value is allowed for the specified attribute
java.lang.NoSuchFieldException
- - The attribute is not present in the JobAd
java.lang.Exception
public JobAd getJobAdValue(java.lang.String attrName) throws java.lang.NoSuchFieldException, java.lang.IllegalArgumentException, JobAdException
attrName
- The name of the attribute name to be retrieved
nvalidAttributeValueException
- The specified attribute is of list type
java.lang.IllegalArgumentException
- - The type of retrieved value is not allowed for the specified attribute name
java.lang.NoSuchFieldException
- - The requested attribute has not been set yet
JobAdException
public java.lang.String getString(java.lang.String attrName) throws java.lang.NoSuchFieldException, java.lang.IllegalArgumentException, javax.naming.directory.InvalidAttributeValueException
attrName
- The name of the attribute to be retrieved
nvalidAttributeValueException
- The specified attribute is of list type
java.lang.IllegalArgumentException
- - The type of retrieved value is not allowed for the specified attribute name
java.lang.NoSuchFieldException
- - The requested attribute has not been set yet
javax.naming.directory.InvalidAttributeValueException
Ad.getStringValue(java.lang.String)
public int getInt(java.lang.String attrName) throws java.lang.NoSuchFieldException, java.lang.IllegalArgumentException, javax.naming.directory.InvalidAttributeValueException
attrName
- The name of the attribute to be retrieved
javax.naming.directory.InvalidAttributeValueException
- The specified attribute is of list type
java.lang.IllegalArgumentException
- - The type of retrieved value is not allowed for the specified attribute name
java.lang.NoSuchFieldException
- - The requested attribute has not been set yetAd.getIntValue(java.lang.String)
public boolean getBoolean(java.lang.String attrName) throws java.lang.NoSuchFieldException, java.lang.IllegalArgumentException, javax.naming.directory.InvalidAttributeValueException
attrName
- The name of the attribute to be retrieved
javax.naming.directory.InvalidAttributeValueException
- The specified attribute is of list type
java.lang.IllegalArgumentException
- - The type of retrieved value is not allowed for the specified attribute name
java.lang.NoSuchFieldException
- - The requested attribute has not been set yetAd.getBooleanValue(java.lang.String)
public double getDouble(java.lang.String attrName) throws java.lang.NoSuchFieldException, java.lang.IllegalArgumentException, javax.naming.directory.InvalidAttributeValueException
attrName
- The name of the attribute to be retrieved
javax.naming.directory.InvalidAttributeValueException
- The specified attribute is of list type
java.lang.IllegalArgumentException
- - The type of retrieved value is not allowed for the specified attribute name
java.lang.NoSuchFieldException
- - The requested attribute has not been set yetAd.getDoubleValue(java.lang.String)
public void delAttribute(java.lang.String attrName) throws java.lang.NoSuchFieldException
delAttribute
in class Ad
attrName
- The name of the attibute to be deleted
java.lang.NoSuchFieldException
- - The attribute has not been set yetpublic void clear()
clear
in class Ad
public void checkAll() throws JobAdException
JobAdException
public void checkAll(java.lang.String[] attributes) throws JobAdException
JobAdException
public void check(java.lang.String[] attributes) throws JobAdException
java.lang.IllegalArgumentException
- - A value is not of the right type/format/value for an attribute name in the JobAd
java.lang.NoSuchFieldException
- - Unable to find a JobAd mandatory attribute/value
JobAdException
- - one or more values do not match with jobad semantic rulepublic void setSchema(JobAdSchema schema)
public void setDefaultRank(java.lang.String attrValue)
public void setDefaultRequirements(java.lang.String attrValue)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |