public interface IPresentationCacheMechanics extends IMechanics
Modifier and Type | Method and Description |
---|---|
IDependentCache |
getCache()
Returns underlying cache instance that is used to store presentation data
|
byte[] |
getContent(ICacheKey key)
Gets the content cached for the specified key.
|
ICacheKey |
getKey(IThingID userId,
IThingID resourceId,
String params)
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 |
invalidateAllContent()
Invalidates the entire presentation cache.
|
void |
invalidateContent(ICacheKey key)
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 age
|
void |
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.
|
getComponentData, getComponentName, getComponentProvider, getURI, isInitialized, setComponentData, setComponentProvider
init, shutdown
ICacheKey getKey(IThingID userId, IThingID resourceId, String params) throws PortalException
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'.PortalException
boolean hasContent(ICacheKey key) throws PortalException
PortalException
byte[] getContent(ICacheKey key) throws PortalException
PortalException
boolean writeContent(ICacheKey key, OutputStream out) throws PortalException, IOException
PortalException
IOException
boolean writeContent(ICacheKey key, Writer out) throws PortalException, IOException
PortalException
IOException
void putContent(ICacheKey key, byte[] content, IThingIDList dependencies) throws PortalException
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.PortalException
void putContent(ICacheKey key, byte[] content, IThingIDList dependencies, long cacheAge) throws PortalException
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.PortalException
void putContent(ICacheKey key, String content, IThingIDList dependencies) throws PortalException
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.PortalException
void putContent(ICacheKey key, InputStream in, IThingIDList dependencies) throws PortalException, IOException
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.PortalException
IOException
void invalidateAllContent() throws PortalException
PortalException
void invalidateDependentContent(IThingID resourceId) throws PortalException
PortalException
void invalidateContentForUser(IThingID userId) throws PortalException
PortalException
void invalidateDependentContentForUser(IThingID userId, IThingID resourceId) throws PortalException
PortalException
void invalidateContent(ICacheKey key) throws PortalException
PortalException
IDependentCache getCache()