Class | Line # | Actions | |||||
---|---|---|---|---|---|---|---|
SolrReferenceResolver | 33 | 0 | - | 0 | 0 |
1 | /* | |
2 | * See the NOTICE file distributed with this work for additional | |
3 | * information regarding copyright ownership. | |
4 | * | |
5 | * This is free software; you can redistribute it and/or modify it | |
6 | * under the terms of the GNU Lesser General Public License as | |
7 | * published by the Free Software Foundation; either version 2.1 of | |
8 | * the License, or (at your option) any later version. | |
9 | * | |
10 | * This software is distributed in the hope that it will be useful, | |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 | * Lesser General Public License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU Lesser General Public | |
16 | * License along with this software; if not, write to the Free | |
17 | * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | |
18 | * 02110-1301 USA, or see the FSF site: http://www.fsf.org. | |
19 | */ | |
20 | package org.xwiki.search.solr.internal.reference; | |
21 | ||
22 | import org.xwiki.component.annotation.Role; | |
23 | import org.xwiki.model.reference.EntityReference; | |
24 | import org.xwiki.search.solr.internal.api.SolrIndexerException; | |
25 | ||
26 | /** | |
27 | * Recursively retrieves the references for all the indexable entities contained by the given start entity. | |
28 | * | |
29 | * @version $Id: 93b2e5cfea6a6a8be38dfd9bb26cd71806456dd6 $ | |
30 | * @since 5.1M2 | |
31 | */ | |
32 | @Role | |
33 | public interface SolrReferenceResolver | |
34 | { | |
35 | /** | |
36 | * @param rootReference the root entity reference. | |
37 | * @return references for the indexable contained entities, including the given one (but only if it is indexable). | |
38 | * @throws SolrIndexerException if problems occur. | |
39 | */ | |
40 | Iterable<EntityReference> getReferences(EntityReference rootReference) throws SolrIndexerException; | |
41 | ||
42 | /** | |
43 | * @param reference reference to an entity. | |
44 | * @return the ID of the entity, as it is used in the index. | |
45 | * @throws SolrIndexerException if problems occur. | |
46 | * @throws IllegalArgumentException if the passed reference is not supported by the current implementation. | |
47 | */ | |
48 | String getId(EntityReference reference) throws SolrIndexerException, IllegalArgumentException; | |
49 | ||
50 | /** | |
51 | * @param reference reference to an entity. | |
52 | * @return the criteria to access this entity (and its children) | |
53 | * @throws SolrIndexerException when failing to generate query | |
54 | */ | |
55 | String getQuery(EntityReference reference) throws SolrIndexerException; | |
56 | } |