D
- either java.sql.Driver or javax.sql.DataSourcepublic interface DatabaseCluster<D> extends Lifecycle
Modifier and Type | Method and Description |
---|---|
boolean |
activate(Database<D> database,
StateManager manager)
Activates the specified database
|
boolean |
deactivate(Database<D> database,
StateManager manager)
Deactivates the specified database
|
java.util.Map<java.lang.Boolean,java.util.List<Database<D>>> |
getAliveMap(java.util.Collection<Database<D>> databases)
Determines whether the specified databases are alive.
|
Balancer<D> |
getBalancer()
Returns the Balancer implementation used by this database cluster.
|
Database<D> |
getDatabase(java.lang.String id)
Returns the database identified by the specified id
|
DatabaseMetaDataCache |
getDatabaseMetaDataCache()
Returns a DatabaseMetaData cache.
|
Dialect |
getDialect()
Returns a dialect capable of returning database vendor specific values.
|
java.lang.String |
getId()
Returns the identifier of this cluster.
|
LockManager |
getLockManager()
Returns a LockManager capable of acquiring named read/write locks on the specific objects in this database cluster.
|
java.util.concurrent.ExecutorService |
getNonTransactionalExecutor()
Returns an executor service used to execute non-transactional database writes.
|
StateManager |
getStateManager()
Returns a StateManager for persisting database cluster state.
|
java.util.concurrent.ExecutorService |
getTransactionalExecutor()
Returns an executor service used to execute transactional database writes.
|
boolean |
isActive()
Indicates whether or not this cluster is active, i.e.
|
boolean |
isCurrentDateEvaluationEnabled()
Indicates whether or not non-deterministic CURRENT_DATE SQL functions will be evaluated to deterministic static values.
|
boolean |
isCurrentTimeEvaluationEnabled()
Indicates whether or not non-deterministic CURRENT_TIME functions will be evaluated to deterministic static values.
|
boolean |
isCurrentTimestampEvaluationEnabled()
Indicates whether or not non-deterministic CURRENT_TIMESTAMP functions will be evaluated to deterministic static values.
|
boolean |
isIdentityColumnDetectionEnabled()
Indicates whether or not identity column detection is enabled for this cluster.
|
boolean |
isRandEvaluationEnabled()
Indicates whether or not non-deterministic RAND() functions will be replaced by evaluated to static values.
|
boolean |
isSequenceDetectionEnabled()
Indicates whether or not sequence detection is enabled for this cluster.
|
void |
setLockManager(LockManager lockManager)
Sets the LockManager implementation capable of acquiring named read/write locks on the specific objects in this database cluster.
|
void |
setStateManager(StateManager stateManager)
Sets the StateManager implementation for persisting database cluster state.
|
java.lang.String getId()
boolean activate(Database<D> database, StateManager manager)
database
- a database descriptormanager
- a state managerboolean deactivate(Database<D> database, StateManager manager)
database
- a database descriptormanager
- a state managerDatabase<D> getDatabase(java.lang.String id)
id
- a database identifierjava.lang.IllegalArgumentException
- if no database exists with the specified identifierBalancer<D> getBalancer()
Balancer
java.util.concurrent.ExecutorService getTransactionalExecutor()
ExecutorService
java.util.concurrent.ExecutorService getNonTransactionalExecutor()
ExecutorService
Dialect getDialect()
Dialect
LockManager getLockManager()
void setLockManager(LockManager lockManager)
lockManager
- a lock managerStateManager getStateManager()
void setStateManager(StateManager stateManager)
stateManager
- a state managerDatabaseMetaDataCache getDatabaseMetaDataCache()
DatabaseMetaDataCache
implementationboolean isSequenceDetectionEnabled()
boolean isIdentityColumnDetectionEnabled()
boolean isCurrentDateEvaluationEnabled()
boolean isCurrentTimeEvaluationEnabled()
boolean isCurrentTimestampEvaluationEnabled()
boolean isRandEvaluationEnabled()
java.util.Map<java.lang.Boolean,java.util.List<Database<D>>> getAliveMap(java.util.Collection<Database<D>> databases)
databases
- a collection of database descriptorsboolean isActive()