1
|
/**
|
2
|
* Copyright (C) 2007 EDIT
|
3
|
* European Distributed Institute of Taxonomy
|
4
|
* http://www.e-taxonomy.eu
|
5
|
*
|
6
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
7
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
8
|
*/
|
9
|
|
10
|
package eu.etaxonomy.cdm.io.common;
|
11
|
|
12
|
import eu.etaxonomy.cdm.io.common.events.IIoEvent;
|
13
|
import eu.etaxonomy.cdm.io.common.events.IIoObserver;
|
14
|
|
15
|
|
16
|
/**
|
17
|
* @author a.mueller
|
18
|
* @created 20.06.2008
|
19
|
* @version 1.0
|
20
|
*/
|
21
|
|
22
|
public interface ICdmIO<STATE extends IoStateBase> {
|
23
|
|
24
|
final String USER_STORE = "person";
|
25
|
final String PERSON_STORE = "person";
|
26
|
final String TEAM_STORE = "team";
|
27
|
final String REFERENCE_STORE = "reference";
|
28
|
final String NOMREF_STORE = "nomRef";
|
29
|
final String REF_DETAIL_STORE = "refDetail";
|
30
|
final String NOMREF_DETAIL_STORE = "nomRefDetail";
|
31
|
final String TAXONNAME_STORE = "taxonName";
|
32
|
final String TAXON_STORE = "taxon";
|
33
|
final String FEATURE_STORE = "feature";
|
34
|
final String SPECIMEN_STORE = "specimen";
|
35
|
|
36
|
public boolean check(STATE state);
|
37
|
|
38
|
// public boolean invoke(T config, Map<String, MapWrapper<? extends CdmBase>> stores);
|
39
|
|
40
|
public abstract boolean invoke(STATE state);
|
41
|
|
42
|
// public boolean invoke(IoState<T> state);
|
43
|
|
44
|
public void updateProgress(STATE state, String message);
|
45
|
|
46
|
public void updateProgress(STATE state, String message, int worked);
|
47
|
|
48
|
public void warnProgress(STATE state, String message, Throwable e);
|
49
|
|
50
|
//******************** Observers *********************************************************
|
51
|
|
52
|
/**
|
53
|
* Adds an observer to the set of observers for this object, provided that it is not the same as some observer already in the set.
|
54
|
* @param observer
|
55
|
*/
|
56
|
public void addObserver(IIoObserver observer);
|
57
|
|
58
|
/**
|
59
|
* Returns the number of observers of this Observable object.
|
60
|
* @return number of observers
|
61
|
*/
|
62
|
public int countObservers();
|
63
|
/**
|
64
|
* Deletes an observer from the set of observers of this object.
|
65
|
* @param observer
|
66
|
*/
|
67
|
public void deleteObserver(IIoObserver observer);
|
68
|
|
69
|
/**
|
70
|
* Clears the observer list so that this object no longer has any observers.
|
71
|
*/
|
72
|
public void deleteObservers();
|
73
|
|
74
|
/**
|
75
|
* If this object fires an event then notify all of its observers.
|
76
|
*/
|
77
|
public void fire(IIoEvent event);
|
78
|
|
79
|
//******************** End Observers *********************************************************
|
80
|
|
81
|
}
|