org.richfaces.resource

## Class AbstractCacheableResource

- java.lang.Object
- - javax.faces.application.ViewResource
  - - javax.faces.application.Resource
    - - org.richfaces.resource.AbstractBaseResource
      - - org.richfaces.resource.AbstractCacheableResource

- All Implemented Interfaces:
    CacheableResource
  Direct Known Subclasses:
    BaseResourceWrapper, CachedResourceImpl, CompiledCSSResource

      public abstract class AbstractCacheableResource
      extends AbstractBaseResource
      implements CacheableResource

  Since:
    4.0
  Author:
    Nick Belaevski

- - ### Field Summary

    - ### Fields inherited from class org.richfaces.resource.AbstractBaseResource

      `URL_PROTOCOL`

    - ### Fields inherited from class javax.faces.application.Resource

      `COMPONENT_RESOURCE_KEY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractCacheableResource()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `addCacheControlResponseHeaders(javax.faces.context.FacesContext facesContext, Map<String,String> headers)`
    `String` | `getEntityTag(javax.faces.context.FacesContext context)`
    `Date` | `getExpires(javax.faces.context.FacesContext context)` IMPORTANT: this method returned TTL in RF 3.x, now it returns expiration time
    `int` | `getTimeToLive(javax.faces.context.FacesContext context)`
    `boolean` | `isCacheable(javax.faces.context.FacesContext context)`
    `protected Boolean` | `isMatchesEntityTag(javax.faces.context.FacesContext context)` Deprecated.
    `protected boolean` | `isMatchesEntityTag(javax.faces.context.FacesContext context, String matchHeaderValue)`
    `protected Boolean` | `isMatchesLastModified(javax.faces.context.FacesContext context)` Deprecated.
    `protected boolean` | `isMatchesLastModified(javax.faces.context.FacesContext context, String modifiedCondition)`
    `void` | `setCacheable(boolean cacheable)`
    `boolean` | `userAgentNeedsUpdate(javax.faces.context.FacesContext context)`

    - ### Methods inherited from class org.richfaces.resource.AbstractBaseResource

      `addNoCacheResponseHeaders, getClassLoader, getContentLength, getLastModified, getRequestPath, getResponseHeaders, getURL`

    - ### Methods inherited from class javax.faces.application.Resource

      `getContentType, getInputStream, getLibraryName, getResourceName, setContentType, setLibraryName, setResourceName, toString`

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

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

- - ### Constructor Detail

    - #### AbstractCacheableResource

          public AbstractCacheableResource()

  - ### Method Detail

    - #### isCacheable

          public boolean isCacheable(javax.faces.context.FacesContext context)

      Specified by:
        `isCacheable` in interface `CacheableResource`

    - #### isMatchesLastModified

          @Deprecated
          protected Boolean isMatchesLastModified(javax.faces.context.FacesContext context)

      Deprecated.

    - #### isMatchesLastModified

          protected boolean isMatchesLastModified(javax.faces.context.FacesContext context,
                                      String modifiedCondition)

    - #### isMatchesEntityTag

          @Deprecated
          protected Boolean isMatchesEntityTag(javax.faces.context.FacesContext context)

      Deprecated.

    - #### isMatchesEntityTag

          protected boolean isMatchesEntityTag(javax.faces.context.FacesContext context,
                                   String matchHeaderValue)

    - #### setCacheable

          public void setCacheable(boolean cacheable)

    - #### userAgentNeedsUpdate

          public boolean userAgentNeedsUpdate(javax.faces.context.FacesContext context)

      Overrides:
        `userAgentNeedsUpdate` in class `AbstractBaseResource`

    - #### getExpires

          public Date getExpires(javax.faces.context.FacesContext context)

      IMPORTANT: this method returned TTL in RF 3.x, now it returns expiration time
      Specified by:
        `getExpires` in interface `CacheableResource`
      Returns:
        Returns the expired.

    - #### getTimeToLive

          public int getTimeToLive(javax.faces.context.FacesContext context)

      Specified by:
        `getTimeToLive` in interface `CacheableResource`

    - #### getEntityTag

          public String getEntityTag(javax.faces.context.FacesContext context)

      Specified by:
        `getEntityTag` in interface `CacheableResource`

    - #### addCacheControlResponseHeaders

          protected void addCacheControlResponseHeaders(javax.faces.context.FacesContext facesContext,
                                            Map<String,String> headers)

      Overrides:
        `addCacheControlResponseHeaders` in class `AbstractBaseResource`

Copyright © 2016 JBoss by Red Hat. All Rights Reserved.