Class DefaultImageModelCache


  • public class DefaultImageModelCache
    extends ImageModelCache
    Author:
    Fabrizio Giudici
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean contains​(java.io.Serializable id)
      Returns true if there's a local copy with the given id.
      void remove​(java.io.Serializable ic, boolean remote)
      Removes an ImageModel from the cache.
      ImageModel retrieve​(java.io.Serializable id, boolean remote)
      Finds an ImageModel in the cache.
      void store​(ImageModel imageModel)
      Adds an ImageModel to the cache.
      void update​(ImageModel imageModel)
      Updates an ImageModel in the cache.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultImageModelCache

        public DefaultImageModelCache()
    • Method Detail

      • store

        public void store​(ImageModel imageModel)
        Description copied from class: ImageModelCache
        Adds an ImageModel to the cache. The image is always added only in the local cache. Remote caches will pull the images they lack on demand.
        Specified by:
        store in class ImageModelCache
        Parameters:
        imageModel - the ImageModel to add
      • update

        public void update​(ImageModel imageModel)
        Description copied from class: ImageModelCache
        Updates an ImageModel in the cache. This means that all remote copies of this image will be invalidated. TODO: should investigate more complex cases. Maybe the remote workers still want to work with a remote snapshot. Include versioning instead of invalidating?
        Specified by:
        update in class ImageModelCache
        Parameters:
        imageModel - the ImageModel to update
      • remove

        public void remove​(java.io.Serializable ic,
                           boolean remote)
        Description copied from class: ImageModelCache
        Removes an ImageModel from the cache. According to the value of the remote parameter, the operation is performed only locally or also to remote caches.
        Specified by:
        remove in class ImageModelCache
        Parameters:
        ic - the id of the ImageModel to remove
      • retrieve

        public ImageModel retrieve​(java.io.Serializable id,
                                   boolean remote)
        Description copied from class: ImageModelCache
        Finds an ImageModel in the cache. According to the value of the remote parameter, the search is performed only locally or also to remote caches.
        Specified by:
        retrieve in class ImageModelCache
        Parameters:
        id - the id of the ImageModel to remove
      • contains

        public boolean contains​(java.io.Serializable id)
        Description copied from class: ImageModelCache
        Returns true if there's a local copy with the given id.
        Specified by:
        contains in class ImageModelCache
        Parameters:
        id - the id of the ImageModel to remove
        Returns:
        true if there's a local copy