public interface DirectoryProvider extends AutoCloseable
| Modifier and Type | Method and Description |
|---|---|
default void |
close()
Release any resource currently held by the
DirectoryProvider. |
DirectoryHolder |
createDirectory(DirectoryCreationContext context)
Creates a
DirectoryHolder for a given name, allocating internal resources (filesystem directories, ...)
as necessary. |
void |
initialize(DirectoryProviderInitializationContext context) |
void initialize(DirectoryProviderInitializationContext context)
context - The initialization context, giving access to configuration and environment.default void close()
DirectoryProvider.
Per-directory resources do not have to be released here,
as they will be released by calls to DirectoryHolder.close().
After this method has been called, the result of calling any other method on the same instance is undefined.
close in interface AutoCloseableRuntimeException - If an error occurs while releasing resources.DirectoryHolder createDirectory(DirectoryCreationContext context) throws IOException
DirectoryHolder for a given name, allocating internal resources (filesystem directories, ...)
as necessary.
The provided index names are raw and do not take into account the limitations of the internal representation
of indexes. If some characters cannot be used in a given DirectoryProvider,
this provider is expected to escape characters as necessary using an encoding scheme assigning
a unique representation to each index name,
so as to avoid two index names to be encoded into identical internal representations.
Lower-casing the index name, for example, is not an acceptable encoding scheme,
as two index names differing only in case could end up using the same directory.
context - The creation context, giving access to configuration and environment.IOException - If an error occurs while initializing the directory.Copyright © 2006-2019 Red Hat, Inc. and others. Licensed under the GNU Lesser General Public License (LGPL), version 2.1 or later.