public class JobSet extends BaseMetadata implements Serializable
Steps within a JobSet can run either in serial or in parallel mode. In case of serial execution, the JobSet also supports conditional branching based on the execution status of the previous step. For example within a serial JobSet JS, consisting of JobDefinitions J1, J2, and J3, the step J2 can be defined to run if and only if J1 completes successfully. Similarly J3 can be defined to run if J2 finishes with Success or Warning.
Modifier and Type | Class and Description |
---|---|
static class |
JobSet.ExecutionMode
Enums to indicate the execution mode for the JobSet.
|
Modifier and Type | Field and Description |
---|---|
static String |
STEPID_DELIMITER |
Constructor and Description |
---|
JobSet(String name, String description, JobSet.ExecutionMode mode)
Constructs a JobSet with basic attributes.
|
JobSet(String name, String description, JobSet.ExecutionMode mode, ParameterList parameters, JobSetStep[] steps)
Constructs a nearly fully defined JobSet.
|
JobSet(String name, String description, JobSet.ExecutionMode mode, ParameterList parameters, JobSetStep[] steps, String firstStep)
Constructs a fully defined JobSet.
|
JobSet(String name, String displayNameKey, String descriptionKey, JobSet.ExecutionMode mode, ParameterList parameters, JobSetStep[] steps, String[] resourceBundleIDs)
Constructs a nearly fully defined JobSet.
|
JobSet(String name, String displayNameKey, String descriptionKey, JobSet.ExecutionMode mode, ParameterList parameters, JobSetStep[] steps, String firstStep, String[] resourceBundleIDs)
Constructs a fully defined JobSet and associate the JobSet definition with a set of resource bundles.
|
JobSet(String name, String displayNameKey, String descriptionKey, JobSet.ExecutionMode mode, String[] resourceBundleIDs)
Constructs a JobSet with basic attributes.
|
Modifier and Type | Method and Description |
---|---|
void |
addStep(JobSetStep step)
Adds the given step to this JobSet.
|
JobSet |
clone(String newName) |
int |
compareWithParams(Object obj)
Compares an object for equality with this
JobSet object. |
JobSetStep |
deleteStep(String stepId)
Deletes the JobSet step with the given step id.
|
boolean |
equals(Object obj)
Compares an object for equality with this JobSet object.
|
HashMap |
getAllSteps()
Gets all steps of this JobSet and any nested Jobset.
|
BaseMetadataType |
getBaseMetadataType()
Gets the intended type of this metadata.
|
JobSet.ExecutionMode |
getExecutionMode()
Checks whether this JobSet is a serial or a parallel JobSet.
|
String |
getFirstStep()
Returns the id of the first or starting step in a serial JobSet.
|
HashMap |
getJobSetSteps()
Deprecated.
Replaced by
JobSet.getJsSteps() |
List |
getJsSteps()
Gets all jobset steps of this jobset.
|
ParameterList |
getParameters()
Returns all the parameters defined for this JobSet
|
JobSetStep |
getStep(String stepId)
Gets the JobSet step with the given step id.
|
Document |
getSteps()
Deprecated.
Replaced by
JobSet.getJsSteps() . |
void |
setExecutionMode(JobSet.ExecutionMode mode)
Sets the JobSet execution mode to either serial or parallel mode.
|
void |
setFirstStep(String firstStep)
Sets the unique id of the first step to run for a serial JobSet.
|
void |
setJobSetSteps(JobSetStep[] steps)
Deprecated.
Replaced by
JobSet.setJsSteps(JobSetStep[]) . |
void |
setJsSteps(JobSetStep[] steps)
Sets the steps for this jobset to the given steps.
|
void |
setParameters(ParameterList params)
Sets the parameters of this JobSet.
|
void |
setSteps(Document doc, String firstStep)
Deprecated.
Replaced by
JobSet.setJsSteps(JobSetStep[]) . |
void |
validateForExecution()
Validates this JobSet for execution.
|
getDescription, getDescriptionKey, getDisplayName, getDisplayNameKey, getMetadataObjectId, getName, getResourceBundles, hashCode, setDescription, setDescriptionKey, setDisplayName, setDisplayNameKey, setResourceBundles, toString, validate
public static final String STEPID_DELIMITER
public JobSet(String name, String description, JobSet.ExecutionMode mode)
name
- name of the JobSet definition to be created. The name is also used as the default display name unless otherwise specifically set.description
- optional description for the JobSet definition. A null
value is acceptable.mode
- true
for serial JobSet, false
for parallel JobSet.public JobSet(String name, String displayNameKey, String descriptionKey, JobSet.ExecutionMode mode, String[] resourceBundleIDs)
name
- name of the JobSet definition to be created. The name is also used as the default display name unless otherwise specifically set.displayNameKey
- the resource bundle key for the display name. Optional.descriptionKey
- the resource bundle key for the description. Optional.mode
- true
for serial JobSet, false
for parallel JobSet.resourceBundleIDs
- an array of resource bundle id. Optional.public JobSet(String name, String description, JobSet.ExecutionMode mode, ParameterList parameters, JobSetStep[] steps)
setFirstStep
.name
- name for the JobSet definition to be created. The name is also used as the default display name unless otherwise specifically set.description
- optional description field for the JobSet.mode
- indicates the execution mode, true
for serial JobSet, false
for parallel JobSet.parameters
- Parameters declared at the JobSet level.steps
- array of JobSetStep objects that represent the steps for this jobset. This is required for a Serial JobSet. The step id must be a valid step id from within the XML document specifying the steps.public JobSet(String name, String displayNameKey, String descriptionKey, JobSet.ExecutionMode mode, ParameterList parameters, JobSetStep[] steps, String[] resourceBundleIDs)
setFirstStep
.name
- name of the JobSet definition to be created. The name is also used as the default display name unless otherwise specifically set.displayNameKey
- the resource bundle key for the display name. Optional.descriptionKey
- the resource bundle key for the description. Optional.mode
- indicates the execution mode, true
for serial JobSet, false for parallel JobSet.parameters
- Parameters declared at the JobSet level.steps
- array of JobSetStep objects that represent the steps for this jobset.resourceBundleIDs
- an array of resource bundle id. Optional This is required for a Serial JobSet. The step id must be a valid step id from within the XML document specifying the steps.public JobSet(String name, String description, JobSet.ExecutionMode mode, ParameterList parameters, JobSetStep[] steps, String firstStep)
name
- name for the JobSet definition to be created. The name is also used as the default display name unless otherwise specifically set.description
- optional description field for the JobSet.mode
- indicates the execution mode, true
for serial JobSet, false
for parallel JobSet.parameters
- Parameters declared at the JobSet level.steps
- array of JobSetStep objects that represent the steps for this jobset.firstStep
- unique identifier of the step where execution begins for a serial jobset. This parameter is ignored for a parallel jobset.public JobSet(String name, String displayNameKey, String descriptionKey, JobSet.ExecutionMode mode, ParameterList parameters, JobSetStep[] steps, String firstStep, String[] resourceBundleIDs)
name
- name of the JobSet definition to be created. The name is also used as the default display name unless otherwise specifically set.displayNameKey
- the resource bundle key for the display name. Optional.descriptionKey
- the resource bundle key for the description. Optional.mode
- indicates the execution mode; true
for serial JobSet, or false
for parallel JobSet.parameters
- Parameters declared at the JobSet level.steps
- array of JobSetStep objects that represent the steps for this jobset.firstStep
- unique identifier of the step where execution begins for a serial jobset. This parameter is ignored for a parallel jobset.resourceBundleIDs
- an array of resource bundle id. Optionalpublic JobSet.ExecutionMode getExecutionMode()
public void setExecutionMode(JobSet.ExecutionMode mode)
mode
- execution mode to be set (serial or parallel).public ParameterList getParameters()
public void setParameters(ParameterList params)
params
- instance of ParameterList containing all the parameters.@Deprecated public Document getSteps()
JobSet.getJsSteps()
.public void setFirstStep(String firstStep)
Note that the first step is ignored for a parallel JobSet.
firstStep
- unique step id where serial JobSet execution starts.public String getFirstStep()
Note that the first step is ignored for a parallel JobSet.
@Deprecated public void setSteps(Document doc, String firstStep)
JobSet.setJsSteps(JobSetStep[])
.doc
- the XML fragment containing the details of JobSet.firstStep
- the valid step Id from within the XML fragment that indicates the first step. Required only for a Serial JobSet. For parallel JobSet, it can be null.public void addStep(JobSetStep step) throws ValidationException
step
- the step to add.ValidationException
- if the step id already exists in this JobSet.public JobSetStep getStep(String stepId)
stepId
- the id of the step to get.JobSetStep
, or null if the step does not exist.public JobSetStep deleteStep(String stepId)
stepId
- the id of the step to delete.public HashMap getAllSteps() throws MetadataNotFoundException, MetadataServiceException
HashMap
contains all of the steps in this JobSet
and all steps in any JobSet
that is nested in this JobSet.HashMap
that maps fully qualified stepId (sequence of step names delimited with (STEPID_DELIMITER
) to JobSetStep
and includes all steps in this JobSet
and any nested jobsets.MetadataNotFoundException
- if any nested JobSet definition does not exist.MetadataServiceException
- if the metadata subsystem encounters an error.@Deprecated public HashMap getJobSetSteps()
JobSet.getJsSteps()
HashMap
contains the steps in this JobSet
Note that order is not defined for the steps and may be different on a subsequent call.
Steps in any nested jobsets are not included. To include all nested steps, use getAllSteps
.
HashMap
that maps stepId to JobSetStep
.public List getJsSteps()
List
contains the steps in this JobSet
. The steps are returned in the order that they were added to this jobset.
Steps in nested jobsets are not included. To include all nested steps, use getAllSteps
.
List
of steps in this JobSetStep
.JobSet.setJsSteps(JobSetStep[])
public void setJsSteps(JobSetStep[] steps) throws ValidationException
setFirstStep
.steps
- array of JobSetStep
objects to set as the steps for this jobset.ValidationException
- if the step ids are not unique.JobSet.getJsSteps()
@Deprecated public void setJobSetSteps(JobSetStep[] steps)
JobSet.setJsSteps(JobSetStep[])
.steps
- array of JobSetStep
objects to set as the steps for this jobset.public void validateForExecution() throws ValidationException
ValidationException
- if any validation errors occur.public boolean equals(Object obj)
public int compareWithParams(Object obj)
JobSet
object.obj
- object to compare.public BaseMetadataType getBaseMetadataType()
BaseMetadata
getBaseMetadataType
in class BaseMetadata
public JobSet clone(String newName) throws ValidationException
clone
in class BaseMetadata
ValidationException