Package org.opensaml.storage.impl
Class MemoryStorageService
java.lang.Object
net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
net.shibboleth.utilities.java.support.component.AbstractIdentifiedInitializableComponent
net.shibboleth.utilities.java.support.component.AbstractIdentifiableInitializableComponent
org.opensaml.storage.AbstractStorageService
org.opensaml.storage.AbstractMapBackedStorageService
org.opensaml.storage.impl.MemoryStorageService
- All Implemented Interfaces:
Component
,DestructableComponent
,IdentifiableComponent
,IdentifiedComponent
,InitializableComponent
,StorageCapabilities
,StorageCapabilitiesEx
,StorageService
public class MemoryStorageService
extends AbstractMapBackedStorageService
implements StorageCapabilitiesEx
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 ReadWriteLock
A shared lock to synchronize access.private final org.slf4j.Logger
Class logger. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected void
protected TimerTask
Returns 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 ReadWriteLock
getLock()
Get the shared lock to synchronize access.boolean
Returns true iff the storage implementation manages data independent of a single server node.boolean
Returns true iff the storage implementation manages data independent of the client.Methods inherited from class org.opensaml.storage.AbstractMapBackedStorageService
create, delete, deleteContext, deleteImpl, deleteWithVersion, read, read, readImpl, reap, reapWithLock, setDirty, update, updateContextExpiration, updateExpiration, updateImpl, updateWithVersion
Methods 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, updateWithVersion
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractIdentifiableInitializableComponent
setId
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractIdentifiedInitializableComponent
getId
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, initialize, isDestroyed, isInitialized
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.shibboleth.utilities.java.support.component.IdentifiedComponent
getId
Methods inherited from interface org.opensaml.storage.StorageCapabilities
getContextSize, getKeySize, getValueSize
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
contextMap
@NonnullAfterInit @NonnullElements private Map<String,Map<String, contextMapMutableStorageRecord<?>>> 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:
isServerSide
in interfaceStorageCapabilitiesEx
- 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:
isClustered
in interfaceStorageCapabilitiesEx
- Returns:
- true iff the storage implementation manages data independent of a single server node
-
doInitialize
- Overrides:
doInitialize
in classAbstractStorageService
- Throws:
ComponentInitializationException
-
doDestroy
protected void doDestroy()- Overrides:
doDestroy
in classAbstractStorageService
-
getContextMap
@Nonnull @NonnullElements @Live protected Map<String,Map<String, getContextMap()MutableStorageRecord<?>>> 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:
getContextMap
in classAbstractMapBackedStorageService
- Returns:
- map of contexts to manipulate
-
getLock
Get the shared lock to synchronize access.- Specified by:
getLock
in classAbstractMapBackedStorageService
- Returns:
- shared lock
-
getCleanupTask
Returns a cleanup task function to schedule for background cleanup.The default implementation does not supply one.
- Overrides:
getCleanupTask
in classAbstractStorageService
- Returns:
- a task object, or null
-