Class AbstractManagedScheduledJob
- java.lang.Object
-
- com.atlassian.confluence.schedule.AbstractManagedScheduledJob
-
- All Implemented Interfaces:
ManagedScheduledJob,ScheduledJob
- Direct Known Subclasses:
ManagedScheduledCronJob,ManagedScheduledSimpleJob
public abstract class AbstractManagedScheduledJob extends Object implements ManagedScheduledJob
Implements common properties for various implementations of ManagedScheduledJob.
-
-
Field Summary
Fields Modifier and Type Field Description static longDEFAULT_LOCK_WAIT_TIME_MSstatic TimeoutPolicyDEFAULT_TIMEOUT_POLICYstatic StringLOCK_WAIT_TIME_PARAMETER_NAMEstatic StringTIMEOUT_POLICY_PARAMETER_NAME
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractManagedScheduledJob(String jobId, com.atlassian.scheduler.JobRunner jobRunner, com.atlassian.scheduler.config.JobConfig jobConfig, boolean editable, boolean keepingHistory, boolean canRunAdhoc, boolean canDisable, boolean clusteredOnly)For atlassian-scheduler.protectedAbstractManagedScheduledJob(String jobId, com.atlassian.scheduler.JobRunner jobRunner, com.atlassian.scheduler.config.JobConfig jobConfig, boolean editable, boolean keepingHistory, boolean canRunAdhoc, boolean canDisable, boolean clusteredOnly, long lockWaitTime, @Nullable TimeoutPolicy timeoutPolicy)For atlassian-scheduler.protectedAbstractManagedScheduledJob(String jobId, com.atlassian.scheduler.JobRunner jobRunner, com.atlassian.scheduler.config.JobConfig jobConfig, boolean editable, boolean keepingHistory, boolean canRunAdhoc, boolean canDisable, boolean clusteredOnly, long lockWaitTime, @Nullable TimeoutPolicy timeoutPolicy, boolean disabledByDefault)For atlassian-scheduler.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanDisable()booleancanRunAdhoc()booleandisabledByDefault()booleanequals(Object o)com.atlassian.scheduler.config.JobConfiggetJobConfig()When scheduling the job,ScheduleUtil.withTimeZone(JobConfig, TimeZone)may be used to set the time zone in case the job is cron based.com.atlassian.scheduler.config.JobIdgetJobId()com.atlassian.scheduler.JobRunnergetJobRunner()TheJobRunnerKeyto register theJobRunnerresult of this method should be taken from the result ofScheduledJob.getJobConfig().longgetLockWaitTime()Optional<TimeoutPolicy>getTimeoutPolicy()inthashCode()booleanisClusteredOnly()Jobs that are only meaningful in clustered environment won't be scheduled in non-clustered environments.booleanisEditable()booleanisKeepingHistory()booleanisLocalJob()StringtoString()
-
-
-
Field Detail
-
DEFAULT_LOCK_WAIT_TIME_MS
public static final long DEFAULT_LOCK_WAIT_TIME_MS
- See Also:
- Constant Field Values
-
DEFAULT_TIMEOUT_POLICY
public static final TimeoutPolicy DEFAULT_TIMEOUT_POLICY
-
LOCK_WAIT_TIME_PARAMETER_NAME
public static final String LOCK_WAIT_TIME_PARAMETER_NAME
- See Also:
- Constant Field Values
-
TIMEOUT_POLICY_PARAMETER_NAME
public static final String TIMEOUT_POLICY_PARAMETER_NAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AbstractManagedScheduledJob
protected AbstractManagedScheduledJob(String jobId, com.atlassian.scheduler.JobRunner jobRunner, com.atlassian.scheduler.config.JobConfig jobConfig, boolean editable, boolean keepingHistory, boolean canRunAdhoc, boolean canDisable, boolean clusteredOnly)
For atlassian-scheduler.
-
AbstractManagedScheduledJob
protected AbstractManagedScheduledJob(String jobId, com.atlassian.scheduler.JobRunner jobRunner, com.atlassian.scheduler.config.JobConfig jobConfig, boolean editable, boolean keepingHistory, boolean canRunAdhoc, boolean canDisable, boolean clusteredOnly, long lockWaitTime, @Nullable TimeoutPolicy timeoutPolicy)
For atlassian-scheduler.
-
AbstractManagedScheduledJob
protected AbstractManagedScheduledJob(String jobId, com.atlassian.scheduler.JobRunner jobRunner, com.atlassian.scheduler.config.JobConfig jobConfig, boolean editable, boolean keepingHistory, boolean canRunAdhoc, boolean canDisable, boolean clusteredOnly, long lockWaitTime, @Nullable TimeoutPolicy timeoutPolicy, boolean disabledByDefault)
For atlassian-scheduler.
-
-
Method Detail
-
getJobId
public com.atlassian.scheduler.config.JobId getJobId()
- Specified by:
getJobIdin interfaceManagedScheduledJob
-
getJobRunner
public com.atlassian.scheduler.JobRunner getJobRunner()
Description copied from interface:ScheduledJobTheJobRunnerKeyto register theJobRunnerresult of this method should be taken from the result ofScheduledJob.getJobConfig().- Specified by:
getJobRunnerin interfaceScheduledJob
-
getJobConfig
public com.atlassian.scheduler.config.JobConfig getJobConfig()
Description copied from interface:ScheduledJobWhen scheduling the job,ScheduleUtil.withTimeZone(JobConfig, TimeZone)may be used to set the time zone in case the job is cron based.- Specified by:
getJobConfigin interfaceScheduledJob
-
isEditable
public boolean isEditable()
- Specified by:
isEditablein interfaceManagedScheduledJob
-
isKeepingHistory
public boolean isKeepingHistory()
- Specified by:
isKeepingHistoryin interfaceManagedScheduledJob
-
canRunAdhoc
public boolean canRunAdhoc()
- Specified by:
canRunAdhocin interfaceManagedScheduledJob
-
canDisable
public boolean canDisable()
- Specified by:
canDisablein interfaceManagedScheduledJob
-
isClusteredOnly
public boolean isClusteredOnly()
Description copied from interface:ScheduledJobJobs that are only meaningful in clustered environment won't be scheduled in non-clustered environments.- Specified by:
isClusteredOnlyin interfaceScheduledJob
-
isLocalJob
public boolean isLocalJob()
- Specified by:
isLocalJobin interfaceManagedScheduledJob
-
getLockWaitTime
public long getLockWaitTime()
- Specified by:
getLockWaitTimein interfaceManagedScheduledJob
-
getTimeoutPolicy
public Optional<TimeoutPolicy> getTimeoutPolicy()
- Specified by:
getTimeoutPolicyin interfaceManagedScheduledJob
-
disabledByDefault
public boolean disabledByDefault()
- Specified by:
disabledByDefaultin interfaceManagedScheduledJob
-
-