|
|||||||||
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.commerce.endeca.cache.DimensionValueCacheTools
public class DimensionValueCacheTools
A tools class for the DimensionValueCache that contains useful and reusable methods. Some functionality must be synchronized as we use global cache components. There is one cache refresh lock per cache. When we synchronize on this object it means that different threads can execute on different caches simultaneously, however two threads cannot modify the same cache at the same time.
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string |
static java.lang.String |
DATA_DATE
Attribute that indicates last baseline index time |
static java.lang.String |
DEFAULT_CACHE_NAME
Default cache name |
static java.lang.String |
NUM_GENERATIONS
Attribute that indicates number of partial updates |
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 | |
---|---|
DimensionValueCacheTools()
|
Method Summary | |
---|---|
atg.commerce.endeca.cache.DimensionValueCache |
createEmptyCache()
Creates an empty DimensionValueCache. |
void |
fillEmptyCache()
Method to populate an empty cache. |
java.util.List<DimensionValueCacheObject> |
get(java.lang.String pRepositoryId)
Get the dimension values that map to the repository item whose id is passed in. |
protected java.util.List<DimensionValueCacheObject> |
get(java.lang.String pRepositoryId,
boolean pRefresh)
Get an object from the cache. |
DimensionValueCacheObject |
get(java.lang.String pRepositoryId,
java.util.List<java.lang.String> pAncestorIds)
Get a specific dimension value that maps to the repository item whose id is passed in. |
java.util.List |
getAncestorIds(java.lang.String pRepositoryId)
A list of ancestor ids representing the default catalog path from the repository item whose id is passed in, to the catalogs root category. |
AssemblerApplicationConfiguration |
getAssemblerApplicationConfiguration()
|
AssemblerTools |
getAssemblerTools()
|
atg.commerce.endeca.cache.DimensionValueCache |
getCache()
Uses the currentApplicationKey on the assemblerApplicationConfiguration component to return a DimensionValueCache that corresponds to the current context. |
DimensionValueCacheObject |
getCachedObjectForDimval(java.lang.String pDimvalId)
Get the cached object for the passed in dimension value id. |
protected atg.commerce.endeca.cache.DimensionValueCache |
getCacheFromRequest(DynamoHttpServletRequest pRequest)
Checks the current request for a saved cache. |
java.lang.String |
getCacheRefreshHandlerName()
|
protected atg.commerce.endeca.cache.DimensionValueCacheTools.CacheRefreshLock |
getCacheRefreshLock(java.lang.String pApplicationKey)
Returns the CacheRefeshLock from the mCacheRefreshLocks Map. |
CatalogTools |
getCatalogTools()
|
long |
getCheckMDEXUpdatedEveryNRequests()
|
protected DimensionValueCacheObject |
getEntryWithSpecificAncestors(java.lang.String pRepositoryId,
java.util.List<java.lang.String> pAncestorIds)
Iterates over the objects in pAllResults and looks for one that has the specified ancestors pAncestorIds. |
protected atg.commerce.endeca.cache.DimensionValueCacheTools.MdexStats |
getMDEXStats()
data_date represents the time of index creation (i.e. |
protected java.lang.String |
getMDEXStatsURL()
|
long |
getMinimumCacheRefreshIntervalSecs()
|
java.lang.String |
getSavedRequestCachePath()
|
boolean |
isCheckMDEXUpdated()
|
java.lang.String |
printCacheMap()
Prints the contents of all caches managed by this DimensionValueCacheTools component. |
void |
refreshCache()
Refreshes the cache by making a call the cache refresh handler. |
protected void |
saveCacheInRequest(DynamoHttpServletRequest pRequest,
atg.commerce.endeca.cache.DimensionValueCache pCache)
Saves the resolved cache in the request |
void |
setAssemblerApplicationConfiguration(AssemblerApplicationConfiguration pAssemblerApplicationConfiguration)
|
void |
setAssemblerTools(AssemblerTools pAssemblerTools)
|
void |
setCacheRefreshHandlerName(java.lang.String pCacheRefreshHandlerName)
|
void |
setCatalogTools(CatalogTools pCatalogTools)
|
void |
setCheckMDEXUpdated(boolean pCheckMDEXUpdated)
|
void |
setCheckMDEXUpdatedEveryNRequests(long pCheckMDEXUpdatedEveryNRequests)
|
void |
setMinimumCacheRefreshIntervalSecs(long pMinimumCacheRefreshIntervalSecs)
|
void |
setSavedRequestCachePath(java.lang.String pSavedRequestCachePath)
|
void |
swapCache(atg.commerce.endeca.cache.DimensionValueCache pOfflineCache)
Swap in the offline cache map entry to the live one and remove the entry from the offline map. |
protected long |
timeSinceLastUpdateSecs(long pLastCacheUpdate)
Number of seconds since the last cache update |
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl |
---|
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, 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
public static final java.lang.String DEFAULT_CACHE_NAME
public static final java.lang.String DATA_DATE
public static final java.lang.String NUM_GENERATIONS
Constructor Detail |
---|
public DimensionValueCacheTools()
Method Detail |
---|
public AssemblerTools getAssemblerTools()
public void setAssemblerTools(AssemblerTools pAssemblerTools)
mAssemblerTools
- the mAssemblerTools to setpublic CatalogTools getCatalogTools()
public void setCatalogTools(CatalogTools pCatalogTools)
mCatalogTools
- the mCatalogTools to setpublic java.lang.String getCacheRefreshHandlerName()
public void setCacheRefreshHandlerName(java.lang.String pCacheRefreshHandlerName)
mCacheRefreshHandlerName
- the mCacheRefreshHandlerName to setpublic long getMinimumCacheRefreshIntervalSecs()
public void setMinimumCacheRefreshIntervalSecs(long pMinimumCacheRefreshIntervalSecs)
mMinimumCacheRefreshIntervalSecs
- the
mMinimumCacheRefreshIntervalSecs to set.public AssemblerApplicationConfiguration getAssemblerApplicationConfiguration()
public void setAssemblerApplicationConfiguration(AssemblerApplicationConfiguration pAssemblerApplicationConfiguration)
assemblerApplicationConfiguration
- the assemblerApplicationConfiguration to setpublic boolean isCheckMDEXUpdated()
public void setCheckMDEXUpdated(boolean pCheckMDEXUpdated)
pCheckMDEXUpdated
- Set a new checkMDEXUpdated boolean that controls
whether we should check and see if the MDEX has been updated since the
last cache refresh.public long getCheckMDEXUpdatedEveryNRequests()
public void setCheckMDEXUpdatedEveryNRequests(long pCheckMDEXUpdatedEveryNRequests)
pCheckMDEXUpdatedEveryNCacheRequests
- Set the number of cache
requests before we compare the timestamp on the MDEX to that on the cache.public java.lang.String getSavedRequestCachePath()
public void setSavedRequestCachePath(java.lang.String pSavedRequestCachePath)
pSavedRequestCachePath
- Set a new savedRequestCachePath.public atg.commerce.endeca.cache.DimensionValueCache getCache()
public java.util.List getAncestorIds(java.lang.String pRepositoryId)
public DimensionValueCacheObject getCachedObjectForDimval(java.lang.String pDimvalId)
pDimvalId
- A dimension value id.
public java.util.List<DimensionValueCacheObject> get(java.lang.String pRepositoryId)
pRepositoryId
- A repository id
protected java.util.List<DimensionValueCacheObject> get(java.lang.String pRepositoryId, boolean pRefresh)
pRepositoryId
- The item to get from that cache with this repository
id.pRefresh
- If the item does not exist we perform an option refresh
and try to retrieve it again.
public DimensionValueCacheObject get(java.lang.String pRepositoryId, java.util.List<java.lang.String> pAncestorIds)
pRepositoryId
- A repository idpAncestorIds
- A list of ancestor ids. Can be null or empty to
indicate a top level parent item.
protected DimensionValueCacheObject getEntryWithSpecificAncestors(java.lang.String pRepositoryId, java.util.List<java.lang.String> pAncestorIds)
pRepositoryId
- pAncestorIds
- pAllObjects
-
public void refreshCache()
public void swapCache(atg.commerce.endeca.cache.DimensionValueCache pOfflineCache)
pOfflineCache
- The cache that will go live.public void fillEmptyCache()
public atg.commerce.endeca.cache.DimensionValueCache createEmptyCache()
protected atg.commerce.endeca.cache.DimensionValueCacheTools.CacheRefreshLock getCacheRefreshLock(java.lang.String pApplicationKey)
pApplicationKey
-
public java.lang.String printCacheMap()
protected long timeSinceLastUpdateSecs(long pLastCacheUpdate)
pLastCacheUpdate
-
protected java.lang.String getMDEXStatsURL()
protected atg.commerce.endeca.cache.DimensionValueCacheTools.MdexStats getMDEXStats()
protected atg.commerce.endeca.cache.DimensionValueCache getCacheFromRequest(DynamoHttpServletRequest pRequest)
protected void saveCacheInRequest(DynamoHttpServletRequest pRequest, atg.commerce.endeca.cache.DimensionValueCache pCache)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |