01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: *
17: */
18: package org.apache.lenya.cms.lucene;
19:
20: import org.apache.cocoon.components.search.IndexException;
21: import org.apache.lenya.cms.observation.RepositoryListener;
22: import org.apache.lenya.cms.publication.ResourceType;
23: import org.apache.lenya.cms.repository.Session;
24:
25: /**
26: * Index updater which updates the index when a document changes.
27: */
28: public interface IndexUpdater extends RepositoryListener {
29:
30: /**
31: * The service role.
32: */
33: String ROLE = IndexUpdater.class.getName();
34:
35: /**
36: * Adds a document to the index.
37: * @param session The session.
38: * @param resourceType The resource type.
39: * @param publicationId The publication ID.
40: * @param area The area.
41: * @param uuid The UUID.
42: * @param language The language.
43: * @throws IndexException if an error occurs.
44: */
45: void index(Session session, ResourceType resourceType,
46: String publicationId, String area, String uuid,
47: String language) throws IndexException;
48:
49: /**
50: * Deletes a document from the index.
51: * @param session The session.
52: * @param resourceType The resource type.
53: * @param publicationId The publication ID.
54: * @param area The area.
55: * @param uuid The UUID.
56: * @param language The language.
57: * @throws IndexException if an error occurs.
58: */
59: void delete(Session session, ResourceType resourceType,
60: String publicationId, String area, String uuid,
61: String language) throws IndexException;
62:
63: }
|