de.pangaea.metadataportal.config
Class VirtualIndexConfig

java.lang.Object
  extended by de.pangaea.metadataportal.config.IndexConfig
      extended by de.pangaea.metadataportal.config.VirtualIndexConfig

public class VirtualIndexConfig
extends IndexConfig

Configuration of a virtual lucene index. Such indexes can not be the target of a harvest operation. It is only a collection of SingleIndexConfig. It supplies methods to get some index access objects (IndexReader, Searcher) and status information. Because of that it is possible to use these virtual indexes for searching like one single index.

Author:
Uwe Schindler

Field Summary
 IndexConfig[] indexes
           
 
Fields inherited from class de.pangaea.metadataportal.config.IndexConfig
checked, displayName, id, indexReader, oldReaderRef, parent
 
Constructor Summary
VirtualIndexConfig(Config parent)
          Default constructor
 
Method Summary
 void addIndex(String v)
          Adds an index by its id to the configuration.
 void addIndexCollection(Collection<String> v)
          Adds indexes by id to the configuration.
 void check()
          Checks, if configuration is ok.
 IndexReader getSharedIndexReader()
          returns a shared, read-only IndexReader.
 boolean isIndexAvailable()
          checks, if index is available (a segment file is available)
 IndexReader newIndexReader()
          returns a new IndexReader.
 void reopenSharedIndex()
          reopens the shared index reader.
 void warmSharedIndexReader()
          called by SearchService to warm the shared index reader during webapp initialization
 
Methods inherited from class de.pangaea.metadataportal.config.IndexConfig
finalize, isSharedIndexCurrent, newSearcher, releaseOldSharedReader, replaceSharedIndexReader, setDisplayName, setId
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

indexes

public IndexConfig[] indexes
Constructor Detail

VirtualIndexConfig

public VirtualIndexConfig(Config parent)
Default constructor

Method Detail

addIndex

public void addIndex(String v)
Adds an index by its id to the configuration.


addIndexCollection

public void addIndexCollection(Collection<String> v)
Adds indexes by id to the configuration.


check

public void check()
           throws Exception
Description copied from class: IndexConfig
Checks, if configuration is ok. After calling this, you are not able to change anything in this instance.

Overrides:
check in class IndexConfig
Throws:
Exception

getSharedIndexReader

public IndexReader getSharedIndexReader()
                                 throws IOException
Description copied from class: IndexConfig
returns a shared, read-only IndexReader. This reader may not be closed by IndexReader.close().

Specified by:
getSharedIndexReader in class IndexConfig
Throws:
IOException

newIndexReader

public IndexReader newIndexReader()
                           throws IOException
Description copied from class: IndexConfig
returns a new IndexReader. This reader must be closed after using.

Specified by:
newIndexReader in class IndexConfig
Throws:
IOException

isIndexAvailable

public boolean isIndexAvailable()
                         throws IOException
Description copied from class: IndexConfig
checks, if index is available (a segment file is available)

Specified by:
isIndexAvailable in class IndexConfig
Throws:
IOException

reopenSharedIndex

public void reopenSharedIndex()
                       throws IOException
Description copied from class: IndexConfig
reopens the shared index reader.

Specified by:
reopenSharedIndex in class IndexConfig
Throws:
IOException

warmSharedIndexReader

public void warmSharedIndexReader()
                           throws IOException
Description copied from class: IndexConfig
called by SearchService to warm the shared index reader during webapp initialization

Specified by:
warmSharedIndexReader in class IndexConfig
Throws:
IOException


Copyright ©2007-2011 panFMP Developers c/o Uwe Schindler