org.gcube.portlets.user.tdw.server.datasource.jdbc
Class SimpleJDBCDataSourceFactory

java.lang.Object
  extended by org.gcube.portlets.user.tdw.server.datasource.jdbc.SimpleJDBCDataSourceFactory
All Implemented Interfaces:
DataSourceFactory

public class SimpleJDBCDataSourceFactory
extends Object
implements DataSourceFactory

Author:
"Federico De Faveri defaveri@isti.cnr.it"

Field Summary
protected  Map<String,JDBCCredential> credentials
           
protected  org.apache.log4j.Logger logger
           
 
Constructor Summary
SimpleJDBCDataSourceFactory()
           
 
Method Summary
 void closeDataSource(org.gcube.application.framework.core.session.ASLSession session, DataSource dataSource)
          Close the specified DataSource releasing allocated resources.
 Collection<JDBCCredential> getCredentials()
           
 String getId()
          The DataSourceFactory unique id.
 DataSource openDataSource(org.gcube.application.framework.core.session.ASLSession session, TableId tableId)
          Open the specified datasource DataSource.
 String registerTable(String jdbcdUrl, String tableName)
           
 String registerTable(String id, String jdbcdUrl, String tableName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected org.apache.log4j.Logger logger

credentials

protected Map<String,JDBCCredential> credentials
Constructor Detail

SimpleJDBCDataSourceFactory

public SimpleJDBCDataSourceFactory()
Method Detail

registerTable

public String registerTable(String id,
                            String jdbcdUrl,
                            String tableName)

registerTable

public String registerTable(String jdbcdUrl,
                            String tableName)

getCredentials

public Collection<JDBCCredential> getCredentials()

getId

public String getId()
The DataSourceFactory unique id.

Specified by:
getId in interface DataSourceFactory
Returns:

openDataSource

public DataSource openDataSource(org.gcube.application.framework.core.session.ASLSession session,
                                 TableId tableId)
                          throws DataSourceException
Open the specified datasource DataSource.

Specified by:
openDataSource in interface DataSourceFactory
tableId - the datasource id.
Returns:
the retrieved datasource.
Throws:
DataSourceException - if an error occurs retrieving the datasource.

closeDataSource

public void closeDataSource(org.gcube.application.framework.core.session.ASLSession session,
                            DataSource dataSource)
                     throws DataSourceException
Close the specified DataSource releasing allocated resources.

Specified by:
closeDataSource in interface DataSourceFactory
Throws:
DataSourceException


Copyright © 2013. All Rights Reserved.