org.globus.cog.abstraction.impl.common.task
Class JobSpecificationImpl

java.lang.Object
  extended byorg.globus.cog.abstraction.impl.common.task.JobSpecificationImpl
All Implemented Interfaces:
JobSpecification, Specification

public class JobSpecificationImpl
extends Object
implements JobSpecification


Field Summary
 
Fields inherited from interface org.globus.cog.abstraction.interfaces.Specification
FILE_OPERATION, FILE_TRANSFER, JOB_SUBMISSION
 
Constructor Summary
JobSpecificationImpl()
           
 
Method Summary
 void addArgument(int index, String argument)
          Adds a commandline argument for the remote exectable at the given index.
 void addArgument(String argument)
          Adds a commandline argument for the remote exectable.
 void addEnvironmentVariable(String name, String value)
          Adds an environment variable to the remote execution environment.
 Enumeration getAllAttributes()
           
 String getArguments()
          Returns the set of space-separated arguments supplied for the remote executable.
 String getArgumentsAsString()
          Returns the set of space-separated arguments supplied for the remote executable.
 Vector getArgumentsAsVector()
          Retruns a Vector representing the set of commandline arguments for the executable.
 Object getAttribute(String name)
           
 String getDirectory()
          Returns the absolute path name of the remote working directory.
 Collection getEnvironment()
          Returns a collection representing all the environment variable names associated with the remote execution environment.
 String getEnvironmentVariable(String name)
          Returns the environment variable with the given name.
 String getExecutable()
          Returns the absolute location of the executable
 String getSpecification()
           
 String getStdError()
          Returns the file used for redirecting the error produced on the stderr of the remote machine.
 String getStdInput()
          Returns the file used as stdin on the remote machine.
 String getStdOutput()
          Returns the file used for redirecting the output produced on the stdout of the remote machine.
 int getType()
           
 boolean isBatchJob()
          Chacks if the Task is to be executed as a batch job.
 boolean isLocalExecutable()
          Checks if the executable is staged-in from the local machine.
 boolean isLocalInput()
          Checks if the stdin is staged-in from the local machine.
 boolean isRedirected()
          Checks if the stdout and stderror is redirected to the local machine.
 String removeArgument(int index)
          Removes the argument at the given index from the argument list
 void removeArgument(String argument)
          Removes the given argument from the argument list
 String removeEnvironmentVariable(String name)
          Removes the environment variable with the given name from the remote execution environment.
 void setArguments(String arguments)
          Sets the comandline arguments for the remote executable.
 void setArguments(Vector arguments)
          Sets the comandline arguments for the remote executable.
 void setAttribute(String name, Object value)
           
 void setBatchJob(boolean bool)
          Specifies that the Task is to be executed as a batch job.
 void setDirectory(String directory)
          Sets the working directory on the remote machine.
 void setExecutable(String executable)
          Sets the name of the executable to be run remotely.
 void setLocalExecutable(boolean bool)
          Specifies that the executable must be staged-in from the local machine.
 void setLocalInput(boolean bool)
          Specifies that the stdin must be staged-in from the local machine.
 void setRedirected(boolean bool)
          Specifies if the stdout and stderr have to be redirected.
 void setSpecification(String specification)
           
 void setStdError(String error)
          Sets the file for redirecting the error produced on the stderr of the remote machine.
 void setStdInput(String input)
          Sets the file from which to redirect the data as stdin on the remote machine.
 void setStdOutput(String output)
          Sets the file for redirecting the output produced on the stdout of the remote machine.
 void setType(int type)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JobSpecificationImpl

public JobSpecificationImpl()
Method Detail

setType

public void setType(int type)
Specified by:
setType in interface Specification

getType

public int getType()
Specified by:
getType in interface Specification

setSpecification

public void setSpecification(String specification)
Specified by:
setSpecification in interface Specification

getSpecification

public String getSpecification()
Specified by:
getSpecification in interface Specification

setExecutable

