KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > alfresco > repo > search > Indexer


1 /*
2  * Copyright (C) 2005 Alfresco, Inc.
3  *
4  * Licensed under the Mozilla Public License version 1.1
5  * with a permitted attribution clause. You may obtain a
6  * copy of the License at
7  *
8  * http://www.alfresco.org/legal/license.txt
9  *
10  * Unless required by applicable law or agreed to in writing,
11  * software distributed under the License is distributed on an
12  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
13  * either express or implied. See the License for the specific
14  * language governing permissions and limitations under the
15  * License.
16  */

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 /**
23  * This interface abstracts how indexing is used from within the node service
24  * implementation.
25  *
26  * It has to optionally offer transactional integration For example, the lucene
27  * indexer
28  *
29  * @author andyh
30  */

31
32 public interface Indexer
33 {
34     /**
35      * Create an index entry when a new node is created. A node is always
36      * created with a name in a given parent and so a relationship ref is
37      * required.
38      *
39      * @param relationshipRef
40      */

41     public void createNode(ChildAssociationRef relationshipRef);
42
43     /**
44      * Update an index entry due to property changes on a node. There are no
45      * strucural impications from such a change.
46      *
47      * @param nodeRef
48      */

49     public void updateNode(NodeRef nodeRef);
50
51     /**
52      * Delete a node entry from an index. This implies structural change. The
53      * node will be deleted from the index. This will also remove any remaining
54      * refernces to the node from the index. The index has no idea of the
55      * primary link.
56      *
57      * @param relationshipRef
58      */

59     public void deleteNode(ChildAssociationRef relationshipRef);
60
61     /**
62      * Create a refernce link between a parent and child. Implies only
63      * (potential) structural changes
64      *
65      * @param relationshipRef
66      */

67     public void createChildRelationship(ChildAssociationRef relationshipRef);
68
69     /**
70      * Alter the relationship between parent and child nodes in the index.
71      *
72      * This can be used for:
73      * <OL>
74      * <LI> rename,
75      * <LI> move,
76      * <LI> move and rename,
77      * <LI> replace
78      * </OL>
79      *
80      * This could be implemented as a delete and add but some implementations
81      * may be able to optimise this operation.
82      *
83      * @param relationshipBeforeRef
84      * @param relationshipAfterRef
85      */

86     public void updateChildRelationship(ChildAssociationRef relationshipBeforeRef, ChildAssociationRef relationshipAfterRef);
87
88     /**
89      * Delete a relationship between a parent and child.
90      *
91      * This will remove a structural route through the index. The index has no
92      * idea of reference and primary relationships and will happily remove the
93      * primary relationship before refernces which could remain.
94      *
95      * Use delete to ensure all strctural references are removed or call this
96      * sure you are doing an unlink (remove a hard link in the unix file system
97      * world).
98      *
99      * @param relationshipRef
100      */

101     public void deleteChildRelationship(ChildAssociationRef relationshipRef);
102     
103     
104
105 }
106
Popular Tags