Package org.opensaml.storage.impl
Class MemoryStorageService
- All Implemented Interfaces:
Component,DestructableComponent,IdentifiableComponent,IdentifiedComponent,InitializableComponent,EnumeratableStorageService,StorageCapabilities,StorageService
public class MemoryStorageService
extends AbstractMapBackedStorageService
implements StorageCapabilities
Implementation of
AbstractMapBackedStorageService that stores data in-memory in a shared data structure
with no persistence.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Map<String,Map<String, MutableStorageRecord<?>>> Map of contexts.private ReadWriteLockA shared lock to synchronize access.private final org.slf4j.LoggerClass logger. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected voidprotected TimerTaskReturns a cleanup task function to schedule for background cleanup.protected Map<String,Map<String, MutableStorageRecord<?>>> Get the map of contexts to manipulate during operations.protected ReadWriteLockgetLock()Get the shared lock to synchronize access.booleanReturns true iff the storage implementation manages data independent of a single server node.booleanReturns true iff the storage implementation manages data independent of the client.Methods inherited from class org.opensaml.storage.AbstractMapBackedStorageService
create, delete, deleteContext, deleteImpl, deleteWithVersion, getContextKeys, read, read, readImpl, reap, reapWithLock, setDirty, update, updateContextExpiration, updateExpiration, updateImpl, updateWithVersionMethods inherited from class org.opensaml.storage.AbstractStorageService
create, create, delete, deleteWithVersion, getCapabilities, getCleanupInterval, getCleanupTaskTimer, getContextSize, getKeySize, getValueSize, read, setCleanupInterval, setCleanupTaskTimer, setContextSize, setKeySize, setValueSize, update, update, updateExpiration, updateWithVersion, updateWithVersionMethods inherited from class net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
setIdMethods inherited from class net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
ensureId, getId, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentExceptionMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, initialize, isDestroyed, isInitializedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.shibboleth.shared.component.IdentifiedComponent
getIdMethods inherited from interface org.opensaml.storage.StorageCapabilities
getContextSize, getKeySize, getValueSizeMethods inherited from interface org.opensaml.storage.StorageService
create, create, delete, deleteWithVersion, getCapabilities, read, update, update, updateExpiration, updateWithVersion, updateWithVersion
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
contextMap
Map of contexts. -
lock
A shared lock to synchronize access.
-
-
Constructor Details
-
MemoryStorageService
public MemoryStorageService()
-
-
Method Details
-
isServerSide
public boolean isServerSide()Returns true iff the storage implementation manages data independent of the client.- Specified by:
isServerSidein interfaceStorageCapabilities- Returns:
- true iff the storage implementation manages data independent of the client
-
isClustered
public boolean isClustered()Returns true iff the storage implementation manages data independent of a single server node.- Specified by:
isClusteredin interfaceStorageCapabilities- Returns:
- true iff the storage implementation manages data independent of a single server node
-
doInitialize
- Overrides:
doInitializein classAbstractStorageService- Throws:
ComponentInitializationException
-
doDestroy
protected void doDestroy()- Overrides:
doDestroyin classAbstractStorageService
-
getContextMap
Get the map of contexts to manipulate during operations.This method is guaranteed to be called under cover the lock returned by {
AbstractMapBackedStorageService.getLock().- Specified by:
getContextMapin classAbstractMapBackedStorageService- Returns:
- map of contexts to manipulate
-
getLock
Get the shared lock to synchronize access.- Specified by:
getLockin classAbstractMapBackedStorageService- Returns:
- shared lock
-
getCleanupTask
Returns a cleanup task function to schedule for background cleanup.The default implementation does not supply one.
- Overrides:
getCleanupTaskin classAbstractStorageService- Returns:
- a task object, or null
-