public void setExecutable(String executable)
Description copied from interface: JobSpecification
Sets the name of the executable to be run remotely.

Specified by:
setExecutable in interface JobSpecification
Parameters:
executable - a string representing the absolute location of the executable.

getExecutable

public String getExecutable()
Description copied from interface: JobSpecification
Returns the absolute location of the executable

Specified by:
getExecutable in interface JobSpecification

setDirectory

public void setDirectory(String directory)
Description copied from interface: JobSpecification
Sets the working directory on the remote machine.

Specified by:
setDirectory in interface JobSpecification
Parameters:
directory - a string representing the absolute path name of the remote working directory.

getDirectory

public String getDirectory()
Description copied from interface: JobSpecification
Returns the absolute path name of the remote working directory.

Specified by:
getDirectory in interface JobSpecification

addArgument

public void addArgument(String argument)
Description copied from interface: JobSpecification
Adds a commandline argument for the remote exectable. Multiple commandline arguments can be set by making multiple calls to this function.

Specified by:
addArgument in interface JobSpecification
Parameters:
argument - a string representing an argument for the remote executable.

addArgument

public void addArgument(int index,
                        String argument)
Description copied from interface: JobSpecification
Adds a commandline argument for the remote exectable at the given index. Multiple commandline arguments can be set by making multiple calls to this function.

Specified by:
addArgument in interface JobSpecification
Parameters:
index - the index in the argument list
argument - a string representing an argument for the remote executable.

removeArgument

public void removeArgument(String argument)
Description copied from interface: JobSpecification
Removes the given argument from the argument list

Specified by:
removeArgument in interface JobSpecification
Parameters:
argument - the String argument to be removed

removeArgument

public String removeArgument(int index)
Description copied from interface: JobSpecification
Removes the argument at the given index from the argument list

Specified by:
removeArgument in interface JobSpecification
Parameters:
index - the index of the argument to be removed

getArgumentsAsVector

public Vector getArgumentsAsVector()
Description copied from interface: JobSpecification
Retruns a Vector representing the set of commandline arguments for the executable.

Specified by:
getArgumentsAsVector in interface JobSpecification

setArguments

public void setArguments(Vector arguments)
Description copied from interface: JobSpecification
Sets the comandline arguments for the remote executable.

Specified by:
setArguments in interface JobSpecification
Parameters:
arguments - a Vector representing the set of arguments for the remote executable.

setArguments

public void setArguments(String arguments)
Description copied from interface: JobSpecification
Sets the comandline arguments for the remote executable. A set of space seperated arguments can be supplied: "arg1 arg2 agr3 ..."

Specified by:
setArguments in interface JobSpecification
Parameters:
arguments - a string representing the set of arguments for the remote executable.

getArguments

public String getArguments()
Description copied from interface: JobSpecification
Returns the set of space-separated arguments supplied for the remote executable.

Specified by:
getArguments in interface JobSpecification

getArgumentsAsString

public String getArgumentsAsString()
Description copied from interface: JobSpecification
Returns the set of space-separated arguments supplied for the remote executable.

Specified by:
getArgumentsAsString in interface JobSpecification

addEnvironmentVariable

public void addEnvironmentVariable(String name,
                                   String value)
Description copied from interface: JobSpecification
Adds an environment variable to the remote execution environment. Multiple environment variables can be created by making multiple calls to this method.

Specified by:
addEnvironmentVariable in interface JobSpecification
Parameters:
name - the name of the environment variable
value - the value of the environment variable

removeEnvironmentVariable

public String removeEnvironmentVariable(String name)
Description copied from interface: JobSpecification
Removes the environment variable with the given name from the remote execution environment.

Specified by:
removeEnvironmentVariable in interface JobSpecification
Parameters:
name - the name of the environment variable
Returns:
the value of the environment variable

getEnvironmentVariable

public String getEnvironmentVariable(String name)
Description copied from interface: JobSpecification
Returns the environment variable with the given name.

Specified by:
getEnvironmentVariable in interface JobSpecification
Parameters:
name - the name of the environment variable
Returns:
the value of the environment variable

