1 package org.apache.turbine.services.schedule;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 import java.util.List;
20
21 import org.apache.turbine.services.Service;
22 import org.apache.turbine.util.TurbineException;
23
24 /***
25 * ScheduleService interface.
26 *
27 * @author <a href="mailto:mbryson@mont.mindspring.com">Dave Bryson</a>
28 * @author <a href="mailto:quintonm@bellsouth.net">Quinton McCombs</a>
29 * @version $Id: ScheduleService.java 264148 2005-08-29 14:21:04Z henning $
30 */
31 public interface ScheduleService
32 extends Service
33 {
34 /*** Name of service */
35 String SERVICE_NAME = "SchedulerService";
36
37 /*** TR.props key for intially activating the scheduler thread */
38 String INTIALLY_ACTIVE = "enabled";
39
40 /*** TR.props key for the logger */
41 String LOGGER_NAME = "scheduler";
42
43 /***
44 * Get a specific Job from Storage.
45 *
46 * @param oid The int id for the job.
47 * @return A JobEntry.
48 * @exception TurbineException could not retreive job
49 */
50 JobEntry getJob(int oid)
51 throws TurbineException;
52
53 /***
54 * Add a new job to the queue.
55 *
56 * @param je A JobEntry with the job to add.
57 * @throws TurbineException job could not be added
58 */
59 void addJob(JobEntry je)
60 throws TurbineException;
61
62 /***
63 * Modify a Job.
64 *
65 * @param je A JobEntry with the job to modify
66 * @throws TurbineException job could not be updated
67 */
68 void updateJob(JobEntry je)
69 throws TurbineException;
70
71 /***
72 * Remove a job from the queue.
73 *
74 * @param je A JobEntry with the job to remove.
75 * @exception TurbineException job could not be removed
76 */
77 void removeJob(JobEntry je)
78 throws TurbineException;
79
80 /***
81 * List jobs in the queue. This is used by the scheduler UI.
82 *
83 * @return A List of jobs.
84 */
85 List listJobs();
86
87 /***
88 * Determines if the scheduler service is currently active.
89 *
90 * @return Status of the scheduler service.
91 */
92 boolean isEnabled();
93
94 /***
95 * Starts the scheduler if not already running.
96 */
97 void startScheduler();
98
99 /***
100 * Stops the scheduler if ti is currently running.
101 */
102 void stopScheduler();
103
104 }