gov.bnl.star.offline.scheduler.request
Class Request

java.lang.Object
  extended by gov.bnl.star.offline.scheduler.request.Request
All Implemented Interfaces:
java.io.Serializable

public class Request
extends java.lang.Object
implements java.io.Serializable

Holds all the informations describing a job to be executed by the scheduler. It contains the machine from which it was dispatched, the command line, the file required for input and output and the environment variables needed by the process. It can also handle the information about the processes to be dispatched in order to execute the job. The scheduler Policy will decide this information and put it in this class for the Dispatcher to use.

Version:
$Revision: 1.13 $ $Date: 2006/11/21 00:41:31 $
Author:
Gabriele Carcassi & Levente Hajdu & Pavel Jakl
See Also:
Serialized Form

Field Summary
static java.net.URL discard
           
 
Constructor Summary
Request()
           
Request(java.lang.String fileName)
          Creates a new Request and provides XML file name.
Request(java.lang.String username, java.lang.String command, java.lang.String name, java.lang.String description, java.lang.String fileName)
          Creates a new JobRequest with a title and a description.
 
Method Summary
 void addResource(Resource resource)
          Add a Resource value to this Request
 void addToReportText(java.lang.String Text)
           
 Application getApplication()
          Return Application value.
 java.lang.String getAuthenticatedUser()
           
 java.lang.String getCommand()
          Deprecated. use getTask instead
 java.lang.String getDescription()
          Returns a description of the job request.
 java.lang.String getFileListType()
          Getter for property fileListType.
 double getFilesPerHour()
          Getter for property filesPerHour.
 java.lang.String getID()
          Returns the base jobs ID
 java.util.List getInputList()
          Returns the list of data files that were requested as an input of the job.
 java.util.List getInputOrder()
          Getter for property inputOrder.
 java.util.List getJobs()
          Returns a list of all the job objects of this request
 boolean getMail()
          Returns true if communication by mail from the queuing system is allowed.
 java.lang.String getName()
          Returns a title describing the job request.
 int getNProcesses()
          Getter for property nProcesses.
 java.util.List getOutputList()
          Return the list of data files that were requested as an output of the job.
 java.lang.String GetReportText()
           
 java.lang.String getRequestFileName()
          Retrieves the filename of the orignal request sent to the scheduler.
 Resource getResource(java.lang.String name)
          Get a Resource value from this Request If the Resource doesn't exist, return a default Resource
 java.util.Hashtable getResourceTable()
           
 Sandbox getSandbox()
           
 boolean getSimulation()
          Returns true if this job requests is only a simulations.
 java.net.URL getStdErr()
          Deprecated. use getTask().getStdErr() instead
 java.net.URL getStdIn()
          Deprecated. use getTask().getStdIn() instead
 java.net.URL getStdOut()
          Deprecated. use getTask().getStdOut() instead
 Task getTask()
          Return Task value.
 java.lang.String getUsername()
          Returns the user name under which the job has to run.
 boolean hasNoInput()
          Returns true if the job request didn't contain any input.
 void prepareInputOrder(java.lang.String commaSeparated)
           
 void setApplication(Application app)
          Set Application attribute.
 void setAuthenticatedUser(java.lang.String authenticatedUser)
           
 void setCommand(java.lang.String command)
          Deprecated. use setTask instead
 void setFileListType(java.lang.String fileListType)
          Setter for property fileListType.
 void setFilesPerHour(double filesPerHour)
          Setter for property filesPerHour.
 void setID(java.lang.String id)
          sets the base ID for the request
 void setInputOrder(java.util.List inputOrder)
          Setter for property inputOrder.
 void setJobs(java.util.List jobs)
          Sets the list of jobs that where made from this request
 void setMail(boolean mail)
          Specifies if the queuing system is allowed to send mail to the user.
 void setName(java.lang.String name)
          Set the request name
 void setNProcesses(int nProcesses)
          Setter for property nProcesses.
 void setOutputList(java.util.List output)
           
 void SetReportText(java.lang.String Text)
           
 void setResourceMax(java.lang.String name, int max)
          Set a Resource's max value If the Resource doesn't exist, create it
 void setResourceMin(java.lang.String name, int min)
          Set a Resource's min value If the Resource doesn't exist, create it
 void setResourceTable(java.util.Hashtable resources)
           
 void setSandbox(Sandbox sandbox)
           
 void setSimulation(boolean simulation)
          Set to true if this job request is only to be simulated.
 void setStdErr(java.net.URL stderr)
          Deprecated. use setTask() instead
 void setStdIn(java.net.URL stdin)
          Deprecated. use setTask() instead
 void setStdOut(java.net.URL stdout)
          Deprecated. use setTask() instead
 void setTask(Task task)
          Set Task attribute.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

