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 Type
    Method
    Description
    void
    Utility method that removes expired entries.
    get(String id, boolean remove, String requesterId)
    Gets an object from the cache.
    get(String id, String requesterId)
    Gets an object from the cache.
    void
    put(String id, T object, String ownerId)
    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 if
      requesterId - 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 ID
      remove - if set, the returned object is removed from the cache
      requesterId - 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

      void put(String id, T object, String ownerId)
      Adds an object to the cache.
      Parameters:
      id - the object ID
      object - the object to add
      ownerId - the owner identity (may be null)
    • remove

      void remove(String id)
      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.