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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract longdecrementStorageSize(long size) voiddoGC()Runs garbage collecting to delete the file system resources that are associated with entries that were removed.abstract booleanReturnstrueif an entry exists with the givenkey.Gets the blobs associated with the entry with the givenkey.protected StringgetCachingDirName(String key) protected longgetFilePathSize(Path entry) protected Stringabstract SerializablegetParameter(String key, String parameter) Gets the value ofparameterin the entry with the givenkey.abstract Map<String,Serializable> getParameters(String key) Gets values of the parameters in the entry with the givenkey.abstract longReturns the size of the blobs associated with the entry with the givenkeyor-1if entry does not exist.protected longgetSizeOfBlobs(List<Blob> blobs) protected abstract longincrementStorageSize(long size) voidinit(TransientStoreConfig config) Initializes the store from the givenconfig.abstract booleanisCompleted(String key) Returnstrueif the entry with the givenkeyis ready.protected abstract voidUpdates the total storage size and the storage size of the entry with the givenkeyaccording tosizeOfBlobsand stores the blob information in this entry.voidAssociates the givenblobswith the entry with the givenkey.abstract voidputParameter(String key, String parameter, Serializable value) Setsparametertovaluein the entry with the givenkey.abstract voidputParameters(String key, Map<String, Serializable> parameters) Putsparametersin the entry with the givenkey.abstract voidInforms the store that the entry with the givenkeycan be released if TTL or GC parameters require to do some cleanup.voidRemoves entry with the givenkey.voidRemoves all entries from the store.protected abstract voidprotected voidremoveBlobs(String key) protected abstract voidremoveEntry(String key) abstract voidsetCompleted(String key, boolean completed) Marks the entry with the givenkeyas ready.protected abstract voidsetStorageSize(long newSize) Sets the size of the disk storage in bytes.abstract voidshutdown()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, waitMethods 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:TransientStoreProviderInitializes the store from the givenconfig.- Specified by:
initin interfaceTransientStoreProvider
-
shutdown
public abstract void shutdown()Description copied from interface:TransientStoreProviderShuts down the store.- Specified by:
shutdownin interfaceTransientStoreProvider
-
exists
Description copied from interface:TransientStoreReturnstrueif an entry exists with the givenkey.- Specified by:
existsin interfaceTransientStore
-
putParameter
Description copied from interface:TransientStoreSetsparametertovaluein the entry with the givenkey.If entry does not exist a new entry is created. If
parameteralready exists in the entry it is overwritten.- Specified by:
putParameterin interfaceTransientStore
-
getParameter
Description copied from interface:TransientStoreGets the value ofparameterin the entry with the givenkey.Returns
nullif entry or parameter does not exist.- Specified by:
getParameterin interfaceTransientStore
-
putParameters
Description copied from interface:TransientStorePutsparametersin the entry with the givenkey. Overwrites any existing parameter in the entry.If entry does not exist a new entry is created.
- Specified by:
putParametersin interfaceTransientStore
-
getParameters
Description copied from interface:TransientStoreGets values of the parameters in the entry with the givenkey.Returns
nullif entry does not exist.- Specified by:
getParametersin interfaceTransientStore
-
getBlobs
Description copied from interface:TransientStoreGets the blobs associated with the entry with the givenkey.Returns
nullif entry does not exist.- Specified by:
getBlobsin interfaceTransientStore
-
getSize
Description copied from interface:TransientStoreReturns the size of the blobs associated with the entry with the givenkeyor-1if entry does not exist.- Specified by:
getSizein interfaceTransientStore
-
isCompleted
Description copied from interface:TransientStoreReturnstrueif the entry with the givenkeyis ready.- Specified by:
isCompletedin interfaceTransientStore
-
setCompleted
Description copied from interface:TransientStoreMarks the entry with the givenkeyas ready.If entry does not exist a new entry is created.
- Specified by:
setCompletedin interfaceTransientStore
-
release
Description copied from interface:TransientStoreInforms the store that the entry with the givenkeycan be released if TTL or GC parameters require to do some cleanup.Has no effect if entry does not exist.
- Specified by:
releasein 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 givenkeyaccording tosizeOfBlobsand 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:TransientStoreAssociates the givenblobswith the entry with the givenkey.If entry does not exist a new entry is created.
- Specified by:
putBlobsin interfaceTransientStore
-
storeBlobs
-
getCachingDirectory
-
getCachingDirName
-
getSizeOfBlobs
-
loadBlobs
-
doGC
public void doGC()Description copied from interface:TransientStoreProviderRuns garbage collecting to delete the file system resources that are associated with entries that were removed.- Specified by:
doGCin interfaceTransientStoreProvider
-
getKeyCachingDirName
-
getFilePathSize
-
remove
Description copied from interface:TransientStoreRemoves entry with the givenkey.Has no effect if entry does not exist.
- Specified by:
removein interfaceTransientStore
-
removeBlobs
-
removeAll
public void removeAll()Description copied from interface:TransientStoreProviderRemoves all entries from the store.- Specified by:
removeAllin interfaceTransientStoreProvider
-
getCacheDir
-