org.griphyn.vdl.dax
Class Job

java.lang.Object
  extended by org.griphyn.vdl.Chimera
      extended by org.griphyn.vdl.dax.DAX
          extended by org.griphyn.vdl.dax.Job
All Implemented Interfaces:
Cloneable

public class Job
extends DAX
implements Cloneable

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.

Version:
$Revision: 366 $
Author:
Jens-S. V??ckler, Yong Zhao
See Also:
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

m_namespace

private String m_namespace
Each transformation and derivation resides in a namespace. Mind that namespaces are currently flat. If you need to impose any kind of hierarchy, please do so yourself, e.g. use periods between hierarchy intifiers. The namespace is part of the key identifying a logical transformation.


m_name

private String m_name
Each transformation and derivation can be identified by a name. For a transformation, this is part of the logical transformation name. Derivations can be anonymous, and not use a name.


m_version

private String m_version
Each transformation and derivation has a version associated with their definition. While a version number is mandatory for transformation, being part of the logical transformation key, a derivation can remain anonymous without version.


m_dv_namespace

private String m_dv_namespace
DVs are dynamically mapped to TR. This variable records the namespace of the chosen DV.


m_dv_name

private String m_dv_name
DVs are dynamically mapped to TR. This variable records the name of the chosen DV.


m_dv_version

private String m_dv_version
DVs are dynamically mapped to TR. This variable records the version of the chosen DV.


m_id

private String m_id
Each job also gets a unique id to refer to it from references.

See Also:
Child

m_chain

private String m_chain
A compound transformation may be nested. For purposes of display and grouping, it is feasible to record the compound transformation chain. This is an optional argument.


m_stdin

private Filename m_stdin
stdin is a Filename which must be of input linkage. Alternatively, it may be unused (null).


m_stdout

private Filename m_stdout
stdout is a Filename which must be of output linkage. Alternatively, it may be unused (null).


m_stderr

private Filename m_stderr
stderr is a Filename which must be of output linkage. Alternatively, it may be unused (null).


m_level

private int m_level
The level is set by the topological sort. It is optional.


m_argumentList

private ArrayList m_argumentList
The argument list describes the command line arguments as sum of strings and filename references. Each element is a Leaf, which is either implemented by a Filename or PseudoText instance.

See Also:
Leaf, Filename, PseudoText

m_profileList

private ArrayList m_profileList
The profile list encapsulates scheduler specific data in a generic structure.

See Also:
Profile

m_usesList

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.

See Also:
Filename
Constructor Detail

Job

public Job()
Default ctor: Note that a job must be named.


Job

public Job(String namespace,
           String name,
           String version,
           String id)
Convenience ctor. Any job must be named. The job id will be assembled from the name.

Parameters:
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.
See Also:
Transformation

Job

public Job(String namespace,
           String name,
           String version,
           String id,
           String dv_namespace,
           String dv_name,
           String dv_version)
Convenience ctor. Any job must be named. The job id will be assembled from the name.

Parameters:
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.
See Also:
Transformation
Method Detail

clone

public Object clone()
Creates and returns a copy of this object.

Overrides:
clone in class Object
Returns:
a new instance, semi-deep copy

addArgument

public void addArgument(Leaf vArgument)
Accessor: Adds an argument to the list of arguments

Parameters:
vArgument - is an argument fragment to append to the command line arguments.
See Also:
Leaf

addArgument

public void addArgument(int index,
                        Leaf vArgument)
                 throws IndexOutOfBoundsException
Accessor: Inserts an argument at an arbitrary place into the list. Each component in this vector with an index greater or equal to the specified index is shifted upward to have an index one greater than the value it had previously.

Parameters:
index - is the position to insert an argument
vArgument - is the argument fragment to insert at the specified place.
Throws:
IndexOutOfBounds - if the argument does not fit into the list.
IndexOutOfBoundsException
See Also:
setArgument( int, Leaf ), getArgument( int ), Leaf

matchWithNull

private boolean matchWithNull(String a,
                              String b)
Compares two strings, each of which may be null.

Parameters:
a - is the first string
b - is the other string to compare to
Returns:
true, if both strings are null, or both strings match.

addProfile

public boolean addProfile(Profile vProfile)
Accessor: Appends a profile definition to the list of profiles. This method provides extra magic, ensuring unique namespace and key identifiers in the profile list. If the ns:id of the profile to add already exists in the list, the list entry will be overwritten with the new version.

