forked from mausch/QuartzNetWebConsole
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Wrapper for IScheduler with simpler Quartz 1.x methods
- Loading branch information
Showing
3 changed files
with
97 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
using System; | ||
using Quartz; | ||
using Quartz.Impl.Matchers; | ||
|
||
namespace QuartzNetWebConsole.Utils { | ||
public class SchedulerWrapper { | ||
private readonly IScheduler scheduler; | ||
|
||
public SchedulerWrapper(IScheduler scheduler) { | ||
this.scheduler = scheduler; | ||
} | ||
|
||
public void Shutdown() { | ||
scheduler.Shutdown(); | ||
} | ||
|
||
public void Start() { | ||
scheduler.Start(); | ||
} | ||
|
||
public void Standby() { | ||
scheduler.Standby(); | ||
} | ||
|
||
public void PauseAll() { | ||
scheduler.PauseAll(); | ||
} | ||
|
||
public void ResumeAll() { | ||
scheduler.ResumeAll(); | ||
} | ||
|
||
public void ResumeJobGroup(string groupName) { | ||
scheduler.ResumeJobs(GroupMatcher<JobKey>.GroupEquals(groupName)); | ||
} | ||
|
||
public void ResumeTriggerGroup(string groupName) { | ||
scheduler.ResumeTriggers(GroupMatcher<TriggerKey>.GroupEquals(groupName)); | ||
} | ||
|
||
public void PauseJobGroup(string groupName) { | ||
scheduler.PauseJobs(GroupMatcher<JobKey>.GroupEquals(groupName)); | ||
} | ||
|
||
public void PauseTriggerGroup(string groupName) { | ||
scheduler.PauseTriggers(GroupMatcher<TriggerKey>.GroupEquals(groupName)); | ||
} | ||
|
||
public void RemoveGlobalJobListener(string name) { | ||
scheduler.ListenerManager.RemoveJobListener(name); | ||
} | ||
|
||
public void RemoveGlobalTriggerListener(string name) { | ||
scheduler.ListenerManager.RemoveTriggerListener(name); | ||
} | ||
|
||
public void DeleteJob(string jobName, string groupName) { | ||
scheduler.DeleteJob(new JobKey(jobName, groupName)); | ||
} | ||
|
||
public void PauseJob(string jobName, string groupName) { | ||
scheduler.PauseJob(new JobKey(jobName, groupName)); | ||
} | ||
|
||
public void ResumeJob(string jobName, string groupName) { | ||
scheduler.ResumeJob(new JobKey(jobName, groupName)); | ||
} | ||
|
||
public void TriggerJob(string jobName, string groupName) { | ||
scheduler.TriggerJob(new JobKey(jobName, groupName)); | ||
} | ||
|
||
public void TriggerJobWithVolatileTrigger(string jobName, string groupName) { | ||
throw new NotSupportedException(); | ||
} | ||
|
||
public void Interrupt(string jobName, string groupName) { | ||
scheduler.Interrupt(new JobKey(jobName, groupName)); | ||
} | ||
|
||
public void ResumeTrigger(string triggerName, string groupName) { | ||
scheduler.ResumeTrigger(new TriggerKey(triggerName, groupName)); | ||
} | ||
|
||
public void PauseTrigger(string triggerName, string groupName) { | ||
scheduler.PauseTrigger(new TriggerKey(triggerName, groupName)); | ||
} | ||
|
||
public void UnscheduleJob(string triggerName, string groupName) { | ||
scheduler.UnscheduleJob(new TriggerKey(triggerName, groupName)); | ||
} | ||
} | ||
} |