com.digitalsanctuary.atg.servlet.pipeline
Class CacheControllerPipelineServlet

java.lang.Object
  extended byatg.nucleus.GenericService
      extended byatg.nucleus.TimedOperationService
          extended byatg.servlet.pipeline.PipelineableServletImpl
              extended byatg.servlet.pipeline.InsertableServletImpl
                  extended bycom.digitalsanctuary.atg.servlet.pipeline.CacheControllerPipelineServlet
All Implemented Interfaces:
atg.nucleus.AdminableService, atg.nucleus.logging.ApplicationLogging, atg.nucleus.naming.ComponentNameResolver, java.util.EventListener, atg.servlet.pipeline.InsertableServlet, atg.naming.NameContextBindingListener, atg.naming.NameContextElement, atg.naming.NameResolver, atg.servlet.pipeline.PipelineableServlet, atg.nucleus.Service, atg.nucleus.ServiceListener, javax.servlet.Servlet

public class CacheControllerPipelineServlet
extends atg.servlet.pipeline.InsertableServletImpl

Checks the request based on mime-type and URI, and determines the correct cache related response headers to return. For instance you might want to cache images for a month, CSS files for a week, and JSPs not at all.

Author:
Devon Hillard devon@digitalsanctuary.com copyright 2008 DigitalSanctuary Inc. All Rights Reserved.

Field Summary
 
Fields inherited from class atg.servlet.pipeline.InsertableServletImpl
CLASS_VERSION
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
 
Constructor Summary
CacheControllerPipelineServlet()
           
 
Method Summary
 void flushCache()
          This method flushes the URI-cache time cache.
 java.util.Map getMimeTypeCacheMap()
           
 java.util.Map getURICacheMap()
           
 boolean isCacheRequestsWithQueryParams()
           
 void service(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          Checks the request based on mime-type and URI, and determines the correct cache related response headers to return.
 void setCacheRequestsWithQueryParams(boolean pCacheRequestsWithQueryParams)
           
 void setMimeTypeCacheMap(java.util.Map pMimeTypeCacheMap)
           
 void setURICacheMap(java.util.Map pCacheMap)
           
 
Methods inherited from class atg.servlet.pipeline.InsertableServletImpl
doStartService, getInsertAfterServlet, setInsertAfterServlet
 
Methods inherited from class atg.servlet.pipeline.PipelineableServletImpl
createAdminServlet, destroy, getAdminServlet, getNextServlet, getServletConfig, getServletInfo, init, passRequest, passRequest, service, service, setNextServlet, setServletInfo
 
Methods inherited from class atg.nucleus.TimedOperationService
getAverageRequestHandlingTime, getHandledRequestCount, getRequestStartTime, getTotalRequestHandlingTime, isKeepingStatistics, notifyHandledRequest, resetStatistics, setKeepingStatistics
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, doStopService, getAbsoluteName, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingWarning, setServiceInfo, startService, stopService
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface atg.servlet.pipeline.PipelineableServlet
getNextServlet, passRequest, setNextServlet
 
Methods inherited from interface javax.servlet.Servlet
destroy, getServletConfig, getServletInfo, init, service
 

Constructor Detail

CacheControllerPipelineServlet

public CacheControllerPipelineServlet()
Method Detail

service

public void service(atg.servlet.DynamoHttpServletRequest pRequest,
                    atg.servlet.DynamoHttpServletResponse pResponse)
             throws java.io.IOException,
                    javax.servlet.ServletException
Checks the request based on mime-type and URI, and determines the correct cache related response headers to return. For instance you might want to cache images for a month, CSS files for a week, and JSPs not at all.

Parameters:
pRequest - the ATG Request.
pResponse - the ATG Response.
Throws:
java.io.IOException - in case of error.
javax.servlet.ServletException - in case of error.
See Also:
PipelineableServletImpl.service(atg.servlet.DynamoHttpServletRequest, atg.servlet.DynamoHttpServletResponse)

flushCache

public void flushCache()
This method flushes the URI-cache time cache.


getMimeTypeCacheMap

public java.util.Map getMimeTypeCacheMap()
Returns:
the mimeTypeCacheMap

setMimeTypeCacheMap

public void setMimeTypeCacheMap(java.util.Map pMimeTypeCacheMap)
Parameters:
pMimeTypeCacheMap - the mimeTypeCacheMap to set

getURICacheMap

public java.util.Map getURICacheMap()
Returns:
the uRICacheMap

setURICacheMap

public void setURICacheMap(java.util.Map pCacheMap)
Parameters:
pCacheMap - the uRICacheMap to set

isCacheRequestsWithQueryParams

public boolean isCacheRequestsWithQueryParams()
Returns:
the cacheRequestsWithQueryParams

setCacheRequestsWithQueryParams

public void setCacheRequestsWithQueryParams(boolean pCacheRequestsWithQueryParams)
Parameters:
pCacheRequestsWithQueryParams - the cacheRequestsWithQueryParams to set