Class JCRIndexingServiceImpl
- java.lang.Object
-
- org.exoplatform.services.jcr.ext.index.persistent.impl.JCRIndexingServiceImpl
-
- All Implemented Interfaces:
JCRIndexingService,org.picocontainer.Startable
public class JCRIndexingServiceImpl extends Object implements JCRIndexingService, org.picocontainer.Startable
-
-
Field Summary
Fields Modifier and Type Field Description static StringLAST_OPERATION_FILE_NAME
-
Constructor Summary
Constructors Constructor Description JCRIndexingServiceImpl(org.exoplatform.commons.persistence.impl.EntityManagerService entityManagerService, org.exoplatform.services.jcr.RepositoryService repositoryService, JCRIndexingQueueDAO indexingQueueDAO, org.exoplatform.container.xml.InitParams params)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapplyIndexChangesOnJCR(List<JCRIndexQueueEntity> indexingQueueEntities)Apply the changes coming from queue to JCR.voidapplyIndexChangesOnQueue(Set<String> removedNodes, Set<String> addedNodes, Set<String> parentRemovedNodes, Set<String> parentAddedNodes, String workspaceId)JCR Index Changes applied on JCR to propagate for other nodes through QueuevoidapplyIndexChangesOnQueue(org.exoplatform.services.jcr.impl.core.query.ChangesFilterListsWrapper changes, String workspaceId)JCR Index Changes applied on JCR to propagate for other nodes through QueueList<JCRIndexQueueEntity>findNextOperations(int offset, int batchNumber)StringgetLastExecutedOperation()intgetQueueProcessingPeriod()voidindex(String jcrUUID, String workspaceId, boolean parentChange)voidinit(org.exoplatform.services.jcr.impl.core.query.QueryHandler handler, org.exoplatform.services.jcr.config.QueryHandlerEntry config)Update Queue, JCR indexes and status file.voidpersistLastOperationId()voidpersistQueueOperations()voidprocessIndexingQueue()1/ Read from Queue
2/ Index in JCR
3/ Update Queue to mark operation as executed for this nodevoidreindex(String jcrUUID, String workspaceId, boolean parentChange)voidstart()voidstop()voidunindex(String jcrUUID, String workspaceId, boolean parentChange)voidunindexAll(String workspaceId)voidupdateQueueSwitchStatusInFile()
-
-
-
Field Detail
-
LAST_OPERATION_FILE_NAME
public static final String LAST_OPERATION_FILE_NAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
JCRIndexingServiceImpl
public JCRIndexingServiceImpl(org.exoplatform.commons.persistence.impl.EntityManagerService entityManagerService, org.exoplatform.services.jcr.RepositoryService repositoryService, JCRIndexingQueueDAO indexingQueueDAO, org.exoplatform.container.xml.InitParams params)
-
-
Method Detail
-
processIndexingQueue
public void processIndexingQueue() throws Exception1/ Read from Queue
2/ Index in JCR
3/ Update Queue to mark operation as executed for this node- Specified by:
processIndexingQueuein interfaceJCRIndexingService- Throws:
Exception
-
start
public void start()
- Specified by:
startin interfaceorg.picocontainer.Startable
-
stop
public void stop()
- Specified by:
stopin interfaceorg.picocontainer.Startable
-
applyIndexChangesOnQueue
public void applyIndexChangesOnQueue(org.exoplatform.services.jcr.impl.core.query.ChangesFilterListsWrapper changes, String workspaceId)JCR Index Changes applied on JCR to propagate for other nodes through Queue- Specified by:
applyIndexChangesOnQueuein interfaceJCRIndexingServiceworkspaceId- REPOSITORY_WORKSPACE
-
applyIndexChangesOnQueue
public void applyIndexChangesOnQueue(Set<String> removedNodes, Set<String> addedNodes, Set<String> parentRemovedNodes, Set<String> parentAddedNodes, String workspaceId)
Description copied from interface:JCRIndexingServiceJCR Index Changes applied on JCR to propagate for other nodes through Queue- Specified by:
applyIndexChangesOnQueuein interfaceJCRIndexingService- Parameters:
removedNodes- removed nodes JCR UUIDaddedNodes- added nodes JCR UUIDparentRemovedNodes- removed Parent JCR nodes UUIDparentAddedNodes- added Parent JCR nodes UUIDworkspaceId- REPOSITORY_WORKSPACE
-
init
public void init(org.exoplatform.services.jcr.impl.core.query.QueryHandler handler, org.exoplatform.services.jcr.config.QueryHandlerEntry config)Update Queue, JCR indexes and status file. Initialize JCR Indexing Service- Specified by:
initin interfaceJCRIndexingService
-
applyIndexChangesOnJCR
public void applyIndexChangesOnJCR(List<JCRIndexQueueEntity> indexingQueueEntities) throws Exception
Apply the changes coming from queue to JCR. The changes are identitifed by JCR UUID and Operation type.- Parameters:
indexingQueueEntities-ListofJCRIndexQueueEntityto index- Throws:
Exception- when an error happens while indexing the operation
-
findNextOperations
public List<JCRIndexQueueEntity> findNextOperations(int offset, int batchNumber)
-
unindexAll
public void unindexAll(String workspaceId)
-
updateQueueSwitchStatusInFile
public void updateQueueSwitchStatusInFile()
-
getLastExecutedOperation
public String getLastExecutedOperation()
-
getQueueProcessingPeriod
public int getQueueProcessingPeriod()
-
persistQueueOperations
public void persistQueueOperations()
-
persistLastOperationId
public void persistLastOperationId()
-
-