1 17 package org.alfresco.repo.search; 18 19 import org.alfresco.service.cmr.repository.ChildAssociationRef; 20 import org.alfresco.service.cmr.repository.NodeRef; 21 22 33 public class IndexerComponent implements Indexer 34 { 35 private IndexerAndSearcher indexerAndSearcherFactory; 36 37 public void setIndexerAndSearcherFactory(IndexerAndSearcher indexerAndSearcherFactory) 38 { 39 this.indexerAndSearcherFactory = indexerAndSearcherFactory; 40 } 41 42 public void createNode(ChildAssociationRef relationshipRef) 43 { 44 Indexer indexer = indexerAndSearcherFactory.getIndexer( 45 relationshipRef.getChildRef().getStoreRef()); 46 indexer.createNode(relationshipRef); 47 } 48 49 public void updateNode(NodeRef nodeRef) 50 { 51 Indexer indexer = indexerAndSearcherFactory.getIndexer(nodeRef.getStoreRef()); 52 indexer.updateNode(nodeRef); 53 } 54 55 public void deleteNode(ChildAssociationRef relationshipRef) 56 { 57 Indexer indexer = indexerAndSearcherFactory.getIndexer( 58 relationshipRef.getChildRef().getStoreRef()); 59 indexer.deleteNode(relationshipRef); 60 } 61 62 public void createChildRelationship(ChildAssociationRef relationshipRef) 63 { 64 Indexer indexer = indexerAndSearcherFactory.getIndexer( 65 relationshipRef.getChildRef().getStoreRef()); 66 indexer.createChildRelationship(relationshipRef); 67 } 68 69 public void updateChildRelationship(ChildAssociationRef relationshipBeforeRef, ChildAssociationRef relationshipAfterRef) 70 { 71 Indexer indexer = indexerAndSearcherFactory.getIndexer( 72 relationshipBeforeRef.getChildRef().getStoreRef()); 73 indexer.updateChildRelationship(relationshipBeforeRef, relationshipAfterRef); 74 } 75 76 public void deleteChildRelationship(ChildAssociationRef relationshipRef) 77 { 78 Indexer indexer = indexerAndSearcherFactory.getIndexer( 79 relationshipRef.getChildRef().getStoreRef()); 80 indexer.deleteChildRelationship(relationshipRef); 81 } 82 83 } 84 | Popular Tags |