public abstract class MapBasedDatabasePlatformSupport extends Object implements DatabasePlatformSupport
DatabasePlatformSupport interface. Sub classes must only provide map with
the database specific information. This class takes care of asserting and computing the returned information.| Constructor and Description |
|---|
MapBasedDatabasePlatformSupport() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract Map<DatabaseType,String> |
getAuthenticationInfo() |
String |
getDatabaseUrlForDatabase(DatabaseType databaseType,
String hostname,
int port,
String databaseName)
Constructs the URL for the database by using a
URI to construct the URL |
String |
getDriverClassNameForDatabase(DatabaseType databaseType)
Returns the driver class for the database platform.
|
protected abstract Map<DatabaseType,String> |
getDriverClassNameMappings()
Template method that must be implemented in order to retrieve all driver class names for every supported database
platform.
|
protected abstract Map<DatabaseType,String> |
getSchemeNames()
Template method that mus be implemented to get all scheme names for every supported database platform.
|
public String getDriverClassNameForDatabase(DatabaseType databaseType)
getDriverClassNameForDatabase in interface DatabasePlatformSupportdatabaseType - - The database type used to lookup the driver class name. Must not be nullIllegalArgumentException - if there is not driver class name available for the DatabaseTypepublic String getDatabaseUrlForDatabase(DatabaseType databaseType, String hostname, int port, String databaseName)
URI to construct the URLgetDatabaseUrlForDatabase in interface DatabasePlatformSupportdatabaseType - - The databaseType for which the URL should be constructed.hostname - - The hostname without any port information used to connect to.port - - The port used to connect to the databasedatabaseName - - The database name used to connect to. The usage is implementation specific (e.g. for Oracle this is the SID)IllegalArgumentException - if there is no scheme available for the database type or if the information is not valid to construct a URL.protected abstract Map<DatabaseType,String> getDriverClassNameMappings()
protected abstract Map<DatabaseType,String> getSchemeNames()
protected abstract Map<DatabaseType,String> getAuthenticationInfo()
Copyright © 2017 Pivotal Software, Inc.. All rights reserved.