Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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.
`org.apache.lucene.util.Version` | `getVersion()` Get the version for the Lucene configuration.
`boolean` | `hasExistingIndex(String workspaceName, String indexName)` Return whether the index with the given name already exists for the given workspace name.

Method Detail

### getVersion

    org.apache.lucene.util.Version getVersion()

  Get the version for the Lucene configuration.

  Returns:
    the version

### 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

### hasExistingIndex

    boolean hasExistingIndex(String workspaceName,
                             String indexName)
                             throws SearchEngineException

  Return whether the index with the given name already exists for the given workspace name.

  Parameters:
    `workspaceName` - the workspace name
    `indexName` - the name of the index to be created
  Returns:
    true if the directory and any related files exist, or false if the directory or index files do not exist
  Throws:
    `IllegalArgumentException` - if the workspace name is null
    `SearchEngineException` - if there is a problem creating the directory

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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