Class DefaultCachingStrategy

java.lang.Object
de.iip_ecosphere.platform.connectors.DefaultCachingStrategy
All Implemented Interfaces:
CachingStrategy

public class DefaultCachingStrategy extends Object implements CachingStrategy
A default caching strategy.
Author:
Holger Eichelberger, SSE
  • Field Details

  • Constructor Details

    • DefaultCachingStrategy

      public DefaultCachingStrategy()
  • Method Details

    • setCacheMode

      public void setCacheMode(ConnectorParameter.CacheMode mode)
      Description copied from interface: CachingStrategy
      Defines the actual cache mode.
      Specified by:
      setCacheMode in interface CachingStrategy
      Parameters:
      mode - the actual cache mode
    • checkCache

      public boolean checkCache(Object data)
      Description copied from interface: CachingStrategy
      Checks the cache if configured.
      Specified by:
      checkCache in interface CachingStrategy
      Parameters:
      data - the data to send
      Returns:
      true for sending data, false for not sending data
    • checkCache

      public boolean checkCache(String key, Object data)
      Description copied from interface: CachingStrategy
      Checks a multi-cache if configured.
      Specified by:
      checkCache in interface CachingStrategy
      Parameters:
      key - a key into the cache
      data - the data to send
      Returns:
      true for sending data, false for not sending data
    • checkCache

      private boolean checkCache(String key, Object data, DefaultCachingStrategy.ConsideredSame same)
      Checks the cache.
      Parameters:
      key - the AAS id to consider caches for different AAS
      data - the data to send
      same - a functor checking the data
      Returns:
      true for sending data, false for not sending data
    • clearCache

      public void clearCache()
      Description copied from interface: CachingStrategy
      Clears the cache.
      Specified by:
      clearCache in interface CachingStrategy