org.deegree_impl.services.wms
Class WMSCache

java.lang.Object
  extended byjava.util.TimerTask
      extended byorg.deegree_impl.tools.Cache_Impl
          extended byorg.deegree_impl.services.wms.WMSCache
All Implemented Interfaces:
Cache, java.lang.Runnable

public class WMSCache
extends Cache_Impl

class for caching the results of GetMap and GetFeatureInfo requests. GetMap requests containing a reference to a SLD document won't be written into the cache.

Version:
$Revision: 1.8 $
Author:
Andreas Poth

Field Summary
private  int actualSize
           
private static WMSCache cache
           
private  int maxSize
           
 
Fields inherited from class org.deegree_impl.tools.Cache_Impl
data, lastCallTime
 
Fields inherited from class java.util.TimerTask
 
Constructor Summary
private WMSCache(int maxSize)
          Creates a new instance of WMSCache
 
Method Summary
 OGCWebServiceResponse get(WMSGetFeatureInfoRequest identifier)
          gets an entry from the cache.
 OGCWebServiceResponse get(WMSGetLegendGraphicRequest identifier)
          gets an entry from the cache.
 OGCWebServiceResponse get(WMSGetMapRequest identifier)
          gets an entry from the cache.
static WMSCache getInstance(int maxSize)
          realizes the singelton pattern to access/create an instance of a WMSCache
 void push(OGCWebServiceRequest identifier, java.lang.Object data)
          pushes a new entry to the cache.
 
Methods inherited from class org.deegree_impl.tools.Cache_Impl
clear, deleteOldest, get, getCurrentSize, getMaxEntries, getMaxLifeTime, getUpdateInterval, push, remove, run, setMaxEntries, setMaxLifeTime, setUpdateInterval, toString
 
Methods inherited from class java.util.TimerTask
cancel, scheduledExecutionTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

cache

private static WMSCache cache

actualSize

private int actualSize

maxSize

private int maxSize
Constructor Detail

WMSCache

private WMSCache(int maxSize)
Creates a new instance of WMSCache

Parameters:
maxSize - maximum cache size in KB
Method Detail

getInstance

public static WMSCache getInstance(int maxSize)
realizes the singelton pattern to access/create an instance of a WMSCache

Parameters:
maxSize - maximum cache size in KB
Returns:
instance of WMSCache

get

public OGCWebServiceResponse get(WMSGetMapRequest identifier)
gets an entry from the cache. The entry that shall be returned will be identified by the passed identifier. If no entry for a passed identifier can be found within the cache the method shall return null.

Parameters:
identifier - key of a entry of the cache

get

public OGCWebServiceResponse get(WMSGetLegendGraphicRequest identifier)
gets an entry from the cache. The entry that shall be returned will be identified by the passed identifier. If no entry for a passed identifier can be found within the cache the method shall return null.

Parameters:
identifier - key of a entry of the cache

get

public OGCWebServiceResponse get(WMSGetFeatureInfoRequest identifier)
gets an entry from the cache. The entry that shall be returned will be identified by the passed identifier. If no entry for a passed identifier can be found within the cache the method shall return null.

Parameters:
identifier - key of a entry of the cache

push

public void push(OGCWebServiceRequest identifier,
                 java.lang.Object data)
pushes a new entry to the cache. Each entry is marked by an unique identifier. The passed data object shall be a Image or a String.

Parameters:
identifier - identifier key of a entry of the cache
data - data object to be stored in the cache