Class | Line # | Actions | |||||
---|---|---|---|---|---|---|---|
DocumentIterator | 37 | 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.job; | |
21 | ||
22 | import java.util.Iterator; | |
23 | ||
24 | import org.apache.commons.lang3.tuple.Pair; | |
25 | import org.xwiki.component.annotation.Role; | |
26 | import org.xwiki.model.reference.DocumentReference; | |
27 | import org.xwiki.model.reference.EntityReference; | |
28 | ||
29 | /** | |
30 | * Iterates the documents from a store. | |
31 | * | |
32 | * @version $Id: f7249b9569656ed2393ab79eab99a5de1e47d96f $ | |
33 | * @param <T> the type of data used to determine if a document is up to date | |
34 | * @since 5.4.5 | |
35 | */ | |
36 | @Role | |
37 | public interface DocumentIterator<T> extends Iterator<Pair<DocumentReference, T>> | |
38 | { | |
39 | /** | |
40 | * Limit the iterator to the specified entity (e.g. a wiki or a space). If the passed reference is {@code null} (or | |
41 | * if you don't call this method) then all the documents from the underlying store are iterated. Otherwise, only the | |
42 | * documents that correspond to the specified entity are returned. | |
43 | * | |
44 | * @param rootReference specifies the root entity (e.g. a wiki or a space) whose documents should be iterated | |
45 | */ | |
46 | void setRootReference(EntityReference rootReference); | |
47 | ||
48 | /** | |
49 | * @return estimate the size of the iterated store for showing progress information | |
50 | */ | |
51 | long size(); | |
52 | } |