com.ca.jcs.cache
Class CacheManager

java.lang.Object
  extended by com.ca.jcs.cache.CacheManager
All Implemented Interfaces:
Activatable
Direct Known Subclasses:
EHCacheManager

public abstract class CacheManager
extends Object
implements Activatable

Simple wrapper around pluggable caching solution.


Field Summary
protected  Logger log
           
 
Constructor Summary
CacheManager(Logger log, String configReference)
          Create a manager using provided logger and configuration (which will be interpretted by the concrete implementation.
 
Method Summary
protected  void debug(String msg, Name ldapDn)
           
abstract  void debugDump()
          Dump the whole state of the cache to the log to aid in debugging.
protected  String entryString(String key, CachedObjectInfo cachedObjectInfo)
           
 CachedObjectInfo get(Name ldapDn)
          Return information cached for provided DN, or null if none is found (or its expired).
abstract  CachedObjectInfo getCached(Name ldapDN)
          Return information cached for provided DN, or null if none is found (or its expired).
 void put(ObjectInfo objInfo, Name connDn, Attribute objectClassAttr)
          Record information in cache, which may expire or be flushed later according to configuration.
abstract  void putCached(LdapDN ldapDn, CachedObjectInfo cachedObjectInfo)
          Record information in cache, which may expire or be flushed later according to configuration.
 boolean remove(ObjectInfo objInfo)
          Remove all information cached for the provided object and any of its contained children.
abstract  boolean removeCached(LdapDN ldapDn, boolean isContainer)
          Remove all information cached for the provided object and any of its contained children.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ca.jcs.Activatable
activate, deactivate
 

Field Detail

log

protected Logger log
Constructor Detail

CacheManager

public CacheManager(Logger log,
                    String configReference)
Create a manager using provided logger and configuration (which will be interpretted by the concrete implementation.

Method Detail

debug

protected void debug(String msg,
                     Name ldapDn)

get

public CachedObjectInfo get(Name ldapDn)
Return information cached for provided DN, or null if none is found (or its expired).


put

public void put(ObjectInfo objInfo,
                Name connDn,
                Attribute objectClassAttr)
Record information in cache, which may expire or be flushed later according to configuration.


remove

public boolean remove(ObjectInfo objInfo)
Remove all information cached for the provided object and any of its contained children.


entryString

protected String entryString(String key,
                             CachedObjectInfo cachedObjectInfo)

debugDump

public abstract void debugDump()
Dump the whole state of the cache to the log to aid in debugging.


getCached

public abstract CachedObjectInfo getCached(Name ldapDN)
                                    throws Exception
Return information cached for provided DN, or null if none is found (or its expired).

Throws:
Exception

putCached

public abstract void putCached(LdapDN ldapDn,
                               CachedObjectInfo cachedObjectInfo)
                        throws Exception
Record information in cache, which may expire or be flushed later according to configuration.

Throws:
Exception

removeCached

public abstract boolean removeCached(LdapDN ldapDn,
                                     boolean isContainer)
                              throws Exception
Remove all information cached for the provided object and any of its contained children.

Throws:
Exception


Created 2011-07-14 13:27 EST