|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.nucleus.logging.VariableArgumentApplicationLoggingImpl atg.nucleus.GenericService atg.search.cache.SearchQueryCache
public class SearchQueryCache
This class is used to create components for storing performed queries (request/response) and documents in a cache.
Search information is not stored in persistent store and only available as a live value while getting response from Search Engine (QueryRequest and QueryRequest.Response objects). That is why it is required to place it in some kind of session history cache, so such information can be accessible later.
The cache is designed as a Least Recently Used (LRU) cache, so when new object is arrived and cache is full, new object will replace oldest one. All items are being expired from the cache only when it is full. The administrator is able to tune both the number of request/response objects in a history cache(via queryCount property) and the number of documents that should be cached per search(via documentCount property). It is also possible to specify -1 as unlimited size for cache.
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string |
Fields inherited from class atg.nucleus.GenericService |
---|
SERVICE_INFO_KEY |
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging |
---|
DEFAULT_LOG_TRACE_STATUS |
Fields inherited from interface atg.nucleus.logging.ApplicationLogging |
---|
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS |
Constructor Summary | |
---|---|
SearchQueryCache()
|
Method Summary | |
---|---|
void |
doStartService()
This is called after a Service has been created, placed into the naming hierarchy, and initialized with its configured property values. |
atg.search.cache.CacheElement |
get(java.lang.String pQueryId)
Returns CacheElement object (request/response) from the cache by query Id |
Document |
getDocument(java.lang.String pUrl)
Returns document object from the cache by URL |
Document |
getDocumentById(java.lang.String pId)
Returns document object from the cache by id |
atg.search.cache.SearchDocumentCache |
getDocumentCache()
Returns documentCache property. |
int |
getDocumentCount()
Returns property documentCount. |
int |
getQueryCount()
Returns property queryCount. |
void |
put(java.lang.String pQueryId,
atg.search.cache.CacheElement pCacheElement)
Puts CacheElement object (request/response) into the cache by query Id |
java.lang.String |
putDocument(java.lang.String pQueryId,
Document pDocument)
Puts document object into the cache |
void |
setDocumentCache(atg.search.cache.SearchDocumentCache pDocumentCache)
Sets documentCache property. |
void |
setDocumentCount(int pDocumentCount)
Sets documentCount property. |
void |
setQueryCount(int pQueryCount)
Sets property queryCount. |
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl |
---|
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.String CLASS_VERSION
Constructor Detail |
---|
public SearchQueryCache()
Method Detail |
---|
public int getQueryCount()
public void setQueryCount(int pQueryCount)
pQueryCount
- New value for queryCount propertypublic int getDocumentCount()
public void setDocumentCount(int pDocumentCount)
pDocumentCount
- New value for documentCount propertypublic atg.search.cache.SearchDocumentCache getDocumentCache()
public void setDocumentCache(atg.search.cache.SearchDocumentCache pDocumentCache)
pDocumentCache
- New value for documentCache propertypublic void put(java.lang.String pQueryId, atg.search.cache.CacheElement pCacheElement)
pQueryId
- Query IdpCacheElement
- CacheElement objectpublic atg.search.cache.CacheElement get(java.lang.String pQueryId)
pQueryId
- Query Id
public java.lang.String putDocument(java.lang.String pQueryId, Document pDocument)
pQueryId
- Query IdpDocument
- document object
public Document getDocument(java.lang.String pUrl)
pUrl
- document URL
public Document getDocumentById(java.lang.String pId)
pId
- document Id
public void doStartService() throws ServiceException
doStartService
in class GenericService
ServiceException
- if the Service had a problem
starting up
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |