Interface IPresentationCacheMechanics

All Superinterfaces:
IComponent, IInitializable, IMechanics, ISystemHandler

public interface IPresentationCacheMechanics extends IMechanics
Mechanics for getting, putting, and clearing html fragments in the prenentation cache.
  • Method Details

    • getKey

      ICacheKey getKey(IThingID userId, IThingID resourceId, String params) throws PortalException
      Gets the cache key for the specified user and resource.
      Parameters:
      userId - User for whom to get the key.
      resourceId - Resource for which to get the key. May be null.
      params - Parameters that modify the key, such as the name of the cached fragment, the number of items displayed in the fragment, etc. An example value is 'view=children,start=1,pageSize=10,sort=name,order=a'.
      Throws:
      PortalException
    • hasContent

      boolean hasContent(ICacheKey key) throws PortalException
      Returns true if there is valid cached content for the specified key.
      Throws:
      PortalException
    • getContent

      byte[] getContent(ICacheKey key) throws PortalException
      Gets the content cached for the specified key. Returns null if there is no content cached for the sepecified key.
      Throws:
      PortalException
    • writeContent

      boolean writeContent(ICacheKey key, OutputStream out) throws PortalException, IOException
      Writes the content cached for the specified key to the output stream. Writes nothing if there is no content cached for the specified key.
      Returns:
      True if cached content to write.
      Throws:
      PortalException
      IOException
    • writeContent

      boolean writeContent(ICacheKey key, Writer out) throws PortalException, IOException
      Writes the content cached for the specified key to the output stream. Writes nothing if there is no content cached for the specified key.
      Returns:
      True if cached content to write.
      Throws:
      PortalException
      IOException
    • putContent

      void putContent(ICacheKey key, byte[] content, IThingIDList dependencies) throws PortalException
      Caches the content for the specified key.
      Parameters:
      key - Key under which to cache the content.
      content - Content to cache. Must not be null.
      dependencies - List of things the modification of which invalidates the cached content. May be null.
      Throws:
      PortalException
    • putContent

      void putContent(ICacheKey key, byte[] content, IThingIDList dependencies, long cacheAge) throws PortalException
      Caches the content for the specified key and cache age
      Parameters:
      key - Key under which to cache the content.
      content - Content to cache. Must not be null.
      dependencies - List of things the modification of which invalidates
      cacheAge - the content age the cached content. May be null.
      Throws:
      PortalException
    • putContent

      void putContent(ICacheKey key, String content, IThingIDList dependencies) throws PortalException
      Caches the content for the specified key.
      Parameters:
      key - Key under which to cache the content.
      content - Content to cache. Must not be null.
      dependencies - List of things the modification of which invalidates the cached content. May be null.
      Throws:
      PortalException
    • putContent

      void putContent(ICacheKey key, InputStream in, IThingIDList dependencies) throws PortalException, IOException
      Caches the entire content of the input stream for the specified key.
      Parameters:
      key - Key under which to cache the content.
      in - Content to cache. Must not be null.
      dependencies - List of things the modification of which invalidates the cached content. May be null.
      Throws:
      PortalException
      IOException
    • invalidateAllContent

      void invalidateAllContent() throws PortalException
      Invalidates the entire presentation cache.
      Throws:
      PortalException
    • invalidateDependentContent

      void invalidateDependentContent(IThingID resourceId) throws PortalException
      Invalidates all cached content dependent on the specified resource.
      Throws:
      PortalException
    • invalidateContentForUser

      void invalidateContentForUser(IThingID userId) throws PortalException
      Invalidates all content cached for the specified user.
      Throws:
      PortalException
    • invalidateDependentContentForUser

      void invalidateDependentContentForUser(IThingID userId, IThingID resourceId) throws PortalException
      Invalidates all cached content dependent on the specified resource for the specified user.
      Throws:
      PortalException
    • invalidateContent

      void invalidateContent(ICacheKey key) throws PortalException
      Invalidates the cached content for the specified key.
      Throws:
      PortalException
    • getCache

      IDependentCache getCache()
      Returns underlying cache instance that is used to store presentation data
      Returns:
      cache instance