2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
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.
10 package eu
.etaxonomy
.taxeditor
.datasource
;
12 import java
.util
.List
;
14 import eu
.etaxonomy
.cdm
.api
.application
.CdmApplicationController
;
15 import eu
.etaxonomy
.cdm
.database
.CdmPersistentDataSource
;
16 import eu
.etaxonomy
.cdm
.database
.DatabaseTypeEnum
;
17 import eu
.etaxonomy
.cdm
.database
.ICdmDataSource
;
24 public interface ICdmDataSourceRepository
{
27 * Get a list of all CDM dataSources associated
28 * with this session of the Taxonomic Editor, persistent
33 public List
<ICdmDataSource
> getAll();
36 * Add <code>dataSource</code> to the list of all
37 * CDM dataSources associated with this session
38 * of the Taxonomic Editor.
43 public boolean add(ICdmDataSource dataSource
);
46 * If <code>dataSourceName</code> already exists as persistent CDM
47 * dataSources, it is updated with parameter values.
49 * If it does not exist, <code>dataSource</code> will be created.
51 * @param dataSourceName
60 public CdmPersistentDataSource
save(String dataSourceName
, DatabaseTypeEnum databaseType
, String server
, String database
,
61 int port
, String username
, String password
);
64 * Almost identical to {@link #save(String,DatabaseTypeEnum,String,String,int,String,String)},
65 * except it does not take a <code>port</code>.
67 * @param dataSourceName
75 public CdmPersistentDataSource
save(String dataSourceName
, DatabaseTypeEnum databaseType
, String server
, String database
,
76 String username
, String password
);
79 * Remove <code>dataSource</code> from the list of all
80 * CDM dataSources associated with this session
81 * of the Taxonomic Editor.
86 public boolean remove(ICdmDataSource dataSource
);
89 * Remove <code>dataSource</code> from the list of all
90 * <i>persistent</i> CDM dataSources associated with this
96 public boolean delete(CdmPersistentDataSource dataSource
);
99 * All data source operations run through a <code>CdmApplicationController</code>.
101 * @param cdmAppController
103 public void setCdmApplicationController(CdmApplicationController cdmAppController
);
106 * Get the data source currently associated with this
111 public ICdmDataSource
getCurrentDataSource();
114 * Set <code>dataSource</code> as this Taxonomic Editor's
115 * current data source.
120 public boolean setCurrentDataSource(ICdmDataSource dataSource
);