org.crosswire.jsword.book.search.lucene
Class LuceneIndexManager

java.lang.Object
  extended by org.crosswire.jsword.book.search.lucene.LuceneIndexManager
All Implemented Interfaces:
IndexManager

public class LuceneIndexManager
extends Object
implements IndexManager

An implementation of IndexManager for Lucene indexes.

Distribution Licence:
JSword is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
The License is available on the internet here, or by writing to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
The copyright to this program is held by it's authors.

Version:
$Id: LuceneIndexManager.java,v 1.9 2005/03/22 12:40:03 dmsmith Exp $
Author:
Joe Walker [joe at eireneh dot com]
See Also:
Licence

Field Summary
private static String DIR_LUCENE
          The lucene search index directory
private static String DIR_SEGMENTS
          The segments directory
protected static Map INDEXES
          The created indexes
private static Logger log
          The log stream
 
Constructor Summary
LuceneIndexManager()
           
 
Method Summary
 void deleteIndex(Book book)
          Tidy up after yourself and remove all the files that make up any indexes you created.
 Index getIndex(Book book)
          Create a new Searcher.
protected  URL getStorageArea(Book book)
          Determine where an index should be stored
 void installDownloadedIndex(Book book, URL tempDest)
          We have downloaded a search index to a zip file.
 boolean isIndexed(Book book)
          Detects if index data has been stored for this Bible already
 void scheduleIndexCreation(Book book)
          Read from the given source version to generate ourselves.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INDEXES

protected static final Map INDEXES
The created indexes


DIR_SEGMENTS

private static final String DIR_SEGMENTS
The segments directory

See Also:
Constant Field Values

DIR_LUCENE

private static final String DIR_LUCENE
The lucene search index directory

See Also:
Constant Field Values

log

private static final Logger log
The log stream

Constructor Detail

LuceneIndexManager

public LuceneIndexManager()
Method Detail

isIndexed

public boolean isIndexed(Book book)
Description copied from interface: IndexManager
Detects if index data has been stored for this Bible already

Specified by:
isIndexed in interface IndexManager

getIndex

public Index getIndex(Book book)
               throws BookException
Description copied from interface: IndexManager
Create a new Searcher.

Specified by:
getIndex in interface IndexManager
Throws:
BookException

scheduleIndexCreation

public void scheduleIndexCreation(Book book)
Description copied from interface: IndexManager
Read from the given source version to generate ourselves. On completion of this method the index should be usable.

Specified by:
scheduleIndexCreation in interface IndexManager

installDownloadedIndex

public void installDownloadedIndex(Book book,
                                   URL tempDest)
                            throws BookException
Description copied from interface: IndexManager
We have downloaded a search index to a zip file. It should be installed from here.

Specified by:
installDownloadedIndex in interface IndexManager
Parameters:
book - The book that we downloaded an index for
tempDest - The URL of a zip file to install
Throws:
BookException

deleteIndex

public void deleteIndex(Book book)
                 throws BookException
Description copied from interface: IndexManager
Tidy up after yourself and remove all the files that make up any indexes you created.

Specified by:
deleteIndex in interface IndexManager
Throws:
BookException

getStorageArea

protected URL getStorageArea(Book book)
                      throws IOException
Determine where an index should be stored

Parameters:
book - The book to be indexed
Returns:
A URL to store stuff in
Throws:
IOException - If there is a problem in finding where to store stuff

Copyright ? 2003-2004