Class DefaultCachingStrategy

  • All Implemented Interfaces:
    CachingStrategy

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

      • singleCache

        private java.lang.Object singleCache
      • cache

        private java.util.Map<java.lang.String,​java.lang.Object> cache
    • Constructor Detail

      • DefaultCachingStrategy

        public DefaultCachingStrategy()
    • Method Detail

      • checkCache

        public boolean checkCache​(java.lang.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​(java.lang.String key,
                                  java.lang.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​(java.lang.String key,
                                   java.lang.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