public interface DataSourceManager extends AutoCloseable
DataSource
s.Modifier and Type | Method and Description |
---|---|
boolean |
containsDataSource(String name) |
boolean |
deleteConfig(String name)
Deletes the configuration associated with the
name |
Optional<Database> |
getConfig(String name) |
default DataSource |
getDataSource(String name) |
<T extends DataSource> |
getDataSource(String name,
Class<T> clazz) |
List<DataSource> |
getDataSources() |
Page<DataSource> |
getDataSources(Pageable pageable) |
void |
saveConfig(Database config)
Saves the provided database
config . |
void |
startDataSource(String name)
Starts the data source associated with the
name |
void |
stopDataSource(String name)
Stops the data source associated with the
name |
void |
testConfig(Database config)
Tests whether this manager can create a connection to the provided
config |
close
<T extends DataSource> T getDataSource(String name, Class<T> clazz)
DataSource
associated with the name
.DatabaseException
- if the underlying manager can't construct a DataSource
from the
namedefault DataSource getDataSource(String name)
DataSource
associated with the name
.void saveConfig(Database config)
config
.IllegalStateException
- if a data source that matches the config name is runningboolean deleteConfig(String name)
name
IllegalStateException
- if a data source that matches the config name is runningvoid testConfig(Database config) throws DatabaseException
config
DatabaseException
- if this manager can't establish a connection using the config
Optional<Database> getConfig(String name)
name
boolean containsDataSource(String name)
name
void startDataSource(String name)
name
void stopDataSource(String name)
name
List<DataSource> getDataSources()
Page<DataSource> getDataSources(Pageable pageable)
Copyright © 2021. All rights reserved.