public final class MapDbPersistenceBackendFactory extends AbstractPersistenceBackendFactory
MapDbPersistenceBackend.
As other implementations of PersistenceBackendFactory, this class can create transient and persistent
databases. Persistent back-end creation can be configured using Resource.save(Map) and Resource.load(Map) option maps.
The factory handles transient back-ends by creating in-memory Map instances. Persistent back-ends are created
according to the provided resource options (MapDbStoreOptions).
| Modifier and Type | Field and Description |
|---|---|
static String |
NAME
The literal description of the factory.
|
BACKEND_PROPERTY, CONFIG_FILE| Modifier and Type | Method and Description |
|---|---|
void |
copyBackend(PersistenceBackend from,
PersistenceBackend to)
Copies the content from a
PersistenceBackend to another. |
PersistenceBackend |
createPersistentBackend(File directory,
Map<?,?> options)
Creates a
PersistenceBackend in the given directory. |
protected PersistentStore |
createSpecificPersistentStore(PersistentResource resource,
PersistenceBackend backend,
Map<?,?> options)
Creates a
PersistentStore between the given resource and the given backend
according to the given options. |
PersistenceBackend |
createTransientBackend()
Creates an in-memory
PersistenceBackend. |
PersistentStore |
createTransientStore(PersistentResource resource,
PersistenceBackend backend)
|
static PersistenceBackendFactory |
getInstance()
Returns the instance of this class.
|
String |
getName()
Returns the literal description of the created
PersistenceBackend. |
createPersistentStore, getStoreOptions, processGlobalConfigurationpublic static final String NAME
@Nonnull public static PersistenceBackendFactory getInstance()
public String getName()
AbstractPersistenceBackendFactoryPersistenceBackend.getName in class AbstractPersistenceBackendFactoryPersistenceBackendprotected PersistentStore createSpecificPersistentStore(PersistentResource resource, PersistenceBackend backend, Map<?,?> options) throws InvalidDataStoreException
AbstractPersistenceBackendFactoryPersistentStore between the given resource and the given backend
according to the given options.
The returned PersistentStore may be a succession of several PersistentStore.
Contrary to AbstractPersistenceBackendFactory.createPersistentStore(PersistentResource, PersistenceBackend, Map), this method is
associated to a specific PersistenceBackend, and called before creating global
PersistentStore.
createSpecificPersistentStore in class AbstractPersistenceBackendFactoryresource - the resourcebackend - the back-endoptions - the optionsInvalidDataStoreException - if there is at least one invalid value in options, or if an option is
missingpublic PersistenceBackend createTransientBackend()
PersistenceBackendFactoryPersistenceBackend.public PersistenceBackend createPersistentBackend(File directory, Map<?,?> options) throws InvalidDataStoreException
PersistenceBackendFactoryPersistenceBackend in the given directory.directory - the directoryoptions - the options that defines the behaviour of the back-endInvalidDataStoreException - the invalid datastore exceptionpublic PersistentStore createTransientStore(PersistentResource resource, PersistenceBackend backend)
PersistenceBackendFactoryresource - the resourcebackend - the back-endpublic void copyBackend(PersistenceBackend from, PersistenceBackend to)
PersistenceBackendFactoryPersistenceBackend to another.from - the back-end to copyto - the destinationCopyright © 2013–2017 Atlanmod INRIA LINA Mines Nantes. All rights reserved.