org.apache.jetspeed.cache
Interface JetspeedCache

All Known Subinterfaces:
JetspeedContentCache

public interface JetspeedCache

Provides interface to Jetspeed for cache related activities Abstraction around actual cache implementation

Version:
$Id: $
Author:
David Sean Taylor

Method Summary
 void addEventListener(JetspeedCacheEventListener listener, boolean local)
          Add a cache listener for supported cache events, either for local or remote cache events
 void clear()
          clear all content in the cache
 ContentCacheKey createCacheKey(RequestContext rc, String windowId)
          Create a portlet content cache key based on dynamic request context information and a window id
 CacheElement createElement(Object key, Object content)
          Create a cached element
 void evictContentForSession(String sessionId)
          Evict all cached content for the given session identifier
 void evictContentForUser(String username)
          Evict all cached content for the given username
 CacheElement get(Object key)
          Retrieve an object from the cache
 int getTimeToIdleSeconds()
           
 int getTimeToLiveSeconds()
           
 boolean isKeyInCache(Object key)
           
 void put(CacheElement object)
          Put an object into the cache, adding it, or replacing if exists
 boolean remove(Object key)
          Remove an object from the cache
 void removeEventListener(JetspeedCacheEventListener listener, boolean local)
           
 boolean removeQuiet(Object key)
          Remove object from cache, do not notify listeners
 

Method Detail

get

CacheElement get(Object key)
Retrieve an object from the cache

Parameters:
key - The key used to find the object
Returns:
the found object or null

clear

void clear()
clear all content in the cache


put

void put(CacheElement object)
Put an object into the cache, adding it, or replacing if exists

Parameters:
object -

createElement

CacheElement createElement(Object key,
                           Object content)
Create a cached element

Parameters:
key -
content -
Returns:

isKeyInCache

boolean isKeyInCache(Object key)

remove

boolean remove(Object key)
Remove an object from the cache

Parameters:
key -
Returns:
true if the object was removed, false otherwise

removeQuiet

boolean removeQuiet(Object key)
Remove object from cache, do not notify listeners

Parameters:
key -
Returns:
trie if the object was removed, false otherwise

getTimeToIdleSeconds

int getTimeToIdleSeconds()
Returns:
the default idle time in seconds for this cache

getTimeToLiveSeconds

int getTimeToLiveSeconds()
Returns:
the default idle time in seconds for this cache

evictContentForUser

void evictContentForUser(String username)
Evict all cached content for the given username

Parameters:
username - unique user identifier

evictContentForSession

void evictContentForSession(String sessionId)
Evict all cached content for the given session identifier

Parameters:
sessionid - unique session identifier

createCacheKey

ContentCacheKey createCacheKey(RequestContext rc,
                               String windowId)
Create a portlet content cache key based on dynamic request context information and a window id

Parameters:
rc -
windowId -
Returns:
Since:
2.1.2

addEventListener

void addEventListener(JetspeedCacheEventListener listener,
                      boolean local)
Add a cache listener for supported cache events, either for local or remote cache events

Parameters:
listener -
local - if true, listen to local events, if false, listen to remote

removeEventListener

void removeEventListener(JetspeedCacheEventListener listener,
                         boolean local)


Copyright © 1999-2007 Apache Software Foundation. All Rights Reserved.