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
.types
;
12 import org
.springframework
.jdbc
.datasource
.DriverManagerDataSource
;
14 import eu
.etaxonomy
.cdm
.database
.ICdmDataSource
;
21 public interface IDatabaseType
{
25 public String
getName();
29 public String
getClassString();
33 public String
getUrlString();
37 public int getDefaultPort();
42 public String
getHibernateDialect();
45 * Returns the connection String for the given parameters, using default port
46 * @param cdmDataSource represents a datasource
47 * @return the connection String
49 public String
getConnectionString(ICdmDataSource cdmDataSource
);
53 * Returns the DriverManagerDataSource class that that the datasource needs to create a spring bean
54 * @return the DriverManagerDataSource class
56 public Class
<?
extends DriverManagerDataSource
> getDriverManagerDataSourceClass();
60 * Returns the Name of the initialization method to be used when a hibernate datasource is created for this database
61 * @return String name of the init method
63 public String
getInitMethod();
66 * Returns the Name of the destroying method to be used when a hibernate datasource representing this database is destroyed
67 * @return String name of the destroy method
69 public String
getDestroyMethod();
72 * Returns the server name for a given connection string. Null or empty string is returned if the
73 * connection string is invalid
74 * @param connectionString the connection string
75 * @return string representing the server
77 public String
getServerNameByConnectionString(String connectionString
);
81 * Returns the port for a given connection string. If no port is defined the default port is returned.
82 * If connection string is <code>null</code> or unvalid -1 is returned
83 * @param connectionString the connection string
84 * @return int representing the port number
86 public int getPortByConnectionString(String connectionString
);
90 * Returns the database name for a given connection string. Null or empty string is returned if the
91 * connection string is invalid
92 * @param connectionString the connection string
93 * @return string representing the database
95 public abstract String
getDatabaseNameByConnectionString(String connectionString
);