KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > mybatchfwk > history > IExecutionHistory


1 /*
2  * MyBatchFramework - Open-source batch framework.
3  * Copyright (C) 2006 Jérôme Bertèche cyberteche@users.sourceforge.net
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * Jérôme Bertèche
16  * Email: cyberteche@users.sourceforge.net
17  */

18 package net.sf.mybatchfwk.history;
19
20 import java.util.Iterator JavaDoc;
21
22 import net.sf.mybatchfwk.BatchConfiguration;
23 import net.sf.mybatchfwk.BatchException;
24
25 /**
26  * An ExecutionHistory is design to store the id of the completed and failed tasks.
27  *
28  * @author Administrateur
29  */

30 public interface IExecutionHistory {
31     
32     /**
33      * Init the storage system (called one time at the beginning of the batch)
34      * @param configuration the configuration of the batch
35      */

36     public void initStorage(BatchConfiguration configuration) throws BatchException;
37     
38     /**
39      * Close the storage system (called one time at the end of the batch)
40      */

41     public void closeStorage() throws BatchException;
42     
43     /**
44      * Return true is this task has already been executed and completed
45      * @param id the id a a task
46      * @throws BatchException
47      */

48     public boolean isCompletedTask(String JavaDoc id) throws BatchException;
49     
50     /**
51      * Return true is this task has already been executed but failed
52      * @param id
53      */

54     public boolean isFailedTask(String JavaDoc id) throws BatchException;
55     
56     /**
57      * Store the id of the completed task
58      * @param id
59      */

60     public void storeCompletedTaskId(String JavaDoc id) throws BatchException;
61     
62     /**
63      * Store the id of the failed task
64      * @param id
65      */

66     public void storeFailedTaskId(String JavaDoc id) throws BatchException;
67     
68     /**
69      * Return an iterator over the id of the completed tasks
70      * @return
71      * @throws BatchException
72      */

73     public Iterator JavaDoc completedTasksIdIterator() throws BatchException;
74     
75     /**
76      * Return an iterator over the id of the completed tasks
77      * @return
78      * @throws BatchException
79      */

80     public Iterator JavaDoc failedTasksIdIterator() throws BatchException;
81 }
82
Popular Tags