org.modeshape.search.lucene
Interface LuceneConfiguration

All Known Implementing Classes:
LuceneConfigurations.FileSystemDirectoryFromNameFactory, LuceneConfigurations.PoolingDirectoryFactory, LuceneConfigurations.RamDirectoryFactory

@ThreadSafe
public interface LuceneConfiguration

Interface used to obtain the Lucene Directory instance that should be used for a workspace given the name of the workspace. There are several implementations (see LuceneConfigurations), but custom implementations can always be used.


Method Summary
 boolean destroyDirectory(String workspaceName, String indexName)
          Destroy the Directory that is used for the workspace with the supplied name.
 org.apache.lucene.store.Directory getDirectory(String workspaceName, String indexName)
          Get the Directory that should be used for the workspace with the supplied name.
 

Method Detail

getDirectory

org.apache.lucene.store.Directory getDirectory(String workspaceName,
                                               String indexName)
                                               throws SearchEngineException
Get the Directory that should be used for the workspace with the supplied name.

Parameters:
workspaceName - the workspace name
indexName - the name of the index to be created
Returns:
the directory; never null
Throws:
IllegalArgumentException - if the workspace name is null
SearchEngineException - if there is a problem creating the directory

destroyDirectory

boolean destroyDirectory(String workspaceName,
                         String indexName)
                         throws SearchEngineException
Destroy the Directory that is used for the workspace with the supplied name.

Parameters:
workspaceName - the workspace name
indexName - the name of the index to be created
Returns:
true if the directory existed and was destroyed, or false if the directory didn't exist
Throws:
IllegalArgumentException - if the workspace name is null
SearchEngineException - if there is a problem creating the directory


Copyright © 2008-2010 JBoss, a division of Red Hat. All Rights Reserved.