public final class ReadOnlyModeAwareDataSource extends org.springframework.jdbc.datasource.DelegatingDataSource implements ReadOnlyModeCapable
DataSource implementation that prevents execution of queries
altering the database when read-only mode is enabled.| Constructor and Description |
|---|
ReadOnlyModeAwareDataSource(DataSource targetDataSource) |
| Modifier and Type | Method and Description |
|---|---|
Connection |
getConnection() |
Connection |
getConnection(String username,
String password) |
int |
getReadOnlyModePriority()
Get the priority of the service.
|
void |
switchReadOnlyMode(boolean enable)
Enable/disable read-only mode for a specific functional area this ReadOnlyModeCapable is responsible for.
|
public ReadOnlyModeAwareDataSource(DataSource targetDataSource)
public Connection getConnection() throws SQLException
getConnection in interface DataSourcegetConnection in class org.springframework.jdbc.datasource.DelegatingDataSourceSQLExceptionpublic Connection getConnection(String username, String password) throws SQLException
getConnection in interface DataSourcegetConnection in class org.springframework.jdbc.datasource.DelegatingDataSourceSQLExceptionpublic void switchReadOnlyMode(boolean enable)
ReadOnlyModeCapableswitchReadOnlyMode in interface ReadOnlyModeCapableenable - true in case the read-only mode should be enabled; false otherwisepublic int getReadOnlyModePriority()
ReadOnlyModeCapablegetReadOnlyModePriority in interface ReadOnlyModeCapableCopyright © 2004–2020 Jahia Solutions Group SA. All rights reserved.