|
Enhydra 5.1 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.enhydra.dods.cache.QueryCacheImpl
This class contains data and mechanisms needed for caching data objects and queries.
Field Summary | |
protected LRUCache |
cache
LRU cache for storing data objects. |
protected boolean |
cacheReadOnly
This attribute contains information if cache is read-only. |
protected LRUCache |
complexQCache
Cache for storing complex queries. |
protected boolean |
fullCaching
This attribute contains information if the type of caching is "full". |
protected java.lang.String |
initialQueryCache
Initial query statement, used for cache initialization. |
protected boolean |
multi
This attribute contains information if multi databases are used. |
protected LRUCache |
simpleQCache
Cache for storing simple queries. |
Fields inherited from interface org.enhydra.dods.cache.QueryCache |
DEFAULT_MAX_CACHE_SIZE, DEFAULT_MAX_COMPLEX_QUERY_CACHE_SIZE, DEFAULT_MAX_SIMPLE_QUERY_CACHE_SIZE |
Constructor Summary | |
QueryCacheImpl()
Constructor () - creates cache with its default maximal size and simple and complex query caches with their default maximal sizes. |
|
QueryCacheImpl(int maxCSize)
Constructor (int) - creates cache with maximal size maxCSize and simple and complex query caches with their default maximal sizes. |
Method Summary | |
QueryCacheItem |
addComplexQuery(QueryCacheItem queryItem)
|
GenericDO |
addDO(GenericDO newDO)
|
QueryCacheItem |
addSimpleQuery(QueryCacheItem queryItem)
|
protected void |
checkFull()
Checks if this is special type of caching - full caching and updates attribute fullCaching if necessary. |
GenericDO |
deleteDO(GenericDO DO)
Deletes DO from simpleQCache and complexQCache |
LRUCache |
getCache()
Returns cache. |
java.util.Map |
getCacheContent()
Returns cache content. |
boolean |
getCacheReadOnly()
Returns read-only attribute. |
int |
getCacheSize()
Returns size of currently used cache. |
java.lang.String |
getCacheType()
Get cache type. |
int |
getComplexQueryCacheSize()
Returns size of currently used complex query cache. |
QueryResult |
getComplexQueryResults(java.lang.String dbName,
java.lang.String query)
|
GenericDO |
getDOByHandle(java.lang.String handle)
|
java.lang.String |
getInitialQueryCache()
Returns initialQueryCache. |
int |
getMaxCacheSize()
Returns maximum cache size. |
int |
getMaxCacheSize(boolean real)
Get maximum cache size. |
int |
getMaxComplexQueryCacheSize()
Returns maximum size of complex query cache. |
int |
getMaxComplexQueryCacheSize(boolean real)
Gets maximum complex query cache size. |
int |
getMaxSimpleQueryCacheSize()
Returns maximum size of simple query cache. |
int |
getMaxSimpleQueryCacheSize(boolean real)
Gets maximum simple query cache size. |
QueryResult |
getQueryResults(java.lang.String dbName,
java.lang.String query)
|
int |
getSimpleQueryCacheSize()
Returns size of currently used simple query cache. |
QueryResult |
getSimpleQueryResults(java.lang.String dbName,
java.lang.String query)
|
boolean |
isFull()
Returns |
boolean |
isMulti()
|
QueryCacheItem |
newQueryCacheItemInstance(java.lang.String dbName)
|
void |
readConfiguration(Config config,
Config globalConfig)
Read cache configuration from application's configuration file. |
void |
refresh()
Refreshes caches. |
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 |
setCacheReadOnly(boolean readOnly)
Sets read-only attribute. |
void |
setInitialQueryCache(java.lang.String initQ)
Sets initialQueryCache attribute. |
void |
setMaxCacheSize(int maxSize)
Sets maximum cache size. |
void |
setMaxComplexQueryCacheSize(int maxSize)
Sets maximum size of complex query cache. |
void |
setMaxSimpleQueryCacheSize(int maxSize)
Sets maximum size of simple query cache. |
void |
setMulti(boolean newMulti)
|
void |
show()
Shows content of this class. |
boolean |
toReconfigure()
Checks wheather cache reconfiguration needs to be done. |
java.lang.String |
toString()
Shows content of this class. |
GenericDO |
updateDO(GenericDO DO)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected LRUCache cache
protected LRUCache simpleQCache
protected LRUCache complexQCache
protected boolean cacheReadOnly
protected java.lang.String initialQueryCache
protected boolean fullCaching
protected boolean multi
Constructor Detail |
public QueryCacheImpl(int maxCSize)
maxCSize
- maximal cache size.public QueryCacheImpl()
Method Detail |
public void refresh()
public java.util.Map getCacheContent()
getCacheContent
in interface QueryCache
HashMap
of DO objects.public int getMaxCacheSize()
getMaxCacheSize
in interface CacheAdministration
public int getMaxCacheSize(boolean real)
getMaxCacheSize
in interface CacheAdministration
real
- If this parameter is true method return real maximum cache
size, othervise return appropriate value for statistic.
public int getCacheSize()
getCacheSize
in interface CacheAdministration
public void setMaxCacheSize(int maxSize)
setMaxCacheSize
in interface CacheAdministration
maxSize
- Maximum cache size.public int getMaxSimpleQueryCacheSize()
getMaxSimpleQueryCacheSize
in interface CacheAdministration
public int getMaxSimpleQueryCacheSize(boolean real)
getMaxSimpleQueryCacheSize
in interface CacheAdministration
real
- If this parameter is true method return real maximum cache
size, othervise return appropriate value for statistic.
public void setMaxSimpleQueryCacheSize(int maxSize)
setMaxSimpleQueryCacheSize
in interface CacheAdministration
maxSize
- maximum size of simple query cache.public int getSimpleQueryCacheSize()
getSimpleQueryCacheSize
in interface CacheAdministration
public int getMaxComplexQueryCacheSize()
getMaxComplexQueryCacheSize
in interface CacheAdministration
public int getMaxComplexQueryCacheSize(boolean real)
getMaxComplexQueryCacheSize
in interface CacheAdministration
real
- If this parameter is true method return real maximum cache
size, othervise return appropriate value for statistic.
public void setMaxComplexQueryCacheSize(int maxSize)
setMaxComplexQueryCacheSize
in interface CacheAdministration
maxSize
- maximum size of complex query cache.public int getComplexQueryCacheSize()
getComplexQueryCacheSize
in interface CacheAdministration
public void setCacheReadOnly(boolean readOnly)
setCacheReadOnly
in interface CacheAdministration
readOnly
- New read-only value.public boolean getCacheReadOnly()
getCacheReadOnly
in interface CacheAdministration
public void setInitialQueryCache(java.lang.String initQ)
setInitialQueryCache
in interface CacheAdministration
initQ
- New initialQueryCache.public java.lang.String getInitialQueryCache()
getInitialQueryCache
in interface CacheAdministration
public boolean isFull()
isFull
in interface CacheAdministration
public boolean isMulti()
isMulti
in interface QueryCache
public void setMulti(boolean newMulti)
setMulti
in interface QueryCache
newMulti
- new value for multipublic LRUCache getCache()
public boolean toReconfigure()
toReconfigure
in interface QueryCache
public void readConfiguration(Config config, Config globalConfig)
config
- configuration for this cache.globalConfig
- default configuration for all application's caches.protected void checkFull()
public GenericDO addDO(GenericDO newDO)
addDO
in interface QueryCache
public GenericDO removeDO(GenericDO DO)
removeDO
in interface QueryCache
public GenericDO removeDO(java.lang.String handle)
removeDO
in interface QueryCache
handle
- String representation of object Id that will be removed.
public java.lang.String getCacheType()
getCacheType
in interface CacheAdministration
public GenericDO updateDO(GenericDO DO)
updateDO
in interface QueryCache
public GenericDO deleteDO(GenericDO DO)
deleteDO
in interface QueryCache
public QueryCacheItem newQueryCacheItemInstance(java.lang.String dbName)
newQueryCacheItemInstance
in interface QueryCache
public QueryCacheItem addSimpleQuery(QueryCacheItem queryItem)
addSimpleQuery
in interface QueryCache
public QueryCacheItem removeSimpleQuery(QueryCacheItem queryItem)
removeSimpleQuery
in interface QueryCache
public QueryCacheItem addComplexQuery(QueryCacheItem queryItem)
addComplexQuery
in interface QueryCache
public QueryCacheItem removeComplexQuery(QueryCacheItem queryItem)
removeComplexQuery
in interface QueryCache
public GenericDO getDOByHandle(java.lang.String handle)
getDOByHandle
in interface QueryCache
handle
-
public QueryResult getSimpleQueryResults(java.lang.String dbName, java.lang.String query)
getSimpleQueryResults
in interface QueryCache
public QueryResult getComplexQueryResults(java.lang.String dbName, java.lang.String query)
getComplexQueryResults
in interface QueryCache
public QueryResult getQueryResults(java.lang.String dbName, java.lang.String query)
getQueryResults
in interface QueryCache
public void show()
public java.lang.String toString()
toString
in class java.lang.Object
|
Enhydra 5.1 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |