org.xcmis.search.lucene.index
Class CacheableIndexDataManager

java.lang.Object
  extended by org.xcmis.search.lucene.index.LocalStorageIndexDataManager
      extended by org.xcmis.search.lucene.index.LocalIndexDataManagerProxy
          extended by org.xcmis.search.lucene.index.CacheableIndexDataManager
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:
TransactionableIndexDataManager

public class CacheableIndexDataManager
extends LocalIndexDataManagerProxy

Created by The eXo Platform SAS.

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

Constructor Summary
CacheableIndexDataManager(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()
           
 IndexTransactionModificationReport save(IndexTransaction<org.apache.lucene.document.Document> changes)
          Saves the IndexTransaction from this storage
 void stop()
          Dispose resources
 
Methods inherited from class org.xcmis.search.lucene.index.LocalStorageIndexDataManager
isStarted, isStoped, start
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CacheableIndexDataManager

public CacheableIndexDataManager(IndexConfiguration indexConfuguration)
                          throws IndexException,
                                 IndexConfigurationException
Throws:
IndexConfigurationException
IndexException
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
Overrides:
aggregate in class LocalStorageIndexDataManager
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>
Overrides:
getDirectory in class LocalStorageIndexDataManager
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>
Overrides:
getDirectorySize in class LocalStorageIndexDataManager
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>
Overrides:
getDocument in class LocalStorageIndexDataManager
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>
Overrides:
getDocumentCount in class LocalStorageIndexDataManager
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>
Overrides:
getIndexReader in class LocalStorageIndexDataManager
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>
Overrides:
getLastModifedTime in class LocalStorageIndexDataManager
Returns:
last modification time.

save

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

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

stop

public void stop()
Dispose resources

Specified by:
stop in interface StartableResource
Specified by:
stop in interface Startable
Overrides:
stop in class LocalStorageIndexDataManager


Copyright © 2003-2013 eXo Platform SAS. All Rights Reserved.