org.appng.core.controller.filter

## Class PageCacheFilter

- java.lang.Object
- - org.appng.core.controller.filter.PageCacheFilter

- All Implemented Interfaces:
    javax.servlet.Filter

      public class PageCacheFilter
      extends Object
      implements javax.servlet.Filter

  A `Filter` which caches responses in form of an `CachedResponse`
  Author:
    Matthias Herlitzius, Matthias Müller

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static String` | `CACHE_HIT`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PageCacheFilter()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected boolean` | `acceptsGzipEncoding(javax.servlet.http.HttpServletRequest request)`
    `protected String` | `calculateKey(javax.servlet.http.HttpServletRequest request)`
    `void` | `destroy()`
    `void` | `doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain)`
    `protected CachedResponse` | `getCachedResponse(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.FilterChain chain, Site site, javax.cache.Cache<String,CachedResponse> cache, javax.cache.expiry.ExpiryPolicy expiryPolicy)`
    `protected CachedResponse` | `handleCaching(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Site site, javax.servlet.FilterChain chain, javax.cache.Cache<String,CachedResponse> cache, javax.cache.expiry.ExpiryPolicy expiryPolicy)`
    `protected CachedResponse` | `performRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.FilterChain chain, Site site, javax.cache.expiry.ExpiryPolicy expiryPolicy)`
    `protected void` | `writeResponse(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, CachedResponse pageInfo)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface javax.servlet.Filter

      `init`

- - ### Field Detail

    - #### CACHE_HIT

          protected static final String CACHE_HIT

  - ### Constructor Detail

    - #### PageCacheFilter

          public PageCacheFilter()

  - ### Method Detail

    - #### destroy

          public void destroy()

      Specified by:
        `destroy` in interface `javax.servlet.Filter`

    - #### doFilter

          public void doFilter(javax.servlet.ServletRequest request,
                               javax.servlet.ServletResponse response,
                               javax.servlet.FilterChain chain)
                        throws IOException,
                               javax.servlet.ServletException

      Specified by:
        `doFilter` in interface `javax.servlet.Filter`
      Throws:
        `IOException`
        `javax.servlet.ServletException`

    - #### handleCaching

          protected CachedResponse handleCaching(javax.servlet.http.HttpServletRequest request,
                                                 javax.servlet.http.HttpServletResponse response,
                                                 Site site,
                                                 javax.servlet.FilterChain chain,
                                                 javax.cache.Cache<String,CachedResponse> cache,
                                                 javax.cache.expiry.ExpiryPolicy expiryPolicy)
                                          throws javax.servlet.ServletException,
                                                 IOException

      Throws:
        `javax.servlet.ServletException`
        `IOException`

    - #### writeResponse

          protected void writeResponse(javax.servlet.http.HttpServletRequest request,
                                       javax.servlet.http.HttpServletResponse response,
                                       CachedResponse pageInfo)
                                throws IOException

      Throws:
        `IOException`

    - #### getCachedResponse

          protected CachedResponse getCachedResponse(javax.servlet.http.HttpServletRequest request,
                                                     javax.servlet.http.HttpServletResponse response,
                                                     javax.servlet.FilterChain chain,
                                                     Site site,
                                                     javax.cache.Cache<String,CachedResponse> cache,
                                                     javax.cache.expiry.ExpiryPolicy expiryPolicy)
                                              throws javax.servlet.ServletException,
                                                     IOException

      Throws:
        `javax.servlet.ServletException`
        `IOException`

    - #### performRequest

          protected CachedResponse performRequest(javax.servlet.http.HttpServletRequest request,
                                                  javax.servlet.http.HttpServletResponse response,
                                                  javax.servlet.FilterChain chain,
                                                  Site site,
                                                  javax.cache.expiry.ExpiryPolicy expiryPolicy)
                                           throws IOException,
                                                  javax.servlet.ServletException

      Throws:
        `IOException`
        `javax.servlet.ServletException`

    - #### calculateKey

          protected String calculateKey(javax.servlet.http.HttpServletRequest request)

    - #### acceptsGzipEncoding

          protected boolean acceptsGzipEncoding(javax.servlet.http.HttpServletRequest request)

Copyright © 2011–2023 aiticon GmbH. All rights reserved.