View Javadoc

1   package org.apache.turbine.services.schedule;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *   http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  import java.util.List;
23  
24  import org.apache.turbine.services.Service;
25  import org.apache.turbine.util.TurbineException;
26  
27  /***
28   * ScheduleService interface.
29   *
30   * @author <a href="mailto:mbryson@mont.mindspring.com">Dave Bryson</a>
31   * @author <a href="mailto:quintonm@bellsouth.net">Quinton McCombs</a>
32   * @version $Id: ScheduleService.java 534527 2007-05-02 16:10:59Z tv $
33   */
34  public interface ScheduleService
35          extends Service
36  {
37      /*** Name of service */
38      String SERVICE_NAME = "SchedulerService";
39  
40      /*** TR.props key for intially activating the scheduler thread */
41      String INTIALLY_ACTIVE = "enabled";
42  
43      /*** TR.props key for the logger */
44      String LOGGER_NAME = "scheduler";
45  
46      /***
47       * Get a specific Job from Storage.
48       *
49       * @param oid The int id for the job.
50       * @return A JobEntry.
51       * @exception TurbineException could not retreive job
52       */
53      JobEntry getJob(int oid)
54              throws TurbineException;
55  
56      /***
57       * Add a new job to the queue.
58       *
59       * @param je A JobEntry with the job to add.
60       * @throws TurbineException job could not be added
61       */
62      void addJob(JobEntry je)
63              throws TurbineException;
64  
65      /***
66       * Modify a Job.
67       *
68       * @param je A JobEntry with the job to modify
69       * @throws TurbineException job could not be updated
70       */
71      void updateJob(JobEntry je)
72              throws TurbineException;
73  
74      /***
75       * Remove a job from the queue.
76       *
77       * @param je A JobEntry with the job to remove.
78       * @exception TurbineException job could not be removed
79       */
80      void removeJob(JobEntry je)
81              throws TurbineException;
82  
83      /***
84       * List jobs in the queue.  This is used by the scheduler UI.
85       *
86       * @return A List of jobs.
87       */
88      List listJobs();
89  
90      /***
91       * Determines if the scheduler service is currently active.
92       *
93       * @return Status of the scheduler service.
94       */
95      boolean isEnabled();
96  
97      /***
98       * Starts the scheduler if not already running.
99       */
100     void startScheduler();
101 
102     /***
103      * Stops the scheduler if ti is currently running.
104      */
105     void stopScheduler();
106 
107 }