org.wso2.carbon.identity.application.common.persistence
Class JDBCPersistenceManager

java.lang.Object
  extended by org.wso2.carbon.identity.application.common.persistence.JDBCPersistenceManager

public class JDBCPersistenceManager
extends Object

This class is used for handling Identity Application Management data persistence in a JDBC Store. It reads the data source properties from the JNDI name given in application-authentication.xml. During the server start-up, it checks whether the database is created, if not it creates one. This is implemented as a singleton. An instance of this class can be obtained through JDBCPersistenceManager.getInstance() method.


Method Summary
 Connection getDBConnection()
          Returns a database connection for Identity Application Management data store.
static JDBCPersistenceManager getInstance()
          Get an instance of the JDBCPersistenceManager.
 void initializeDatabase()
          Get an instance of the JDBCPersistenceManager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static JDBCPersistenceManager getInstance()
                                          throws IdentityApplicationManagementException
Get an instance of the JDBCPersistenceManager. It implements a lazy initialization with double checked locking.

Returns:
JDBCPersistenceManager instance
Throws:
IdentityApplicationManagementException - Error when reading the data source configurations

initializeDatabase

public void initializeDatabase()
                        throws IdentityApplicationManagementException
Get an instance of the JDBCPersistenceManager. It implements a lazy initialization with double checked locking.

Throws:
IdentityApplicationManagementException - Error when initializing Identity Application Management data store

getDBConnection

public Connection getDBConnection()
                           throws IdentityApplicationManagementException
Returns a database connection for Identity Application Management data store.

Returns:
Database connection
Throws:
IdentityApplicationManagementException - Error when getting DB connection on the Identity Provider Management data source


Copyright © 2015 WSO2. All rights reserved.