org.wso2.carbon.registry.core.jdbc.dataaccess
Class JDBCDataAccessManager

java.lang.Object
  extended by org.wso2.carbon.registry.core.jdbc.dataaccess.JDBCDataAccessManager
All Implemented Interfaces:
DataAccessManager

public class JDBCDataAccessManager
extends Object
implements DataAccessManager

An implementation of DataAccessManager to access a back-end JDBC-based database.


Constructor Summary
JDBCDataAccessManager(DataBaseConfiguration dataBaseConfiguration)
          Creates a JDBC Data Access Manager from the given database configuration.
JDBCDataAccessManager(DataSource dataSource)
          Constructor accepting a JDBC data source.
 
Method Summary
static DataSource buildDataSource(DataBaseConfiguration config)
          Method to build a data source from a given database configuration.
 void createDatabase()
          Method to create the database for the registry.
 ClusterLock getClusterLock()
          Method to obtain an instance of the cluster lock.
 DAOManager getDAOManager()
          Method to obtain an instance of the data access object manager.
 DatabaseTransaction getDatabaseTransaction()
          Method to obtain an instance of the database transaction.
 DataSource getDataSource()
          Method to retrieve the JDBC data source.
 QueryProcessor getQueryProcessor()
          Method obtain an instance of the query processor used to run queries.
 TransactionManager getTransactionManager()
          Method to obtain an instance of the transaction manager.
 boolean isDatabaseExisting()
          Method to test whether the registry database is existing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDBCDataAccessManager

public JDBCDataAccessManager(DataSource dataSource)
Constructor accepting a JDBC data source.

Parameters:
dataSource - the JDBC data source.

JDBCDataAccessManager

public JDBCDataAccessManager(DataBaseConfiguration dataBaseConfiguration)
Creates a JDBC Data Access Manager from the given database configuration.

Parameters:
dataBaseConfiguration - the database configuration.
Method Detail

getClusterLock

public ClusterLock getClusterLock()
Description copied from interface: DataAccessManager
Method to obtain an instance of the cluster lock.

Specified by:
getClusterLock in interface DataAccessManager
Returns:
instance of the lock implementation.

getTransactionManager

public TransactionManager getTransactionManager()
Description copied from interface: DataAccessManager
Method to obtain an instance of the transaction manager.

Specified by:
getTransactionManager in interface DataAccessManager
Returns:
instance of the transaction manager implementation.

getDatabaseTransaction

public DatabaseTransaction getDatabaseTransaction()
Description copied from interface: DataAccessManager
Method to obtain an instance of the database transaction.

Specified by:
getDatabaseTransaction in interface DataAccessManager
Returns:
instance of the database transaction implementation.

getQueryProcessor

public QueryProcessor getQueryProcessor()
Description copied from interface: DataAccessManager
Method obtain an instance of the query processor used to run queries.

Specified by:
getQueryProcessor in interface DataAccessManager
Returns:
the query processor to execute sql queries.

getDAOManager

public DAOManager getDAOManager()
Description copied from interface: DataAccessManager
Method to obtain an instance of the data access object manager.

Specified by:
getDAOManager in interface DataAccessManager
Returns:
instance of the data access object manager implementation.

createDatabase

public void createDatabase()
                    throws RegistryException
Description copied from interface: DataAccessManager
Method to create the database for the registry.

Specified by:
createDatabase in interface DataAccessManager
Throws:
RegistryException - if the operation failed.

isDatabaseExisting

public boolean isDatabaseExisting()
Description copied from interface: DataAccessManager
Method to test whether the registry database is existing.

Specified by:
isDatabaseExisting in interface DataAccessManager
Returns:
true if the database is existing or false if not.

getDataSource

public DataSource getDataSource()
Method to retrieve the JDBC data source.

Returns:
the JDBC data source.

buildDataSource

public static DataSource buildDataSource(DataBaseConfiguration config)
Method to build a data source from a given database configuration.

Parameters:
config - the database configuration.
Returns:
the built data source.


Copyright © 2011 WSO2 Inc. All Rights Reserved.