Package com.redwood.scheduler.api.model
Interface ForecastJob
-
- All Superinterfaces:
BusinessKeyObject
,ForecastJobComp
,Readable
,SchedulerEntity
,SchedulerEntityComp
public interface ForecastJob extends ForecastJobComp, SchedulerEntity, BusinessKeyObject, Readable
Data for the forecast of a job. Created for existing jobs and on demand for job groups for specific dates.
-
-
Field Summary
Fields Modifier and Type Field Description static Long
DEFAULT_RUNTIME
Default runtime in milliseconds for to forecast jobs that have no statistics.static Long
FREQUENCY_PERIOD_LENGTH
Length of the period for which we create one frequency forecast job.static String
OBJECT_TYPE
String that will be returned fromSchedulerEntity.getObjectType()
for "ForecastJob" objects.static QueryObjectType<ForecastJob>
TYPE
Type that can be used inSchedulerSession.executeObjectQuery(QueryObjectType, String, Object...)
.-
Fields inherited from interface com.redwood.scheduler.api.model.SchedulerEntity
ACTION_AUDIT, ACTION_EXPORT, ACTION_READ, BEHAVIOR_DEPRECATED, BEHAVIOR_NONE, BEHAVIOR_SYSTEM
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description RWIterable<ForecastJob>
forecast(JobForecastContext forecastContext)
Create forecast jobs based on the current forecast job.void
forecastJob(JobForecastContext forecastContext)
Fill this forecast job with a forecast for the job that is set in the job attribute.RWIterable<ForecastJob>
getChildForecastJobs()
Get anRWIterable
over a collection ofChildForecastJobs
, the collection will be ordered by ChildOrder.Long
getChildOrder()
Get the value for ChildOrder.String
getDescription()
Get the value for Description.String
getErrorDescription()
Get the value for ErrorDescription.JobEstimates
getEstimates()
Get the value for Estimates.DateTimeZone
getExpectedEndTime()
Get the value for ExpectedEndTime.Long
getExpectedRunTime()
Get the value for ExpectedRunTime.DateTimeZone
getExpectedStartTime()
Get the value for ExpectedStartTime.ForecastJobStatus
getForecastStatus()
Get the value for ForecastStatus.Long
getFrequency()
Get the value for Frequency.Job
getJob()
Get the Job.JobChainCall
getJobChainCall()
Get the JobChainCall.JobChainStep
getJobChainStep()
Get the JobChainStep.JobDefinition
getJobDefinition()
Get the JobDefinition.DateTimeZone
getJobGroupEndDate()
Get the value for JobGroupEndDate.Long
getJobGroupId()
Get the value for JobGroupId.Long
getJobGroupMaxJobs()
Get the value for JobGroupMaxJobs.Long
getJobGroupPresubmitCount()
Get the value for JobGroupPresubmitCount.RWIterable<JobDefinitionJobLock>
getJobLocks()
Return the JobLocks for this forecast job.JobStatus
getJobStatus()
Get the value for JobStatus.JobMaintenance
getMaintenance()
Get the value for Maintenance.DateTimeZone
getNextSubmitBaseTime()
Get the value for NextSubmitBaseTime.Long
getNumChildForecastJobs()
Get the value for NumChildForecastJobs.ForecastJob
getParentForecastJob()
Get the ParentForecastJob.Long
getPriority()
Get the value for Priority.Queue
getQueue()
Get the Queue.RWIterable<JobDefinitionRaiseEvent>
getRaiseEvents()
Return the event definitions that are forecasted to be raised.String
getRecurrencePattern()
Get the value for RecurrencePattern.Long
getReturnCode()
Get the value for ReturnCode.String
getSearchDescription()
Get the value for SearchDescription.String
getStartAtValue()
Get the value for StartAtValue.DateTimeZone
getStartTime()
Get the value for StartTime.Long
getStepIteration()
Get the value for StepIteration.SubmitFrame
getSubmitFrame()
Get the SubmitFrame.TimeWindow
getTimeWindow()
Get the TimeWindow.RWIterable<JobDefinitionWaitEvent>
getWaitEvents()
Return the event definitions that are forecasted to be waited for.void
setDescription(String newDescription)
Set the value for Description.void
setExpectedRunTime(Long newExpectedRunTime)
Set the value for ExpectedRunTime.void
setFrequency(Long newFrequency)
Set the value for Frequency.void
setJob(Job newJob)
Set the value for Job.void
setJobChainCall(JobChainCall newJobChainCall)
Set the value for JobChainCall.void
setJobChainStep(JobChainStep newJobChainStep)
Set the value for JobChainStep.void
setJobDefinition(JobDefinition newJobDefinition)
Set the value for JobDefinition.void
setJobGroupId(Long newJobGroupId)
Set the value for JobGroupId.void
setParentForecastJob(ForecastJob newParentForecastJob)
Set the value for ParentForecastJob.void
setQueue(Queue newQueue)
Set the value for Queue.void
setStartTime(DateTimeZone newStartTime)
Set the value for StartTime.void
setSubmitFrame(SubmitFrame newSubmitFrame)
Set the value for SubmitFrame.void
setTimeWindow(TimeWindow newTimeWindow)
Set the value for TimeWindow.-
Methods inherited from interface com.redwood.scheduler.api.model.BusinessKeyObject
getBusinessKey
-
Methods inherited from interface com.redwood.scheduler.api.model.SchedulerEntity
canPerform, createSubjectObjectPrivilegeGrant, deleteObject, getAuditTrail, getAuditTrailSize, getBehavior, getEffectiveBehavior, getErrorNameEN, getErrorNameKey, getLLPVersion, getLOV, getLOVSupport, getObjectType, getParentSchedulerEntities, getRuntime, getSubjectObjectPrivilegeGrantBySubject, getSubjectObjectPrivilegeGrants, getUniqueId, getUrl, getUrl, isCreated, isDeletable, isDeleted, isModifiable, isModified, isSelectVersioned, processRelatedObjects, processRelatedObjects, processRelatedObjects, refreshObject, resetObject, resetObject, resetValuesToDefault, selectForRead
-
-
-
-
Field Detail
-
OBJECT_TYPE
static final String OBJECT_TYPE
String that will be returned fromSchedulerEntity.getObjectType()
for "ForecastJob" objects.- See Also:
- Constant Field Values
-
TYPE
static final QueryObjectType<ForecastJob> TYPE
Type that can be used inSchedulerSession.executeObjectQuery(QueryObjectType, String, Object...)
.
-
DEFAULT_RUNTIME
static final Long DEFAULT_RUNTIME
Default runtime in milliseconds for to forecast jobs that have no statistics.
-
FREQUENCY_PERIOD_LENGTH
static final Long FREQUENCY_PERIOD_LENGTH
Length of the period for which we create one frequency forecast job. Value in milliseconds. Current value is 5 minutes.
-
-
Method Detail
-
getChildOrder
Long getChildOrder()
Get the value for ChildOrder. (The index number of this child with respect to its siblings and its parent) This value is mandatory, and therefore will not benull
if this object has been retrieved from the database.- Returns:
- the field
- Throws:
com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException
- This will be thrown if this method is called while the object is not attached to a session.
-
getDescription
String getDescription()
Get the value for Description. (The name of the job.) This value is mandatory, and therefore will not benull
if this object has been retrieved from the database.- Returns:
- the field
- Throws:
com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException
- This will be thrown if this method is called while the object is not attached to a session.
-
getSearchDescription
String getSearchDescription()
Get the value for SearchDescription. (The description converted to upper-case, used for searching.) This value is mandatory, and therefore will not benull
if this object has been retrieved from the database.- Returns:
- the field
- Throws:
com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException
- This will be thrown if this method is called while the object is not attached to a session.
-
getErrorDescription
String getErrorDescription()
Get the value for ErrorDescription. (The description of the error that occurred when forecasting this job.) This value is mandatory, and therefore will not benull
if this object has been retrieved from the database.- Returns:
- the field
- Throws:
com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException
- This will be thrown if this method is called while the object is not attached to a session.
-
getEstimates
JobEstimates getEstimates()
Get the value for Estimates. (Estimates for this job.) This value is mandatory, and therefore will not benull
if this object has been retrieved from the database.- Returns:
- the field
- Throws:
com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException
- This will be thrown if this method is called while the object is not attached to a session.
-
getExpectedEndTime
DateTimeZone getExpectedEndTime()
Get the value for ExpectedEndTime. (The date and time when the job is expected to finish.) This value is mandatory, and therefore will not benull
if this object has been retrieved from the database.- Returns:
- the field
- Throws:
com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException
- This will be thrown if this method is called while the object is not attached to a session.
-
getExpectedRunTime
Long getExpectedRunTime()
Get the value for ExpectedRunTime. (The average run time from the JobDefinition statistics when the forecast job is created.)- Returns:
- the field
- Throws:
com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException
- This will be thrown if this method is called while the object is not attached to a session.
-
getExpectedStartTime
DateTimeZone getExpectedStartTime()
Get the value for ExpectedStartTime. (The date and time the job is expected to start executing.) This value is mandatory, and therefore will not benull
if this object has been retrieved from the database.- Returns:
- the field
- Throws:
com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException
- This will be thrown if this method is called while the object is not attached to a session.
-
getForecastStatus
ForecastJobStatus getForecastStatus()
Get the value for ForecastStatus. (The current status of the job) This value is mandatory, and therefore will not benull
if this object has been retrieved from the database.- Returns:
- the field
- Throws:
com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException
- This will be thrown if this method is called while the object is not attached to a session.
-
getFrequency
Long getFrequency()
Get the value for Frequency. (The number of times the job will submit between the expected start and end time.) This value is mandatory, and therefore will not benull
if this object has been retrieved from the database.- Returns:
- the field
- Throws:
com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException
- This will be thrown if this method is called while the object is not attached to a session.
-
getJobGroupEndDate
DateTimeZone getJobGroupEndDate()
Get the value for JobGroupEndDate. (The job group ends at the defined date and time. )- Returns:
- the field
- Throws:
com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException
- This will be thrown if this method is called while the object is not attached to a session.
-
getJobGroupId
Long getJobGroupId()
Get the value for JobGroupId. (The job group id for external use. Note that the JobGroup object is not externally visible.) This value is mandatory, and therefore will not benull
if this object has been retrieved from the database.- Returns:
- the field
- Throws:
com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException
- This will be thrown if this method is called while the object is not attached to a session.
-
getJobGroupMaxJobs
Long getJobGroupMaxJobs()
Get the value for JobGroupMaxJobs. (The job group ends if the defined maximum of jobs is reached. )- Returns:
- the field
- Throws:
com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException
- This will be thrown if this method is called while the object is not attached to a session.
-
getJobGroupPresubmitCount
Long getJobGroupPresubmitCount()
Get the value for JobGroupPresubmitCount. (The number of jobs that is scheduled in advance for the job group.)- Returns:
- the field
- Throws:
com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException
- This will be thrown if this method is called while the object is not attached to a session.
-
getJobStatus
JobStatus getJobStatus()
Get the value for JobStatus. (The current status of the job) This value is mandatory, and therefore will not benull
if this object has been retrieved from the database.- Returns:
- the field
- Throws:
com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException
- This will be thrown if this method is called while the object is not attached to a session.
-
getMaintenance
JobMaintenance getMaintenance()
Get the value for Maintenance. (The maintenance level for the Job.) This value is mandatory, and therefore will not benull
if this object has been retrieved from the database.- Returns:
- the field
- Throws:
com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException
- This will be thrown if this method is called while the object is not attached to a session.
-
getNextSubmitBaseTime
DateTimeZone getNextSubmitBaseTime()
Get the value for NextSubmitBaseTime. (The time that will be used as a start time for the calculation of the next RequestedStartTime for a Job with a SubmitFrame or a RecurrencePattern.) This value is mandatory, and therefore will not benull
if this object has been retrieved from the database.- Returns:
- the field
- Throws:
com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException
- This will be thrown if this method is called while the object is not attached to a session.
-
getNumChildForecastJobs
Long getNumChildForecastJobs()
Get the value for NumChildForecastJobs. (How many children ForecastJobs does this ForecastJob have? This is a performance optimization field.) This value is mandatory, and therefore will not benull
if this object has been retrieved from the database.- Returns:
- the field
- Throws:
com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException
- This will be thrown if this method is called while the object is not attached to a session.
-
getPriority
Long getPriority()
Get the value for Priority. (The priority of a job. priority 1-100, higher has precedence; This field only has relevance if the resources or queue size is limited.) This value is mandatory, and therefore will not benull
if this object has been retrieved from the database.- Returns:
- the field
- Throws:
com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException
- This will be thrown if this method is called while the object is not attached to a session.
-
getRecurrencePattern
String getRecurrencePattern()
Get the value for RecurrencePattern. (The recurrence pattern for this forecast)- Returns:
- the field
- Throws:
com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException
- This will be thrown if this method is called while the object is not attached to a session.
-
getReturnCode
Long getReturnCode()
Get the value for ReturnCode. (The return code of the job)- Returns:
- the field
- Throws:
com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException
- This will be thrown if this method is called while the object is not attached to a session.
-
getStartAtValue
String getStartAtValue()
Get the value for StartAtValue. (At which job chain step the job should start running from.)- Returns:
- the field
- Throws:
com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException
- This will be thrown if this method is called while the object is not attached to a session.
-
getStartTime
DateTimeZone getStartTime()
Get the value for StartTime. (The date and time the job is expected to start executing.) This value is mandatory, and therefore will not benull
if this object has been retrieved from the database.- Returns:
- the field
- Throws:
com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException
- This will be thrown if this method is called while the object is not attached to a session.
-
getStepIteration
Long getStepIteration()
Get the value for StepIteration. (For job chain steps and their calls only: Iteration number.)- Returns:
- the field
- Throws:
com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException
- This will be thrown if this method is called while the object is not attached to a session.
-
setDescription
void setDescription(String newDescription)
Set the value for Description. (The name of the job.) This value is mandatory.- Parameters:
newDescription
- the new value for Description. If this isnull
, then the object cannot be persisted.- Throws:
com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException
- This will be thrown if this method is called while the object is not attached to a session.
-
setExpectedRunTime
void setExpectedRunTime(Long newExpectedRunTime)
Set the value for ExpectedRunTime. (The average run time from the JobDefinition statistics when the forecast job is created.) This value is optional.- Parameters:
newExpectedRunTime
- the new value for ExpectedRunTime.- Throws:
com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException
- This will be thrown if this method is called while the object is not attached to a session.
-
setFrequency
void setFrequency(Long newFrequency)
Set the value for Frequency. (The number of times the job will submit between the expected start and end time.) This value is mandatory.- Parameters:
newFrequency
- the new value for Frequency. If this isnull
, then the object cannot be persisted.- Throws:
com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException
- This will be thrown if this method is called while the object is not attached to a session.
-
setJobGroupId
void setJobGroupId(Long newJobGroupId)
Set the value for JobGroupId. (The job group id for external use. Note that the JobGroup object is not externally visible.) This value is mandatory.- Parameters:
newJobGroupId
- the new value for JobGroupId. If this isnull
, then the object cannot be persisted.- Throws:
com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException
- This will be thrown if this method is called while the object is not attached to a session.
-
setStartTime
void setStartTime(DateTimeZone newStartTime)
Set the value for StartTime. (The date and time the job is expected to start executing.) This value is mandatory.- Parameters:
newStartTime
- the new value for StartTime. If this isnull
, then the object cannot be persisted.- Throws:
com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException
- This will be thrown if this method is called while the object is not attached to a session.
-
forecast
RWIterable<ForecastJob> forecast(JobForecastContext forecastContext)
Create forecast jobs based on the current forecast job. The start and run time determine the forecast period. A forecast job without job group and zero frequency will return an iterator with all job groups that will be forecast in the requested time interval. If job group is filled and frequency is zero, an iterator with the forecast jobs for that job group in the requested time interval is returned.- Specified by:
forecast
in interfaceForecastJobComp
- Parameters:
forecastContext
- An object with the parameters for the forecast.- Returns:
- The iterator over the all forecast jobs.
-
forecastJob
void forecastJob(JobForecastContext forecastContext)
Fill this forecast job with a forecast for the job that is set in the job attribute. If the job is a chain, the forecasts for the steps and calls will be child objects of the returned forecast job.- Parameters:
forecastContext
- An object with the parameters for the forecast.
-
getJobLocks
RWIterable<JobDefinitionJobLock> getJobLocks()
Return the JobLocks for this forecast job.- Specified by:
getJobLocks
in interfaceForecastJobComp
- Returns:
- The iterator over the JobLocks for this forecast job.
-
getRaiseEvents
RWIterable<JobDefinitionRaiseEvent> getRaiseEvents()
Return the event definitions that are forecasted to be raised.- Specified by:
getRaiseEvents
in interfaceForecastJobComp
- Returns:
- The iterator over the event definitions that are forecasted to be raised.
-
getWaitEvents
RWIterable<JobDefinitionWaitEvent> getWaitEvents()
Return the event definitions that are forecasted to be waited for.- Specified by:
getWaitEvents
in interfaceForecastJobComp
- Returns:
- The iterator over the event definitions that are forecasted to be waited for.
-
getParentForecastJob
ForecastJob getParentForecastJob()
Get the ParentForecastJob.- Returns:
- ParentForecastJob
- Throws:
com.redwood.scheduler.api.exception.ObjectDeletedException
- If this method is called when the object has been marked for deletion.com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException
- If this method is called when the object has been removed from it's session.
-
getJob
Job getJob()
Get the Job.- Returns:
- Job
- Throws:
com.redwood.scheduler.api.exception.ObjectDeletedException
- If this method is called when the object has been marked for deletion.com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException
- If this method is called when the object has been removed from it's session.
-
getJobChainCall
JobChainCall getJobChainCall()
Get the JobChainCall.- Returns:
- JobChainCall
- Throws:
com.redwood.scheduler.api.exception.ObjectDeletedException
- If this method is called when the object has been marked for deletion.com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException
- If this method is called when the object has been removed from it's session.
-
getJobChainStep
JobChainStep getJobChainStep()
Get the JobChainStep.- Returns:
- JobChainStep
- Throws:
com.redwood.scheduler.api.exception.ObjectDeletedException
- If this method is called when the object has been marked for deletion.com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException
- If this method is called when the object has been removed from it's session.
-
getJobDefinition
JobDefinition getJobDefinition()
Get the JobDefinition.- Returns:
- JobDefinition
- Throws:
com.redwood.scheduler.api.exception.ObjectDeletedException
- If this method is called when the object has been marked for deletion.com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException
- If this method is called when the object has been removed from it's session.
-
getQueue
Queue getQueue()
Get the Queue.- Returns:
- Queue
- Throws:
com.redwood.scheduler.api.exception.ObjectDeletedException
- If this method is called when the object has been marked for deletion.com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException
- If this method is called when the object has been removed from it's session.
-
getSubmitFrame
SubmitFrame getSubmitFrame()
Get the SubmitFrame.- Returns:
- SubmitFrame
- Throws:
com.redwood.scheduler.api.exception.ObjectDeletedException
- If this method is called when the object has been marked for deletion.com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException
- If this method is called when the object has been removed from it's session.
-
getTimeWindow
TimeWindow getTimeWindow()
Get the TimeWindow.- Returns:
- TimeWindow
- Throws:
com.redwood.scheduler.api.exception.ObjectDeletedException
- If this method is called when the object has been marked for deletion.com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException
- If this method is called when the object has been removed from it's session.
-
setParentForecastJob
void setParentForecastJob(ForecastJob newParentForecastJob)
Set the value for ParentForecastJob. This value is optional.- Parameters:
newParentForecastJob
- is the object to set ParentForecastJob to. The parent Job of this Job.
-
setJob
void setJob(Job newJob)
Set the value for Job. This value is optional.- Parameters:
newJob
- is the object to set Job to. The real job for a forecast job.
-
setJobChainCall
void setJobChainCall(JobChainCall newJobChainCall)
Set the value for JobChainCall. This value is optional.- Parameters:
newJobChainCall
- is the object to set JobChainCall to. The forecast job of a job chain call.
-
setJobChainStep
void setJobChainStep(JobChainStep newJobChainStep)
Set the value for JobChainStep. This value is optional.- Parameters:
newJobChainStep
- is the object to set JobChainStep to. The forecast job representing a job chain step.
-
setJobDefinition
void setJobDefinition(JobDefinition newJobDefinition)
Set the value for JobDefinition. This value is mandatory.- Parameters:
newJobDefinition
- is the object to set JobDefinition to. The job definition for a forecast job. If this isnull
, then the object cannot be persisted.
-
setQueue
void setQueue(Queue newQueue)
Set the value for Queue. This value is mandatory.- Parameters:
newQueue
- is the object to set Queue to. The queue of a forecast job. If this isnull
, then the object cannot be persisted.
-
setSubmitFrame
void setSubmitFrame(SubmitFrame newSubmitFrame)
Set the value for SubmitFrame. This value is optional.- Parameters:
newSubmitFrame
- is the object to set SubmitFrame to. The submit frame of a forecast job.
-
setTimeWindow
void setTimeWindow(TimeWindow newTimeWindow)
Set the value for TimeWindow. This value is optional.- Parameters:
newTimeWindow
- is the object to set TimeWindow to. The time window of a forecast job.
-
getChildForecastJobs
RWIterable<ForecastJob> getChildForecastJobs()
Get anRWIterable
over a collection ofChildForecastJobs
, the collection will be ordered by ChildOrder. If the collection is empty, an empty iterator will be returned, that is, this method will never returnnull
. The parent Job of this Job.- Specified by:
getChildForecastJobs
in interfaceForecastJobComp
- Returns:
- An
RWIterable
over a collection ofForecastJob
objects , the collection will be ordered by ChildOrder.
-
-