Class ScheduledJob
java.lang.Object
com.broadleafcommerce.scheduledjob.domain.ScheduledJob
- All Implemented Interfaces:
 com.broadleafcommerce.data.tracking.core.ContextStateAware,Serializable
public class ScheduledJob
extends Object
implements com.broadleafcommerce.data.tracking.core.ContextStateAware, Serializable
Represents a scheduled job for the system to execute. Can be a single use or repeatable job.
- Author:
 - Chad Harchar (charchar)
 - See Also:
 
- 
Constructor Summary
ConstructorsConstructorDescriptionScheduledJob(boolean enabled, String id, String name, String type, String timingType, boolean executed, Instant previousLastExecuted, Instant lastExecuted, Instant updated, Instant targetDate, String cron, List<ScheduledJobDetail> details, boolean manageInAdmin, String author, boolean trackExecutionDetails, com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState) ScheduledJob(String id) Convenience constructor mostly intended for testing. - 
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanThe admin user who created this jobcom.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextStateA subset ofTrackinginformation to expose the context state for this object.getCron()A cron expression used to drive the schedule for the job execution.Collection of detailed information for the jobgetId()The context ID of the scheduled job.The date on which the job last executed.getName()Display name for this scheduled job.The previous date on which the job last executed.The date on which a single use job should execute.The timing type of this scheduled job.getType()The type of this scheduled job, used to help identify and organize jobs that share a common origin.The date on which the job was last updated by a user.inthashCode()booleanWhether this scheduled job is enabled, thus allowing it to run.booleanWhether this scheduled job has been executed.booleanWhether or not the job can be managed through the Admin interface.booleanA flag to indicate whether the execution details of this scheduled-job should be tracked.voidThe admin user who created this jobvoidsetContextState(com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState) A subset ofTrackinginformation to expose the context state for this object.voidA cron expression used to drive the schedule for the job execution.voidsetDetails(List<ScheduledJobDetail> details) Collection of detailed information for the jobvoidsetEnabled(boolean enabled) Whether this scheduled job is enabled, thus allowing it to run.voidsetExecuted(boolean executed) Whether this scheduled job has been executed.voidThe context ID of the scheduled job.voidsetLastExecuted(Instant lastExecuted) The date on which the job last executed.voidsetManageInAdmin(boolean manageInAdmin) Whether or not the job can be managed through the Admin interface.voidDisplay name for this scheduled job.voidsetPreviousLastExecuted(Instant previousLastExecuted) The previous date on which the job last executed.voidsetTargetDate(Instant targetDate) The date on which a single use job should execute.voidsetTimingType(String timingType) The timing type of this scheduled job.voidsetTrackExecutionDetails(boolean trackExecutionDetails) A flag to indicate whether the execution details of this scheduled-job should be tracked.voidThe type of this scheduled job, used to help identify and organize jobs that share a common origin.voidsetUpdated(Instant updated) The date on which the job was last updated by a user.toString() 
- 
Constructor Details
- 
ScheduledJob
Convenience constructor mostly intended for testing.- Parameters:
 id-
 - 
ScheduledJob
public ScheduledJob(boolean enabled, String id, String name, String type, String timingType, boolean executed, Instant previousLastExecuted, Instant lastExecuted, Instant updated, Instant targetDate, String cron, List<ScheduledJobDetail> details, boolean manageInAdmin, String author, boolean trackExecutionDetails, com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState)  - 
ScheduledJob
public ScheduledJob() 
 - 
 - 
Method Details
- 
isEnabled
public boolean isEnabled()Whether this scheduled job is enabled, thus allowing it to run.- Returns:
 - Whether this scheduled job is enabled, thus allowing it to run.
 
 - 
getId
The context ID of the scheduled job.- Returns:
 - the context ID of the scheduled job.
 
 - 
getName
Display name for this scheduled job.- Returns:
 - the name of this scheduled job
 
 - 
getType
The type of this scheduled job, used to help identify and organize jobs that share a common origin.- Returns:
 - The type of this scheduled job, used to help identify and organize targets that share a common origin.
 
 - 
getTimingType
The timing type of this scheduled job. Can be either based on a target date or recurring based on a cron expression.- Returns:
 - The timing type of this scheduled job. Can be either single date or recurring based on a cron expression.
 
 - 
isExecuted
public boolean isExecuted()Whether this scheduled job has been executed.- Returns:
 - Whether or not the job has been executed
 
 - 