getEnvironment

public Collection getEnvironment()
Description copied from interface: JobSpecification
Returns a collection representing all the environment variable names associated with the remote execution environment.

Specified by:
getEnvironment in interface JobSpecification

setStdOutput

public void setStdOutput(String output)
Description copied from interface: JobSpecification
Sets the file for redirecting the output produced on the stdout of the remote machine.

Specified by:
setStdOutput in interface JobSpecification
Parameters:
output - a string representing the file for redirecting the remote stdout.

getStdOutput

public String getStdOutput()
Description copied from interface: JobSpecification
Returns the file used for redirecting the output produced on the stdout of the remote machine.

Specified by:
getStdOutput in interface JobSpecification

setStdInput

public void setStdInput(String input)
Description copied from interface: JobSpecification
Sets the file from which to redirect the data as stdin on the remote machine.

Specified by:
setStdInput in interface JobSpecification

getStdInput

public String getStdInput()
Description copied from interface: JobSpecification
Returns the file used as stdin on the remote machine.

Specified by:
getStdInput in interface JobSpecification

setStdError

public void setStdError(String error)
Description copied from interface: JobSpecification
Sets the file for redirecting the error produced on the stderr of the remote machine.

Specified by:
setStdError in interface JobSpecification
Parameters:
error - a string representing the file for redirecting the remote error.

getStdError

public String getStdError()
Description copied from interface: JobSpecification
Returns the file used for redirecting the error produced on the stderr of the remote machine.

Specified by:
getStdError in interface JobSpecification

setBatchJob

public void setBatchJob(boolean bool)
Description copied from interface: JobSpecification
Specifies that the Task is to be executed as a batch job. If it is a batch job, then the client machine will not be notified regarding the stautus of the remote execution. From the client's perspective, the Task is completed as soon as it is submitted remotely. The execution status and the output/error must be retrieved by the user in an offline fashion.

Specified by:
setBatchJob in interface JobSpecification
Parameters:
bool - a boolean value indicating if the Task is a batch job.

isBatchJob

public boolean isBatchJob()
Description copied from interface: JobSpecification
Chacks if the Task is to be executed as a batch job.

Specified by:
isBatchJob in interface JobSpecification

setRedirected

public void setRedirected(boolean bool)
Description copied from interface: JobSpecification
Specifies if the stdout and stderr have to be redirected.

If filename for the setStdOutput in this Specification is null and the setRedirected is true, then the remote stdout is redirected to the local machine and can be retrieved from the getOutput method of the container Task.

Specified by:
setRedirected in interface JobSpecification

isRedirected

public boolean isRedirected()
Description copied from interface: JobSpecification
Checks if the stdout and stderror is redirected to the local machine.

Specified by:
isRedirected in interface JobSpecification

setLocalInput

public void setLocalInput(boolean bool)
Description copied from interface: JobSpecification
Specifies that the stdin must be staged-in from the local machine.

Specified by:
setLocalInput in interface JobSpecification

isLocalInput

public boolean isLocalInput()
Description copied from interface: JobSpecification
Checks if the stdin is staged-in from the local machine.

Specified by:
isLocalInput in interface JobSpecification

setLocalExecutable

public void setLocalExecutable(boolean bool)
Description copied from interface: JobSpecification
Specifies that the executable must be staged-in from the local machine.

Specified by:
setLocalExecutable in interface JobSpecification

isLocalExecutable

public boolean isLocalExecutable()
Description copied from interface: JobSpecification
Checks if the executable is staged-in from the local machine.

Specified by:
isLocalExecutable in interface JobSpecification

setAttribute

public void setAttribute(String name,
                         Object value)
Specified by:
setAttribute in interface JobSpecification

getAttribute

public Object getAttribute(String name)
Specified by:
getAttribute in interface JobSpecification

getAllAttributes

public Enumeration getAllAttributes()
Specified by:
getAllAttributes in interface JobSpecification