org.richfaces.resource

## Class BaseResourceWrapper<T>

- java.lang.Object
- - javax.faces.application.ViewResource
  - - javax.faces.application.Resource
    - - org.richfaces.resource.AbstractBaseResource
      - - org.richfaces.resource.AbstractCacheableResource
        - - org.richfaces.resource.BaseResourceWrapper<T>

- All Implemented Interfaces:
    javax.faces.component.StateHolder, javax.faces.FacesWrapper<T>, CacheableResource, VersionedResource
  Direct Known Subclasses:
    Java2DUserResourceWrapperImpl, UserResourceWrapperImpl

      public abstract class BaseResourceWrapper<T>
      extends AbstractCacheableResource
      implements VersionedResource, javax.faces.component.StateHolder, javax.faces.FacesWrapper<T>

  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
    `BaseResourceWrapper(T resourceObject, boolean cacheable, boolean versioned)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `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
    `Map<String,String>` | `getResponseHeaders()`
    `int` | `getTimeToLive(javax.faces.context.FacesContext context)`
    `String` | `getVersion()`
    `T` | `getWrapped()`
    `protected abstract Map<String,String>` | `getWrappedResourceResponseHeaders()`
    `boolean` | `isCacheable(javax.faces.context.FacesContext context)`
    `boolean` | `isTransient()`
    `void` | `restoreState(javax.faces.context.FacesContext context, Object state)`
    `Object` | `saveState(javax.faces.context.FacesContext context)`
    `void` | `setTransient(boolean newTransientValue)`

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

      `addCacheControlResponseHeaders, isMatchesEntityTag, isMatchesEntityTag, isMatchesLastModified, isMatchesLastModified, setCacheable, userAgentNeedsUpdate`

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

      `addNoCacheResponseHeaders, getClassLoader, getContentLength, getLastModified, getRequestPath, 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

    - #### BaseResourceWrapper

          public BaseResourceWrapper(T resourceObject,
                             boolean cacheable,
                             boolean versioned)

  - ### Method Detail

    - #### getWrappedResourceResponseHeaders

          protected abstract Map<String,String> getWrappedResourceResponseHeaders()

    - #### getResponseHeaders

          public Map<String,String> getResponseHeaders()

      Overrides:
        `getResponseHeaders` in class `AbstractBaseResource`

    - #### getVersion

          public String getVersion()

      Specified by:
        `getVersion` in interface `VersionedResource`

    - #### isCacheable

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

      Specified by:
        `isCacheable` in interface `CacheableResource`
      Overrides:
        `isCacheable` in class `AbstractCacheableResource`

    - #### getExpires

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

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

    - #### getEntityTag

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

      Specified by:
        `getEntityTag` in interface `CacheableResource`
      Overrides:
        `getEntityTag` in class `AbstractCacheableResource`

    - #### getTimeToLive

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

      Specified by:
        `getTimeToLive` in interface `CacheableResource`
      Overrides:
        `getTimeToLive` in class `AbstractCacheableResource`

    - #### isTransient

          public boolean isTransient()

      Specified by:
        `isTransient` in interface `javax.faces.component.StateHolder`

    - #### setTransient

          public void setTransient(boolean newTransientValue)

      Specified by:
        `setTransient` in interface `javax.faces.component.StateHolder`

    - #### saveState

          public Object saveState(javax.faces.context.FacesContext context)

      Specified by:
        `saveState` in interface `javax.faces.component.StateHolder`

    - #### restoreState

          public void restoreState(javax.faces.context.FacesContext context,
                          Object state)

      Specified by:
        `restoreState` in interface `javax.faces.component.StateHolder`

    - #### getWrapped

          public T getWrapped()

      Specified by:
        `getWrapped` in interface `javax.faces.FacesWrapper<T>`

Copyright © 2014 JBoss by Red Hat. All rights reserved.