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
.cdm
.database
;
12 import org
.hibernate
.cache
.CacheProvider
;
13 import org
.springframework
.beans
.factory
.config
.BeanDefinition
;
15 import eu
.etaxonomy
.cdm
.database
.DbSchemaValidation
;
17 public interface ICdmDataSource
{
20 * Returns a BeanDefinition object of type DriverManagerDataSource that contains
21 * datsource properties (url, username, password, ...)
22 * @return BeanDefinition
24 public BeanDefinition
getDatasourceBean();
28 * @return BeanDefinition
30 public BeanDefinition
getHibernatePropertiesBean(DbSchemaValidation hbm2dll
);
36 * @param cacheProviderClass
37 * @return BeanDefinition
39 public BeanDefinition
getHibernatePropertiesBean(DbSchemaValidation hbm2dll
, Boolean showSql
, Boolean formatSql
, Boolean registerSearchListener
, Class
<?
extends CacheProvider
> cacheProviderClass
);
43 * The name representation of thie Datasource.
46 public String
getName();
52 public String
getServer();
57 public String
getDatabase();
59 public DatabaseTypeEnum
getDatabaseType();
69 public String
getFilePath();
74 public H2Mode
getMode();
78 * Tests, if a database connection can be established.
79 * @return true if test was successful, false otherwise
81 public boolean testConnection();
83 public String
getUsername();
85 public String
getPassword();
89 // public void setFilePath(String filePath);
91 // public void setMode(H2Mode mode);