Package com.webmethods.portal.mech.cache
Interface IPresentationCacheMechanics
- All Superinterfaces:
IComponent
,IInitializable
,IMechanics
,ISystemHandler
Mechanics for getting, putting, and clearing html fragments in the prenentation cache.
-
Method Summary
Modifier and TypeMethodDescriptiongetCache()
Returns underlying cache instance that is used to store presentation databyte[]
getContent
(ICacheKey key) Gets the content cached for the specified key.Gets the cache key for the specified user and resource.boolean
hasContent
(ICacheKey key) Returns true if there is valid cached content for the specified key.void
Invalidates the entire presentation cache.void
Invalidates the cached content for the specified key.void
invalidateContentForUser
(IThingID userId) Invalidates all content cached for the specified user.void
invalidateDependentContent
(IThingID resourceId) Invalidates all cached content dependent on the specified resource.void
invalidateDependentContentForUser
(IThingID userId, IThingID resourceId) Invalidates all cached content dependent on the specified resource for the specified user.void
putContent
(ICacheKey key, byte[] content, IThingIDList dependencies) Caches the content for the specified key.void
putContent
(ICacheKey key, byte[] content, IThingIDList dependencies, long cacheAge) Caches the content for the specified key and cache agevoid
putContent
(ICacheKey key, InputStream in, IThingIDList dependencies) Caches the entire content of the input stream for the specified key.void
putContent
(ICacheKey key, String content, IThingIDList dependencies) Caches the content for the specified key.boolean
writeContent
(ICacheKey key, OutputStream out) Writes the content cached for the specified key to the output stream.boolean
writeContent
(ICacheKey key, Writer out) Writes the content cached for the specified key to the output stream.Methods inherited from interface com.webmethods.portal.system.IComponent
getComponentData, getComponentName, getComponentProvider, getURI, isInitialized, setComponentData, setComponentProvider
Methods inherited from interface com.webmethods.portal.system.init.IInitializable
init, shutdown
-
Method Details
-
getKey
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
Returns true if there is valid cached content for the specified key.- Throws:
PortalException
-
getContent
Gets the content cached for the specified key. Returns null if there is no content cached for the sepecified key.- Throws:
PortalException
-
writeContent
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
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
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 invalidatescacheAge
- the content age the cached content. May be null.- Throws:
PortalException
-
putContent
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
Invalidates the entire presentation cache.- Throws:
PortalException
-
invalidateDependentContent
Invalidates all cached content dependent on the specified resource.- Throws:
PortalException
-
invalidateContentForUser
Invalidates all content cached for the specified user.- Throws:
PortalException
-
invalidateDependentContentForUser
Invalidates all cached content dependent on the specified resource for the specified user.- Throws:
PortalException
-
invalidateContent
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
-