de.pangaea.metadataportal.config
Class SingleIndexConfig

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

public class SingleIndexConfig
extends IndexConfig

Configuration of a real lucene index. Such indexes can be the target of a harvest operation.

Author:
Uwe Schindler

Field Summary
 Class<? extends Harvester> harvesterClass
           
 Properties harvesterProperties
           
 Templates xslt
           
 Map<QName,Object> xsltParams
           
 
Fields inherited from class de.pangaea.metadataportal.config.IndexConfig
checked, displayName, id, indexReader, oldReaderRef, parent
 
Constructor Summary
SingleIndexConfig(Config parent)
          Default constructor
 
Method Summary
 void addHarvesterProperty(String value)
          Deprecated. 
 void check()
          Checks, if configuration is ok.
protected  void finalize()
           
 String getFullIndexPath()
          Returns the local, expanded file system path to index.
 Directory getIndexDirectory()
          Returns the directory implementation, that contains the index.
 IndexReader getSharedIndexReader()
          returns a shared, read-only IndexReader.
 boolean isIndexAvailable()
          checks, if index is available (a segment file is available)
 IndexReader newIndexReader(boolean readOnly)
          returns a new IndexReader, optionally read-only.
 IndexWriter newIndexWriter(boolean create)
          Opens an IndexWriter for adding Documents to Index.
 void reopenSharedIndex()
          reopens the shared index reader.
 void setHarvesterClass(String v)
          Deprecated. 
 void setIndexDir(String v)
          Sets index directory (called from Digester on config load).
 void warmSharedIndexReader()
          called by SearchService to warm the shared index reader during webapp initialization
protected  void warmSharedIndexReader(IndexReader r)
          warms the shared index readers after reopen or when triggered
 
Methods inherited from class de.pangaea.metadataportal.config.IndexConfig
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

harvesterClass

public Class<? extends Harvester> harvesterClass

harvesterProperties

public final Properties harvesterProperties

xslt

public Templates xslt

xsltParams

public Map<QName,Object> xsltParams
Constructor Detail

SingleIndexConfig

public SingleIndexConfig(Config parent)
Default constructor

Method Detail

setIndexDir

public void setIndexDir(String v)
                 throws IOException
Sets index directory (called from Digester on config load).

Throws:
IOException

setHarvesterClass

@PublicForDigesterUse
@Deprecated
public void setHarvesterClass(String v)
                       throws ClassNotFoundException
Deprecated. 

Sets class name of harvester (called from Digester on config load).

Throws:
ClassNotFoundException

addHarvesterProperty

@PublicForDigesterUse
@Deprecated
public void addHarvesterProperty(String value)
Deprecated. 

Adds property for harvester (called from Digester on config load).


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

getFullIndexPath

public String getFullIndexPath()
                        throws IOException
Returns the local, expanded file system path to index.

Throws:
IOException

getIndexDirectory

public Directory getIndexDirectory()
                            throws IOException
Returns the directory implementation, that contains the index.

Throws:
IOException

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(boolean readOnly)
                           throws IOException
Description copied from class: IndexConfig
returns a new IndexReader, optionally read-only. This reader must be closed after using.

Specified by:
newIndexReader in class IndexConfig
Throws:
IOException

newIndexWriter

public IndexWriter newIndexWriter(boolean create)
                           throws IOException
Opens an IndexWriter for adding Documents to Index.

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

protected void warmSharedIndexReader(IndexReader r)
                              throws IOException
warms the shared index readers after reopen or when triggered

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

finalize

protected void finalize()
                 throws Throwable
Overrides:
finalize in class IndexConfig
Throws:
Throwable


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