org.xcmis.search.lucene.index
Class LocalStorageIndexDataManager

java.lang.Object
  extended by org.xcmis.search.lucene.index.LocalStorageIndexDataManager
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, IndexAggregator, StartableResource, Startable
Direct Known Subclasses:
LocalIndexDataManagerProxy

public class LocalStorageIndexDataManager
extends Object
implements LuceneIndexDataManager, IndexAggregator, Startable

Created by The eXo Platform SAS.

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

Constructor Summary
LocalStorageIndexDataManager(IndexConfiguration indexConfuguration)
           
 
Method Summary
 IndexTransactionModificationReport aggregate(Collection<LuceneIndexDataManager> indexes)
          Saves the list of indexes.
 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

LocalStorageIndexDataManager

public LocalStorageIndexDataManager(IndexConfiguration indexConfuguration)
                             throws IndexException,
                                    IndexConfigurationException
Throws:
IndexConfigurationException
IndexException
IndexConfigurationException
Method Detail

aggregate

public IndexTransactionModificationReport aggregate(Collection<LuceneIndexDataManager> indexes)
                                             throws IndexException,
                                                    IndexTransactionException
Description copied from interface: IndexAggregator
Saves the list of indexes.

Specified by:
aggregate in interface IndexAggregator
Throws:
IndexException
IndexTransactionException

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,
                                               IndexTransactionException
Description copied from interface: IndexDataKeeper
Saves the IndexTransaction from this storage

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

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 © 2011 eXo Platform SAS. All Rights Reserved.