info.magnolia.imaging.caching
Class AbstractContentBasedCachingStrategy<P>

java.lang.Object
  extended by info.magnolia.imaging.caching.AbstractContentBasedCachingStrategy<P>
Type Parameters:
P - type of ParameterProvider's parameter
All Implemented Interfaces:
CachingStrategy<P>
Direct Known Subclasses:
ContentBasedCachingStrategy, NodeDataBasedCachingStrategy

public abstract class AbstractContentBasedCachingStrategy<P>
extends Object
implements CachingStrategy<P>

Superclass for Content based CachingStrategies.

Version:
$Id$

Constructor Summary
AbstractContentBasedCachingStrategy()
           
 
Method Summary
 String getCachePath(ImageGenerator<ParameterProvider<P>> generator, ParameterProvider<P> parameterProvider)
          Returns a unique path pertinent to the given generator and parameter to use for storing the generated image.
protected abstract  info.magnolia.cms.core.Content getContent(P param)
           
protected abstract  String getPathOf(P param)
           
protected abstract  String getWorkspaceName(P param)
           
 boolean shouldRegenerate(info.magnolia.cms.core.NodeData cachedBinary, ParameterProvider<P> parameterProvider)
          The default implementation simply delegates this decision to ParameterProvider.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractContentBasedCachingStrategy

public AbstractContentBasedCachingStrategy()
Method Detail

getCachePath

public String getCachePath(ImageGenerator<ParameterProvider<P>> generator,
                           ParameterProvider<P> parameterProvider)
Description copied from interface: CachingStrategy
Returns a unique path pertinent to the given generator and parameter to use for storing the generated image.

Specified by:
getCachePath in interface CachingStrategy<P>

shouldRegenerate

public boolean shouldRegenerate(info.magnolia.cms.core.NodeData cachedBinary,
                                ParameterProvider<P> parameterProvider)
The default implementation simply delegates this decision to ParameterProvider.

Specified by:
shouldRegenerate in interface CachingStrategy<P>
Returns:
true if the image should be regenerated.

getWorkspaceName

protected abstract String getWorkspaceName(P param)

getContent

protected abstract info.magnolia.cms.core.Content getContent(P param)

getPathOf

protected abstract String getPathOf(P param)


Copyright © 2014 Magnolia International Ltd.. All Rights Reserved.