01: /*
02: * Copyright 2004-2006 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16:
17: package org.compass.core.engine.subindex;
18:
19: import org.compass.core.Property;
20: import org.compass.core.engine.SearchEngineException;
21:
22: /**
23: * Reprensetns a set of sub indexes, and knows how to map a single sub index
24: * value from an alias and a set of {@link Property} ids.
25: * <p/>
26: * This allows to have different mappings from {@link org.compass.core.Resource}
27: * to a specific sub index.
28: *
29: * @author kimchy
30: */
31: public interface SubIndexHash {
32:
33: /**
34: * Returns all the sub indexes that {@link #mapSubIndex(String,org.compass.core.Property[])}
35: * might be generating.
36: */
37: String[] getSubIndexes();
38:
39: /**
40: * Copmutes a sub index based on the given alias and ids.
41: *
42: * @param alias The alias to compute the sub index by (optional)
43: * @param ids The set of ids to compute the sub index by (optional)
44: * @return The hashed sub index
45: * @throws SearchEngineException
46: */
47: String mapSubIndex(String alias, Property[] ids)
48: throws SearchEngineException;
49: }
|