Package de.dlr.proseo.model
Class Job
java.lang.Object
de.dlr.proseo.model.PersistentObject
de.dlr.proseo.model.Job
A collection of job steps required to fulfil an order for a specific period of time (e. g. one orbit).
Note: As a future extension a selection by geographical area in addition to or instead of a period of time is envisioned.
- Author:
- Dr. Thomas Bassler
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnumeration describing possible job states. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCheck whether a job state change is required based on the current state of the contained job steps, and if so, propagate the state change to the processing orderbooleanTest equality of persistent objects based on their unique ID.Checks whether the job has failed stepsGets the processing state of the jobGets the job stepsgetOrbit()Gets the related orbit (if any)Gets the processing priorityGets the processing facility for this jobGets the order this job belongs toGets the start time of the processing time intervalGets the end time of the processing time intervalChecks whether the job has failed steps (convenience method for getHasFailedJobSteps())inthashCode()voidsetHasFailedJobSteps(Boolean hasFailedJobSteps) Sets whether the job has failed stepsvoidsetJobState(Job.JobState jobState) Sets the processing state of the job and propagates it to the processing ordervoidsetJobSteps(Set<JobStep> jobSteps) Sets the job stepsvoidSets the related orbitvoidsetPriority(Integer priority) Sets the processing priorityvoidsetProcessingFacility(ProcessingFacility processingFacility) Sets the processing facility for this jobvoidsetProcessingOrder(ProcessingOrder processingOrder) Sets the order this job belongs tovoidsetStartTime(Instant startTime) Sets the start time of the processing time intervalvoidsetStopTime(Instant stopTime) Sets the end time of the processing time intervaltoString()Methods inherited from class de.dlr.proseo.model.PersistentObject
getId, getVersion, incrementVersion, setId
-
Constructor Details
-
Job
public Job()
-
-
Method Details
-
getProcessingOrder
Gets the order this job belongs to- Returns:
- the order
-
setProcessingOrder
Sets the order this job belongs to- Parameters:
processingOrder- the order to set
-
getJobState
Gets the processing state of the job- Returns:
- the jobState
-
setJobState
Sets the processing state of the job and propagates it to the processing order- Parameters:
jobState- the jobState to set- Throws:
IllegalStateException- if the intended job state transition is illegal
-
checkStateChange
@Transactional public void checkStateChange()Check whether a job state change is required based on the current state of the contained job steps, and if so, propagate the state change to the processing order -
getOrbit
Gets the related orbit (if any)- Returns:
- the orbit (null if there is no direct relationship with an orbit)
-
setOrbit
Sets the related orbit- Parameters:
orbit- the orbit to set
-
getStartTime
Gets the start time of the processing time interval- Returns:
- the startTime
-
setStartTime
Sets the start time of the processing time interval- Parameters:
startTime- the startTime to set
-
getStopTime
Gets the end time of the processing time interval- Returns:
- the stopTime
-
setStopTime
Sets the end time of the processing time interval- Parameters:
stopTime- the stopTime to set
-
getPriority
Gets the processing priority- Returns:
- the priority
-
setPriority
Sets the processing priority- Parameters:
priority- the priority to set
-
getHasFailedJobSteps
Checks whether the job has failed steps- Returns:
- true, if at least one job step is in FAILED state, false otherwise
-
hasFailedJobSteps
Checks whether the job has failed steps (convenience method for getHasFailedJobSteps())- Returns:
- true, if at least one job step is in FAILED state, false otherwise
-
setHasFailedJobSteps
Sets whether the job has failed steps- Parameters:
hasFailedJobSteps- set to true, when a step of this job fails
-
getProcessingFacility
Gets the processing facility for this job- Returns:
- the processingFacility
-
setProcessingFacility
Sets the processing facility for this job- Parameters:
processingFacility- the processingFacility to set
-
getJobSteps
Gets the job steps- Returns:
- the jobSteps
-
setJobSteps
Sets the job steps- Parameters:
jobSteps- the jobSteps to set
-
hashCode
public int hashCode()- Overrides:
hashCodein classPersistentObject
-
equals
Description copied from class:PersistentObjectTest equality of persistent objects based on their unique ID.- Overrides:
equalsin classPersistentObject- Parameters:
obj- the object to compare this object to- Returns:
- true, if obj is a persistent object and has the same ID, false otherwise
- See Also:
-
toString
-