Package com.ibm.fhir.persistence.proxy
Class FHIRDebugXADataSource
- java.lang.Object
-
- com.ibm.fhir.persistence.proxy.FHIRDebugXADataSource
-
- All Implemented Interfaces:
CommonDataSource
,XADataSource
public class FHIRDebugXADataSource extends Object implements XADataSource
Wraps a Derby embedded datasource so we can debug connection handling issues by returning wrapped datasources (and wrapped connections)
-
-
Constructor Summary
Constructors Constructor Description FHIRDebugXADataSource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description XADataSource
getDelegate()
int
getLoginTimeout()
PrintWriter
getLogWriter()
Logger
getParentLogger()
XAConnection
getXAConnection()
XAConnection
getXAConnection(String tenantId, String dsId)
XADataSource
makeDelegate()
This function will return an XADataSource instance that is configured according to the connection properties associated with the FHIRRequestContext info found on thread-local.void
setLoginTimeout(int seconds)
void
setLogWriter(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
-
getLogWriter
public PrintWriter getLogWriter() throws SQLException
- Specified by:
getLogWriter
in interfaceCommonDataSource
- Specified by:
getLogWriter
in interfaceXADataSource
- Throws:
SQLException
-
setLogWriter
public void setLogWriter(PrintWriter out) throws SQLException
- Specified by:
setLogWriter
in interfaceCommonDataSource
- Specified by:
setLogWriter
in interfaceXADataSource
- Throws:
SQLException
-
setLoginTimeout
public void setLoginTimeout(int seconds) throws SQLException
- Specified by:
setLoginTimeout
in interfaceCommonDataSource
- Specified by:
setLoginTimeout
in interfaceXADataSource
- Throws:
SQLException
-
getLoginTimeout
public int getLoginTimeout() throws SQLException
- Specified by:
getLoginTimeout
in interfaceCommonDataSource
- Specified by:
getLoginTimeout
in interfaceXADataSource
- Throws:
SQLException
-
getParentLogger
public Logger getParentLogger() throws SQLFeatureNotSupportedException
- Specified by:
getParentLogger
in interfaceCommonDataSource
- Throws:
SQLFeatureNotSupportedException
-
getXAConnection
public XAConnection getXAConnection() throws SQLException
- Specified by:
getXAConnection
in interfaceXADataSource
- Throws:
SQLException
-
getXAConnection
public XAConnection getXAConnection(String tenantId, String dsId) throws SQLException
- Specified by:
getXAConnection
in interfaceXADataSource
- Throws:
SQLException
-
getDelegate
public XADataSource getDelegate() throws SQLException
- Throws:
SQLException
-
makeDelegate
public XADataSource makeDelegate() 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
-
-