FIXME: The profile should carry a state to signal appending or replacing.

Parameters:
vProfile - is the profile to append to remembered profiles.
Returns:
false for a new elements, and true, if an existing element was overwritten.
See Also:
Profile

addProfile

public void addProfile(int index,
                       Profile vProfile)
                throws IndexOutOfBoundsException
Accessor: Inserts a profile definition at an arbitrary position into the list of profiles. Each component in this vector with an index greater or equal to the specified index is shifted upward to have an index one greater than the value it had previously.

Parameters:
index - is the position to insert the definitions into.
vProfile - is the profile to append to remembered profiles.
Throws:
IndexOutOfBounds - if the argument does not fit into the list.
IndexOutOfBoundsException
See Also:
setProfile( int, Profile ), getProfile( int ), Profile

addUses

public void addUses(Filename filename)
Accessor: Appends a filename to the list of used filenames.

Parameters:
filename - is the LFN to append to remembered filenames.
Throws:
IndexOutOfBounds - if the argument does not fit into the list.
See Also:
Filename

addUses

public void addUses(int index,
                    Filename filename)
             throws IndexOutOfBoundsException
Accessor: Inserts a logical filename at an arbitrary position into the list of used filenames. Each component in this vector with an index greater or equal to the specified index is shifted upward to have an index one greater than the value it had previously.

Parameters:
index - is the position to insert the definitions into.
filename - is the LFN to append to remembered filenames.
Throws:
IndexOutOfBounds - if the argument does not fit into the list.
IndexOutOfBoundsException
See Also:
setUses( int, Filename ), getUses( int ), Filename

enumerateArgument

public Enumeration enumerateArgument()
Deprecated. Use the new Collection based interfaces

Accessor: Provides an iterator for the argument fragment list.

Returns:
the iterator for the commandline argument fragments.
See Also:
Leaf, Enumeration

enumerateProfile

public Enumeration enumerateProfile()
Deprecated. Use the new Collection based interfaces

Accessor: Provides an iterator for the Profile list.

Returns:
the iterator for the Profile list.
See Also:
Profile, Enumeration

enumerateUses

public Enumeration enumerateUses()
Deprecated. Use the new Collection based interfaces

Accessor: Provides an iterator for the used Filename list.

Returns:
the iterator for the Filename list.
See Also:
Filename, Enumeration

getArgument

public Leaf getArgument(int index)
                 throws IndexOutOfBoundsException
Accessor: Obtains an argument fragment from an arbitrary position.

Parameters:
index - is the place to look up the element at.
Returns:
the argument fragment at the specified place.
Throws:
IndexOutOfBoundsException - if the referenced position does not exist.
See Also:
addArgument( int, Leaf ), setArgument( int, Leaf ), Leaf

getArgument

public Leaf[] getArgument()
Deprecated. Use the new Collection based interfaces

Accessor: Obtains the complete commandline arguments

Returns:
an array with all commandline argument fragments inside.
See Also:
setArgument( Leaf[] ), Leaf

getArgumentCount

public int getArgumentCount()
Accessor: Obtains the count of fragments in the argument list.

Returns:
the number of arguments in the commandline argument list.
See Also:
Leaf

getArgumentList

public List getArgumentList()
Accessor: Gets an array of all values that constitute the current argument line. This list is read-only.

Returns:
an array with a mixture of either PseudoText or Filename values.
See Also:
setArgument( Collection ), PseudoText, Filename

getChain

public String getChain()
Accessor: Obtains the XML list attribute which contains the chain of compound transformations that lead to this job.

Returns:
the chain, which may be empty or even null.
See Also:
setChain( String )

getID

public String getID()
Accessor: Obtains the unique ID of this job. The ID will be used in references in the dependency list.

Returns:
The unique id from this job.
See Also:
setID( String ), Child

getName

public String getName()
Accessor: Obtains the current name of the job.

Returns:
the name as logical TR string for this job.
See Also:
setName( String )

getNamespace

public String getNamespace()
Accessor: Obtains the current namespace that is used for the definition. Note that a namespace is part of the key for any logical transformation.

Returns:
the namespace the definition resides in, or null, if no namespace was defined.
See Also:
setNamespace(java.lang.String)

getDVNamespace

public String getDVNamespace()
Accessor: Obtains the current namespace from the DV that created this job. Note that a namespace is part of the key for any DV.

Returns:
the namespace the DV resides in, or null, if no namespace was defined.
See Also:
setDVNamespace(java.lang.String), setDV( String, String, String )

getDVName

public String getDVName()
Accessor: Obtains the current name from the DV that created this job. Note that a name is part of the key for any DV.

Returns:
the name the DV resides in.
See Also:
setDVName(java.lang.String), setDV( String, String, String )

getDVVersion

public String getDVVersion()
Accessor: Obtains the current version from the DV that created this job. Note that a version is part of the key triple for any DV.

Returns:
the version the DV resides in, or null, if no version was defined.
See Also:
setDVVersion(java.lang.String), setDV( String, String, String )

getStdin

public Filename getStdin()
Accessor: Obtains the current setting of stdin redirection.

Returns:
a filename which will be associated with stdin, or null, if unset.
See Also:
setStdin( Filename )

getLevel

public int getLevel()
Accessor

See Also:
setLevel(int)

setLevel

public void setLevel(int level)
Accessor.

Parameters:
level -
See Also:
getLevel()

getStdout

public Filename getStdout()
Accessor: Obtains the current setting of stdout redirection.

Returns:
a filename which will be associated with stdout, or null, if unset.
See Also:
setStdout( Filename )

getStderr

public Filename getStderr()
Accessor: Obtains the current setting of stderr redirection.

Returns:
a filename which will be associated with stderr, or null, if unset.
See Also:
setStderr( Filename )

getProfile

public Profile getProfile(int index)
                   throws IndexOutOfBoundsException
Accessor: Obtains an Profile at an arbitrary position.

Parameters:
index - is the place to look up the element at.
Throws:
IndexOutOfBoundsException - if the referenced position does not exist.
See Also:
addProfile( int, Profile ), setProfile( int, Profile ), Profile

getProfile

public Profile[] getProfile()
Deprecated. Use the new Collection based interfaces

Accessor: Obtains all profiles.

Returns:
an array with all profiles inside.
See Also:
setProfile( Profile[] ), Profile

getProfileCount

public int getProfileCount()
Accessor: Counts the number of profile specifications known to this job.

Returns:
the number of profiles
See Also:
Profile

getProfileList

public List getProfileList()
Accessor: Obtain a read-only copy of the list of all Profile specifications.

Returns:
a collection containing the scheduler specific environment options for the job.
See Also:
setProfile( Collection ), Profile

getUses

public Filename getUses(int index)
                 throws IndexOutOfBoundsException
Accessor: Obtains an Filename at an arbitrary position.

Parameters:
index - is the place to look up the element at.
Throws:
IndexOutOfBoundsException - if the referenced position does not exist.
See Also:
addUses( int, Filename ), setUses( int, Filename ), Filename

getUses

public Filename[] getUses()
Deprecated. Use the new Collection based interfaces

Accessor: Obtain a copy of the list of all Filename specifications, that were part of the arguments that generated this job.

Returns:
an array containing the used filenames for the job.
See Also:
setUses( Filename[] ), Filename

getUsesCount

public int getUsesCount()
Accessor: Counts the number of argument-referenced logical filenames known to this job.

Returns:
the number of LFNs.
See Also:
Filename

getUsesList

public List getUsesList()
Accessor: Obtain a copy of the list of all Filename specifications, that were part of the arguments that generated this job. This list is read-only.

Returns:
an array containing the used filenames for the job.
See Also:
setUses( Collection ), Filename

getVersion

public String getVersion()
Accessor: Obtains the current version of the definition. A version is an integral part of a logical transformation.

Returns:
the version number of this definition, or null, if no version number was defined.
See Also:
setVersion(java.lang.String)

iterateArgument

public Iterator iterateArgument()
Accessor: Provides an iterator to the internal list of all commandline argument elements.

Returns:
an iterator to walk the list with.

iterateProfile

public Iterator iterateProfile()
Accessor: Provides an iterator to the internal list of all profiles.

Returns:
an iterator to walk the list with.

iterateUses

public Iterator iterateUses()
Accessor: Provides an iterator to the internal list of used filenames.

Returns:
an iterator to walk the list with.

listIterateArgument

public ListIterator listIterateArgument()
Accessor: Provides a list iterator to the internal list of all commandline argument elements.

Returns:
a list iterator to walk the list with.

listIterateArgument

public ListIterator listIterateArgument(int start)
Accessor: Provides a list iterator to the internal list of all commandline argument elements.

Parameters:
start - is the start index
Returns:
a list iterator to walk the list with.

listIterateProfile

public ListIterator listIterateProfile()
Accessor: Provides a list iterator to the internal list of all profiles.

Returns:
a list iterator to walk the list with.

listIterateProfile

public ListIterator listIterateProfile(int start)
Accessor: Provides a list iterator to the internal list of all profiles.

Parameters:
start - is the start index
Returns:
a list iterator to walk the list with.

listIterateUses

public ListIterator listIterateUses()
Accessor: Provides a list iterator to the internal list of all used filenames.

Returns:
a list iterator to walk the list with.

listIterateUses

public ListIterator listIterateUses(int start)
Accessor: Provides a list iterator to the internal list of all used filenames.

Parameters:
start - is the start index
Returns:
a list iterator to walk the list with.

removeAllArgument

public void removeAllArgument()
Accessor: Removes all commandline arguments pieces.


removeAllProfile

public void removeAllProfile()
Accessor: Removes all profile declarations.

See Also:
Profile

removeAllUses

public void removeAllUses()
Accessor: Removes all known Filenames.

See Also:
Filename

removeArgument

public Leaf removeArgument(int index)
Accessor: Removes a commandline argument fragment from the commandline. Each component in this vector with an index greater or equal to the specified index is shifted downward to have an index one smaller than the value it had previously. The size of this vector is decreased by 1.

Parameters:
index - is the position to remove the argument fragment from.
Returns:
the removed fragment.
Throws:
ArrayIndexOutOfBoundsException - if the index was invalid.
See Also:
Leaf

removeProfile

public Profile removeProfile(int index)
Accessor: Removes a profile. Each component in this vector with an index greater or equal to the specified index is shifted downward to have an index one smaller than the value it had previously. The size of this vector is decreased by 1.

Parameters:
index - is the position to remove the profile from.
Returns:
the removed Profile.
Throws:
ArrayIndexOutOfBoundsException - if the index was invalid.
See Also:
Profile

removeUses

public Filename removeUses(int index)
Accessor: Removes a used filename from the list of argument-referenced LFNs. Each component in this vector with an index greater or equal to the specified index is shifted downward to have an index one smaller than the value it had previously. The size of this vector is decreased by 1.

Parameters:
index - is the position to remove the filename from.
Returns:
the removed Filename
Throws:
ArrayIndexOutOfBoundsException - if the index was invalid.
See Also:
Filename

setArgument

public void setArgument(int index,
                        Leaf vArgument)
                 throws IndexOutOfBoundsException
Accessor: Overwrites an commandline argument fragment with a new one.

Parameters:
index - is the position to overwrite the element at
vArgument - is the new commandline argument fragment.
Throws:
IndexOutOfBoundsException - if the position does not exist.
See Also:
Leaf, addArgument( int, Leaf ), getArgument( int )

setArgument

public void setArgument(Leaf[] argumentArray)
Deprecated. Use the new Collection based interfaces

Accessor: Replace the commandline arguments with a new commandline argument fragment list.

Parameters:
argumentArray - is the new commandline argument array.
See Also:
getArgument(), Leaf

setArgument

public void setArgument(Collection arguments)
Accessor: Replace the commandline arguments with a new commandline argument fragment list.

Parameters:
arguments - is the new commandline argument collection.
See Also:
getArgumentList(), Leaf

setName

public void setName(String name)
Accessor: Sets the current name of the job. If the job ID was not set previously, it will be set to the job name. FIXME: We need to use the primary key triple for logical TR!

Parameters:
name - the new name as logical TR string for this job.
See Also:
getName()

setNamespace

public void setNamespace(String namespace)
Accessor: Sets or overwrites the TR namespace identifier.

Parameters:
namespace -
See Also:
getNamespace()

setDVNamespace

public void setDVNamespace(String namespace)
Accessor: Sets or overwrites the DV namespace identifier.

Parameters:
namespace -
See Also:
getDVNamespace(), setDV( String, String, String )

setDVName

public void setDVName(String name)
Accessor: Sets or overwrites the DV name identifier.

Parameters:
name -
See Also:
getDVName(), setDV( String, String, String )

setDVVersion

public void setDVVersion(String version)
Accessor: Sets or overwrites the DV version identifier.

Parameters:
version -
See Also:
getDVVersion(), setDV( String, String, String )

setDV

