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