Interface DataSourceManager
-
public interface DataSourceManager
Service interface that wraps the Apache commons-dbcp. It allows consumers to retrieve a name dataSource.- Author:
- bramk
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_DATASOURCE_NAME
Default data source use by WebManager to connect to a database.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
exists(String dataSourceName)
String[]
getAllDataSourceNames()
String[]
getAllJDBCResources()
Returns all JDBC resources as provided by the application server via JNDI.String[]
getAllSpecifications()
DataSource
getDataSource()
Returns the default WebManager data source.DataSource
getDataSource(String dataSourceName)
String
getDatasourceType(String datasourceName)
Returns the datasource type for the datasource name.DataSourceProperties
getProperties(String name)
void
initialize()
Initializes the DataSourceManager.void
remove(String name)
void
setProperties(String name, DataSourceProperties properties)
-
-
-
Field Detail
-
DEFAULT_DATASOURCE_NAME
static final String DEFAULT_DATASOURCE_NAME
Default data source use by WebManager to connect to a database.- See Also:
- Constant Field Values
-
-
Method Detail
-
getAllSpecifications
String[] getAllSpecifications()
- Returns:
-
getAllDataSourceNames
String[] getAllDataSourceNames()
-
exists
boolean exists(String dataSourceName)
-
getDataSource
DataSource getDataSource(String dataSourceName) throws SQLException
- Throws:
SQLException
-
getProperties
DataSourceProperties getProperties(String name) throws SQLException
- Throws:
SQLException
-
remove
void remove(String name) throws SQLException
- Throws:
SQLException
-
setProperties
void setProperties(String name, DataSourceProperties properties) throws SQLException
- Throws:
SQLException
-
initialize
void initialize()
Initializes the DataSourceManager. The executed actions are implementation-specific.
-
getDatasourceType
String getDatasourceType(String datasourceName)
Returns the datasource type for the datasource name.- Parameters:
datasourceName
- the name of the datasource- Returns:
- The type of datasource
-
getAllJDBCResources
String[] getAllJDBCResources()
Returns all JDBC resources as provided by the application server via JNDI.- Returns:
- JNDI names of JDBC resources
-
getDataSource
DataSource getDataSource() throws SQLException
Returns the default WebManager data source.- Returns:
- the default WebManager data source
- Throws:
SQLException
- In case an SQL Exception occurs when retrieving the data source
-
-