View Javadoc

1   package org.apache.turbine.services.schedule;
2   
3   /*
4    * Copyright 2001-2005 The Apache Software Foundation.
5    *
6    * Licensed under the Apache License, Version 2.0 (the "License")
7    * you may not use this file except in compliance with the License.
8    * You may obtain a copy of the License at
9    *
10   *     http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing, software
13   * distributed under the License is distributed on an "AS IS" BASIS,
14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   * See the License for the specific language governing permissions and
16   * limitations under the License.
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 }