org.mmbase.module
Interface scancacheInterface

All Known Implementing Classes:
scancache

public interface scancacheInterface

File cache system interface. System for caching texts (it stores and retrieves strings) by use of a key. While in theory it is possible to cache ANY text, this is mainly used to store pages based on their url.
Caching is done in pools. Each pool has its own memory cache and files, and has different ways to handle file caching.

Version:
$Id: scancacheInterface.java 35335 2009-05-21 08:14:41Z michiel $
Author:
Daniel Ockeloen, Pierre van Rooden (javadocs)
Application:
SCAN
Rename:
SCANCacheInterface

Method Summary
 String get(String pool, String key, scanpage sp)
          Retrieve a file from the indicated pool's cache.
 String get(String pool, String key, String line, scanpage sp)
          Retrieve a file from the indicated pool's cache.
 long getExpireDate(String poolName, String key, String expireStr)
          getExpireDate.
 long getLastModDate(String poolName, String key)
          getLastModDate.
 void init()
          Initializes the module.
 String newput(String pool, HttpServletResponse res, String key, String value, String mimeType)
          Store a file in the indicated pool's cache.
 String newput2(String pool, String key, String value, int cachetype, String mimeType)
          Deprecated. Temporary hack for solving asis problems (?). Use newput(String, HttpServletResponse, String, String, String) instead.
 String put(String pool, String key, String value)
          Store a file in the indicated pool's cache.
 void remove(String poolName, String key)
          Removes an entry from the cache pool.
 

Method Detail

init

void init()
Initializes the module. Also defined in ModuleInterface, so why is it in here?


get

String get(String pool,
           String key,
           scanpage sp)
Retrieve a file from the indicated pool's cache.

Parameters:
pool - name of the cache pool
key - key under which the content was cached
Returns:
the cached content as a string, or null if no entry was found (i.e. cache was empty or poolname was invalid).

get

String get(String pool,
           String key,
           String line,
           scanpage sp)
Retrieve a file from the indicated pool's cache.

Parameters:
pool - name of the cache pool
key - key under which the content was cached
line - options for retrieving, such as an expiration value
Returns:
the cached content as a string, or null if no entry was found (i.e. cache was empty or poolname was invalid).

getExpireDate

long getExpireDate(String poolName,
                   String key,
                   String expireStr)
getExpireDate.

Parameters:
poolName -
key -
expireStr -
Returns:
long

getLastModDate

long getLastModDate(String poolName,
                    String key)
getLastModDate.

Parameters:
poolName -
key -
Returns:
long

put

String put(String pool,
           String key,
           String value)
Store a file in the indicated pool's cache. Returns the old value if available.

Parameters:
pool - name of the cache pool
key - key under which the content was cached
value - content to store
Returns:
the old cached content as a string, or null if no entry was found

newput

String newput(String pool,
              HttpServletResponse res,
              String key,
              String value,
              String mimeType)
Store a file in the indicated pool's cache. Returns the old value if available.

Parameters:
pool - name of the cache pool
res - response object for retrieving headers (used by mmbase.org?)
key - key under which the content was cached
value - content to store
mimeType - the content's mime type
Returns:
the old cached content as a string, or null if no entry was found

newput2

String newput2(String pool,
               String key,
               String value,
               int cachetype,
               String mimeType)
Deprecated. Temporary hack for solving asis problems (?). Use newput(String, HttpServletResponse, String, String, String) instead.

Store a file in the indicated pool's cache. Returns the old value if available.

Parameters:
pool - name of the cache pool
key - key under which the content was cached
value - content to store
cachetype - only needed for cachepool "PAGE". If 0, no file transfer is performed. Otherwise the NetFileSrv builder is invoked to start the VWM that handles the transfer.
mimeType - the page's mime type, only needed for cachepool "PAGE"
Returns:
the old cached content as a string, or null if no entry was found

remove

void remove(String poolName,
            String key)
Removes an entry from the cache pool.

Parameters:
poolName - name of cache pool
key - key of the content to remove


MMBase 2.0-SNAPSHOT - null