discard

public static java.net.URL discard
Constructor Detail

Request

public Request(java.lang.String username,
               java.lang.String command,
               java.lang.String name,
               java.lang.String description,
               java.lang.String fileName)
Creates a new JobRequest with a title and a description. Should only be used for legacy JDL request construction.

Parameters:
username - the username submitting the job
command - the command line to be executed
name - a short description of the job
description - a more detailed description of the job
fileName - the XML request file name

Request

public Request(java.lang.String fileName)
Creates a new Request and provides XML file name.

Parameters:
fileName - the XML request file name

Request

public Request()
Method Detail

setResourceTable

public void setResourceTable(java.util.Hashtable resources)

getResourceTable

public java.util.Hashtable getResourceTable()

setID

public void setID(java.lang.String id)
sets the base ID for the request


getID

public java.lang.String getID()
Returns the base jobs ID


setJobs

public void setJobs(java.util.List jobs)
Sets the list of jobs that where made from this request


getJobs

public java.util.List getJobs()
Returns a list of all the job objects of this request


setSimulation

public void setSimulation(boolean simulation)
Set to true if this job request is only to be simulated. By simulations we mean that the scheduler will prepare everything in the same way it would if it was not a simulation, but it wouldn't execute the final command for the job submission. For example, it would analize the job, check if it's a valid request, query the catalog, assign to target, prepare scripts, but don't dispatch the request.

This mode is intended to be used by advanced users and developers to check whether their request was executed correctly. The dispatcher is responsible to check for this flag, and implement fake dispatching.

Parameters:
simulation - true if no actual dispatching action is requested

getRequestFileName

public java.lang.String getRequestFileName()
Retrieves the filename of the orignal request sent to the scheduler.


getUsername

public java.lang.String getUsername()
Returns the user name under which the job has to run.

Returns:
the username submitting the job

hasNoInput

public boolean hasNoInput()
Returns true if the job request didn't contain any input.

Returns:
true if not input was specified

getCommand

public java.lang.String getCommand()
Deprecated. use getTask instead

Returns the command line to be executed on the remote machine.

Returns:
the command line to be executed

getName

public java.lang.String getName()
Returns a title describing the job request.

Returns:
a short description of the job

getDescription

public java.lang.String getDescription()
Returns a description of the job request.

Returns:
a full description of the job

getStdIn

public java.net.URL getStdIn()
Deprecated. use getTask().getStdIn() instead

Returns the location from which the standard input will be read.

Returns:
the file from which to redirect the standard in

getStdOut

public java.net.URL getStdOut()
Deprecated. use getTask().getStdOut() instead

Return the location to which the standard output has to be redirected.

Returns:
a file containing the output file where the standard out should be redirected

getStdErr

public java.net.URL getStdErr()
Deprecated. use getTask().getStdErr() instead

Return the location to which the standard error has to be redirected.

Returns:
a file containing the output file where the standard error should be redirected

getApplication

public Application getApplication()
Return Application value.

Returns:
application

getTask

public Task getTask()
Return Task value.

Returns:
task

getInputList

public java.util.List getInputList()
Returns the list of data files that were requested as an input of the job.

Returns:
the requested input file list

getOutputList

public java.util.List getOutputList()
Return the list of data files that were requested as an output of the job.

Returns:
the requested output file list

setOutputList

public void setOutputList(java.util.List output)

getSimulation

public boolean getSimulation()
Returns true if this job requests is only a simulations. By simulations we mean that the scheduler will prepare everything in the same way it would if it was not a simulation, but it wouldn't execute the final command for the job submission. For example, it would analize the job, check if it's a valid request, query the catalog, assign to target, prepare scripts, but don't dispatch the request.

This mode is intended to be used by advanced users and developers to check whether their request was executed correctly. The dispatcher is responsible to check for this flag, and implement fake dispatching.

Returns:
true if the scheduler shouldn't dispatch the job

getMail

public boolean getMail()
Returns true if communication by mail from the queuing system is allowed.

Returns:
true if the output, or other messages, can be sent by mail

getFileListType

public java.lang.String getFileListType()
Getter for property fileListType.

Returns:
Value of property fileListType.

getFilesPerHour

public double getFilesPerHour()
Getter for property filesPerHour.

Returns:
Value of property filesPerHour.

getInputOrder

public java.util.List getInputOrder()
Getter for property inputOrder.

Returns:
Value of property inputOrder.

addResource

public void addResource(Resource resource)
Add a Resource value to this Request

Parameters:
resource - to add

getResource

public Resource getResource(java.lang.String name)
Get a Resource value from this Request If the Resource doesn't exist, return a default Resource

Parameters:
name - of resource to get

setResourceMin

public void setResourceMin(java.lang.String name,
                           int min)
Set a Resource's min value If the Resource doesn't exist, create it

Parameters:
name - of Resource
min - value

setResourceMax

public void setResourceMax(java.lang.String name,
                           int max)
Set a Resource's max value If the Resource doesn't exist, create it

Parameters:
name - of Resource
max - value

getNProcesses

public int getNProcesses()
Getter for property nProcesses. Returns -1 if nProcess is not set.

Returns:
Value of property nProcesses.

setNProcesses

public void setNProcesses(int nProcesses)
Setter for property nProcesses.

Parameters:
nProcesses - New value of property nProcesses.

addToReportText

public void addToReportText(java.lang.String Text)

SetReportText

public void SetReportText(java.lang.String Text)

GetReportText

public java.lang.String GetReportText()

setName

public void setName(java.lang.String name)
Set the request name

Parameters:
name -

setCommand

public void setCommand(java.lang.String command)
Deprecated. use setTask instead

Sets the command line to be executed to the remote machine. Should only be called for JDL request, in which case task was created in the constructor

Parameters:
command - the command line to be executed

setStdIn

public void setStdIn(java.net.URL stdin)
Deprecated. use setTask() instead

Sets the location from which the standard input will be reed.

Parameters:
stdin - a file containing the input file to be redirected in the standard in

setStdOut

public void setStdOut(java.net.URL stdout)
Deprecated. use setTask() instead

Sets the location in which the standard output will be saved.

Parameters:
stdout - a file containing the output file where the standard out should be redirected

setStdErr

public void setStdErr(java.net.URL stderr)
Deprecated. use setTask() instead

Sets the location in which the standard error will be saved.

Parameters:
stderr - a file containing the output file where the standard error should be redirected

setApplication

public void setApplication(Application app)
Set Application attribute.

Parameters:
app -

setTask

public void setTask(Task task)
Set Task attribute.

Parameters:
task -

setMail

public void setMail(boolean mail)
Specifies if the queuing system is allowed to send mail to the user.

Parameters:
mail - true if the user is allowed to recieve mail

setFileListType

public void setFileListType(java.lang.String fileListType)
Setter for property fileListType.

Parameters:
fileListType - New value of property fileListType.

setFilesPerHour

public void setFilesPerHour(double filesPerHour)
Setter for property filesPerHour.

Parameters:
filesPerHour - New value of property filesPerHour.

setInputOrder

public void setInputOrder(java.util.List inputOrder)
Setter for property inputOrder.

Parameters:
inputOrder - New value of property inputOrder.

prepareInputOrder

public void prepareInputOrder(java.lang.String commaSeparated)

getAuthenticatedUser

public java.lang.String getAuthenticatedUser()

setAuthenticatedUser

public void setAuthenticatedUser(java.lang.String authenticatedUser)

setSandbox

public void setSandbox(Sandbox sandbox)

getSandbox

public Sandbox getSandbox()


Copyright © 2002-2004 STAR collaboration - Brookhaven National Laboratory. All Rights Reserved.