net.sf.hajdbc
Interface DatabaseClusterMBean

All Known Subinterfaces:
CommonDataSourceDatabaseClusterMBean<D>, ConnectionPoolDataSourceDatabaseClusterMBean, DataSourceDatabaseClusterMBean, DriverDatabaseClusterMBean, XADataSourceDatabaseClusterMBean
All Known Implementing Classes:
AbstractDatabaseCluster, CommonDataSourceDatabaseCluster, ConnectionPoolDataSourceDatabaseCluster, DataSourceDatabaseCluster, DriverDatabaseCluster, XADataSourceDatabaseCluster

public interface DatabaseClusterMBean

Since:
1.0
Version:
$Revision: 2038 $
Author:
Paul Ferraro

Method Summary
 void activate(String databaseId)
          Synchronizes, using the default strategy, and reactivates the specified database.
 void activate(String databaseId, String syncId)
          Synchronizes, using the specified strategy, and reactivates the specified database.
 void addActivationListener(DatabaseActivationListener listener)
           
 void addDeactivationListener(DatabaseDeactivationListener listener)
           
 void addSynchronizationListener(SynchronizationListener listener)
           
 void deactivate(String databaseId)
          Deactivates the specified database.
 void flushMetaDataCache()
          Flushes this cluster's cache of DatabaseMetaData.
 Set<String> getActiveDatabases()
          Returns a collection of active databases in this cluster.
 String getDefaultSynchronizationStrategy()
          Returns the default synchronization strategy used by this cluster.
 Set<String> getInactiveDatabases()
          Returns a collection of inactive databases in this cluster.
 Set<String> getSynchronizationStrategies()
          Returns the set of synchronization strategies available to this cluster.
 URL getUrl()
          Returns the URL of the configuration file for this cluster.
 String getVersion()
          Return the current HA-JDBC version
 boolean isAlive(String databaseId)
          Determines whether or not the specified database is responsive
 void remove(String databaseId)
          Removes the specified database/DataSource from the cluster.
 void removeActivationListener(DatabaseActivationListener listener)
           
 void removeDeactivationListener(DatabaseDeactivationListener listener)
           
 void removeSynchronizationListener(SynchronizationListener listener)
           
 String toString()
          Provided so that mbean proxies will use mbean toString() implementation
 

Method Detail

isAlive

boolean isAlive(String databaseId)
Determines whether or not the specified database is responsive

Parameters:
databaseId - a database identifier
Returns:
true, if the database is alive, false otherwise
Throws:
IllegalArgumentException - if no database exists with the specified identifier.

deactivate

void deactivate(String databaseId)
Deactivates the specified database.

Parameters:
databaseId - a database identifier
Throws:
IllegalArgumentException - if no database exists with the specified identifier.
IllegalStateException - if mbean could not be re-registered using inactive database interface.

activate

void activate(String databaseId)
Synchronizes, using the default strategy, and reactivates the specified database.

Parameters:
databaseId - a database identifier
Throws:
IllegalArgumentException - if no database exists with the specified identifier.
IllegalStateException - if synchronization fails, or if mbean could not be re-registered using active database interface.

activate

void activate(String databaseId,
              String syncId)
Synchronizes, using the specified strategy, and reactivates the specified database.

Parameters:
databaseId - a database identifier
syncId - the class name of a synchronization strategy
Throws:
IllegalArgumentException - if no database exists with the specified identifier, or no synchronization strategy exists with the specified identifier.
IllegalStateException - if synchronization fails, or if mbean could not be re-registered using active database interface.

getActiveDatabases

Set<String> getActiveDatabases()
Returns a collection of active databases in this cluster.

Returns:
a list of database identifiers

getInactiveDatabases

Set<String> getInactiveDatabases()
Returns a collection of inactive databases in this cluster.

Returns:
a collection of database identifiers

getVersion

String getVersion()
Return the current HA-JDBC version

Returns:
the current version

remove

void remove(String databaseId)
Removes the specified database/DataSource from the cluster.

Parameters:
databaseId - a database identifier
Throws:
IllegalStateException - if database is still active, or if mbean unregistration fails.

flushMetaDataCache

void flushMetaDataCache()
Flushes this cluster's cache of DatabaseMetaData.


getSynchronizationStrategies

Set<String> getSynchronizationStrategies()
Returns the set of synchronization strategies available to this cluster.

Returns:
a set of synchronization strategy identifiers

getDefaultSynchronizationStrategy

String getDefaultSynchronizationStrategy()
Returns the default synchronization strategy used by this cluster.

Returns:
a synchronization strategy identifier

getUrl

URL getUrl()
Returns the URL of the configuration file for this cluster.

Returns:
a URL

toString

String toString()
Provided so that mbean proxies will use mbean toString() implementation

Overrides:
toString in class Object
Returns:
string representation of this cluster

addActivationListener

void addActivationListener(DatabaseActivationListener listener)

removeActivationListener

void removeActivationListener(DatabaseActivationListener listener)

addDeactivationListener

void addDeactivationListener(DatabaseDeactivationListener listener)

removeDeactivationListener

void removeDeactivationListener(DatabaseDeactivationListener listener)

addSynchronizationListener

void addSynchronizationListener(SynchronizationListener listener)

removeSynchronizationListener

void removeSynchronizationListener(SynchronizationListener listener)