com.novell.zos.jdl
Class RunJobSpec

java.lang.Object
  extended by com.novell.zos.jdl.RunJobSpec

public class RunJobSpec
extends java.lang.Object

Defines the attributes for starting a child job or a stand-alone job. An instance of this class is passed to self.runJob().

Example of using RunJobSpec for starting a child job with a custom instance name and supplying a job argument

      spec = RunJobSpec()
      spec.setJobName("quickie")
      spec.setInstanceName("quickie child")
      spec.setJobArgs( { "numJoblets" : 5 } )
      self.runJob(spec)
 

Example of using RunJobSpec with a Constraint to constrain that a resource belongs to a group and use the constraint in starting a child job:

          c = ContainsConstraint()
          c.setFact("resource.groups")
          c.setValue("webserver-group")

          spec = RunJobSpec()
          spec.setJobName("myChildJob")
          spec.setConstraint(c)
          self.runJob(spec)
 
Example of starting a stand-alone job. New Job will not be a child job of the current job.
      spec = RunJobSpec()
      spec.setJobName("quickie")
      spec.setInstanceName("quickie stand-alone")
      spec.setJobArgs( { "numJoblets" : 5 } )
      spec.setStandAlone(True)
      self.runJob(spec)
 


Constructor Summary
RunJobSpec()
          Construct a default RunJobSpec.
 
Method Summary
 void setConstraint(Constraint constraint)
          Set an additional constraint to use for the new job instance.
 void setInstanceName(java.lang.String instanceName)
          Define a job instance name.
 void setJobArgs(org.python.core.PyDictionary arguments)
          Define the job arguments to supply to the child job.
 void setJobName(java.lang.String jobName)
          Define the deployed job name of the child job to run.
 void setJobTracing(boolean tracing)
          Enable or disable job and joblet tracing (for debug purposes).
 void setPolicy(java.lang.String policy)
          Set an additional policy of constraints to use for the new job instance.
 void setPolicyName(java.lang.String policyName)
          Set an additional previously deployed policy of constraints to use for the new job instance.
 void setPriority(int priority)
          Set a priority for this job using supplied integer constant.
 void setPriority(java.lang.String priority)
          Set a priority for this job using supplied string.
 void setStandAlone(boolean standAlone)
          Indicates that the new job will not be a child job but a new stand alone job.
 void setStartTime(long time)
          Set the start time for this job based on number of milliseconds since epoch.
 void setStartTime(java.lang.String time)
          Set the start time for this job using a supplied date/time string.
 void setWaitForRunning(boolean waitForRunning)
          Indicates that the runjob() invocation waits until the child job has transitioned to the Running state.
 void setWaitForStarting(boolean waitForStarting)
          Indicates that the runjob() invocation waits until the child job has transitioned to the Starting state.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RunJobSpec

public RunJobSpec()
Construct a default RunJobSpec.

Method Detail

setJobArgs

public void setJobArgs(org.python.core.PyDictionary arguments)
Define the job arguments to supply to the child job. These are any facts defined in policy for the jobargs namespace. If job arguments are required by the job then the arguments are required. This function is not use if no job arguments are defined for the job to run.

Parameters:
arguments - Dictionary of job argument name and value pairs

setJobTracing

public void setJobTracing(boolean tracing)
Enable or disable job and joblet tracing (for debug purposes).

Parameters:
tracing - true to enable tracing, false to use job default

setJobName

public void setJobName(java.lang.String jobName)
Define the deployed job name of the child job to run. Required.

Parameters:
jobName - Deployed job name of child job to run

setInstanceName

public void setInstanceName(java.lang.String instanceName)
Define a job instance name. The default is to use the deployed job name as the instance name. Optional.

Parameters:
instanceName - Job instance name

setPriority

public void setPriority(java.lang.String priority)
Set a priority for this job using supplied string. Default is the user's priority. Optional.

Parameters:
priority - Priority to set in the user's band

setPriority

public void setPriority(int priority)
Set a priority for this job using supplied integer constant. Default is the user's priority. Optional.

Parameters:
priority - Priority to set in the user's band

setStartTime

public void setStartTime(long time)
Set the start time for this job based on number of milliseconds since epoch. Optional.

Parameters:
time - Milliseconds since epoch

setStartTime

public void setStartTime(java.lang.String time)
Set the start time for this job using a supplied date/time string.

Examples:

      "2/15/07"
      "2/15/07 5 PM"
      "8 AM"
 
Optional.

Parameters:
time - date/time string to start the job

setPolicy

public void setPolicy(java.lang.String policy)
Set an additional policy of constraints to use for the new job instance. Optional

Parameters:
policy - Policy text

setPolicyName

public void setPolicyName(java.lang.String policyName)
Set an additional previously deployed policy of constraints to use for the new job instance. The policy must already exist. Optional.

Parameters:
policyName - Name of an already deployed policy

setConstraint

public void setConstraint(Constraint constraint)
Set an additional constraint to use for the new job instance. Optional.

Parameters:
constraint - Constraint instance

setStandAlone

public void setStandAlone(boolean standAlone)
Indicates that the new job will not be a child job but a new stand alone job. The default is new jobs are child jobs of the initiating job.

Parameters:
standAlone - true to create a new stand alone job, false (default) to create a child job

setWaitForStarting

public void setWaitForStarting(boolean waitForStarting)
Indicates that the runjob() invocation waits until the child job has transitioned to the Starting state.

Parameters:
waitForStarting - true to wait, false (the default) to not wait

setWaitForRunning

public void setWaitForRunning(boolean waitForRunning)
Indicates that the runjob() invocation waits until the child job has transitioned to the Running state.

Parameters:
waitForRunning - true to wait, false (the default) to not wait


Copyright (c) 2008 Novell, Inc. All rights reserved.