Package it.tidalwave.image
Class DefaultImageModelCache
- java.lang.Object
-
- it.tidalwave.image.ImageModelCache
-
- it.tidalwave.image.DefaultImageModelCache
-
public class DefaultImageModelCache extends ImageModelCache
- Author:
- Fabrizio Giudici
-
-
Constructor Summary
Constructors Constructor Description DefaultImageModelCache()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontains(java.io.Serializable id)Returns true if there's a local copy with the given id.voidremove(java.io.Serializable ic, boolean remote)Removes an ImageModel from the cache.ImageModelretrieve(java.io.Serializable id, boolean remote)Finds an ImageModel in the cache.voidstore(ImageModel imageModel)Adds an ImageModel to the cache.voidupdate(ImageModel imageModel)Updates an ImageModel in the cache.-
Methods inherited from class it.tidalwave.image.ImageModelCache
getInstance, setDefault
-
-
-
-
Method Detail
-
store
public void store(ImageModel imageModel)
Description copied from class:ImageModelCacheAdds 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:
storein classImageModelCache- Parameters:
imageModel- the ImageModel to add
-
update
public void update(ImageModel imageModel)
Description copied from class:ImageModelCacheUpdates 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:
updatein classImageModelCache- Parameters:
imageModel- the ImageModel to update
-
remove
public void remove(java.io.Serializable ic, boolean remote)Description copied from class:ImageModelCacheRemoves an ImageModel from the cache. According to the value of theremoteparameter, the operation is performed only locally or also to remote caches.- Specified by:
removein classImageModelCache- Parameters:
ic- the id of the ImageModel to remove
-
retrieve
public ImageModel retrieve(java.io.Serializable id, boolean remote)
Description copied from class:ImageModelCacheFinds an ImageModel in the cache. According to the value of theremoteparameter, the search is performed only locally or also to remote caches.- Specified by:
retrievein classImageModelCache- Parameters:
id- the id of the ImageModel to remove
-
contains
public boolean contains(java.io.Serializable id)
Description copied from class:ImageModelCacheReturns true if there's a local copy with the given id.- Specified by:
containsin classImageModelCache- Parameters:
id- the id of the ImageModel to remove- Returns:
- true if there's a local copy
-
-