1
|
/**
|
2
|
* Copyright (C) 2008 EDIT
|
3
|
* European Distributed Institute of Taxonomy
|
4
|
* http://www.e-taxonomy.eu
|
5
|
*/
|
6
|
|
7
|
package eu.etaxonomy.cdm.io.common;
|
8
|
|
9
|
import java.util.Set;
|
10
|
|
11
|
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
|
12
|
|
13
|
import eu.etaxonomy.cdm.api.application.ICdmRepository;
|
14
|
import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
|
15
|
import eu.etaxonomy.cdm.config.Configuration;
|
16
|
import eu.etaxonomy.cdm.database.DbSchemaValidation;
|
17
|
import eu.etaxonomy.cdm.io.common.events.IIoObserver;
|
18
|
import eu.etaxonomy.cdm.persistence.hibernate.HibernateConfiguration;
|
19
|
|
20
|
|
21
|
/**
|
22
|
* @author a.babadshanjan
|
23
|
* @since 13.11.2008
|
24
|
*/
|
25
|
public interface IIoConfigurator extends IIoObservable{
|
26
|
|
27
|
/**
|
28
|
* A String representation of the used source may it be a source to be imported (e.g. "BerlinModel Cichorieae Database")
|
29
|
* or a source to be exported (e.g. "CDM Cichorieae Database")
|
30
|
* @return String representing the source for the io
|
31
|
*/
|
32
|
public String getSourceNameString();
|
33
|
|
34
|
|
35
|
/**
|
36
|
* A String representation of the destination may it be an import destination and therefore a CDM (e.g. CDM Cichorieae Database)
|
37
|
* or an export destination (e.g. CDM XML)
|
38
|
* @return
|
39
|
*/
|
40
|
public String getDestinationNameString();
|
41
|
|
42
|
|
43
|
/**
|
44
|
* Returns the CdmApplicationController
|
45
|
* @return
|
46
|
*/
|
47
|
public ICdmRepository getCdmAppController();
|
48
|
|
49
|
|
50
|
/**
|
51
|
* Sets the CdmApplicationController
|
52
|
* @param cdmApp the cdmApp to set
|
53
|
*/
|
54
|
public void setCdmAppController(ICdmRepository cdmApp);
|
55
|
|
56
|
/**
|
57
|
* Get the way how the CDM schema is validated
|
58
|
* @see eu.etaxonomy.cdm.database.DbSchemaValidation
|
59
|
* @return
|
60
|
*/
|
61
|
public DbSchemaValidation getDbSchemaValidation();
|
62
|
|
63
|
/**
|
64
|
* Get the way how the CDM schema is validated
|
65
|
* For exports values that delete the source (CREATE, CREATE_DROP) are not allowed and may throw an
|
66
|
* Exception in the further run
|
67
|
* @see eu.etaxonomy.cdm.database.DbSchemaValidation
|
68
|
* @param dbSchemaValidation
|
69
|
*/
|
70
|
public void setDbSchemaValidation(DbSchemaValidation dbSchemaValidation);
|
71
|
|
72
|
|
73
|
/**
|
74
|
* Returns the progress monitor.
|
75
|
* @return
|
76
|
*/
|
77
|
public IProgressMonitor getProgressMonitor();
|
78
|
|
79
|
/**
|
80
|
* Sets the progress monitor.
|
81
|
* @see #getProgressMonitor()
|
82
|
* @param monitor
|
83
|
*/
|
84
|
public void setProgressMonitor(IProgressMonitor monitor);
|
85
|
|
86
|
/**
|
87
|
* Returns the observers for this import/export
|
88
|
* @return
|
89
|
*/
|
90
|
@Override
|
91
|
public Set<IIoObserver> getObservers();
|
92
|
|
93
|
/**
|
94
|
* Sets the observers for this import/export
|
95
|
* @param observers
|
96
|
*/
|
97
|
public void setObservers(Set<IIoObserver> observers);
|
98
|
|
99
|
public UsernamePasswordAuthenticationToken getAuthenticationToken();
|
100
|
|
101
|
public void setAuthenticationToken(UsernamePasswordAuthenticationToken token);
|
102
|
|
103
|
public void setAuthentication(String login, String password);
|
104
|
|
105
|
/**
|
106
|
* Creates the UsernamePasswordAuthenticationToken for the default admin.
|
107
|
*
|
108
|
* @see Configuration#adminLogin
|
109
|
* @see Configuration#adminPassword
|
110
|
*/
|
111
|
public void authenticateAsDefaultAdmin();
|
112
|
|
113
|
/**
|
114
|
* @return the hibernate configuration to use, if some values are set
|
115
|
*/
|
116
|
public HibernateConfiguration getHibernateConfig();
|
117
|
|
118
|
|
119
|
/**
|
120
|
* @return
|
121
|
*/
|
122
|
public String getUserFriendlyIOName();
|
123
|
|
124
|
}
|