cdmlib 2.5
[cdmlib.git] / cdmlib-persistence / src / main / java / eu / etaxonomy / cdm / database / update / ITermUpdater.java
1 package eu.etaxonomy.cdm.database.update;
2
3 import eu.etaxonomy.cdm.common.IProgressMonitor;
4 import eu.etaxonomy.cdm.database.ICdmDataSource;
5
6 public interface ITermUpdater {
7
8 /**
9 * Invokes this CDM term updater and updates the schema up to the current CDM
10 * term version. Throws an exception if this updaters target version does
11 * not equal the current CDM schema version.
12 * @param datasource
13 * @param monitor
14 * @return
15 * @throws Exception
16 */
17 boolean invoke(ICdmDataSource datasource, IProgressMonitor monitor) throws Exception;
18
19 /**
20 * Invokes this CDM term updater and updates the terms up to the given
21 * target version. Throws an exception if this updaters target version does
22 * not equal the given target version.
23 * @param targetVersion
24 * @param datasource
25 * @param monitor
26 * @return
27 * @throws Exception
28 */
29 boolean invoke(String targetVersion, ICdmDataSource datasource, IProgressMonitor monitor) throws Exception;
30
31 /**
32 * Returns the previous CDM term updater
33 * @return
34 */
35 public ITermUpdater getPreviousUpdater();
36
37 /**
38 * Returns the next CDM term updater
39 * @return
40 */
41 public ITermUpdater getNextUpdater();
42
43 /**
44 * Returns the number of steps to run to update the datasource
45 * to the term version this term updater is updating to.
46 * This includes needed steps in previous updaters.
47 * @see #getPreviousUpdater()
48 * @return number of steps
49 */
50 int countSteps(ICdmDataSource datasource);
51
52 String getTargetVersion();
53
54 }