info.magnolia.module.cache.filter
Class CachedRedirect

java.lang.Object
  extended by info.magnolia.module.cache.filter.CachedRedirect
All Implemented Interfaces:
CachedEntry, Serializable

public class CachedRedirect
extends Object
implements CachedEntry, Serializable

Cached redirect contract providing access to the status code and target location.

Version:
$Revision: $ ($Author: $)
Author:
gjoseph
See Also:
Serialized Form

Constructor Summary
CachedRedirect(int statusCode, String location, String originalUrl, int timeToLiveInSeconds)
           
 
Method Summary
 long getLastModificationTime()
          Produce last modification date of the cache entry.
 String getLocation()
           
 String getOriginalURL()
          Entry might be required to produce url used to create it in the first place.
 int getStatusCode()
           
 int getTimeToLiveInSeconds()
           
 void replay(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.FilterChain chain)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CachedRedirect

public CachedRedirect(int statusCode,
                      String location,
                      String originalUrl,
                      int timeToLiveInSeconds)
Method Detail

getStatusCode

public int getStatusCode()

getLocation

public String getLocation()

replay

public void replay(javax.servlet.http.HttpServletRequest request,
                   javax.servlet.http.HttpServletResponse response,
                   javax.servlet.FilterChain chain)
            throws IOException,
                   javax.servlet.ServletException
Specified by:
replay in interface CachedEntry
chain - a cache entry might want to delegate to the filter chain, see DelegatingBlobCachedEntry.replay(HttpServletRequest, HttpServletResponse, FilterChain)
Throws:
IOException
javax.servlet.ServletException

getOriginalURL

public String getOriginalURL()
Description copied from interface: CachedEntry
Entry might be required to produce url used to create it in the first place.

Specified by:
getOriginalURL in interface CachedEntry
Returns:
URL that triggered cache entry creation.

getLastModificationTime

public long getLastModificationTime()
Description copied from interface: CachedEntry
Produce last modification date of the cache entry. If no other time can be discerned, the time of entry creation should be returned.

Specified by:
getLastModificationTime in interface CachedEntry
Returns:
time when cached entry was last modified. This time should reflect real modification time of the cached content.

getTimeToLiveInSeconds

public int getTimeToLiveInSeconds()
Specified by:
getTimeToLiveInSeconds in interface CachedEntry


Copyright © 2003-2012 Magnolia International Ltd.. All Rights Reserved.