Class FHIRDbProxyDatasourceConnectionStrategy
- java.lang.Object
-
- com.ibm.fhir.persistence.jdbc.connection.FHIRDbConnectionStrategyBase
-
- com.ibm.fhir.persistence.jdbc.connection.FHIRDbProxyDatasourceConnectionStrategy
-
- All Implemented Interfaces:
FHIRDbConnectionStrategy
,QueryHints
public class FHIRDbProxyDatasourceConnectionStrategy extends FHIRDbConnectionStrategyBase
Hides the logic behind obtaining a JDBCConnection
from the DAO code. This strategy is used for configurations using the FHIR proxy datasource, which supports dynamic configurations of datasources without requiring the application server to restart.
-
-
Constructor Summary
Constructors Constructor Description FHIRDbProxyDatasourceConnectionStrategy(TransactionSynchronizationRegistry trxSyncRegistry, Action newConnectionAction)
Public constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Connection
getConnection()
Get a connection to the desired data source identified by the currentFHIRRequestContext
protected Connection
getConnection(DataSource datasource, String tenantId, String dsId)
Get a connection configured for the given tenant and datasourceId-
Methods inherited from class com.ibm.fhir.persistence.jdbc.connection.FHIRDbConnectionStrategyBase
configure, getFlavor, getHintValue, getQueryHints
-
-
-
-
Constructor Detail
-
FHIRDbProxyDatasourceConnectionStrategy
public FHIRDbProxyDatasourceConnectionStrategy(TransactionSynchronizationRegistry trxSyncRegistry, Action newConnectionAction) throws FHIRException
Public constructor. The proxy datasource must be present (registered in JNDI) at server startup.- Throws:
FHIRPersistenceDBConnectException
- if the proxy datasource is not configuredFHIRException
-
-
Method Detail
-
getConnection
public Connection getConnection() throws FHIRPersistenceDBConnectException
Description copied from interface:FHIRDbConnectionStrategy
Get a connection to the desired data source identified by the currentFHIRRequestContext
- Returns:
- a
Connection
. Never null. - Throws:
FHIRPersistenceDBConnectException
-
getConnection
protected Connection getConnection(DataSource datasource, String tenantId, String dsId) throws SQLException, FHIRPersistenceException
Description copied from class:FHIRDbConnectionStrategyBase
Get a connection configured for the given tenant and datasourceId- Overrides:
getConnection
in classFHIRDbConnectionStrategyBase
- Returns:
- Throws:
SQLException
FHIRPersistenceException
-
-