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: */package org.apache.cocoon.components.search.components;
17:
18: import org.apache.avalon.framework.configuration.ConfigurationException;
19: import org.apache.cocoon.components.search.Index;
20: import org.apache.cocoon.components.search.IndexException;
21: import org.apache.excalibur.source.Source;
22:
23: /**
24: * Index Manager Class allow to register and access to a specific index
25: *
26: * @author Maisonneuve Nicolas
27: */
28: public interface IndexManager {
29:
30: public static final String ROLE = IndexManager.class.getName();
31:
32: /**
33: * Return all indexes
34: *
35: * @return Array of indexes
36: */
37: public Index[] getIndex() throws IndexException;
38:
39: /**
40: * Return the index with the id
41: *
42: * @param id
43: * the index ID
44: * @return l'index, null if no found
45: */
46: public Index getIndex(String id) throws IndexException;
47:
48: /**
49: * add a index in the indexmanager
50: *
51: * @param index
52: */
53: public void addIndex(Index index);
54:
55: /**
56: * remove a index
57: *
58: * @param id
59: * ID de l'index
60: */
61: public void remove(String id);
62:
63: /**
64: * Check if the index exist
65: *
66: * @param id
67: * ID de l'index
68: * @return true if the index exist
69: */
70: public boolean contains(String id);
71:
72: /**
73: * Adds indexes from the given configuration file to the index manager.
74: * @param confSource
75: * @throws ConfigurationException
76: */
77: public void addIndexes(Source confSource)
78: throws ConfigurationException;
79: }
|