Package org.nuxeo.ecm.core.storage.mem
Class MemRepository
java.lang.Object
org.nuxeo.ecm.core.storage.dbs.DBSRepositoryBase
org.nuxeo.ecm.core.storage.mem.MemRepository
- All Implemented Interfaces:
LockManager
,Repository
,DBSRepository
In-memory implementation of a
DBSRepository
.
Internally, the repository is a map from id to document object.
A document object is a JSON-like document stored as a Map recursively containing the data, see DBSDocument
for the description of the document.
- Since:
- 5.9.4
-
Nested Class Summary
Nested classes/interfaces inherited from class org.nuxeo.ecm.core.storage.dbs.DBSRepositoryBase
DBSRepositoryBase.BlobFinder, DBSRepositoryBase.IdType
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final String
The content of the repository, a map of document id -> object.Fields inherited from class org.nuxeo.ecm.core.storage.dbs.DBSRepositoryBase
blobKeysPaths, blobManager, capabilities, changeTokenEnabled, DEBUG_UUIDS, DISABLE_ECM_BLOB_KEYS, fulltextConfiguration, idType, lockManager, repositoryName, selfRegisteredLockManager, TYPE_ROOT, UUID_ZERO, UUID_ZERO_DEBUG
Fields inherited from interface org.nuxeo.ecm.core.model.Repository
CAPABILITY_QUERY_BLOB_KEYS, CAPABILITY_REPOSITORY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
Gets the allowed id types for this DBS repository.Gets a new connection to this repository.Gets the lock on a document.protected void
void
markReferencedBlobs
(BiConsumer<String, String> markerCallback) Marks the blobs in use by passing them to the provided callback (taking the blob key and the repository name).removeLock
(String id, String owner) Removes the lock from a document.Sets a lock on a document.void
shutdown()
boolean
Checks whether this repository supports transactions.void
Update repository capabilities after a migration.Methods inherited from class org.nuxeo.ecm.core.storage.dbs.DBSRepositoryBase
getBlobKeysPaths, getBlobManager, getCapability, getFulltextConfiguration, getIdType, getLockManager, getLockManagerName, getName, getSession, initBlobsPaths, initLockManager, isChangeTokenEnabled, isFulltextDisabled, isFulltextSearchDisabled, isFulltextStoredInBlob
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.nuxeo.ecm.core.api.lock.LockManager
clearLockManagerCaches, closeLockManager
Methods inherited from interface org.nuxeo.ecm.core.model.Repository
getActiveSessionsCount, hasCapability
-
Field Details
-
NOSCROLL_ID
- See Also:
-
states
The content of the repository, a map of document id -> object.
-
-
Constructor Details
-
MemRepository
-
-
Method Details
-
getAllowedIdTypes
Description copied from class:DBSRepositoryBase
Gets the allowed id types for this DBS repository. The first one is the default.- Specified by:
getAllowedIdTypes
in classDBSRepositoryBase
-
shutdown
public void shutdown()- Specified by:
shutdown
in interfaceRepository
- Overrides:
shutdown
in classDBSRepositoryBase
-
initRepository
protected void initRepository() -
generateNewId
-
supportsTransactions
public boolean supportsTransactions()Description copied from interface:DBSRepository
Checks whether this repository supports transactions.- Returns:
true
if the repository supports transactions- See Also:
-
getConnection
Description copied from interface:DBSRepository
Gets a new connection to this repository.- Returns:
- a new connection
-
getLock
Description copied from interface:LockManager
Gets the lock on a document.If the document does not exist,
null
is returned.- Specified by:
getLock
in interfaceLockManager
- Overrides:
getLock
in classDBSRepositoryBase
- Parameters:
id
- the document id- Returns:
- the existing lock, or
null
when there is no lock
-
setLock
Description copied from interface:LockManager
Sets a lock on a document.If the document is already locked, returns its existing lock status (there is no re-locking,
LockManager.removeLock(java.lang.String, java.lang.String)
must be called first).- Specified by:
setLock
in interfaceLockManager
- Overrides:
setLock
in classDBSRepositoryBase
- Parameters:
id
- the document idlock
- the lock to set- Returns:
null
if locking succeeded, or the existing lock if locking failed
-
removeLock
Description copied from interface:LockManager
Removes the lock from a document.The previous lock is returned.
If
owner
isnull
then the lock is unconditionally removed.If
owner
is notnull
, it must match the existing lock owner for the lock to be removed. If it doesn't match, the returned lock will returntrue
forLock.getFailed()
.- Specified by:
removeLock
in interfaceLockManager
- Overrides:
removeLock
in classDBSRepositoryBase
- Parameters:
id
- the document idowner
- the owner to check, ornull
for no check- Returns:
- the previous lock (may be
null
), with a failed flag if locking failed
-
markReferencedBlobs
Description copied from interface:Repository
Marks the blobs in use by passing them to the provided callback (taking the blob key and the repository name). -
updateCapabilities
public void updateCapabilities()Description copied from interface:DBSRepository
Update repository capabilities after a migration. Internal use only.
-