Class FHIRDbConnectionStrategyBase
- java.lang.Object
- 
- org.linuxforhealth.fhir.persistence.jdbc.connection.FHIRDbConnectionStrategyBase
 
- 
- All Implemented Interfaces:
- FHIRDbConnectionStrategy,- QueryHints
 - Direct Known Subclasses:
- FHIRDbTenantDatasourceConnectionStrategy
 
 public abstract class FHIRDbConnectionStrategyBase extends java.lang.Object implements FHIRDbConnectionStrategy, QueryHints Common base for multi-tenant connection strategy implementations
- 
- 
Constructor SummaryConstructors Modifier Constructor Description protectedFHIRDbConnectionStrategyBase(javax.transaction.TransactionSynchronizationRegistry trxSyncRegistry, Action newConnectionAction)Protected constructor
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapplySearchOptimizerOptions(java.sql.Connection c, boolean isCompartment)Apply any optimizer options configured to improve search query performance See issue-1911 for details.protected voidconfigure(java.sql.Connection connection, java.lang.String tenantId, java.lang.String dsId)Check with the transaction sync registry to see if this is the first time we've worked with this connection in the current transaction.protected java.sql.ConnectiongetConnection(javax.sql.DataSource datasource, java.lang.String tenantId, java.lang.String dsId)Get a connection configured for the given tenant and datasourceIdFHIRDbFlavorgetFlavor()Get the flavor of the database we are working with to reveal its capabilitiesjava.lang.StringgetHintValue(java.lang.String hintProperty)Get the hint value from the configurationQueryHintsgetQueryHints()Append the given hint to FHIR search queries- 
Methods inherited from class java.lang.Objectclone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface org.linuxforhealth.fhir.persistence.jdbc.connection.FHIRDbConnectionStrategygetConnection
 
- 
 
- 
- 
- 
Constructor Detail- 
FHIRDbConnectionStrategyBaseprotected FHIRDbConnectionStrategyBase(javax.transaction.TransactionSynchronizationRegistry trxSyncRegistry, Action newConnectionAction) throws FHIRPersistenceDataAccessExceptionProtected constructor- Parameters:
- trxSyncRegistry- the transaction sync registry
- newConnectionAction- actions to apply when a connection is created
- Throws:
- FHIRPersistenceDataAccessException
 
 
- 
 - 
Method Detail- 
configureprotected void configure(java.sql.Connection connection, java.lang.String tenantId, java.lang.String dsId) throws FHIRPersistenceExceptionCheck with the transaction sync registry to see if this is the first time we've worked with this connection in the current transaction.- Parameters:
- connection- the new connection
- tenantId- the tenant to which the connection belongs
- dsId- the datasource in the tenant to which the connection belongs
- Throws:
- FHIRPersistenceException
 
 - 
getConnectionprotected java.sql.Connection getConnection(javax.sql.DataSource datasource, java.lang.String tenantId, java.lang.String dsId) throws java.sql.SQLException, FHIRPersistenceExceptionGet a connection configured for the given tenant and datasourceId- Parameters:
- datasource-
- tenantId-
- dsId-
- Returns:
- Throws:
- java.sql.SQLException
- FHIRPersistenceException
 
 - 
getFlavorpublic FHIRDbFlavor getFlavor() throws FHIRPersistenceDataAccessException Description copied from interface:FHIRDbConnectionStrategyGet the flavor of the database we are working with to reveal its capabilities- Specified by:
- getFlavorin interface- FHIRDbConnectionStrategy
- Returns:
- the datastore/source flavor from the FHIR configuration
- Throws:
- FHIRPersistenceDataAccessException- if there is an issue with the configuration
 
 - 
getHintValuepublic java.lang.String getHintValue(java.lang.String hintProperty) Description copied from interface:QueryHintsGet the hint value from the configuration- Specified by:
- getHintValuein interface- QueryHints
- Returns:
 
 - 
getQueryHintspublic QueryHints getQueryHints() Description copied from interface:FHIRDbConnectionStrategyAppend the given hint to FHIR search queries- Specified by:
- getQueryHintsin interface- FHIRDbConnectionStrategy
- Returns:
 
 - 
applySearchOptimizerOptionspublic void applySearchOptimizerOptions(java.sql.Connection c, boolean isCompartment)Description copied from interface:FHIRDbConnectionStrategyApply any optimizer options configured to improve search query performance See issue-1911 for details.- Specified by:
- applySearchOptimizerOptionsin interface- FHIRDbConnectionStrategy
- Parameters:
- c- the connection to be configured
- isCompartment- true if the query is a compartment-based search
 
 
- 
 
-