Class AbstractInMemoryIntegrationServiceCache<T extends Serializable>
java.lang.Object
se.idsec.signservice.integration.core.impl.AbstractIntegrationServiceCache<T>
se.idsec.signservice.integration.core.impl.AbstractInMemoryIntegrationServiceCache<T>
- Type Parameters:
T- the cached object type
- All Implemented Interfaces:
IntegrationServiceCache<T>
- Direct Known Subclasses:
InMemoryDocumentCache,InMemoryIntegrationServiceStateCache
public abstract class AbstractInMemoryIntegrationServiceCache<T extends Serializable>
extends AbstractIntegrationServiceCache<T>
Base class for an in-memory implementation of the
IntegrationServiceCache interface.- Author:
- Martin Lindström (martin@idsec.se), Stefan Santesson (stefan@idsec.se)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classClass representing the cache entry.Nested classes/interfaces inherited from class se.idsec.signservice.integration.core.impl.AbstractIntegrationServiceCache
AbstractIntegrationServiceCache.CacheEntry<T extends Serializable> -
Field Summary
Fields inherited from class se.idsec.signservice.integration.core.impl.AbstractIntegrationServiceCache
MAX_AGE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidUtility method that removes expired entries.protected AbstractIntegrationServiceCache.CacheEntry<T> getCacheEntry(String id) Gets the cache entry identified byid.protected voidputCacheObject(String id, T object, String ownerId, long expirationTime) Adds the supplied entry identified byidto the cache.protected voidRemoves the object identified byid.
-
Constructor Details
-
AbstractInMemoryIntegrationServiceCache
public AbstractInMemoryIntegrationServiceCache()
-
-
Method Details
-
getCacheEntry
Gets the cache entry identified byid.- Specified by:
getCacheEntryin classAbstractIntegrationServiceCache<T extends Serializable>- Parameters:
id- the ID- Returns:
- the entry or null
-
putCacheObject
Adds the supplied entry identified byidto the cache.- Specified by:
putCacheObjectin classAbstractIntegrationServiceCache<T extends Serializable>- Parameters:
id- the IDobject- the object to addownerId- the owner of the object (may be null)expirationTime- expiration time (in millis)
-
removeCacheObject
Removes the object identified byid.- Specified by:
removeCacheObjectin classAbstractIntegrationServiceCache<T extends Serializable>- Parameters:
id- the ID
-
clearExpired
public void clearExpired()Utility method that removes expired entries. Should be called by a scheduled task.
-