org.xcmis.search.lucene.index
Class PersistedIndex

java.lang.Object
  extended by org.xcmis.search.lucene.index.PersistedIndex
All Implemented Interfaces:
IndexDataConsumer<org.apache.lucene.index.IndexReader,org.apache.lucene.document.Document,org.apache.lucene.store.Directory>, IndexDataKeeper<org.apache.lucene.document.Document>, IndexDataManager<org.apache.lucene.document.Document,org.apache.lucene.index.IndexReader,org.apache.lucene.store.Directory>, LuceneIndexDataManager, StartableResource, Startable

public class PersistedIndex
extends Object
implements LuceneIndexDataManager, Startable

Created by The eXo Platform SAS.

Version:
$Id: PersistedIndex.java 2 2010-02-04 17:21:49Z andrew00x $
Author:
Sergey Kabashnyuk

Constructor Summary
PersistedIndex(org.apache.lucene.store.Directory directory)
           
 
Method Summary
 org.apache.lucene.store.Directory getDirectory()
          
 long getDirectorySize(boolean includeInherited)
          
 org.apache.lucene.document.Document getDocument(String uuid)
          
 long getDocumentCount()
          
 org.apache.lucene.index.IndexReader getIndexReader()
          
 long getLastModifedTime()
          
 boolean isStarted()
          
 boolean isStoped()
          
 IndexTransactionModificationReport save(IndexTransaction<org.apache.lucene.document.Document> changes)
          Saves the IndexTransaction from this storage
 void start()
          Allocate resources
 void stop()
          Dispose resources
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PersistedIndex

public PersistedIndex(org.apache.lucene.store.Directory directory)
Method Detail

getDirectory

public org.apache.lucene.store.Directory getDirectory()
                                               throws IndexException

Specified by:
getDirectory in interface IndexDataConsumer<org.apache.lucene.index.IndexReader,org.apache.lucene.document.Document,org.apache.lucene.store.Directory>
Returns:
index reader.
Throws:
IndexException

getDirectorySize

public long getDirectorySize(boolean includeInherited)

Specified by:
getDirectorySize in interface IndexDataConsumer<org.apache.lucene.index.IndexReader,org.apache.lucene.document.Document,org.apache.lucene.store.Directory>
Returns:
size of index directory.

getDocument

public org.apache.lucene.document.Document getDocument(String uuid)
                                                throws IndexException

Specified by:
getDocument in interface IndexDataConsumer<org.apache.lucene.index.IndexReader,org.apache.lucene.document.Document,org.apache.lucene.store.Directory>
Returns:
document
Throws:
IndexException

getDocumentCount

public long getDocumentCount()

Specified by:
getDocumentCount in interface IndexDataConsumer<org.apache.lucene.index.IndexReader,org.apache.lucene.document.Document,org.apache.lucene.store.Directory>
Returns:
number of documents.

getIndexReader

public org.apache.lucene.index.IndexReader getIndexReader()
                                                   throws IndexException

Specified by:
getIndexReader in interface IndexDataConsumer<org.apache.lucene.index.IndexReader,org.apache.lucene.document.Document,org.apache.lucene.store.Directory>
Returns:
index reader.
Throws:
IndexException

getLastModifedTime

public long getLastModifedTime()

Specified by:
getLastModifedTime in interface IndexDataConsumer<org.apache.lucene.index.IndexReader,org.apache.lucene.document.Document,org.apache.lucene.store.Directory>
Returns:
last modification time.

isStarted

public boolean isStarted()

Specified by:
isStarted in interface StartableResource
Returns:
the isStarted

isStoped

public boolean isStoped()

Specified by:
isStoped in interface StartableResource
Returns:
the isStoped

save

public IndexTransactionModificationReport save(IndexTransaction<org.apache.lucene.document.Document> changes)
                                        throws IndexException
Saves the IndexTransaction from this storage

Specified by:
save in interface IndexDataKeeper<org.apache.lucene.document.Document>
Throws:
IndexException

start

public void start()
Allocate resources

Specified by:
start in interface StartableResource
Specified by:
start in interface Startable

stop

public void stop()
Dispose resources

Specified by:
stop in interface StartableResource
Specified by:
stop in interface Startable


Copyright © 2010 eXo Platform SAS. All Rights Reserved.