getPreviousLastExecuted
The previous date on which the job last executed. This is useful for jobs that need to communicate the previous date they executed on to external listeners sincelastExecutedwill already have been updated to the current execution date (i.e., now) by the time they receive the message.Some jobs will use the date the job last executed in order to limit queries to entities that have been modified since then, such as checking which Product Tags have gone expired since the last time they were checked.
- Returns:
 - The previous date on which the job last executed.
 
 - 
getLastExecuted
The date on which the job last executed.- Returns:
 - The date on which the job last executed.
 
 - 
getUpdated
The date on which the job was last updated by a user.- Returns:
 - The date on which the job was last updated by a user.
 
 - 
getTargetDate
The date on which a single use job should execute.- Returns:
 - The date on which a single use job should execute
 
 - 
getCron
A cron expression used to drive the schedule for the job execution.- Returns:
 - A cron expression used to drive the schedule for the job execution
 
 - 
getDetails
Collection of detailed information for the job- Returns:
 - Collection of detailed information for the job
 
 - 
isManageInAdmin
public boolean isManageInAdmin()Whether or not the job can be managed through the Admin interface.- Returns:
 - Whether or not the job can be managed through the Admin interface
 
 - 
getAuthor
The admin user who created this job - 
isTrackExecutionDetails
public boolean isTrackExecutionDetails()A flag to indicate whether the execution details of this scheduled-job should be tracked.Set as
falseby default - 
getContextState
public com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState getContextState()A subset ofTrackinginformation to expose the context state for this object.- Specified by:
 getContextStatein interfacecom.broadleafcommerce.data.tracking.core.ContextStateAware- Returns:
 - a subset of 
Trackinginformation to expose the context state for this object 
 - 
setEnabled
public void setEnabled(boolean enabled) Whether this scheduled job is enabled, thus allowing it to run.- Parameters:
 enabled- Whether this scheduled job is enabled, thus allowing it to run.
 - 
setId
The context ID of the scheduled job.- Parameters:
 id- the context ID of the scheduled job.
 - 
setName
Display name for this scheduled job.- Parameters:
 name- the name of this scheduled job
 - 
setType
The type of this scheduled job, used to help identify and organize jobs that share a common origin.- Parameters:
 type- The type of this scheduled job, used to help identify and organize targets that share a common origin.
 - 
setTimingType
The timing type of this scheduled job. Can be either based on a target date or recurring based on a cron expression.- Parameters:
 timingType- The timing type of this scheduled job. Can be either single date or recurring based on a cron expression.
 - 
setExecuted
public void setExecuted(boolean executed) Whether this scheduled job has been executed.- Parameters:
 executed- Whether or not the job has been executed
 - 
setPreviousLastExecuted
The previous date on which the job last executed. This is useful for jobs that need to communicate the previous date they executed on to external listeners sincelastExecutedwill already have been updated to the current execution date (i.e., now) by the time they receive the message.Some jobs will use the date the job last executed in order to limit queries to entities that have been modified since then, such as checking which Product Tags have gone expired since the last time they were checked.
- Parameters:
 previousLastExecuted- The previous date on which the job last executed.
 - 
setLastExecuted
The date on which the job last executed.- Parameters:
 lastExecuted- The date on which the job last executed.
 - 
setUpdated
The date on which the job was last updated by a user.- Parameters:
 updated- The date on which the job was last updated by a user.
 - 
setTargetDate
The date on which a single use job should execute.- Parameters:
 targetDate- The date on which a single use job should execute
 - 
setCron
A cron expression used to drive the schedule for the job execution.- Parameters:
 cron- A cron expression used to drive the schedule for the job execution
 - 
setDetails
Collection of detailed information for the job- Parameters:
 details- Collection of detailed information for the job
 - 
setManageInAdmin
public void setManageInAdmin(boolean manageInAdmin) Whether or not the job can be managed through the Admin interface.- Parameters:
 manageInAdmin- Whether or not the job can be managed through the Admin interface
 - 
setAuthor
The admin user who created this job - 
setTrackExecutionDetails
public void setTrackExecutionDetails(boolean trackExecutionDetails) A flag to indicate whether the execution details of this scheduled-job should be tracked.Set as
falseby default - 
setContextState
public void setContextState(com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState) A subset ofTrackinginformation to expose the context state for this object.- Specified by:
 setContextStatein interfacecom.broadleafcommerce.data.tracking.core.ContextStateAware- Parameters:
 contextState- a subset ofTrackinginformation to expose the context state for this object
 - 
equals
 - 
canEqual
 - 
hashCode
public int hashCode() - 
toString
 
 -