Package org.alfresco.repo.search
Class IndexerComponent
java.lang.Object
org.springframework.extensions.surf.util.AbstractLifecycleBean
org.alfresco.repo.search.IndexerComponent
- All Implemented Interfaces:
EventListener,Indexer,org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware,org.springframework.context.ApplicationListener
public class IndexerComponent
extends org.springframework.extensions.surf.util.AbstractLifecycleBean
implements Indexer
Component API for indexing. Delegates to the real index retrieved from the
indexerAndSearcherFactory
Transactional support is free.- Author:
- andyh
- See Also:
-
Field Summary
Fields inherited from class org.springframework.extensions.surf.util.AbstractLifecycleBean
log -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateChildRelationship(ChildAssociationRef relationshipRef) Create a refernce link between a parent and child.voidcreateNode(ChildAssociationRef relationshipRef) Create an index entry when a new node is created.voiddeleteChildRelationship(ChildAssociationRef relationshipRef) Delete a relationship between a parent and child.voiddeleteIndex(StoreRef storeRef) Delete the index for a storevoiddeleteNode(ChildAssociationRef relationshipRef) Delete a node entry from an index.voiddetectNodeChanges(NodeRef nodeRef, SearchService searcher, Collection<ChildAssociationRef> addedParents, Collection<ChildAssociationRef> deletedParents, Collection<ChildAssociationRef> createdNodes, Collection<NodeRef> updatedNodes) Does a database vs index comparison for the given created/updated/renamed/referenced nodeRef in order to determine the set of indexing operations requiredvoidprotected voidonBootstrap(org.springframework.context.ApplicationEvent event) protected voidonShutdown(org.springframework.context.ApplicationEvent event) voidsetIndexerAndSearcherFactory(IndexerAndSearcher indexerAndSearcherFactory) voidsetReadThrough(boolean isReadThrough) Activates 'read through' behaviour for this indexer.voidsetStoreRedirectorProxyFactory(StoreRedirectorProxyFactory<IndexerAndSearcher> storeRedirectorProxyFactory) voidupdateChildRelationship(ChildAssociationRef relationshipBeforeRef, ChildAssociationRef relationshipAfterRef) Alter the relationship between parent and child nodes in the index.voidupdateNode(NodeRef nodeRef) Update an index entry due to property changes on a node.Methods inherited from class org.springframework.extensions.surf.util.AbstractLifecycleBean
getApplicationContext, onApplicationEvent, setApplicationContextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.context.ApplicationListener
supportsAsyncExecution
-
Constructor Details
-
IndexerComponent
public IndexerComponent()
-
-
Method Details
-
setStoreRedirectorProxyFactory
public void setStoreRedirectorProxyFactory(StoreRedirectorProxyFactory<IndexerAndSearcher> storeRedirectorProxyFactory) -
onBootstrap
protected void onBootstrap(org.springframework.context.ApplicationEvent event) - Specified by:
onBootstrapin classorg.springframework.extensions.surf.util.AbstractLifecycleBean
-
onShutdown
protected void onShutdown(org.springframework.context.ApplicationEvent event) - Specified by:
onShutdownin classorg.springframework.extensions.surf.util.AbstractLifecycleBean
-
setIndexerAndSearcherFactory
-
setReadThrough
public void setReadThrough(boolean isReadThrough) Description copied from interface:IndexerActivates 'read through' behaviour for this indexer. Rather than accessing the database through the current (potentially old) transaction, it will use a discrete read only transaction for each node it indexes. This avoids 'stale' nodes building up in the caches during long reindex runs.- Specified by:
setReadThroughin interfaceIndexer- Parameters:
isReadThrough- boolean
-
createNode
Description copied from interface:IndexerCreate an index entry when a new node is created. A node is always created with a name in a given parent and so a relationship ref is required.- Specified by:
createNodein interfaceIndexer- Parameters:
relationshipRef- ChildAssociationRef
-
updateNode
Description copied from interface:IndexerUpdate an index entry due to property changes on a node. There are no strucural impications from such a change.- Specified by:
updateNodein interfaceIndexer- Parameters:
nodeRef- NodeRef
-
deleteNode
Description copied from interface:IndexerDelete a node entry from an index. This implies structural change. The node will be deleted from the index. This will also remove any remaining refernces to the node from the index. The index has no idea of the primary link.- Specified by:
deleteNodein interfaceIndexer- Parameters:
relationshipRef- ChildAssociationRef
-
createChildRelationship
Description copied from interface:IndexerCreate a refernce link between a parent and child. Implies only (potential) structural changes- Specified by:
createChildRelationshipin interfaceIndexer- Parameters:
relationshipRef- ChildAssociationRef
-
updateChildRelationship
public void updateChildRelationship(ChildAssociationRef relationshipBeforeRef, ChildAssociationRef relationshipAfterRef) Description copied from interface:IndexerAlter the relationship between parent and child nodes in the index. This can be used for:- rename,
- move,
- move and rename,
- replace
- Specified by:
updateChildRelationshipin interfaceIndexer- Parameters:
relationshipBeforeRef- ChildAssociationRefrelationshipAfterRef- ChildAssociationRef
-
deleteChildRelationship
Description copied from interface:IndexerDelete a relationship between a parent and child. This will remove a structural route through the index. The index has no idea of reference and primary relationships and will happily remove the primary relationship before refernces which could remain. Use delete to ensure all strctural references are removed or call this sure you are doing an unlink (remove a hard link in the unix file system world).- Specified by:
deleteChildRelationshipin interfaceIndexer- Parameters:
relationshipRef- ChildAssociationRef
-
detectNodeChanges
public void detectNodeChanges(NodeRef nodeRef, SearchService searcher, Collection<ChildAssociationRef> addedParents, Collection<ChildAssociationRef> deletedParents, Collection<ChildAssociationRef> createdNodes, Collection<NodeRef> updatedNodes) Description copied from interface:IndexerDoes a database vs index comparison for the given created/updated/renamed/referenced nodeRef in order to determine the set of indexing operations required- Specified by:
detectNodeChangesin interfaceIndexer- Parameters:
nodeRef- the nodeRef to processsearcher- searcher to query the indexesaddedParents- set to add new secondary parent associations todeletedParents- set to add removed secondary parent associations tocreatedNodes- set to add created nodes toupdatedNodes- set to add updated nodes to
-
deleteIndex
Description copied from interface:IndexerDelete the index for a store- Specified by:
deleteIndexin interfaceIndexer- Parameters:
storeRef- StoreRef
-
flushPending
public void flushPending()- Specified by:
flushPendingin interfaceIndexer
-