org.mmbase.applications.vprowizards.spring.cache
Class BasicOSCacheNameResolver

java.lang.Object
  extended by org.mmbase.applications.vprowizards.spring.cache.BasicOSCacheNameResolver
All Implemented Interfaces:
OSCacheNameResolver

public class BasicOSCacheNameResolver
extends Object
implements OSCacheNameResolver

This basic flushname resolver uses the FlushNameTemplateBean to clear the templates out of the flushnames. So what are templates: in order to create flushname values dynamically there is a simpel template system in place. Templates have this format:
"somecachename, type[page], something[page]"
The listresult tag checks for the values between square brackets, and then appends the nodenumber of the current row's node type matches it. The result is:
"somecachename, type[page:120], something[page:120]"
This template string is not simply replaced by the nodenumber becouse when you go back to the list using the path, this flushname will be in the session (the original flushname was probably given as a parameter from the editors menu) , so by appending the nodenumber the template can be reused.
When the flushname is finally used to flush the caches, the template is cleared from the flushname string.

Author:
ebunders

Constructor Summary
BasicOSCacheNameResolver()
           
 
Method Summary
 String resolveCacheGroupName(String flushname, HttpServletRequest request)
          create a full cache group name based on a given identifier.
 String resolveCacheKeyName(String flushname, HttpServletRequest request)
          create a full cache key name based on a given identifier.
(package private) static String stripTemplates(String flushname)
          this method strips the templates away from the flushnames and just leaves the nodenumbers.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicOSCacheNameResolver

public BasicOSCacheNameResolver()
Method Detail

stripTemplates

static String stripTemplates(String flushname)
                      throws Exception
this method strips the templates away from the flushnames and just leaves the nodenumbers. This should yield the actual flushnames.

Parameters:
flushname -
Returns:
Throws:
Exception - when there is a problem with parsing the template

resolveCacheGroupName

public String resolveCacheGroupName(String flushname,
                                    HttpServletRequest request)
Description copied from interface: OSCacheNameResolver
create a full cache group name based on a given identifier.

Specified by:
resolveCacheGroupName in interface OSCacheNameResolver
Returns:

resolveCacheKeyName

public String resolveCacheKeyName(String flushname,
                                  HttpServletRequest request)
Description copied from interface: OSCacheNameResolver
create a full cache key name based on a given identifier.

Specified by:
resolveCacheKeyName in interface OSCacheNameResolver
Returns:


MMBase 2.0-SNAPSHOT - null