org.olat.search.service.update
Class IndexUpdater

java.lang.Object
  extended by org.olat.search.service.update.IndexUpdater
All Implemented Interfaces:
java.lang.Runnable

public class IndexUpdater
extends java.lang.Object
implements java.lang.Runnable

The IndexUpdater thread controls the update of existing search index. The update thread could be disabled with config parameter 'updateInterval=0'.

Author:
Christian Guretzki

Constructor Summary
IndexUpdater(java.lang.String indexPath, long updateInterval)
           
 
Method Summary
 void addToIndex(org.apache.lucene.document.Document document)
          Add new or changed index document to update-queue.
 void deleteFromIndex(org.apache.lucene.document.Document document)
          Add index document to delete-queue.
 void run()
           
 void startUpdater()
          Start updater thread.
 void stopUpdater()
          Stop update thread asynchron.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IndexUpdater

public IndexUpdater(java.lang.String indexPath,
                    long updateInterval)
Parameters:
indexPath - Absolute file-path of existing index-directory which will be updated
updateInterval - Updater sleeps this time [ms] between running again.
Method Detail

addToIndex

public void addToIndex(org.apache.lucene.document.Document document)
Add new or changed index document to update-queue.

Parameters:
document - New or changed index document.

deleteFromIndex

public void deleteFromIndex(org.apache.lucene.document.Document document)
Add index document to delete-queue.

Parameters:
document - Delete this index document.

run

public void run()
Specified by:
run in interface java.lang.Runnable

startUpdater

public void startUpdater()
Start updater thread.


stopUpdater

public void stopUpdater()
Stop update thread asynchron.