Enhydra 5.1 API

org.enhydra.dods.cache
Interface QueryCache

All Superinterfaces:
CacheAdministration
All Known Implementing Classes:
QueryCacheImpl

public interface QueryCache
extends CacheAdministration

This class contains data and mechanisms needed for caching data objects and queries.


Field Summary
static int DEFAULT_MAX_CACHE_SIZE
          Constant for maximal number of DO objects in the cache.
static int DEFAULT_MAX_COMPLEX_QUERY_CACHE_SIZE
          Constant for maximal number of Query objects in the complex query cache.
static int DEFAULT_MAX_SIMPLE_QUERY_CACHE_SIZE
          Constant for maximal number of Query objects in the simple query cache.
 
Method Summary
 QueryCacheItem addComplexQuery(QueryCacheItem queryItem)
           
 GenericDO addDO(GenericDO newDO)
           
 QueryCacheItem addSimpleQuery(QueryCacheItem queryItem)
           
 GenericDO deleteDO(GenericDO DO)
          Deletes DO from simpleQCache and complexQCache
 java.util.Map getCacheContent()
          Returns cache content.
 QueryResult getComplexQueryResults(java.lang.String dbName, java.lang.String query)
           
 GenericDO getDOByHandle(java.lang.String handle)
           
 QueryResult getQueryResults(java.lang.String dbName, java.lang.String query)
           
 QueryResult getSimpleQueryResults(java.lang.String dbName, java.lang.String query)
           
 boolean isMulti()
           
 QueryCacheItem newQueryCacheItemInstance(java.lang.String dbName)
           
 QueryCacheItem removeComplexQuery(QueryCacheItem queryItem)
           
 GenericDO removeDO(GenericDO DO)
          Remove DO from cache.
 GenericDO removeDO(java.lang.String handle)
          Remove DO from cache.
 QueryCacheItem removeSimpleQuery(QueryCacheItem queryItem)
           
 void setMulti(boolean newMulti)
           
 boolean toReconfigure()
          Checks wheather cache reconfiguration needs to be done.
 GenericDO updateDO(GenericDO DO)
           
 
Methods inherited from interface org.enhydra.dods.cache.CacheAdministration
getCacheReadOnly, getCacheSize, getCacheType, getComplexQueryCacheSize, getInitialQueryCache, getMaxCacheSize, getMaxCacheSize, getMaxComplexQueryCacheSize, getMaxComplexQueryCacheSize, getMaxSimpleQueryCacheSize, getMaxSimpleQueryCacheSize, getSimpleQueryCacheSize, isFull, setCacheReadOnly, setInitialQueryCache, setMaxCacheSize, setMaxComplexQueryCacheSize, setMaxSimpleQueryCacheSize
 

Field Detail

DEFAULT_MAX_CACHE_SIZE

public static final int DEFAULT_MAX_CACHE_SIZE
Constant for maximal number of DO objects in the cache. Used if application's configuration file doesn't contain information about maximal cache size.

See Also:
Constant Field Values

DEFAULT_MAX_SIMPLE_QUERY_CACHE_SIZE

public static final int DEFAULT_MAX_SIMPLE_QUERY_CACHE_SIZE
Constant for maximal number of Query objects in the simple query cache.

See Also:
Constant Field Values

DEFAULT_MAX_COMPLEX_QUERY_CACHE_SIZE

public static final int DEFAULT_MAX_COMPLEX_QUERY_CACHE_SIZE
Constant for maximal number of Query objects in the complex query cache.

See Also:
Constant Field Values
Method Detail

getCacheContent

public java.util.Map getCacheContent()
Returns cache content.

Returns:
cache content as Map of DO objects.

isMulti

public boolean isMulti()
Returns:
true if multi caching is used, otherwise false.

setMulti

public void setMulti(boolean newMulti)
Parameters:
newMulti - new value for multi

toReconfigure

public boolean toReconfigure()
Checks wheather cache reconfiguration needs to be done.

Returns:
true if cache reconfiguration needs to be done, otherwise false.

addDO

public GenericDO addDO(GenericDO newDO)

removeDO

public GenericDO removeDO(GenericDO DO)
Remove DO from cache.

Returns:
removed DO object.

removeDO

public GenericDO removeDO(java.lang.String handle)
Remove DO from cache.

Parameters:
handle - String representation of object Id that will be removed.
Returns:
removed DO object.

updateDO

public GenericDO updateDO(GenericDO DO)

deleteDO

public GenericDO deleteDO(GenericDO DO)
Deletes DO from simpleQCache and complexQCache


newQueryCacheItemInstance

public QueryCacheItem newQueryCacheItemInstance(java.lang.String dbName)

addSimpleQuery

public QueryCacheItem addSimpleQuery(QueryCacheItem queryItem)

removeSimpleQuery

public QueryCacheItem removeSimpleQuery(QueryCacheItem queryItem)

addComplexQuery

public QueryCacheItem addComplexQuery(QueryCacheItem queryItem)

removeComplexQuery

public QueryCacheItem removeComplexQuery(QueryCacheItem queryItem)

getDOByHandle

public GenericDO getDOByHandle(java.lang.String handle)
Parameters:
handle -
Returns:

getSimpleQueryResults

public QueryResult getSimpleQueryResults(java.lang.String dbName,
                                         java.lang.String query)

getComplexQueryResults

public QueryResult getComplexQueryResults(java.lang.String dbName,
                                          java.lang.String query)

getQueryResults

public QueryResult getQueryResults(java.lang.String dbName,
                                   java.lang.String query)

Enhydra 5.1 API