|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.modeshape.search.lucene.LuceneConfigurations.PoolingDirectoryFactory<org.apache.lucene.store.FSDirectory> org.modeshape.search.lucene.LuceneConfigurations.FileSystemDirectoryFromNameFactory
public static class LuceneConfigurations.FileSystemDirectoryFromNameFactory
A LuceneConfiguration
implementation that creates FSDirectory
instances for each workspace and index name.
This factory is created with a parent directory under which all workspace and index directories are created.
This uses the supplied encoders to translate the workspace and index names into valid directory names. By default, no encoding is performed, meaning that the workspace and index names are used explicitly as directory names. This default behavior, then, means that not all values of workspace names or index names will work. If you want to be sure that all workspace names work, supply an encoder for the workspace names. (Index names are currently such that they will always be valid directory names, but you can always supply an encoder if you'd like.)
Constructor Summary | |
---|---|
protected |
LuceneConfigurations.FileSystemDirectoryFromNameFactory(File parent)
Create 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. |
protected |
LuceneConfigurations.FileSystemDirectoryFromNameFactory(File parent,
org.apache.lucene.store.LockFactory lockFactory)
Create 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. |
protected |
LuceneConfigurations.FileSystemDirectoryFromNameFactory(File parent,
org.apache.lucene.store.LockFactory lockFactory,
TextEncoder workspaceNameEncoder,
TextEncoder indexNameEncoder)
Create 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. |
protected |
LuceneConfigurations.FileSystemDirectoryFromNameFactory(File parent,
TextEncoder workspaceNameEncoder,
TextEncoder indexNameEncoder)
Create 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. |
Method Summary | |
---|---|
protected org.apache.lucene.store.FSDirectory |
create(File directory,
org.apache.lucene.store.LockFactory lockFactory)
Override this method to define which subclass of FSDirectory should be created. |
protected org.apache.lucene.store.FSDirectory |
createDirectory(String workspaceName,
String indexName)
Method implemented by subclasses to create a new Directory implementation. |
protected boolean |
doDestroy(org.apache.lucene.store.FSDirectory directory)
|
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. |
Methods inherited from class org.modeshape.search.lucene.LuceneConfigurations.PoolingDirectoryFactory |
---|
destroyDirectory, getDirectory |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected LuceneConfigurations.FileSystemDirectoryFromNameFactory(File parent)
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.
parent
- the parent folder
IllegalArgumentException
- if the parent file is nullprotected LuceneConfigurations.FileSystemDirectoryFromNameFactory(File parent, org.apache.lucene.store.LockFactory lockFactory)
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.
parent
- the parent folderlockFactory
- the lock factory; may be null
IllegalArgumentException
- if the parent file is nullprotected LuceneConfigurations.FileSystemDirectoryFromNameFactory(File parent, TextEncoder workspaceNameEncoder, TextEncoder indexNameEncoder)
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.
parent
- the parent folderworkspaceNameEncoder
- the encoder that should be used for encoding the workspace name into a directory nameindexNameEncoder
- the encoder that should be used for encoding the index name into a directory name
IllegalArgumentException
- if the parent file is nullprotected LuceneConfigurations.FileSystemDirectoryFromNameFactory(File parent, org.apache.lucene.store.LockFactory lockFactory, TextEncoder workspaceNameEncoder, TextEncoder indexNameEncoder)
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.
parent
- the parent folderlockFactory
- the lock factory; may be nullworkspaceNameEncoder
- the encoder that should be used for encoding the workspace name into a directory nameindexNameEncoder
- the encoder that should be used for encoding the index name into a directory name
IllegalArgumentException
- if the parent file is nullMethod Detail |
---|
public org.apache.lucene.util.Version getVersion()
LuceneConfiguration.getVersion()
protected org.apache.lucene.store.FSDirectory createDirectory(String workspaceName, String indexName)
LuceneConfigurations.PoolingDirectoryFactory
createDirectory
in class LuceneConfigurations.PoolingDirectoryFactory<org.apache.lucene.store.FSDirectory>
workspaceName
- the name of the workspace for which the Directory
is to be created; never nullindexName
- the name of the index to be created
protected boolean doDestroy(org.apache.lucene.store.FSDirectory directory) throws SearchEngineException
doDestroy
in class LuceneConfigurations.PoolingDirectoryFactory<org.apache.lucene.store.FSDirectory>
SearchEngineException
LuceneConfigurations.PoolingDirectoryFactory.doDestroy(org.apache.lucene.store.Directory)
protected org.apache.lucene.store.FSDirectory create(File directory, org.apache.lucene.store.LockFactory lockFactory) throws IOException
FSDirectory
should be created.
directory
- the file system directory; never nulllockFactory
- the lock factory; may be null
FSDirectory
instance
IOException
- if there is a problem creating the FSDirectory instancepublic boolean hasExistingIndex(String workspaceName, String indexName) throws SearchEngineException
LuceneConfiguration
hasExistingIndex
in interface LuceneConfiguration
hasExistingIndex
in class LuceneConfigurations.PoolingDirectoryFactory<org.apache.lucene.store.FSDirectory>
workspaceName
- the workspace nameindexName
- the name of the index to be created
SearchEngineException
- if there is a problem creating the directory
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |