Class MockScheduledJobManager
java.lang.Object
com.atlassian.integrationtest.confluence.user.MockScheduledJobManager
- All Implemented Interfaces:
ScheduledJobNodeManager,ScheduledJobManager
public class MockScheduledJobManager
extends Object
implements ScheduledJobManager, ScheduledJobNodeManager
A No-op implementation to temporarily allow integration tests to run
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddisable(com.atlassian.scheduler.config.JobId jobId) Disables the specified job, and removes it from the scheduler.voiddisableJob(com.atlassian.scheduler.config.JobId jobId) Disable job on this node only.voidenable(com.atlassian.scheduler.config.JobId jobId) Enables the specified job, and adds it to the scheduler.voidenableJob(com.atlassian.scheduler.config.JobId jobId) Enable job on this node only.getCronExpression(com.atlassian.scheduler.config.JobId jobId) Gets the currently configured cron expression, or the default value if none has been configured.getRepeatInterval(com.atlassian.scheduler.config.JobId jobId) Gets the currently configured repeat interval, or the default value if none has been configured.getScheduledJob(com.atlassian.scheduler.config.JobId jobId) Gets the list of managed job status.voidrunNow(com.atlassian.scheduler.config.JobId jobId) Schedules the specified to run immediately.updateCronJobSchedule(com.atlassian.scheduler.config.JobId jobId, String newCronSchedule) Updates stored schedule.updateCronSchedule(com.atlassian.scheduler.config.JobId jobId, String newCronSchedule) updateSimpleJobSchedule(com.atlassian.scheduler.config.JobId jobId, long repeatInterval) Updates stored schedule.updateSimpleSchedule(com.atlassian.scheduler.config.JobId jobId, long repeatInterval)
-
Constructor Details
-
MockScheduledJobManager
public MockScheduledJobManager()
-
-
Method Details
-
getScheduledJobs
Description copied from interface:ScheduledJobManagerGets the list of managed job status.- Specified by:
getScheduledJobsin interfaceScheduledJobManager
-
getScheduledJob
- Specified by:
getScheduledJobin interfaceScheduledJobManager
-
updateCronJobSchedule
public Date updateCronJobSchedule(com.atlassian.scheduler.config.JobId jobId, String newCronSchedule) Description copied from interface:ScheduledJobManagerUpdates stored schedule. If the job is being scheduled e.g. enabled, it will be rescheduled. If the job is not being scheduled e.g. disabled, it won't be rescheduled.Only valid for
ManagedScheduledCronJoband requiresAbstractManagedScheduledJob.isEditable()to be true.- Specified by:
updateCronJobSchedulein interfaceScheduledJobManager- Returns:
- Date of the next execution
-
updateCronSchedule
- Specified by:
updateCronSchedulein interfaceScheduledJobNodeManager
-
updateSimpleJobSchedule
public Date updateSimpleJobSchedule(com.atlassian.scheduler.config.JobId jobId, long repeatInterval) Description copied from interface:ScheduledJobManagerUpdates stored schedule. If the job is being scheduled e.g. enabled, it will be rescheduled. If the job is not being scheduled e.g. disabled, it won't be rescheduled.Only valid for
ManagedScheduledSimpleJoband requiresAbstractManagedScheduledJob.isEditable()to be true.- Specified by:
updateSimpleJobSchedulein interfaceScheduledJobManager- Returns:
- Date of the next execution
-
updateSimpleSchedule
- Specified by:
updateSimpleSchedulein interfaceScheduledJobNodeManager
-
runNow
public void runNow(com.atlassian.scheduler.config.JobId jobId) Description copied from interface:ScheduledJobManagerSchedules the specified to run immediately.Requires
ManagedScheduledJob.canRunAdhoc()to be true.- Specified by:
runNowin interfaceScheduledJobManager
-
disable
public void disable(com.atlassian.scheduler.config.JobId jobId) Description copied from interface:ScheduledJobManagerDisables the specified job, and removes it from the scheduler.Requires
ManagedScheduledJob.canDisable()to be true.- Specified by:
disablein interfaceScheduledJobManager
-
disableJob
public void disableJob(com.atlassian.scheduler.config.JobId jobId) Description copied from interface:ScheduledJobNodeManagerDisable job on this node only.- Specified by:
disableJobin interfaceScheduledJobNodeManager- Parameters:
jobId- the job ID.
-
enable
public void enable(com.atlassian.scheduler.config.JobId jobId) Description copied from interface:ScheduledJobManagerEnables the specified job, and adds it to the scheduler.Requires
ManagedScheduledJob.canDisable()to be true.- Specified by:
enablein interfaceScheduledJobManager
-
enableJob
public void enableJob(com.atlassian.scheduler.config.JobId jobId) Description copied from interface:ScheduledJobNodeManagerEnable job on this node only.- Specified by:
enableJobin interfaceScheduledJobNodeManager- Parameters:
jobId- the job ID.
-
getCronExpression
Description copied from interface:ScheduledJobManagerGets the currently configured cron expression, or the default value if none has been configured.- Specified by:
getCronExpressionin interfaceScheduledJobManager- Returns:
nullif not a cron job.
-
getRepeatInterval
Description copied from interface:ScheduledJobManagerGets the currently configured repeat interval, or the default value if none has been configured.- Specified by:
getRepeatIntervalin interfaceScheduledJobManager- Returns:
nullif not a simple job
-