Class TransformCache

java.lang.Object
net.sf.basedb.util.listable.TransformCache

public class TransformCache
extends Object
A simple cache implementation for holding the result of source item to target item transformation.
Since:
3.16
Author:
nicklas
  • Field Details

  • Constructor Details

    • TransformCache

      public TransformCache​(int timeoutInMinutes)
      Creates a new cache with the specified timeout.
  • Method Details

    • getKey

      public static TransformCache.CacheKey getKey​(Item sourceType, Item targetType, SyncFilter.SourceItemTransform transform, Set<Integer> sourceIds)
      Get a key that is able to identify a given transformation. We need the source and target item types as well as the transformation direction and all source items ids. It is recommended that the sourceIds set is a SortedSet. If not, a new sorted set is automatically created.
    • get

      public Set<Integer> get​(TransformCache.CacheKey key)
      Get a cached entry if. Null is returned if there is no entry or if the existing entry is too old.
    • store

      public void store​(TransformCache.CacheKey key, Set<Integer> targetList)
      Store a new entry into the cache.
    • clean

      void clean()