org.wso2.carbon.identity.thrift.authentication.internal.persistance
Class ThriftAuthenticationJDBCPersistenceManager

java.lang.Object
  extended by org.wso2.carbon.identity.thrift.authentication.internal.persistance.ThriftAuthenticationJDBCPersistenceManager

public class ThriftAuthenticationJDBCPersistenceManager
extends Object

This class is used for handling authentication meta data persistence in the Thrift Authentication JDBC Store. During the server start-up, it checks whether the database is created, if not it creates one. It reads the data source properties from the thrift-authentication.xml. This is implemented as a singleton. An instance of this class can be obtained through ThriftAuthenticationJDBCPersistenceManager.getInstance() method.


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

Method Detail

getInstance

public static ThriftAuthenticationJDBCPersistenceManager getInstance()
                                                              throws AuthenticationException
Get an instance of the ThriftAuthenticationJDBCPersistenceManager. It implements a lazy initialization with double checked locking, because it is initialized first by identity.core module during the start up.

Returns:
ThriftAuthenticationJDBCPersistenceManager instance
Throws:
AuthenticationException - Error when reading the data source configurations

getDBConnection

public Connection getDBConnection()
                           throws AuthenticationException
Returns an database connection for Identity data source.

Returns:
Database connection
Throws:
AuthenticationException - Exception occurred when getting the data source.


Copyright © 2015 WSO2. All rights reserved.