org.modeshape.search.lucene
Class LuceneConfigurations

java.lang.Object
  extended by org.modeshape.search.lucene.LuceneConfigurations

public class LuceneConfigurations
extends Object

A family of LuceneConfiguration implementations.


Nested Class Summary
static class LuceneConfigurations.FileSystemDirectoryFromNameFactory
          A LuceneConfiguration implementation that creates FSDirectory instances for each workspace and index name.
protected static class LuceneConfigurations.IndexId
           
protected static class LuceneConfigurations.PoolingDirectoryFactory<DirectoryType extends org.apache.lucene.store.Directory>
          A LuceneConfiguration implementation that creates Directory instances of the supplied type for each workspace and pools the results, ensuring that the same Directory instance is always returned for the same workspace name.
static class LuceneConfigurations.RamDirectoryFactory
          A LuceneConfiguration implementation that creates RAMDirectory instances for each workspace and index name.
 
Constructor Summary
LuceneConfigurations()
           
 
Method Summary
static LuceneConfiguration inMemory()
          Return a new LuceneConfiguration that creates in-memory directories.
static LuceneConfiguration using(File parent)
          Return a new LuceneConfiguration that creates FSDirectory instances mapped to folders under a parent folder, where the workspace name is used to create the workspace folder.
static LuceneConfiguration using(File parent, org.apache.lucene.store.LockFactory lockFactory)
          Return a new LuceneConfiguration that creates FSDirectory instances mapped to folders under a parent folder, where the workspace name is used to create the workspace folder.
static LuceneConfiguration using(File parent, org.apache.lucene.store.LockFactory lockFactory, TextEncoder workspaceNameEncoder, TextEncoder indexNameEncoder)
          Return a new LuceneConfiguration that creates FSDirectory instances mapped to folders under a parent folder, where the workspace name is used to create the workspace folder.
static LuceneConfiguration using(File parent, TextEncoder workspaceNameEncoder, TextEncoder indexNameEncoder)
          Return a new LuceneConfiguration that creates FSDirectory instances mapped to folders under a parent folder, where the workspace name is used to create the workspace folder.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LuceneConfigurations

public LuceneConfigurations()
Method Detail

inMemory

public static final LuceneConfiguration inMemory()
Return a new LuceneConfiguration that creates in-memory directories.

Returns:
the new directory configuration; never null

using

public static final LuceneConfiguration using(File parent)
Return a new LuceneConfiguration that creates FSDirectory instances mapped to folders under a parent folder, where the workspace name is used to create the workspace folder. Note that this has ramifications on the allowable workspace names.

Parameters:
parent - the parent folder
Returns:
the new directory configuration; never null
Throws:
IllegalArgumentException - if the parent file is null

using

public static final LuceneConfiguration using(File parent,
                                              org.apache.lucene.store.LockFactory lockFactory)
Return a new LuceneConfiguration that creates FSDirectory instances mapped to folders under a parent folder, where the workspace name is used to create the workspace folder. Note that this has ramifications on the allowable workspace names.

Parameters:
parent - the parent folder
lockFactory - the lock factory; may be null
Returns:
the new directory configuration; never null
Throws:
IllegalArgumentException - if the parent file is null

using

public static final LuceneConfiguration using(File parent,
                                              TextEncoder workspaceNameEncoder,
                                              TextEncoder indexNameEncoder)
Return a new LuceneConfiguration that creates FSDirectory instances mapped to folders under a parent folder, where the workspace name is used to create the workspace folder. Note that this has ramifications on the allowable workspace names.

Parameters:
parent - the parent folder
workspaceNameEncoder - the encoder that should be used for encoding the workspace name into a directory name
indexNameEncoder - the encoder that should be used for encoding the index name into a directory name
Returns:
the new directory configuration; never null
Throws:
IllegalArgumentException - if the parent file is null

using

public static final LuceneConfiguration using(File parent,
                                              org.apache.lucene.store.LockFactory lockFactory,
                                              TextEncoder workspaceNameEncoder,
                                              TextEncoder indexNameEncoder)
Return a new LuceneConfiguration that creates FSDirectory instances mapped to folders under a parent folder, where the workspace name is used to create the workspace folder. Note that this has ramifications on the allowable workspace names.

Parameters:
parent - the parent folder
lockFactory - the lock factory; may be null
workspaceNameEncoder - the encoder that should be used for encoding the workspace name into a directory name
indexNameEncoder - the encoder that should be used for encoding the index name into a directory name
Returns:
the new directory configuration; never null
Throws:
IllegalArgumentException - if the parent file is null


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