public void setDV(String namespace,
                  String name,
                  String version)
Accessor: Sets or overwrites the DV FQDN triple.

Parameters:
namespace - is the DV's namespace, may be null
name - is the DV name, should not be null
version - is the DV version, may be null
See Also:
getDVNamespace(), getDVName(), getDVVersion(), setDVNamespace( String ), setDVName( String ), setDVVersion( String )

setChain

public void setChain(String chain)
Accessor: Sets the XML list attribute which contains the chain of compound transformations that lead to this job.

Parameters:
chain - is the chain, which may be empty or even null.
See Also:
getChain( )

setID

public void setID(String id)
Accessor: Sets the unique ID of this job. The ID will be used in references in the dependency list. Please do not use this function.

Parameters:
id - is the new unique id for this job.
See Also:
getID(), Child

setStdin

public void setStdin(Filename f)
Accessor: Sets or releases the stdin redirection.

Parameters:
f - is a filename which will be associated with stdin, or null to release redirection.
See Also:
getStdin()

setStdout

public void setStdout(Filename f)
Accessor: Sets or releases the stdout redirection.

Parameters:
f - is a filename which will be associated with stdout, or null to unset.
See Also:
getStdout()

setStderr

public void setStderr(Filename f)
Accessor: Sets or releases the stderr redirection.

Parameters:
f - is a filename which will be associated with stderr, or null to unset.
See Also:
getStderr()

setProfile

public void setProfile(int index,
                       Profile vProfile)
                throws IndexOutOfBoundsException
Accessor: Overwrites a profile with a new profile

Parameters:
index - is the position to overwrite the profile at.
vProfile - is the new profile to use in overwriting.
Throws:
IndexOutOfBoundsException - if the position does not exist.
See Also:
Profile, addProfile( int, Profile ), getProfile( int )

setProfile

public void setProfile(Profile[] profileArray)
Deprecated. Use the new Collection based interfaces

Accessor: Replace the internal profile list with a new list.

Parameters:
profileArray - is the new list of profiles to use for the job.
See Also:
getProfile(), Profile

setProfile

public void setProfile(Collection profiles)
Accessor: Replace the internal profile list with a new list.

Parameters:
profiles - is the new list of profiles to use for the job.
See Also:
getProfileList(), Profile

setUses

public void setUses(int index,
                    Filename vFilename)
             throws IndexOutOfBoundsException
Accessor: Overwrites a used filename with a new LFN.

Parameters:
index - is the position to overwrite the LFN at.
vFilename - is the new LFN to use in overwriting.
Throws:
IndexOutOfBoundsException - if the position does not exist.
See Also:
addUses( int, Filename ), getUses( int ), Filename

setUses

public void setUses(Filename[] filenameArray)
Deprecated. Use the new Collection based interfaces

Accessor: Replace the internal list of used LFNs with a new list.

Parameters:
filenameArray - is the new list of argument-referenced filenames to use for the job.
See Also:
getUses(), Filename

setUses

public void setUses(Collection filenames)
Accessor: Replace the internal list of used LFNs with a new list.

Parameters:
filenames - is a new collection of argument-referenced filenames to use for the job.
See Also:
getUsesList(), Filename

setVersion

public void setVersion(String version)
Accessor: Sets the version of the definition.

Parameters:
version -
See Also:
getVersion()

toString

public void toString(Writer stream)
              throws IOException
Converts the active state into something meant for human consumption. The method will be called when recursively traversing the instance tree.

Specified by:
toString in class Chimera
Parameters:
stream - is a stream opened and ready for writing. This can also be a string stream for efficient output.
Throws:
IOException - if something fishy happens to the stream.

formatFilename

private String formatFilename(String tag,
                              String indent,
                              String namespace,
                              Filename f,
                              boolean full)
Helper: Formats the attributes of any Filename instance, or inherited instances.

Parameters:
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.
Returns:
the XML-formatted attributes without the element tags.

toXML

public void toXML(Writer stream,
                  String indent,
                  String namespace)
           throws IOException
Dump the state of the current element as XML output. This function traverses all sibling classes as necessary, and converts the data into pretty-printed XML output. The stream interface should be able to handle large output efficiently.

Specified by:
toXML in class Chimera
Parameters:
stream - 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.
Throws:
IOException - if something fishy happens to the stream.
See Also:
BufferedWriter


Copyright © 2007 The University of Southern California. All Rights Reserved.