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 long
DEFAULT_LOCK_WAIT_TIME_MS
static TimeoutPolicy
DEFAULT_TIMEOUT_POLICY
static String
LOCK_WAIT_TIME_PARAMETER_NAME
static String
TIMEOUT_POLICY_PARAMETER_NAME
-
Constructor Summary
Constructors Modifier Constructor Description 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.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.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 Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canDisable()
boolean
canRunAdhoc()
boolean
disabledByDefault()
boolean
equals(Object o)
com.atlassian.scheduler.config.JobConfig
getJobConfig()
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.JobId
getJobId()
com.atlassian.scheduler.JobRunner
getJobRunner()
TheJobRunnerKey
to register theJobRunner
result of this method should be taken from the result ofScheduledJob.getJobConfig()
.long
getLockWaitTime()
Optional<TimeoutPolicy>
getTimeoutPolicy()
int
hashCode()
boolean
isClusteredOnly()
Jobs that are only meaningful in clustered environment won't be scheduled in non-clustered environments.boolean
isEditable()
boolean
isKeepingHistory()
boolean
isLocalJob()
String
toString()
-
-
-
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:
getJobId
in interfaceManagedScheduledJob
-
getJobRunner
public com.atlassian.scheduler.JobRunner getJobRunner()
Description copied from interface:ScheduledJob
TheJobRunnerKey
to register theJobRunner
result of this method should be taken from the result ofScheduledJob.getJobConfig()
.- Specified by:
getJobRunner
in interfaceScheduledJob
-
getJobConfig
public com.atlassian.scheduler.config.JobConfig getJobConfig()
Description copied from interface:ScheduledJob
When scheduling the job,ScheduleUtil.withTimeZone(JobConfig, TimeZone)
may be used to set the time zone in case the job is cron based.- Specified by:
getJobConfig
in interfaceScheduledJob
-
isEditable
public boolean isEditable()
- Specified by:
isEditable
in interfaceManagedScheduledJob
-
isKeepingHistory
public boolean isKeepingHistory()
- Specified by:
isKeepingHistory
in interfaceManagedScheduledJob
-
canRunAdhoc
public boolean canRunAdhoc()
- Specified by:
canRunAdhoc
in interfaceManagedScheduledJob
-
canDisable
public boolean canDisable()
- Specified by:
canDisable
in interfaceManagedScheduledJob
-
isClusteredOnly
public boolean isClusteredOnly()
Description copied from interface:ScheduledJob
Jobs that are only meaningful in clustered environment won't be scheduled in non-clustered environments.- Specified by:
isClusteredOnly
in interfaceScheduledJob
-
isLocalJob
public boolean isLocalJob()
- Specified by:
isLocalJob
in interfaceManagedScheduledJob
-
getLockWaitTime
public long getLockWaitTime()
- Specified by:
getLockWaitTime
in interfaceManagedScheduledJob
-
getTimeoutPolicy
public Optional<TimeoutPolicy> getTimeoutPolicy()
- Specified by:
getTimeoutPolicy
in interfaceManagedScheduledJob
-
disabledByDefault
public boolean disabledByDefault()
- Specified by:
disabledByDefault
in interfaceManagedScheduledJob
-
-