org.alfresco.repo.search
Class IndexerComponent

java.lang.Object
  extended by org.springframework.extensions.surf.util.AbstractLifecycleBean
      extended by org.alfresco.repo.search.IndexerComponent
All Implemented Interfaces:
java.util.EventListener, Indexer, 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 IndexerComponent.indexerAndSearcherFactory Transactional support is free.

See Also:
Indexer

Field Summary
 
Fields inherited from class org.springframework.extensions.surf.util.AbstractLifecycleBean
log
 
Constructor Summary
IndexerComponent()
           
 
Method Summary
 void createChildRelationship(org.alfresco.service.cmr.repository.ChildAssociationRef relationshipRef)
          Create a refernce link between a parent and child.
 void createNode(org.alfresco.service.cmr.repository.ChildAssociationRef relationshipRef)
          Create an index entry when a new node is created.
 void deleteChildRelationship(org.alfresco.service.cmr.repository.ChildAssociationRef relationshipRef)
          Delete a relationship between a parent and child.
 void deleteIndex(org.alfresco.service.cmr.repository.StoreRef storeRef)
          Delete the index for a store
 void deleteNode(org.alfresco.service.cmr.repository.ChildAssociationRef relationshipRef)
          Delete a node entry from an index.
 void flushPending()
           
protected  void onBootstrap(org.springframework.context.ApplicationEvent event)
           
protected  void onShutdown(org.springframework.context.ApplicationEvent event)
           
 void setIndexerAndSearcherFactory(IndexerAndSearcher indexerAndSearcherFactory)
           
 void setReadThrough(boolean isReadThrough)
          Activates 'read through' behaviour for this indexer.
 void setStoreRedirectorProxyFactory(StoreRedirectorProxyFactory storeRedirectorProxyFactory)
           
 void updateChildRelationship(org.alfresco.service.cmr.repository.ChildAssociationRef relationshipBeforeRef, org.alfresco.service.cmr.repository.ChildAssociationRef relationshipAfterRef)
          Alter the relationship between parent and child nodes in the index.
 void updateNode(org.alfresco.service.cmr.repository.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, setApplicationContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IndexerComponent

public IndexerComponent()
Method Detail

setStoreRedirectorProxyFactory

public void setStoreRedirectorProxyFactory(StoreRedirectorProxyFactory storeRedirectorProxyFactory)

onBootstrap

protected void onBootstrap(org.springframework.context.ApplicationEvent event)
Specified by:
onBootstrap in class org.springframework.extensions.surf.util.AbstractLifecycleBean

onShutdown

protected void onShutdown(org.springframework.context.ApplicationEvent event)
Specified by:
onShutdown in class org.springframework.extensions.surf.util.AbstractLifecycleBean

setIndexerAndSearcherFactory

public void setIndexerAndSearcherFactory(IndexerAndSearcher indexerAndSearcherFactory)

setReadThrough

public void setReadThrough(boolean isReadThrough)
Description copied from interface: Indexer
Activates '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:
setReadThrough in interface Indexer

createNode

public void createNode(org.alfresco.service.cmr.repository.ChildAssociationRef relationshipRef)
Description copied from interface: Indexer
Create 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:
createNode in interface Indexer

updateNode

public void updateNode(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Description copied from interface: Indexer
Update an index entry due to property changes on a node. There are no strucural impications from such a change.

Specified by:
updateNode in interface Indexer

deleteNode

public void deleteNode(org.alfresco.service.cmr.repository.ChildAssociationRef relationshipRef)
Description copied from interface: Indexer
Delete 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:
deleteNode in interface Indexer

createChildRelationship

public void createChildRelationship(org.alfresco.service.cmr.repository.ChildAssociationRef relationshipRef)
Description copied from interface: Indexer
Create a refernce link between a parent and child. Implies only (potential) structural changes

Specified by:
createChildRelationship in interface Indexer

updateChildRelationship

public void updateChildRelationship(org.alfresco.service.cmr.repository.ChildAssociationRef relationshipBeforeRef,
                                    org.alfresco.service.cmr.repository.ChildAssociationRef relationshipAfterRef)
Description copied from interface: Indexer
Alter the relationship between parent and child nodes in the index. This can be used for:
  1. rename,
  2. move,
  3. move and rename,
  4. replace
This could be implemented as a delete and add but some implementations may be able to optimise this operation.

Specified by:
updateChildRelationship in interface Indexer

deleteChildRelationship

public void deleteChildRelationship(org.alfresco.service.cmr.repository.ChildAssociationRef relationshipRef)
Description copied from interface: Indexer
Delete 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:
deleteChildRelationship in interface Indexer

deleteIndex

public void deleteIndex(org.alfresco.service.cmr.repository.StoreRef storeRef)
Description copied from interface: Indexer
Delete the index for a store

Specified by:
deleteIndex in interface Indexer

flushPending

public void flushPending()
Specified by:
flushPending in interface Indexer


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.