Class FHIRDbTenantDatasourceConnectionStrategy
- java.lang.Object
-
- com.ibm.fhir.persistence.jdbc.connection.FHIRDbConnectionStrategyBase
-
- com.ibm.fhir.persistence.jdbc.connection.FHIRDbTenantDatasourceConnectionStrategy
-
- All Implemented Interfaces:
FHIRDbConnectionStrategy
,QueryHints
public class FHIRDbTenantDatasourceConnectionStrategy extends FHIRDbConnectionStrategyBase
Hides the logic behind obtaining a JDBCConnection
from the DAO code. Uses datasource and tenant ids configured in the fhir-server-config to map directly to a managed datasource. All managed datasources must be available when the server starts. This differs from the proxy datasource strategyFHIRDbPropsConnectionStrategy
which supports dynamic (programmatic) definition of managed datasources.
-
-
Constructor Summary
Constructors Constructor Description FHIRDbTenantDatasourceConnectionStrategy(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
FHIRDbFlavor
getFlavor()
Get the flavor of the database we are working with to reveal its capabilities-
Methods inherited from class com.ibm.fhir.persistence.jdbc.connection.FHIRDbConnectionStrategyBase
configure, getConnection, getHintValue, getQueryHints
-
-
-
-
Constructor Detail
-
FHIRDbTenantDatasourceConnectionStrategy
public FHIRDbTenantDatasourceConnectionStrategy(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
-
getFlavor
public FHIRDbFlavor getFlavor() throws FHIRPersistenceDataAccessException
Description copied from interface:FHIRDbConnectionStrategy
Get the flavor of the database we are working with to reveal its capabilities- Specified by:
getFlavor
in interfaceFHIRDbConnectionStrategy
- Overrides:
getFlavor
in classFHIRDbConnectionStrategyBase
- Returns:
- the datastore/source flavor from the FHIR configuration
- Throws:
FHIRPersistenceDataAccessException
- if there is an issue with the configuration
-
-