Class PostgresReindexResourceDAO
- java.lang.Object
-
- org.linuxforhealth.fhir.persistence.jdbc.dao.impl.FHIRDbDAOImpl
-
- org.linuxforhealth.fhir.persistence.jdbc.dao.impl.ResourceDAOImpl
-
- org.linuxforhealth.fhir.persistence.jdbc.dao.ReindexResourceDAO
-
- org.linuxforhealth.fhir.persistence.jdbc.postgres.PostgresReindexResourceDAO
-
- All Implemented Interfaces:
FHIRDbDAO
,ResourceDAO
public class PostgresReindexResourceDAO extends ReindexResourceDAO
PostgreSQL specialization of the DAO used to assist the reindex custom operation
-
-
Field Summary
-
Fields inherited from class org.linuxforhealth.fhir.persistence.jdbc.dao.impl.ResourceDAOImpl
DEFAULT_VALUE_REINDEX_TSTAMP, IDX_DATA, IDX_IS_DELETED, IDX_LAST_UPDATED, IDX_LOGICAL_ID, IDX_LOGICAL_RESOURCE_ID, IDX_RESOURCE_ID, IDX_RESOURCE_PAYLOAD_KEY, IDX_RESOURCE_TYPE_ID, IDX_VERSION_ID
-
-
Constructor Summary
Constructors Constructor Description PostgresReindexResourceDAO(java.sql.Connection connection, IDatabaseTranslator translator, ParameterDAO parameterDao, java.lang.String schemaName, FHIRDbFlavor flavor, javax.transaction.TransactionSynchronizationRegistry trxSynchRegistry, FHIRPersistenceJDBCCache cache, ParameterTransactionDataImpl ptdi)
Public constructor for use in a JEE contextPostgresReindexResourceDAO(java.sql.Connection connection, IDatabaseTranslator translator, ParameterDAO parameterDao, java.lang.String schemaName, FHIRDbFlavor flavor, FHIRPersistenceJDBCCache cache)
Public constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
deleteResourceParameters(java.lang.String resourceTypeName, long logicalResourceId)
Delete all the parameter values for the given resourceType/logicalResourceIdResourceIndexRecord
getNextResource(java.security.SecureRandom random, java.time.Instant reindexTstamp, java.lang.Integer resourceTypeId, java.lang.String logicalId)
Pick the next resource to process, then also lock it.-
Methods inherited from class org.linuxforhealth.fhir.persistence.jdbc.dao.ReindexResourceDAO
getResource, getResourceToReindex, getTranslator, insert, lockLogicalResource, updateParameterHash, updateParameters
-
Methods inherited from class org.linuxforhealth.fhir.persistence.jdbc.dao.impl.ResourceDAOImpl
checkIfNoneMatch, createDTO, getCache, getResourceTypeId, getSearchByIdsNoDataSql, getSearchByIdsSql, getTransactionData, history, historyCount, read, readAllResourceTypeNames, readLogicalResourceId, readLogicalResourceIdList, readResourceTypeId, search, search, searchByIds, searchCount, searchCount, searchForIds, searchWholeSystem, setInt, setPersistenceContext, setString, versionRead
-
Methods inherited from class org.linuxforhealth.fhir.persistence.jdbc.dao.impl.FHIRDbDAOImpl
buildExceptionWithIssue, buildFHIRPersistenceDBConnectException, cleanup, cleanup, createDTOs, getConnection, getFlavor, getSchemaName, runCountQuery, runCountQuery, runQuery, runQuery, runQuery_STR_VALUES, severe, severe
-
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.linuxforhealth.fhir.persistence.jdbc.dao.api.FHIRDbDAO
getConnection, getFlavor
-
-
-
-
Constructor Detail
-
PostgresReindexResourceDAO
public PostgresReindexResourceDAO(java.sql.Connection connection, IDatabaseTranslator translator, ParameterDAO parameterDao, java.lang.String schemaName, FHIRDbFlavor flavor, FHIRPersistenceJDBCCache cache)
Public constructor- Parameters:
connection
-translator
-parameterDao
-schemaName
-flavor
-cache
-
-
PostgresReindexResourceDAO
public PostgresReindexResourceDAO(java.sql.Connection connection, IDatabaseTranslator translator, ParameterDAO parameterDao, java.lang.String schemaName, FHIRDbFlavor flavor, javax.transaction.TransactionSynchronizationRegistry trxSynchRegistry, FHIRPersistenceJDBCCache cache, ParameterTransactionDataImpl ptdi)
Public constructor for use in a JEE context- Parameters:
connection
-translator
-parameterDao
-schemaName
-flavor
-trxSynchRegistry
-cache
-
-
-
Method Detail
-
getNextResource
public ResourceIndexRecord getNextResource(java.security.SecureRandom random, java.time.Instant reindexTstamp, java.lang.Integer resourceTypeId, java.lang.String logicalId) throws java.lang.Exception
Description copied from class:ReindexResourceDAO
Pick the next resource to process, then also lock it. Specializations for different databases may use different techniques to optimize locking/concurrency control.- Overrides:
getNextResource
in classReindexResourceDAO
- Parameters:
random
- used to generate a random numberreindexTstamp
- only get resource with a reindex_tstamp less than thisresourceTypeId
- the resource type ID of a specific resource type, or nulllogicalId
- the resource ID of a specific resource, or null- Returns:
- the resource record, or null when there is nothing left to do
- Throws:
java.lang.Exception
-
deleteResourceParameters
protected void deleteResourceParameters(java.lang.String resourceTypeName, long logicalResourceId) throws java.sql.SQLException
Description copied from class:ReindexResourceDAO
Delete all the parameter values for the given resourceType/logicalResourceId- Overrides:
deleteResourceParameters
in classReindexResourceDAO
- Throws:
java.sql.SQLException
-
-