001: package org.apache.turbine.services.schedule;
002:
003: /*
004: * Licensed to the Apache Software Foundation (ASF) under one
005: * or more contributor license agreements. See the NOTICE file
006: * distributed with this work for additional information
007: * regarding copyright ownership. The ASF licenses this file
008: * to you under the Apache License, Version 2.0 (the
009: * "License"); you may not use this file except in compliance
010: * with the License. You may obtain a copy of the License at
011: *
012: * http://www.apache.org/licenses/LICENSE-2.0
013: *
014: * Unless required by applicable law or agreed to in writing,
015: * software distributed under the License is distributed on an
016: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
017: * KIND, either express or implied. See the License for the
018: * specific language governing permissions and limitations
019: * under the License.
020: */
021:
022: import java.util.List;
023:
024: import org.apache.turbine.services.Service;
025: import org.apache.turbine.util.TurbineException;
026:
027: /**
028: * ScheduleService interface.
029: *
030: * @author <a href="mailto:mbryson@mont.mindspring.com">Dave Bryson</a>
031: * @author <a href="mailto:quintonm@bellsouth.net">Quinton McCombs</a>
032: * @version $Id: ScheduleService.java 534527 2007-05-02 16:10:59Z tv $
033: */
034: public interface ScheduleService extends Service {
035: /** Name of service */
036: String SERVICE_NAME = "SchedulerService";
037:
038: /** TR.props key for intially activating the scheduler thread */
039: String INTIALLY_ACTIVE = "enabled";
040:
041: /** TR.props key for the logger */
042: String LOGGER_NAME = "scheduler";
043:
044: /**
045: * Get a specific Job from Storage.
046: *
047: * @param oid The int id for the job.
048: * @return A JobEntry.
049: * @exception TurbineException could not retreive job
050: */
051: JobEntry getJob(int oid) throws TurbineException;
052:
053: /**
054: * Add a new job to the queue.
055: *
056: * @param je A JobEntry with the job to add.
057: * @throws TurbineException job could not be added
058: */
059: void addJob(JobEntry je) throws TurbineException;
060:
061: /**
062: * Modify a Job.
063: *
064: * @param je A JobEntry with the job to modify
065: * @throws TurbineException job could not be updated
066: */
067: void updateJob(JobEntry je) throws TurbineException;
068:
069: /**
070: * Remove a job from the queue.
071: *
072: * @param je A JobEntry with the job to remove.
073: * @exception TurbineException job could not be removed
074: */
075: void removeJob(JobEntry je) throws TurbineException;
076:
077: /**
078: * List jobs in the queue. This is used by the scheduler UI.
079: *
080: * @return A List of jobs.
081: */
082: List listJobs();
083:
084: /**
085: * Determines if the scheduler service is currently active.
086: *
087: * @return Status of the scheduler service.
088: */
089: boolean isEnabled();
090:
091: /**
092: * Starts the scheduler if not already running.
093: */
094: void startScheduler();
095:
096: /**
097: * Stops the scheduler if ti is currently running.
098: */
099: void stopScheduler();
100:
101: }
|