Package com.ibm.fhir.persistence.proxy
Class FHIRProxyXADataSource
- java.lang.Object
 - 
- com.ibm.fhir.persistence.proxy.FHIRProxyXADataSource
 
 
- 
- All Implemented Interfaces:
 CommonDataSource,XADataSource
public class FHIRProxyXADataSource extends Object implements XADataSource
This class serves as a proxy for creating XA connections to databases according to a properties-based configuration. 
- 
- 
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFHIRProxyXADataSource.DataSourceCacheEntryInternal envelope for caching data source entries 
- 
Constructor Summary
Constructors Constructor Description FHIRProxyXADataSource() 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static FHIRProxyXADataSource.DataSourceCacheEntrycreateDataSourceCacheEntry(String dsId)Creates an appropriate datasource and its cache entry according to the properties associated with the specified datastore-idList<XADataSource>getCachedDataSources()This method returns a list of all the cached XADataSource instances held by this proxy datasource.static StringgetDataSourceImplClassnameForType(String type)Returns the XADataSource implementation classname associated with the specified type, or null if the type is not recognized.XADataSourcegetDelegate()This function will return an XADataSource instance that is configured according to the connection properties associated with the FHIRRequestContext info found on thread-local.intgetLoginTimeout()PrintWritergetLogWriter()LoggergetParentLogger()XAConnectiongetXAConnection()XAConnectiongetXAConnection(String tenantId, String dsId)voidsetLoginTimeout(int seconds)voidsetLogWriter(PrintWriter out)- 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 
- 
Methods inherited from interface javax.sql.CommonDataSource
createShardingKeyBuilder 
- 
Methods inherited from interface javax.sql.XADataSource
createXAConnectionBuilder 
 - 
 
 - 
 
- 
- 
Method Detail
- 
getCachedDataSources
public List<XADataSource> getCachedDataSources()
This method returns a list of all the cached XADataSource instances held by this proxy datasource. 
- 
getLogWriter
public PrintWriter getLogWriter() throws SQLException
- Specified by:
 getLogWriterin interfaceCommonDataSource- Specified by:
 getLogWriterin interfaceXADataSource- Throws:
 SQLException
 
- 
setLogWriter
public void setLogWriter(PrintWriter out) throws SQLException
- Specified by:
 setLogWriterin interfaceCommonDataSource- Specified by:
 setLogWriterin interfaceXADataSource- Throws:
 SQLException
 
- 
setLoginTimeout
public void setLoginTimeout(int seconds) throws SQLException- Specified by:
 setLoginTimeoutin interfaceCommonDataSource- Specified by:
 setLoginTimeoutin interfaceXADataSource- Throws:
 SQLException
 
- 
getLoginTimeout
public int getLoginTimeout() throws SQLException- Specified by:
 getLoginTimeoutin interfaceCommonDataSource- Specified by:
 getLoginTimeoutin interfaceXADataSource- Throws:
 SQLException
 
- 
getParentLogger
public Logger getParentLogger() throws SQLFeatureNotSupportedException
- Specified by:
 getParentLoggerin interfaceCommonDataSource- Throws:
 SQLFeatureNotSupportedException
 
- 
getXAConnection
public XAConnection getXAConnection() throws SQLException
- Specified by:
 getXAConnectionin interfaceXADataSource- Throws:
 SQLException
 
- 
getXAConnection
public XAConnection getXAConnection(String tenantId, String dsId) throws SQLException
- Specified by:
 getXAConnectionin interfaceXADataSource- Throws:
 SQLException
 
- 
getDelegate
public XADataSource getDelegate() throws SQLException
This function will return an XADataSource instance that is configured according to the connection properties associated with the FHIRRequestContext info found on thread-local. Note: this function is declared as public for testing purposes. Normally, this function is only called internally.- Throws:
 SQLException
 
- 
getDataSourceImplClassnameForType
public static String getDataSourceImplClassnameForType(String type)
Returns the XADataSource implementation classname associated with the specified type, or null if the type is not recognized.- Parameters:
 type- the datasource type (e.g. "db2", "derby", etc.)
 
- 
createDataSourceCacheEntry
public static FHIRProxyXADataSource.DataSourceCacheEntry createDataSourceCacheEntry(String dsId) throws Exception
Creates an appropriate datasource and its cache entry according to the properties associated with the specified datastore-id- Throws:
 Exception
 
 - 
 
 -