org.apache.wicket.request.resource.caching
Class QueryStringWithTimestampResourceCachingStrategy

java.lang.Object
  extended by org.apache.wicket.request.resource.caching.AbstractResourceCachingStrategy
      extended by org.apache.wicket.request.resource.caching.QueryStringWithTimestampResourceCachingStrategy
All Implemented Interfaces:
IResourceCachingStrategy

public class QueryStringWithTimestampResourceCachingStrategy
extends AbstractResourceCachingStrategy

resource caching strategy that adds a last-modified timestamp to the query string of the resource (this is similar to how wicket 1.4 does it when enabling timestamps on resources).

Author:
Peter Ertl

Field Summary
 
Fields inherited from class org.apache.wicket.request.resource.caching.AbstractResourceCachingStrategy
TIMESTAMP_KEY
 
Constructor Summary
QueryStringWithTimestampResourceCachingStrategy()
          Constructor
QueryStringWithTimestampResourceCachingStrategy(String timestampParameter)
          Constructor
 
Method Summary
 void decorateResponse(AbstractResource.ResourceResponse response)
          decorate resource response
 void decorateUrl(ResourceUrl url, ResourceReference reference)
          add caching related information to filename + parameters
 String getTimestampParameter()
           
 void undecorateUrl(ResourceUrl url)
          Removes caching related information from filename + parameters.
 
Methods inherited from class org.apache.wicket.request.resource.caching.AbstractResourceCachingStrategy
getLastModified, isLastModifiedCacheEnabled, setLastModifiedCacheEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryStringWithTimestampResourceCachingStrategy

public QueryStringWithTimestampResourceCachingStrategy()
Constructor


QueryStringWithTimestampResourceCachingStrategy

public QueryStringWithTimestampResourceCachingStrategy(String timestampParameter)
Constructor

Parameters:
timestampParameter - name of timestamp parameter which will be added to query string
Method Detail

getTimestampParameter

public final String getTimestampParameter()
Returns:
name of timestamp parameter which will be added to query string

decorateUrl

public void decorateUrl(ResourceUrl url,
                        ResourceReference reference)
Description copied from interface: IResourceCachingStrategy
add caching related information to filename + parameters

Parameters:
url - parameters to which caching information should be added and which will be used to construct the url to the resource
reference - resource reference

undecorateUrl

public void undecorateUrl(ResourceUrl url)
Description copied from interface: IResourceCachingStrategy
Removes caching related information from filename + parameters. In essenese this method undoes what IResourceCachingStrategy.decorateUrl(ResourceUrl, ResourceReference) did.

Parameters:
url - parameters that were used to construct the url to the resource and from which previously added caching information should be stripped

decorateResponse

public void decorateResponse(AbstractResource.ResourceResponse response)
Description copied from interface: IResourceCachingStrategy
decorate resource response



Copyright © 2004-2011 Apache Software Foundation. All Rights Reserved.