org.globus.cog.gridface.interfaces
Interface GridCommand

All Superinterfaces:
ExecutableObject, StatusListener
All Known Implementing Classes:
CHDIRCommandImpl, CHMODCommandImpl, CLOSECommandImpl, COPYCommandImpl, COPYDirCommandImpl, COPYFileCommandImpl, EXECCommandImpl, EXISTSCommandImpl, GETDIRCommandImpl, GETFILECommandImpl, GridCommandImpl, ISDIRCommandImpl, LSCommandImpl, MKDIRCommandImpl, OPENCommandImpl, PUTDIRCommandImpl, PUTFILECommandImpl, PWDCommandImpl, RENAMECommandImpl, RMDIRCommandImpl, RMFILECommandImpl, URLCOPYCommandImpl

public interface GridCommand
extends StatusListener, ExecutableObject

Grid command can be executed in cog-abstraction as tasks.


Field Summary
 
Fields inherited from interface org.globus.cog.abstraction.interfaces.ExecutableObject
TASK, TASKGRAPH
 
Method Summary
 void addArgument(String argument)
          add one argument at a time
 void addStatusListener(StatusListener listener)
          add listener to the command
 String getArgument(int n)
          get the nth argument of the command
 Vector getArguments()
          get all arguments in the form of a vector
 int getArgumentsSize()
          get the total number of arguments
 Object getAttribute(String name)
          get an attribute
 Hashtable getAttributes()
          return the hashtable containing all attributes.
 String getCommand()
          get the command name
 Calendar getCompletedTime()
           
 String getError()
          Get error msg for the given command when status changes to FAILED
 Exception getException()
          Returns the exception for the current status object this is here so it can be overridden by the exec object to make sence of the error codes of jglobus
 String getExceptionString()
          returns an excpetion and its stack to a string using the static method in gridfaces.impl.util.LoggerImpl
 Integer getId()
           
 Object getOutput()
          Get output of the given command when status changes to COMPLETED
 Enumeration getStatusListeners()
          Get a list of all listeners
 Calendar getSubmittedTime()
           
 Task getTask()
           
 Object getTaskAttribute(String key)
          get attributes set for the given command
 ExecutableObject prepareTask()
          prepare the executable object for this command
 void removeStatusListener(StatusListener listener)
          remove listener for this command
 void setArguments(String[] arguments)
          set an array of input arguments
 void setAttribute(String name, Object value)
          set an attribute.
 void setAttributes(Hashtable attribs)
           
 void setCommand(String command)
          set the command to be executed
 void setTask(Task newTask)
           
 void setTaskAttribute(String key, Object value)
          Set attributes for the task to be prepared for this command
 boolean validate()
          validate the given command and return true or false
 
Methods inherited from interface org.globus.cog.abstraction.interfaces.StatusListener
statusChanged
 
Methods inherited from interface org.globus.cog.abstraction.interfaces.ExecutableObject
getIdentity, getName, getObjectType, getStatus, setIdentity, setName, setStatus, setStatus
 

Method Detail

getTask

public Task getTask()

setTask

public void setTask(Task newTask)

getId

public Integer getId()

setCommand

public void setCommand(String command)
set the command to be executed


getCommand

public String getCommand()
get the command name


setArguments

public void setArguments(String[] arguments)
set an array of input arguments


addArgument

public void addArgument(String argument)
add one argument at a time


getArgument

public String getArgument(int n)
get the nth argument of the command


getArgumentsSize

public int getArgumentsSize()
get the total number of arguments


getArguments

public Vector getArguments()
get all arguments in the form of a vector


prepareTask

public ExecutableObject prepareTask()
                             throws Exception
prepare the executable object for this command

Throws:
Exception

setAttribute

public void setAttribute(String name,
                         Object value)
set an attribute. Attributes are the carriers of information.


getAttribute

public Object getAttribute(String name)
get an attribute


getAttributes

public Hashtable getAttributes()
return the hashtable containing all attributes. This is useful in transferring attributes to the task specification


setAttributes

public void setAttributes(Hashtable attribs)

addStatusListener

public void addStatusListener(StatusListener listener)
add listener to the command

Specified by:
addStatusListener in interface ExecutableObject

removeStatusListener

public void removeStatusListener(StatusListener listener)
remove listener for this command

Specified by:
removeStatusListener in interface ExecutableObject

getStatusListeners

public Enumeration getStatusListeners()
Get a list of all listeners


validate

public boolean validate()
validate the given command and return true or false


getSubmittedTime

public Calendar getSubmittedTime()

getCompletedTime

public Calendar getCompletedTime()

getOutput

public Object getOutput()
Get output of the given command when status changes to COMPLETED


getError

public String getError()
Get error msg for the given command when status changes to FAILED


setTaskAttribute

public void setTaskAttribute(String key,
                             Object value)
Set attributes for the task to be prepared for this command


getTaskAttribute

public Object getTaskAttribute(String key)
get attributes set for the given command


getException

public Exception getException()
Returns the exception for the current status object this is here so it can be overridden by the exec object to make sence of the error codes of jglobus


getExceptionString

public String getExceptionString()
returns an excpetion and its stack to a string using the static method in gridfaces.impl.util.LoggerImpl

Returns: