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:
10 Apr 2001
Author:
Daniel Ockeloen, Pierre van Rooden (javadocs)

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

Method Detail

init

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

get

public java.lang.String get(java.lang.String pool,
                            java.lang.String key,
                            scanpage sp)
Retrieve a file from the indicated pool's cache.
Parameters:
poolname - 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

public java.lang.String get(java.lang.String pool,
                            java.lang.String key,
                            java.lang.String line,
                            scanpage sp)
Retrieve a file from the indicated pool's cache.
Parameters:
poolname - 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

public long getExpireDate(java.lang.String poolName,
                          java.lang.String key,
                          java.lang.String expireStr)
getExpireDate.
Parameters:
poolName -  
key -  
expireStr -  
Returns:
long

getLastModDate

public long getLastModDate(java.lang.String poolName,
                           java.lang.String key)
getLastModDate.
Parameters:
poolName -  
key -  
Returns:
long

put

public java.lang.String put(java.lang.String pool,
                            java.lang.String key,
                            java.lang.String value)
Store a file in the indicated pool's cache. Returns the old value if available.
Parameters:
poolname - 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

public java.lang.String newput(java.lang.String pool,
                               javax.servlet.http.HttpServletResponse res,
                               java.lang.String key,
                               java.lang.String value,
                               java.lang.String mimeType)
Store a file in the indicated pool's cache. Returns the old value if available.
Parameters:
poolname - name of the cache pool
res - reponse 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

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

Store a file in the indicated pool's cache. Returns the old value if available.
Parameters:
poolname - 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

public void remove(java.lang.String poolName,
                   java.lang.String key)
Removes an entry from the cache pool.
Parameters:
pool - name of cache pool
key - key of the content to remove


MMBase build 1.6.5.20030923