to.etc.domui.caches.images
Class ImageTask

java.lang.Object
  extended by to.etc.domui.caches.images.ImageTask

public class ImageTask
extends java.lang.Object

Represents some action being handled within the image cache: the retrieval of some image. This separates the cache-based actions from the image-based actions.

Author:
Frits Jalvingh Created on Dec 1, 2009

Method Summary
 void addDeletedFragment(to.etc.domui.caches.images.CachedImageFragment ii)
           
 void addUsedFragment(to.etc.domui.caches.images.CachedImageFragment ii)
          Register an image as recently-used.
protected  long getCurrentVersionLong()
          If the version has not yet been retrieved for this task it gets retrieved; all calls following will use that version.
 java.util.List<to.etc.domui.caches.images.CachedImageFragment> getDeletedFragmentList()
           
 java.lang.Object getFullImage(java.util.List<IImageConversionSpecifier> conversions)
           
 to.etc.domui.caches.images.CachedImageData getImageData(IImageConversionSpecifier[] conversions)
           
 to.etc.domui.caches.images.CachedImageData getImageData(java.util.List<IImageConversionSpecifier> conversions)
          This is the main workhorse for the image cache.
 to.etc.domui.caches.images.CachedImageInfo getImageInfo(java.util.List<IImageConversionSpecifier> conversions)
           
 ImageKey getKey()
           
 to.etc.domui.caches.images.ImageRoot getRoot()
           
 java.util.List<to.etc.domui.caches.images.CachedImageFragment> getUsedFragmentList()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getKey

public ImageKey getKey()

getRoot

public to.etc.domui.caches.images.ImageRoot getRoot()

getCurrentVersionLong

protected long getCurrentVersionLong()
                              throws java.lang.Exception
If the version has not yet been retrieved for this task it gets retrieved; all calls following will use that version. The call must be done before any data gets read; this prevents the race condition where the record is changed between [read data] and [read version].

Returns:
Throws:
java.lang.Exception

getImageData

public to.etc.domui.caches.images.CachedImageData getImageData(IImageConversionSpecifier[] conversions)
                                                        throws java.lang.Exception
Throws:
java.lang.Exception

getImageData

public to.etc.domui.caches.images.CachedImageData getImageData(java.util.List<IImageConversionSpecifier> conversions)
                                                        throws java.lang.Exception
This is the main workhorse for the image cache. This retrieves a possible converted image off some source, using all kinds of caching to make it fast.

Parameters:
cacheKey -
sir -
conversions -
Returns:
Throws:
java.lang.Exception

getImageInfo

public to.etc.domui.caches.images.CachedImageInfo getImageInfo(java.util.List<IImageConversionSpecifier> conversions)
                                                        throws java.lang.Exception
Throws:
java.lang.Exception

getFullImage

public java.lang.Object getFullImage(java.util.List<IImageConversionSpecifier> conversions)
                              throws java.lang.Exception
Throws:
java.lang.Exception

addUsedFragment

public void addUsedFragment(@Nonnull
                            to.etc.domui.caches.images.CachedImageFragment ii)
Register an image as recently-used. The cache will relink it as used. Cannot be called for deleted images.

Parameters:
ii -

addDeletedFragment

public void addDeletedFragment(@Nonnull
                               to.etc.domui.caches.images.CachedImageFragment ii)

getUsedFragmentList

@Nonnull
public java.util.List<to.etc.domui.caches.images.CachedImageFragment> getUsedFragmentList()

getDeletedFragmentList

@Nonnull
public java.util.List<to.etc.domui.caches.images.CachedImageFragment> getDeletedFragmentList()