Class JobDefinition
- java.lang.Object
-
- com.inet.taskplanner.server.api.common.AbstractDefinition<JobDefinition>
-
- com.inet.taskplanner.server.api.job.JobDefinition
-
@JsonData public final class JobDefinition extends AbstractDefinition<JobDefinition>
Definition of a job for aTaskDefinitionwith settings required for the job. A job does some work and often produces someResults which is than passed to the adjacentResultActions.Jobs are created from the definition roughly as:
JobDefinition——extensionName—⟶JobFactory——createFrom()—⟶JobTo map from a
JobDefinitionto aJobFactorythe methodAbstractDefinition.getExtensionName()has to return a name for which aJobFactoryis registered in theServerPluginManager.
This definition also includes settings for the job, i.e. for a report-job the path to the rpt-file. The extension name and the valid properties are usually defined and documented in the correspondingJobFactory.- Since:
- taskplanner 3.0
-
-
Constructor Summary
Constructors Constructor Description JobDefinition(java.lang.String extensionName)Creates a new JobDefinition instance.JobDefinition(java.lang.String extensionName, java.util.Map<java.lang.String,java.lang.String> properties)Creates a new JobDefinition instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JobDefinitioncopyDefinition()Makes a deep copy of this definition.booleanequals(java.lang.Object obj)ConditionDefinitiongetCondition()Get the condition of this Job.inthashCode()voidsetCondition(ConditionDefinition condition)Sets the condition of this JobDefinition.-
Methods inherited from class com.inet.taskplanner.server.api.common.AbstractDefinition
copyDefinitions, getExtensionName, getProperties, getProperty, getUid, removeProperty, setProperty, setUid
-
-
-
-
Constructor Detail
-
JobDefinition
public JobDefinition(java.lang.String extensionName)
Creates a new JobDefinition instance.- Parameters:
extensionName- the unique extensionName, there must be aJobFactoryfor this extensionName.- Since:
- taskplanner 3.0
-
JobDefinition
public JobDefinition(java.lang.String extensionName, @Nullable java.util.Map<java.lang.String,java.lang.String> properties)Creates a new JobDefinition instance.- Parameters:
properties- the initial properties to be set,nullwill have no effectextensionName- the unique extensionName, there must be aJobFactoryfor this extensionName.- Since:
- taskplanner 3.0
-
-
Method Detail
-
getCondition
@Nullable public ConditionDefinition getCondition()
Get the condition of this Job.- Returns:
- the condition of this job, can be null.
- Since:
- taskplanner 3.0
-
setCondition
public void setCondition(@Nullable ConditionDefinition condition)Sets the condition of this JobDefinition. The condition defines if the result of this job must be handled or not.- Parameters:
condition- the condition to set- Since:
- taskplanner 3.0
-
copyDefinition
public JobDefinition copyDefinition()
Makes a deep copy of this definition.- Specified by:
copyDefinitionin classAbstractDefinition<JobDefinition>- Returns:
- a deep copy of this definition.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classAbstractDefinition<JobDefinition>
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classAbstractDefinition<JobDefinition>
-
-