Class AbstractTransientStore
java.lang.Object
org.nuxeo.ecm.core.transientstore.AbstractTransientStore
- All Implemented Interfaces:
TransientStore
,TransientStoreProvider
- Direct Known Subclasses:
SimpleTransientStore
Base class for a
TransientStore
implementation.- Since:
- 7.2
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract long
decrementStorageSize
(long size) void
doGC()
Runs garbage collecting to delete the file system resources that are associated with entries that were removed.abstract boolean
Returnstrue
if an entry exists with the givenkey
.Gets the blobs associated with the entry with the givenkey
.protected String
getCachingDirName
(String key) protected long
getFilePathSize
(Path entry) protected String
abstract Serializable
getParameter
(String key, String parameter) Gets the value ofparameter
in the entry with the givenkey
.abstract Map<String,
Serializable> getParameters
(String key) Gets values of the parameters in the entry with the givenkey
.abstract long
Returns the size of the blobs associated with the entry with the givenkey
or-1
if entry does not exist.protected long
getSizeOfBlobs
(List<Blob> blobs) protected abstract long
incrementStorageSize
(long size) void
init
(TransientStoreConfig config) Initializes the store from the givenconfig
.abstract boolean
isCompleted
(String key) Returnstrue
if the entry with the givenkey
is ready.protected abstract void
Updates the total storage size and the storage size of the entry with the givenkey
according tosizeOfBlobs
and stores the blob information in this entry.void
Associates the givenblobs
with the entry with the givenkey
.abstract void
putParameter
(String key, String parameter, Serializable value) Setsparameter
tovalue
in the entry with the givenkey
.abstract void
putParameters
(String key, Map<String, Serializable> parameters) Putsparameters
in the entry with the givenkey
.abstract void
Informs the store that the entry with the givenkey
can be released if TTL or GC parameters require to do some cleanup.void
Removes entry with the givenkey
.void
Removes all entries from the store.protected abstract void
protected void
removeBlobs
(String key) protected abstract void
removeEntry
(String key) abstract void
setCompleted
(String key, boolean completed) Marks the entry with the givenkey
as ready.protected abstract void
setStorageSize
(long newSize) Sets the size of the disk storage in bytes.abstract void
shutdown()
Shuts down the store.storeBlobs
(String key, List<Blob> blobs) 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.transientstore.api.TransientStoreProvider
getStorageSize, keySet, keyStream
-
Field Details
-
config
-
cacheDir
-
-
Constructor Details
-
AbstractTransientStore
public AbstractTransientStore()
-
-
Method Details
-
init
Description copied from interface:TransientStoreProvider
Initializes the store from the givenconfig
.- Specified by:
init
in interfaceTransientStoreProvider
-
shutdown
public abstract void shutdown()Description copied from interface:TransientStoreProvider
Shuts down the store.- Specified by:
shutdown
in interfaceTransientStoreProvider
-
exists
Description copied from interface:TransientStore
Returnstrue
if an entry exists with the givenkey
.- Specified by:
exists
in interfaceTransientStore
-
putParameter
Description copied from interface:TransientStore
Setsparameter
tovalue
in the entry with the givenkey
.If entry does not exist a new entry is created. If
parameter
already exists in the entry it is overwritten.- Specified by:
putParameter
in interfaceTransientStore
-
getParameter
Description copied from interface:TransientStore
Gets the value ofparameter
in the entry with the givenkey
.Returns
null
if entry or parameter does not exist.- Specified by:
getParameter
in interfaceTransientStore
-
putParameters
Description copied from interface:TransientStore
Putsparameters
in the entry with the givenkey
. Overwrites any existing parameter in the entry.If entry does not exist a new entry is created.
- Specified by:
putParameters
in interfaceTransientStore
-
getParameters
Description copied from interface:TransientStore
Gets values of the parameters in the entry with the givenkey
.Returns
null
if entry does not exist.- Specified by:
getParameters
in interfaceTransientStore
-
getBlobs
Description copied from interface:TransientStore
Gets the blobs associated with the entry with the givenkey
.Returns
null
if entry does not exist.- Specified by:
getBlobs
in interfaceTransientStore
-
getSize
Description copied from interface:TransientStore
Returns the size of the blobs associated with the entry with the givenkey
or-1
if entry does not exist.- Specified by:
getSize
in interfaceTransientStore
-
isCompleted
Description copied from interface:TransientStore
Returnstrue
if the entry with the givenkey
is ready.- Specified by:
isCompleted
in interfaceTransientStore
-
setCompleted
Description copied from interface:TransientStore
Marks the entry with the givenkey
as ready.If entry does not exist a new entry is created.
- Specified by:
setCompleted
in interfaceTransientStore
-
release
Description copied from interface:TransientStore
Informs the store that the entry with the givenkey
can be released if TTL or GC parameters require to do some cleanup.Has no effect if entry does not exist.
- Specified by:
release
in interfaceTransientStore
-
persistBlobs
protected abstract void persistBlobs(String key, long sizeOfBlobs, List<Map<String, String>> blobInfos) Updates the total storage size and the storage size of the entry with the givenkey
according tosizeOfBlobs
and stores the blob information in this entry. -
setStorageSize
protected abstract void setStorageSize(long newSize) Sets the size of the disk storage in bytes. -
incrementStorageSize
protected abstract long incrementStorageSize(long size) -
decrementStorageSize
protected abstract long decrementStorageSize(long size) -
removeAllEntries
protected abstract void removeAllEntries() -
removeEntry
-
putBlobs
Description copied from interface:TransientStore
Associates the givenblobs
with the entry with the givenkey
.If entry does not exist a new entry is created.
- Specified by:
putBlobs
in interfaceTransientStore
-
storeBlobs
-
getCachingDirectory
-
getCachingDirName
-
getSizeOfBlobs
-
loadBlobs
-
doGC
public void doGC()Description copied from interface:TransientStoreProvider
Runs garbage collecting to delete the file system resources that are associated with entries that were removed.- Specified by:
doGC
in interfaceTransientStoreProvider
-
getKeyCachingDirName
-
getFilePathSize
-
remove
Description copied from interface:TransientStore
Removes entry with the givenkey
.Has no effect if entry does not exist.
- Specified by:
remove
in interfaceTransientStore
-
removeBlobs
-
removeAll
public void removeAll()Description copied from interface:TransientStoreProvider
Removes all entries from the store.- Specified by:
removeAll
in interfaceTransientStoreProvider
-
getCacheDir
-