public final class BlueprintsPersistenceBackendFactory extends AbstractPersistenceBackendFactory
BlueprintsPersistenceBackend
.
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 an in-memory TinkerGraph instance. Persistent back-ends
are created according to the provided resource options (see BlueprintsResourceOptions
and BlueprintsStoreOptions
). Default back-end configuration (store directory and graph type) is called dynamically
according to the provided Blueprints implementation InternalBlueprintsTgConfiguration
.
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. |
BlueprintsPersistenceBackend |
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, processGlobalConfiguration
public static final String NAME
@Nonnull public static PersistenceBackendFactory getInstance()
public String getName()
AbstractPersistenceBackendFactory
PersistenceBackend
.getName
in class AbstractPersistenceBackendFactory
PersistenceBackend
protected PersistentStore createSpecificPersistentStore(PersistentResource resource, PersistenceBackend backend, Map<?,?> options) throws InvalidDataStoreException
AbstractPersistenceBackendFactory
PersistentStore
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 AbstractPersistenceBackendFactory
resource
- 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()
PersistenceBackendFactory
PersistenceBackend
.public BlueprintsPersistenceBackend createPersistentBackend(File directory, Map<?,?> options) throws InvalidDataStoreException
PersistenceBackendFactory
PersistenceBackend
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)
PersistenceBackendFactory
resource
- the resourcebackend
- the back-endpublic void copyBackend(PersistenceBackend from, PersistenceBackend to)
PersistenceBackendFactory
PersistenceBackend
to another.from
- the back-end to copyto
- the destinationCopyright © 2013–2017 Atlanmod INRIA LINA Mines Nantes. All rights reserved.