Package org.molgenis.data.index
Class IndexActionRegisterServiceImpl
- java.lang.Object
-
- org.molgenis.data.index.IndexActionRegisterServiceImpl
-
- All Implemented Interfaces:
IndexActionRegisterService,TransactionInformation
@Component public class IndexActionRegisterServiceImpl extends Object implements TransactionInformation, IndexActionRegisterService
Registers changes made to an indexed repository that need to be fixed by indexing the relevant data.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddExcludedEntity(String entityFullName)Excludes an entity from being indexed.booleanforgetIndexActions(String transactionId)Removes all index actions registered for a transaction.Set<EntityKey>getDirtyEntities()Set<String>getDirtyRepositories()Set<String>getEntirelyDirtyRepositories()booleanisEntireRepositoryDirty(EntityType entityType)booleanisEntityDirty(EntityKey entityKey)booleanisRepositoryCompletelyClean(EntityType entityType)voidregister(EntityType entityType, Object entityId)Log and create locks for an add/update/delete operation on a RepositoryvoidstoreIndexActions(String transactionId)Stores the index actions in the repository.
-
-
-
Method Detail
-
addExcludedEntity
public void addExcludedEntity(String entityFullName)
Description copied from interface:IndexActionRegisterServiceExcludes an entity from being indexed.- Specified by:
addExcludedEntityin interfaceIndexActionRegisterService- Parameters:
entityFullName- fully qualified name of the entity to exclude
-
register
@Transactional public void register(EntityType entityType, Object entityId)
Description copied from interface:IndexActionRegisterServiceLog and create locks for an add/update/delete operation on a Repository- Specified by:
registerin interfaceIndexActionRegisterServiceentityId- the ID of the entity, may be null to indicate change to entire repository
-
storeIndexActions
public void storeIndexActions(String transactionId)
Description copied from interface:IndexActionRegisterServiceStores the index actions in the repository. Creates a ReindexActionJob to group them by. storeIndexActions uses a set as optimization to remove the double index actions before the index actions are stored in database.- Specified by:
storeIndexActionsin interfaceIndexActionRegisterService- Parameters:
transactionId- ID for the transaction the index actions were registered under
-
forgetIndexActions
public boolean forgetIndexActions(String transactionId)
Description copied from interface:IndexActionRegisterServiceRemoves all index actions registered for a transaction.- Specified by:
forgetIndexActionsin interfaceIndexActionRegisterService- Parameters:
transactionId- ID for the transaction the index actions were registered under- Returns:
- boolean indicating if any work was present
-
isEntityDirty
public boolean isEntityDirty(EntityKey entityKey)
- Specified by:
isEntityDirtyin interfaceTransactionInformation
-
isEntireRepositoryDirty
public boolean isEntireRepositoryDirty(EntityType entityType)
- Specified by:
isEntireRepositoryDirtyin interfaceTransactionInformation
-
isRepositoryCompletelyClean
public boolean isRepositoryCompletelyClean(EntityType entityType)
- Specified by:
isRepositoryCompletelyCleanin interfaceTransactionInformation
-
getDirtyEntities
public Set<EntityKey> getDirtyEntities()
- Specified by:
getDirtyEntitiesin interfaceTransactionInformation
-
getEntirelyDirtyRepositories
public Set<String> getEntirelyDirtyRepositories()
- Specified by:
getEntirelyDirtyRepositoriesin interfaceTransactionInformation
-
getDirtyRepositories
public Set<String> getDirtyRepositories()
- Specified by:
getDirtyRepositoriesin interfaceTransactionInformation
-
-