Interface IntegrationServiceCache<T extends Serializable>
- Type Parameters:
T
- the type of the cached objects
- All Known Subinterfaces:
DocumentCache
,IntegrationServiceStateCache
- All Known Implementing Classes:
AbstractInMemoryIntegrationServiceCache
,AbstractIntegrationServiceCache
,InMemoryDocumentCache
,InMemoryIntegrationServiceStateCache
public interface IntegrationServiceCache<T extends Serializable>
Generic cache interface for the SignService Integration Service.
- Author:
- Martin Lindström (martin@idsec.se), Stefan Santesson (stefan@idsec.se)
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Utility method that removes expired entries.Gets an object from the cache.Gets an object from the cache.void
Adds an object to the cache.void
Deletes an object having the given ID from the cache.
-
Method Details
-
get
T get(String id, String requesterId) throws se.idsec.signservice.integration.core.error.NoAccessException Gets an object from the cache.Corresponds to
get(id, false)
.- Parameters:
id
- the object ifrequesterId
- optional ID of the requesting actor- Returns:
- the object, or null if it does not exist
- Throws:
se.idsec.signservice.integration.core.error.NoAccessException
- if the owner of the cached object does not match the requester ID
-
get
T get(String id, boolean remove, String requesterId) throws se.idsec.signservice.integration.core.error.NoAccessException Gets an object from the cache.If the
remove
flag is set, the cached object is removed from the cache.- Parameters:
id
- the object IDremove
- if set, the returned object is removed from the cacherequesterId
- optional ID of the requesting actor- Returns:
- the object, or null if it does not exist
- Throws:
se.idsec.signservice.integration.core.error.NoAccessException
- if the owner of the cached object does not match the requester ID
-
put
Adds an object to the cache.- Parameters:
id
- the object IDobject
- the object to addownerId
- the owner identity (may be null)
-
remove
Deletes an object having the given ID from the cache.- Parameters:
id
- the object ID
-
clearExpired
void clearExpired()Utility method that removes expired entries. Should be called by a scheduled task.
-