1   /*
2    *  Indexmanager.java
3    *
4    *  Copyright (c) 1998-2005, The University of Sheffield.
5    *
6    *  This file is part of GATE (see http://gate.ac.uk/), and is free
7    *  software, licenced under the GNU Library General Public License,
8    *  Version 2, June 1991 (in the distribution as file licence.html,
9    *  and also available at http://gate.ac.uk/gate/licence.html).
10   *
11   *  Rosen Marinov, 19/Apr/2002
12   *
13   */
14  
15  package gate.creole.ir;
16  
17  import java.util.List;
18  
19  import gate.Corpus;
20  
21  public interface IndexManager{
22  
23    /**
24     * Gets the corpus this index manages will index.
25     * @return a {@link gate.Corpus} value;
26     */
27    public Corpus getCorpus();
28  
29    /**
30     * Sets the corpus this index manages will index.
31     * @param corpus a {@link gate.Corpus} value;
32     */
33    public void setCorpus(Corpus corpus);
34  
35    /**
36     * Gets the index definition for this index manager.
37     * @return a {@link IndexDefinition} value.
38     */
39    public IndexDefinition getIndexDefinition();
40  
41    /**
42     * Sets the index definition for this index manager.
43     * @param indexDefinition a {@link IndexDefinition} value.
44     */
45    public void setIndexDefinition(IndexDefinition indexDefinition);
46  
47  
48    /** Creates index directory and indexing all
49     *  documents in the corpus. */
50    public void createIndex() throws IndexException;
51  
52    /** Optimize the existing index*/
53    public void optimizeIndex() throws IndexException;
54  
55    /** Delete all index files and directories in index location. */
56    public void deleteIndex() throws IndexException;
57  
58    /** Reindexing changed documents, removing removed documents and
59     *  add to the index new corpus documents. */
60    public void sync(List added, List removed, List changed) throws IndexException;
61  
62  
63  }