01: /*
02: * Copyright 2007 Pentaho Corporation. All rights reserved.
03: * This software was developed by Pentaho Corporation and is provided under the terms
04: * of the Mozilla Public License, Version 1.1, or any later version. You may not use
05: * this file except in compliance with the license. If you need a copy of the license,
06: * please go to http://www.mozilla.org/MPL/MPL-1.1.txt. The Original Code is the Pentaho
07: * BI Platform. The Initial Developer is Pentaho Corporation.
08: *
09: * Software distributed under the Mozilla Public License is distributed on an "AS IS"
10: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. Please refer to
11: * the license for the specific language governing your rights and limitations.
12: */
13: package org.pentaho.core.subscribe;
14:
15: import java.util.List;
16: import java.util.Map;
17:
18: import com.pentaho.repository.subscribe.Schedule;
19:
20: /**
21: * Interface class between the subscription repository and the implementation of the
22: * scheduler.
23: *
24: * @author dmoran
25: *
26: */
27:
28: public interface ISubscriptionScheduler {
29:
30: /**
31: * Synchronizes schedules between the subscription repos and the scheduling system
32: *
33: * @param oldSchedule
34: * The name of the schedule to modify or delete. If null, then the
35: * operation is treated as an add.
36: *
37: * @param newSchedule
38: * The schedule to modify or add. If null, then the operation is
39: * treated as an delete.
40: *
41: * @return true if successfull
42: */
43: public IScheduledJob syncSchedule(String oldScheduleReference,
44: Schedule newSchedule) throws Exception;
45:
46: /**
47: * Synchronizes schedules between the subscription repos and the scheduling system
48: *
49: * @param newSchedules
50: * The list of schedules that should exist. Any schedules not in the
51: * list should be deleted
52: *
53: * @return list of exception messages
54: */
55: public List syncSchedule(List newSchedules) throws Exception;
56:
57: /**
58: * Returns a List of all IScheduledJobs that are currently in the subscription
59: * scheduling system
60: *
61: */
62: public List getScheduledJobs();
63:
64: /**
65: * Returns the IScheduledJob for the passed in schedule reference from the scheduling system
66: * @throws Exception
67: *
68: */
69: public IScheduledJob getScheduledJob(String schedRef)
70: throws Exception;
71:
72: public Map getScheduledJobMap() throws Exception;
73:
74: public IScheduledJob pauseJob(String jobName) throws Exception;
75:
76: public IScheduledJob resumeJob(String jobName) throws Exception;
77:
78: public IScheduledJob executeJob(String jobName) throws Exception;
79:
80: public IScheduledJob deleteJob(String jobName) throws Exception;
81:
82: public IScheduledJob scheduleJob(Schedule schedule)
83: throws Exception;
84:
85: public int getSchedulerState() throws Exception;
86:
87: public void pauseScheduler() throws Exception;
88:
89: public void resumeScheduler() throws Exception;
90:
91: public String getCronSummary(String cron) throws Exception;
92: }
|