|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.griphyn.vdl.Chimera
org.griphyn.vdl.dax.DAX
org.griphyn.vdl.dax.Job
public class Job
This class defines the specifics of a job to run in an abstract manner.
All filename references still refer to logical files. All references
transformations also refer to logical transformtions, though through
Profile physical location hints can be passed.
Profile,
Filename| Field Summary | |
|---|---|
private ArrayList |
m_argumentList
The argument list describes the command line arguments as sum of strings and filename references. |
private String |
m_chain
A compound transformation may be nested. |
private String |
m_dv_name
DVs are dynamically mapped to TR. |
private String |
m_dv_namespace
DVs are dynamically mapped to TR. |
private String |
m_dv_version
DVs are dynamically mapped to TR. |
private String |
m_id
Each job also gets a unique id to refer to it from references. |
private int |
m_level
The level is set by the topological sort. |
private String |
m_name
Each transformation and derivation can be identified by a name. |
private String |
m_namespace
Each transformation and derivation resides in a namespace. |
private ArrayList |
m_profileList
The profile list encapsulates scheduler specific data in a generic structure. |
private Filename |
m_stderr
stderr is a Filename which must be of output linkage. |
private Filename |
m_stdin
stdin is a Filename which must be of input linkage. |
private Filename |
m_stdout
stdout is a Filename which must be of output linkage. |
private ArrayList |
m_usesList
The uses list contains all filenames that were originally part of the linkage via the actual arguments and formal argument defaults. |
private String |
m_version
Each transformation and derivation has a version associated with their definition. |
| Constructor Summary | |
|---|---|
Job()
Default ctor: Note that a job must be named. |
|
Job(String namespace,
String name,
String version,
String id)
Convenience ctor. |
|
Job(String namespace,
String name,
String version,
String id,
String dv_namespace,
String dv_name,
String dv_version)
Convenience ctor. |
|
| Method Summary | |
|---|---|
void |
addArgument(int index,
Leaf vArgument)
Accessor: Inserts an argument at an arbitrary place into the list. |
void |
addArgument(Leaf vArgument)
Accessor: Adds an argument to the list of arguments |
void |
addProfile(int index,
Profile vProfile)
Accessor: Inserts a profile definition at an arbitrary position into the list of profiles. |
boolean |
addProfile(Profile vProfile)
Accessor: Appends a profile definition to the list of profiles. |
void |
addUses(Filename filename)
Accessor: Appends a filename to the list of used filenames. |
void |
addUses(int index,
Filename filename)
Accessor: Inserts a logical filename at an arbitrary position into the list of used filenames. |
Object |
clone()
Creates and returns a copy of this object. |
Enumeration |
enumerateArgument()
Deprecated. Use the new Collection based interfaces |
Enumeration |
enumerateProfile()
Deprecated. Use the new Collection based interfaces |
Enumeration |
enumerateUses()
Deprecated. Use the new Collection based interfaces |
private String |
formatFilename(String tag,
String indent,
String namespace,
Filename f,
boolean full)
Helper: Formats the attributes of any Filename instance,
or inherited instances. |
Leaf[] |
getArgument()
Deprecated. Use the new Collection based interfaces |
Leaf |
getArgument(int index)
Accessor: Obtains an argument fragment from an arbitrary position. |
int |
getArgumentCount()
Accessor: Obtains the count of fragments in the argument list. |
List |
getArgumentList()
Accessor: Gets an array of all values that constitute the current argument line. |
String |
getChain()
Accessor: Obtains the XML list attribute which contains the chain of compound transformations that lead to this job. |
String |
getDVName()
Accessor: Obtains the current name from the DV that created this job. |
String |
getDVNamespace()
Accessor: Obtains the current namespace from the DV that created this job. |
String |
getDVVersion()
Accessor: Obtains the current version from the DV that created this job. |
String |
getID()
Accessor: Obtains the unique ID of this job. |
int |
getLevel()
Accessor |
String |
getName()
Accessor: Obtains the current name of the job. |
String |
getNamespace()
Accessor: Obtains the current namespace that is used for the definition. |
Profile[] |
getProfile()
Deprecated. Use the new Collection based interfaces |
Profile |
getProfile(int index)
Accessor: Obtains an Profile at an arbitrary position. |
int |
getProfileCount()
Accessor: Counts the number of profile specifications known to this job. |
List |
getProfileList()
Accessor: Obtain a read-only copy of the list of all Profile specifications. |
Filename |
getStderr()
Accessor: Obtains the current setting of stderr redirection. |
Filename |
getStdin()
Accessor: Obtains the current setting of stdin redirection. |
Filename |
getStdout()
Accessor: Obtains the current setting of stdout redirection. |
Filename[] |
getUses()
Deprecated. Use the new Collection based interfaces |
Filename |
getUses(int index)
Accessor: Obtains an Filename at an arbitrary position. |
int |
getUsesCount()
Accessor: Counts the number of argument-referenced logical filenames known to this job. |
List |
getUsesList()
Accessor: Obtain a copy of the list of all Filename
specifications, that were part of the arguments that generated
this job. |
String |
getVersion()
Accessor: Obtains the current version of the definition. |
Iterator |
iterateArgument()
Accessor: Provides an iterator to the internal list of all commandline argument elements. |
Iterator |
iterateProfile()
Accessor: Provides an iterator to the internal list of all profiles. |
Iterator |
iterateUses()
Accessor: Provides an iterator to the internal list of used filenames. |
ListIterator |
listIterateArgument()
Accessor: Provides a list iterator to the internal list of all commandline argument elements. |
ListIterator |
listIterateArgument(int start)
Accessor: Provides a list iterator to the internal list of all commandline argument elements. |
ListIterator |
listIterateProfile()
Accessor: Provides a list iterator to the internal list of all profiles. |
ListIterator |
listIterateProfile(int start)
Accessor: Provides a list iterator to the internal list of all profiles. |
ListIterator |
listIterateUses()
Accessor: Provides a list iterator to the internal list of all used filenames. |
ListIterator |
listIterateUses(int start)
Accessor: Provides a list iterator to the internal list of all used filenames. |
private boolean |
matchWithNull(String a,
String b)
Compares two strings, each of which may be null. |
void |
removeAllArgument()
Accessor: Removes all commandline arguments pieces. |
void |
removeAllProfile()
Accessor: Removes all profile declarations. |
void |
removeAllUses()
Accessor: Removes all known Filenames. |
Leaf |
removeArgument(int index)
Accessor: Removes a commandline argument fragment from the commandline. |
Profile |
removeProfile(int index)
Accessor: Removes a profile. |
Filename |
removeUses(int index)
Accessor: Removes a used filename from the list of argument-referenced LFNs. |
void |
setArgument(Collection arguments)
Accessor: Replace the commandline arguments with a new commandline argument fragment list. |
void |
setArgument(int index,
Leaf vArgument)
Accessor: Overwrites an commandline argument fragment with a new one. |
void |
setArgument(Leaf[] argumentArray)
Deprecated. Use the new Collection based interfaces |
void |
setChain(String chain)
Accessor: Sets the XML list attribute which contains the chain of compound transformations that lead to this job. |
void |
setDV(String namespace,
String name,
String version)
Accessor: Sets or overwrites the DV FQDN triple. |
void |
setDVName(String name)
Accessor: Sets or overwrites the DV name identifier. |
void |
setDVNamespace(String namespace)
Accessor: Sets or overwrites the DV namespace identifier. |
void |
setDVVersion(String version)
Accessor: Sets or overwrites the DV version identifier. |
void |
setID(String id)
Accessor: Sets the unique ID of this job. |
void |
setLevel(int level)
Accessor. |
void |
setName(String name)
Accessor: Sets the current name of the job. |
void |
setNamespace(String namespace)
Accessor: Sets or overwrites the TR namespace identifier. |
void |
setProfile(Collection profiles)
Accessor: Replace the internal profile list with a new list. |
void |
setProfile(int index,
Profile vProfile)
Accessor: Overwrites a profile with a new profile |
void |
setProfile(Profile[] profileArray)
Deprecated. Use the new Collection based interfaces |
void |
setStderr(Filename f)
Accessor: Sets or releases the stderr redirection. |
void |
setStdin(Filename f)
Accessor: Sets or releases the stdin redirection. |
void |
setStdout(Filename f)
Accessor: Sets or releases the stdout redirection. |
void |
setUses(Collection filenames)
Accessor: Replace the internal list of used LFNs with a new list. |
void |
setUses(Filename[] filenameArray)
Deprecated. Use the new Collection based interfaces |
void |
setUses(int index,
Filename vFilename)
Accessor: Overwrites a used filename with a new LFN. |
void |
setVersion(String version)
Accessor: Sets the version of the definition. |
void |
toString(Writer stream)
Converts the active state into something meant for human consumption. |
void |
toXML(Writer stream,
String indent,
String namespace)
Dump the state of the current element as XML output. |
| Methods inherited from class org.griphyn.vdl.Chimera |
|---|
escape, quote, toString, toXML, toXML, writeAttribute |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private String m_namespace
private String m_name
private String m_version
private String m_dv_namespace
private String m_dv_name
private String m_dv_version
private String m_id
Childprivate String m_chain
private Filename m_stdin
Filename which must be of input linkage.
Alternatively, it may be unused (null).
private Filename m_stdout
Filename which must be of output linkage.
Alternatively, it may be unused (null).
private Filename m_stderr
Filename which must be of output linkage.
Alternatively, it may be unused (null).
private int m_level
private ArrayList m_argumentList
Leaf,
which is either implemented by a Filename or
PseudoText instance.
Leaf,
Filename,
PseudoTextprivate ArrayList m_profileList
Profileprivate ArrayList m_usesList
Filename| Constructor Detail |
|---|
public Job()
public Job(String namespace,
String name,
String version,
String id)
namespace - is the namespace that the TR resides in.name - is the name of the job as logical TR identifier.version - is a version information string of the TR.id - is a short DAX-unique ID to distinguish this job
from other jobs in the same DAG.Transformation
public Job(String namespace,
String name,
String version,
String id,
String dv_namespace,
String dv_name,
String dv_version)
namespace - is the namespace that the TR resides in.name - is the name of the job as logical TR identifier.version - is a version information string of the TR.id - is a short DAX-unique ID to distinguish this job
from other jobs in the same DAG.dv_namespace - is the namespace of the DV for this job.dv_name - is the name of the DV that produced this job.dv_version - is the version of the DV for this job.Transformation| Method Detail |
|---|
public Object clone()
clone in class Objectpublic void addArgument(Leaf vArgument)
vArgument - is an argument fragment to append to the command line
arguments.Leaf
public void addArgument(int index,
Leaf vArgument)
throws IndexOutOfBoundsException
index - is the position to insert an argumentvArgument - is the argument fragment to insert at the
specified place.
IndexOutOfBounds - if the argument does not fit into the list.
IndexOutOfBoundsExceptionsetArgument( int, Leaf ),
getArgument( int ),
Leaf
private boolean matchWithNull(String a,
String b)
a - is the first stringb - is the other string to compare to
public boolean addProfile(Profile vProfile)
FIXME: The profile should carry a state to signal appending or replacing.
vProfile - is the profile to append to remembered profiles.
false for a new elements, and true,
if an existing element was overwritten.Profile
public void addProfile(int index,
Profile vProfile)
throws IndexOutOfBoundsException
index - is the position to insert the definitions into.vProfile - is the profile to append to remembered profiles.
IndexOutOfBounds - if the argument does not fit into the list.
IndexOutOfBoundsExceptionsetProfile( int, Profile ),
getProfile( int ),
Profilepublic void addUses(Filename filename)
filename - is the LFN to append to remembered filenames.
IndexOutOfBounds - if the argument does not fit into the list.Filename
public void addUses(int index,
Filename filename)
throws IndexOutOfBoundsException
index - is the position to insert the definitions into.filename - is the LFN to append to remembered filenames.
IndexOutOfBounds - if the argument does not fit into the list.
IndexOutOfBoundsExceptionsetUses( int, Filename ),
getUses( int ),
Filenamepublic Enumeration enumerateArgument()
Leaf,
Enumerationpublic Enumeration enumerateProfile()
Profile list.
Profile list.Profile,
Enumerationpublic Enumeration enumerateUses()
Filename list.
Filename list.Filename,
Enumeration
public Leaf getArgument(int index)
throws IndexOutOfBoundsException
index - is the place to look up the element at.
IndexOutOfBoundsException - if the referenced position does
not exist.addArgument( int, Leaf ),
setArgument( int, Leaf ),
Leafpublic Leaf[] getArgument()
setArgument( Leaf[] ),
Leafpublic int getArgumentCount()
Leafpublic List getArgumentList()
PseudoText or
Filename values.setArgument( Collection ),
PseudoText,
Filenamepublic String getChain()
null.setChain( String )public String getID()
setID( String ),
Childpublic String getName()
setName( String )public String getNamespace()
setNamespace(java.lang.String)public String getDVNamespace()
setDVNamespace(java.lang.String),
setDV( String, String, String )public String getDVName()
setDVName(java.lang.String),
setDV( String, String, String )public String getDVVersion()
setDVVersion(java.lang.String),
setDV( String, String, String )public Filename getStdin()
null, if unset.setStdin( Filename )public int getLevel()
setLevel(int)public void setLevel(int level)
level - getLevel()public Filename getStdout()
null, if unset.setStdout( Filename )public Filename getStderr()
null, if unset.setStderr( Filename )
public Profile getProfile(int index)
throws IndexOutOfBoundsException
Profile at an arbitrary position.
index - is the place to look up the element at.
IndexOutOfBoundsException - if the referenced position does not exist.addProfile( int, Profile ),
setProfile( int, Profile ),
Profilepublic Profile[] getProfile()
setProfile( Profile[] ),
Profilepublic int getProfileCount()
Profilepublic List getProfileList()
Profile specifications.
setProfile( Collection ),
Profile
public Filename getUses(int index)
throws IndexOutOfBoundsException
Filename at an arbitrary position.
index - is the place to look up the element at.
IndexOutOfBoundsException - if the referenced position does not exist.addUses( int, Filename ),
setUses( int, Filename ),
Filenamepublic Filename[] getUses()
Filename
specifications, that were part of the arguments that generated
this job.
setUses( Filename[] ),
Filenamepublic int getUsesCount()
Filenamepublic List getUsesList()
Filename
specifications, that were part of the arguments that generated
this job. This list is read-only.
setUses( Collection ),
Filenamepublic String getVersion()
setVersion(java.lang.String)public Iterator iterateArgument()
public Iterator iterateProfile()
public Iterator iterateUses()
public ListIterator listIterateArgument()
public ListIterator listIterateArgument(int start)
start - is the start index
public ListIterator listIterateProfile()
public ListIterator listIterateProfile(int start)
start - is the start index
public ListIterator listIterateUses()
public ListIterator listIterateUses(int start)
start - is the start index
public void removeAllArgument()
public void removeAllProfile()
Profilepublic void removeAllUses()
Filenames.
Filenamepublic Leaf removeArgument(int index)
index - is the position to remove the argument fragment from.
ArrayIndexOutOfBoundsException - if the index was invalid.Leafpublic Profile removeProfile(int index)
index - is the position to remove the profile from.
ArrayIndexOutOfBoundsException - if the index was invalid.Profilepublic Filename removeUses(int index)
index - is the position to remove the filename from.
ArrayIndexOutOfBoundsException - if the index was invalid.Filename
public void setArgument(int index,
Leaf vArgument)
throws IndexOutOfBoundsException
index - is the position to overwrite the element atvArgument - is the new commandline argument fragment.
IndexOutOfBoundsException - if the position does not exist.Leaf,
addArgument( int, Leaf ),
getArgument( int )public void setArgument(Leaf[] argumentArray)
argumentArray - is the new commandline argument array.getArgument(),
Leafpublic void setArgument(Collection arguments)
arguments - is the new commandline argument collection.getArgumentList(),
Leafpublic void setName(String name)
name - the new name as logical TR string for this job.getName()public void setNamespace(String namespace)
namespace - getNamespace()public void setDVNamespace(String namespace)
namespace - getDVNamespace(),
setDV( String, String, String )public void setDVName(String name)
name - getDVName(),
setDV( String, String, String )public void setDVVersion(String version)
version - getDVVersion(),
setDV( String, String, String )
public void setDV(String namespace,
String name,
String version)
namespace - is the DV's namespace, may be nullname - is the DV name, should not be nullversion - is the DV version, may be nullgetDVNamespace(),
getDVName(),
getDVVersion(),
setDVNamespace( String ),
setDVName( String ),
setDVVersion( String )public void setChain(String chain)
chain - is the chain, which may be empty or even null.getChain( )public void setID(String id)
id - is the new unique id for this job.getID(),
Childpublic void setStdin(Filename f)
f - is a filename which will be associated with stdin,
or null to release redirection.getStdin()public void setStdout(Filename f)
f - is a filename which will be associated with stdout,
or null to unset.getStdout()public void setStderr(Filename f)
f - is a filename which will be associated with stderr,
or null to unset.getStderr()
public void setProfile(int index,
Profile vProfile)
throws IndexOutOfBoundsException
index - is the position to overwrite the profile at.vProfile - is the new profile to use in overwriting.
IndexOutOfBoundsException - if the position does not exist.Profile,
addProfile( int, Profile ),
getProfile( int )public void setProfile(Profile[] profileArray)
profileArray - is the new list of profiles to use for the job.getProfile(),
Profilepublic void setProfile(Collection profiles)
profiles - is the new list of profiles to use for the job.getProfileList(),
Profile
public void setUses(int index,
Filename vFilename)
throws IndexOutOfBoundsException
index - is the position to overwrite the LFN at.vFilename - is the new LFN to use in overwriting.
IndexOutOfBoundsException - if the position does not exist.addUses( int, Filename ),
getUses( int ),
Filenamepublic void setUses(Filename[] filenameArray)
filenameArray - is the new list of argument-referenced
filenames to use for the job.getUses(),
Filenamepublic void setUses(Collection filenames)
filenames - is a new collection of argument-referenced
filenames to use for the job.getUsesList(),
Filenamepublic void setVersion(String version)
version - getVersion()
public void toString(Writer stream)
throws IOException
toString in class Chimerastream - is a stream opened and ready for writing. This can also
be a string stream for efficient output.
IOException - if something fishy happens to the stream.
private String formatFilename(String tag,
String indent,
String namespace,
Filename f,
boolean full)
Filename instance,
or inherited instances.
tag - is the name of the element to use when formating.indent - is the indentation of the element, may be null.namespace - is an optional namespace to use in the tag.f - is an instance of a Filename object.full - denotes the full attributes set, or just the stdio
attributes set if false.
public void toXML(Writer stream,
String indent,
String namespace)
throws IOException
toXML in class Chimerastream - is a stream opened and ready for writing. This can also
be a string stream for efficient output.indent - is a String of spaces used for pretty
printing. The initial amount of spaces should be an empty string.
The parameter is used internally for the recursive traversal.namespace - is the XML schema namespace prefix. If neither
empty nor null, each element will be prefixed with this prefix,
and the root element will map the XML namespace.
IOException - if something fishy happens to the stream.BufferedWriter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||