org.objectweb.cjdbc.controller.cache.result
Class ResultCacheRule

java.lang.Object
  extended byorg.objectweb.cjdbc.controller.cache.result.ResultCacheRule
All Implemented Interfaces:
XmlComponent

public class ResultCacheRule
extends java.lang.Object
implements XmlComponent

This is the to define cache rules in the cache. A ResultCacheRule is defined by a queryPattern, set to 'default' if default rule, and a CacheBehavior.

Version:
1.0
Author:
Nicolas Modrzyk, Emmanuel Cecchet

Field Summary
private  boolean applyToSkeleton
           
private  CacheBehavior behavior
           
private  boolean isCaseSensitive
           
(package private)  Trace logger
           
private  org.apache.regexp.RE queryPattern
           
private  java.lang.String queryString
           
private  long timestampResolution
           
 
Fields inherited from interface org.objectweb.cjdbc.common.xml.XmlComponent
DOCTYPE_CONTROLLER, DOCTYPE_DB, XML_VERSION
 
Constructor Summary
ResultCacheRule(java.lang.String queryString, boolean caseSensitive, boolean applyToSkeleton, long timestampResolution)
          Creates a new ResultCacheRule
 
Method Summary
 CacheBehavior getCacheBehavior()
          Get the cache behavior
 org.apache.regexp.RE getQueryPattern()
          Get the query pattern
 long getTimestampResolution()
          Retrieve the timestamp resolution of this scheduler
 java.lang.String getXml()
          Get xml formatted representation of this cjdbc component
 CacheBehavior matches(AbstractRequest request)
           
 void setCacheBehavior(CacheBehavior behavior)
          Set the cache behavior
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

Trace logger

queryPattern

private org.apache.regexp.RE queryPattern

queryString

private java.lang.String queryString

isCaseSensitive

private boolean isCaseSensitive

applyToSkeleton

private boolean applyToSkeleton

timestampResolution

private long timestampResolution

behavior

private CacheBehavior behavior
Constructor Detail

ResultCacheRule

public ResultCacheRule(java.lang.String queryString,
                       boolean caseSensitive,
                       boolean applyToSkeleton,
                       long timestampResolution)
                throws org.apache.regexp.RESyntaxException
Creates a new ResultCacheRule

Parameters:
queryString - for this rule
caseSensitive - true if matching is case sensitive
applyToSkeleton - true if rule apply to query skeleton
timestampResolution - timestamp resolution for NOW() macro
Throws:
org.apache.regexp.RESyntaxException - if the query pattern is invalid
Method Detail

getQueryPattern

public org.apache.regexp.RE getQueryPattern()
Get the query pattern

Returns:
the queryPattern for this ResultCacheRule

getCacheBehavior

public CacheBehavior getCacheBehavior()
Get the cache behavior

Returns:
the CacheBehavior for this ResultCacheRule

setCacheBehavior

public void setCacheBehavior(CacheBehavior behavior)
Set the cache behavior

Parameters:
behavior - behavior for this rule

getTimestampResolution

public long getTimestampResolution()
Retrieve the timestamp resolution of this scheduler

Returns:
timestampResolution

matches

public CacheBehavior matches(AbstractRequest request)
Parameters:
request - we may want to add to the cache
Returns:
the behavior to get the entry

getXml

public java.lang.String getXml()
Description copied from interface: XmlComponent
Get xml formatted representation of this cjdbc component

Specified by:
getXml in interface XmlComponent
Returns:
xml formatted fragment
See Also:
XmlComponent.getXml()


Copyright © 2002, 2005 - ObjectWeb Consortium - All Rights Reserved.