Main Page | Packages | Class Hierarchy | Class List | Directories | File List | Class Members | Related Pages

JobRequest Class Reference

Collaboration diagram for JobRequest:

Collaboration graph
[legend]
List of all members.

Detailed Description

Class representing a job to be submitted.

Author:
Jon Butterworth
Version:
Date
2006-09-01 16:50:02 +0100 (Fri, 01 Sep 2006)
Revision
1291

Definition at line 39 of file JobRequest.java.


Public Member Functions

String getRequestingHost ()
String getJobName ()
void setJobName () throws JetWebException
void setMCProcessType (MCProcessType inProc)
MCProcessType getMCProcessType ()
Model getModel ()
 JobRequest (Model inModel, MCProcessType inProc, String rqh) throws JetWebException
File getSubmitScript ()
void setSubmitScript (File script)
String getCardName ()

Static Public Member Functions

void main (String[] args) throws JetWebException

Private Attributes

String suggestion
String cardName
PendingJob pj
File submitScript
String jobname
Model model
MCProcessType proc
String requestingHost

Constructor & Destructor Documentation

JobRequest Model  inModel,
MCProcessType  inProc,
String  rqh
throws JetWebException
 

Build a job request.

Parameters:
model. The Model for which events will be generated.
proc. The MCProcessType for which events will be generated.
Exceptions:
JetWebException 

Definition at line 164 of file JobRequest.java.

00165                            { 
00166 
00167     requestingHost = rqh;
00168     model = inModel;
00169     proc  = inProc;
00170     //valid    = false;
00171     
00172     }


Member Function Documentation

String getCardName  ) 
 

Return the name of the control card file for this job.

Definition at line 191 of file JobRequest.java.

00191 { return cardName; }

String getJobName  ) 
 

JobName is the name (without path) of the shell script which is submitted to the batch system.

Returns:
jobname

Definition at line 98 of file JobRequest.java.

Referenced by JobUtils.doJobRequest(), SubmitScriptHandler.makeGridPP(), SubmitScriptHandler.makeMCRPBS(), SubmitScriptHandler.makeSHEFPBS(), and SubmitScriptHandler.makeUCLNQS().

00098                                {
00099     return jobname;
00100     }

MCProcessType getMCProcessType  ) 
 

Get the MCProcessType for which data will be simulated

Returns:
proc

Definition at line 149 of file JobRequest.java.

00149 {return proc;}

Model getModel  ) 
 

Returns the model on which this JobRequest is based.

Returns:
model

Definition at line 156 of file JobRequest.java.

Referenced by JobUtils.doJobRequest().

00156 {return model;}

String getRequestingHost  ) 
 

Definition at line 54 of file JobRequest.java.

Referenced by JobUtils.submit().

00054 { return requestingHost;}

File getSubmitScript  ) 
 

Get command file for submitting a batch job

Returns:
file

Definition at line 179 of file JobRequest.java.

Referenced by SubmitScriptHandler.makeGridPP(), SubmitScriptHandler.makeMCRPBS(), SubmitScriptHandler.makeSHEFPBS(), and SubmitScriptHandler.makeUCLNQS().

00179 { return submitScript; }

void main String[]  args  )  throws JetWebException [static]
 

Little main program to test job submission.

Definition at line 60 of file JobRequest.java.

References ResultSearchPattern.dumpParms(), ResultSearchPattern.getGenerator(), ResultSearchPattern.getPhotonPDFList(), ResultSearchPattern.getProtonPDFList(), and ResultSearchPattern.setDefaults().

00060                                                                   {
00061     JetWebConfig.init();
00062     ResultSearchPattern search = new ResultSearchPattern();
00063     search.setDefaults();
00064     Model model = new Model(search);
00065     //model.getGeneratorList().add(new Ge);
00066     //  model.getPhotonPDFList().add("GRVLO");
00067     //model.getProtonPDFList().add("CTEQ5");
00068 
00069     model.getPhotonPDFList().add(new PDF(352));
00070     model.getProtonPDFList().add(new PDF(20470));
00071 
00072     model.dumpParms();
00073     MCProcessType proc = new MCProcessType();
00074     JobRequest request = new JobRequest(model,proc,"");
00075     //System.out.println(HTMLUtils.getDescription(request));
00076     System.out.println(HTMLJobWriter.getDescription(request));
00077     //  File submitScript = request.getSubmitScript();
00078     //  System.out.println(submitScript.getName());
00079     //  request.setJobName("testname");
00080 
00081     // Make the files for this job.
00082     JobUtils.makeCards(request);
00083     String newFilePath = JetWebConfig.jobOutDirName+"/testname";
00084     JobUtils.makeScript(newFilePath,model.getGenerator());
00085 
00086     JobUtils.submit(request);
00087     //  SubmitScriptHandler.make(request);
00088     }

void setJobName  )  throws JetWebException
 

Sets the - JobName - the name of the shell script which is submitted to the batch queue. Checks that there is no input parameter file with this name already in the expected directory.

Exceptions:
JetWebException 

Definition at line 109 of file JobRequest.java.

References PendingJob.getName().

Referenced by JobUtils.doJobRequest().

00109                                                     {
00110     
00111     pj = DBJobManager.reserveJobName(suggestion); 
00112     jobname = pj.getName();
00113 
00114     if (jobname.equalsIgnoreCase("invalid")){
00115         throw new JobRequestException("JobRequest has Invalid Job Name");
00116     }
00117 
00118     cardName = JetWebConfig.jobOutDirName+"/"+jobname+".input";
00119     File test = new File(cardName); 
00120     
00121     if (test.exists()) {
00122         throw new JobRequestException
00123         ("JobRequest has Invalid Job Name - file with this name already exists:"
00124          +cardName);
00125     }
00126     
00127     }

void setMCProcessType MCProcessType  inProc  ) 
 

Set the MCProcessType for which data will be simulated.

Parameters:
reaction 

Definition at line 141 of file JobRequest.java.

00141                                                       {
00142         proc = inProc;
00143     }

void setSubmitScript File  script  ) 
 

Set command file for submitting a batch job

Definition at line 184 of file JobRequest.java.

Referenced by JobUtils.submit().

00184                                             {
00185     submitScript=script; 
00186     }


Member Data Documentation

String cardName [private]
 

Definition at line 45 of file JobRequest.java.

String jobname [private]
 

Definition at line 48 of file JobRequest.java.

Model model [private]
 

Definition at line 50 of file JobRequest.java.

PendingJob pj [private]
 

Definition at line 46 of file JobRequest.java.

MCProcessType proc [private]
 

Definition at line 51 of file JobRequest.java.

String requestingHost [private]
 

Definition at line 53 of file JobRequest.java.

File submitScript [private]
 

Definition at line 47 of file JobRequest.java.

String suggestion [private]
 

Definition at line 44 of file JobRequest.java.


The documentation for this class was generated from the following file:

Generated Wed Jan 17 09:14:27 GMT 2007