|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.pentaho.platform.engine.core.system.SimpleMapCacheManager
public class SimpleMapCacheManager
Field Summary |
---|
Fields inherited from interface org.pentaho.platform.api.engine.ICacheManager |
---|
GLOBAL, SESSION |
Constructor Summary | |
---|---|
SimpleMapCacheManager()
|
Method Summary | |
---|---|
boolean |
addCacheRegion(String region)
|
boolean |
addCacheRegion(String region,
Properties cacheProperties)
|
boolean |
cacheEnabled()
Returns the enablement state of the cache. |
boolean |
cacheEnabled(String region)
Returns the enablement state of the cache. |
void |
cacheStop()
Stops the cache by calling the cacheProvider stop method. |
void |
clearCache()
Entirely clears the cache. |
void |
clearRegionCache(String region)
Clears any data for the specified for a specific region(For example region could be session, global etc) |
Set |
getAllEntriesFromRegionCache(String region)
Get a Set of Map.Entry objects from the cache within a specific region |
Set |
getAllKeysFromRegionCache(String region)
Get a Set of Key objects from the cache within a specific region |
List |
getAllValuesFromRegionCache(String region)
Get a list of values from the cache within a specific region |
Object |
getFromGlobalCache(Object key)
Gets an object from the cache without translating the passed in key. |
Object |
getFromRegionCache(String region,
Object key)
Gets an object from the cache within a specific region |
Object |
getFromSessionCache(IPentahoSession session,
String key)
Gets an object from the user session specific cache. |
static SimpleMapCacheManager |
getInstance()
|
void |
killSessionCache(IPentahoSession session)
Removes any session-based data for the specified IPentahoSession . |
void |
killSessionCaches()
Removes all cached items that are session-based. |
void |
onLogout(IPentahoSession session)
|
void |
putInGlobalCache(Object key,
Object value)
Puts an object directly into the cache without translating the passed in key. |
void |
putInRegionCache(String region,
Object key,
Object value)
Puts an object directly into the cache of a specific region |
void |
putInSessionCache(IPentahoSession session,
String key,
Object value)
Puts an object in the session-specific cache. |
void |
removeFromGlobalCache(Object key)
Removes an object from the cache |
void |
removeFromRegionCache(String region,
Object key)
Removes an object from the cache within a specific region |
void |
removeFromSessionCache(IPentahoSession session,
String key)
Removes a data item from the user session specific cache |
void |
removeRegionCache(String region)
Clears any data for the specified for a specific region(For example region could be session, global etc) and removed the region from the map |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SimpleMapCacheManager()
Method Detail |
---|
public static SimpleMapCacheManager getInstance()
public void cacheStop()
ICacheManager
cacheStop
in interface ICacheManager
public boolean cacheEnabled(String region)
ICacheManager
cacheEnabled
in interface ICacheManager
public void onLogout(IPentahoSession session)
onLogout
in interface ICacheManager
onLogout
in interface ILogoutListener
session
- Performs any logout actions based on this session.public boolean addCacheRegion(String region, Properties cacheProperties)
addCacheRegion
in interface ICacheManager
public boolean addCacheRegion(String region)
addCacheRegion
in interface ICacheManager
public void clearRegionCache(String region)
ICacheManager
clearRegionCache
in interface ICacheManager
region
- The region whose objects needs to be removed from the cache.public void removeRegionCache(String region)
ICacheManager
removeRegionCache
in interface ICacheManager
region
- The region whose objects needs to be removed from the cache.public void putInRegionCache(String region, Object key, Object value)
ICacheManager
Important note - most cache implementations require both the key and the value to be serializable.
putInRegionCache
in interface ICacheManager
key
- Object by which the data is indexedvalue
- The data to store in the cache.public Object getFromRegionCache(String region, Object key)
ICacheManager
getFromRegionCache
in interface ICacheManager
region
- the region where the object was put in the cachekey
- The key that the data object was stored with
public Set getAllEntriesFromRegionCache(String region)
ICacheManager
getAllEntriesFromRegionCache
in interface ICacheManager
region
- the region where the object was put in the cache
public Set getAllKeysFromRegionCache(String region)
ICacheManager
getAllKeysFromRegionCache
in interface ICacheManager
region
- the region where the object was put in the cache
public List getAllValuesFromRegionCache(String region)
ICacheManager
getAllValuesFromRegionCache
in interface ICacheManager
region
- the region where the object was put in the cache
public void removeFromRegionCache(String region, Object key)
ICacheManager
removeFromRegionCache
in interface ICacheManager
region
- the region where the object was put in the cachekey
- The key that the data object was stored withpublic boolean cacheEnabled()
ICacheManager
cacheEnabled
in interface ICacheManager
public void clearCache()
ICacheManager
clearCache
in interface ICacheManager
public Object getFromGlobalCache(Object key)
ICacheManager
getFromGlobalCache
in interface ICacheManager
key
- The key that the data object was stored with
public Object getFromSessionCache(IPentahoSession session, String key)
ICacheManager
getFromSessionCache
in interface ICacheManager
session
- The users IPentahoSessionkey
- The key that maps to the data to get from the cache
public void killSessionCache(IPentahoSession session)
ICacheManager
IPentahoSession
.
killSessionCache
in interface ICacheManager
session
- The session whose objects needs to be removed from the cache.public void killSessionCaches()
ICacheManager
killSessionCaches
in interface ICacheManager
public void putInGlobalCache(Object key, Object value)
ICacheManager
Important note - most cache implementations require both the key and the value to be serializable.
putInGlobalCache
in interface ICacheManager
key
- Object by which the data is indexedvalue
- The data to store in the cache.public void putInSessionCache(IPentahoSession session, String key, Object value)
ICacheManager
Take special care that, in a TestCase, you don't have multiple
StandaloneSession objects with the same session key. Consider using
UUIDUtil
to generate a unique sessionId for each
standalone session.
putInSessionCache
in interface ICacheManager
session
- The users IPentahoSessionkey
- The key by which you want to retrieve the data back outvalue
- The data item to place into the cachepublic void removeFromGlobalCache(Object key)
ICacheManager
removeFromGlobalCache
in interface ICacheManager
key
- The key that the data object was stored withpublic void removeFromSessionCache(IPentahoSession session, String key)
ICacheManager
removeFromSessionCache
in interface ICacheManager
session
- The users IPentahoSessionkey
- The key that maps to the value needing removed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |