01: /*
02: * Copyright 2001-2007 Geert Bevin <gbevin[remove] at uwyn dot com>
03: * Distributed under the terms of either:
04: * - the common development and distribution license (CDDL), v1.0; or
05: * - the GNU Lesser General Public License, v2.1 or later
06: * $Id: TaskManager.java 3634 2007-01-08 21:42:24Z gbevin $
07: */
08: package com.uwyn.rife.scheduler;
09:
10: import com.uwyn.rife.scheduler.Task;
11: import com.uwyn.rife.scheduler.exceptions.TaskManagerException;
12: import java.util.Collection;
13:
14: public interface TaskManager {
15: public void setScheduler(Scheduler scheduler);
16:
17: public Scheduler getScheduler();
18:
19: public int addTask(Task task) throws TaskManagerException;
20:
21: public boolean updateTask(Task task) throws TaskManagerException;
22:
23: public Task getTask(int id) throws TaskManagerException;
24:
25: public Collection<Task> getTasksToProcess()
26: throws TaskManagerException;
27:
28: public Collection<Task> getScheduledTasks()
29: throws TaskManagerException;
30:
31: public boolean removeTask(int id) throws TaskManagerException;
32:
33: public boolean rescheduleTask(Task task, long interval,
34: String frequency) throws TaskManagerException;
35:
36: public boolean concludeTask(Task task) throws TaskManagerException;
37:
38: public boolean activateTask(int id) throws TaskManagerException;
39:
40: public boolean deactivateTask(int id) throws TaskManagerException;
41: }
|