View Javadoc

1   package ch.busyboxes.agoo.dao;
2   
3   import ch.busyboxes.agoo.model.WatcherTask;
4   import ch.busyboxes.agoo.model.enumeration.TaskType;
5   
6   /**
7    * DAO for accessing watcher tasks
8    * 
9    * @author julien@busyboxes.ch
10   */
11  public interface WatcherTaskDAO {
12  
13  	/**
14  	 * Returns the next pending task
15  	 * 
16  	 * @return the next pending task
17  	 */
18  	public WatcherTask fetchNextPendingTask();
19  	
20  	/**
21  	 * Creates a new task
22  	 * 
23  	 * @param taskType the new task's type 
24  	 * @param targetId the new task's target ID, if any
25  	 */
26  	public void createNewTask(TaskType taskType, Long targetId);
27  	
28  	/**
29  	 * Updates the given task
30  	 * 
31  	 * @param watcherTask the task
32  	 */
33  	public void updateTask(WatcherTask watcherTask);
34  	
35  	/**
36  	 * Removes the following task
37  	 * 
38  	 * @param watcherTask the task to be removed
39  	 */
40  	public void removeTask(WatcherTask watcherTask);
41  }