Class DatabaseBasedAdaptiveLabelCacheDaoImpl
- java.lang.Object
- 
- com.atlassian.confluence.impl.labels.adaptivelabelcache.dao.DatabaseBasedAdaptiveLabelCacheDaoImpl
 
- 
- All Implemented Interfaces:
- AdaptiveLabelCacheDao
 
 public class DatabaseBasedAdaptiveLabelCacheDaoImpl extends Object implements AdaptiveLabelCacheDao An implementation which uses a separate table for storing persisted data- Since:
- 7.7.0
 
- 
- 
Constructor SummaryConstructors Constructor Description DatabaseBasedAdaptiveLabelCacheDaoImpl(org.hibernate.SessionFactory sessionFactory, SpaceDao spaceDao)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Clears all the recordslonggetSpaceIdByKey(String spaceKey)LabelManager does not work with space ids (only with space keys) So this method is required to retrieve spaces and get their ids Could be removed when LabelManager start supporting finding most used labels by space idStringgetSpaceKeyFromSpaceId(long spaceId)LabelManager does not work with space ids (only with space keys) So this method is required to retrieve spaces and get their keys Could be removed when LabelManager start supporting finding most used labels by space idLiteSearchResultCacheEntryread(long spaceId)Reads cached record by space id.voidremoveRecord(long spaceId)Removes a recordvoidremoveRecordsExpiredAfter(long timestamp)Clears expired recordsvoidwrite(long spaceId, LiteSearchResultCacheEntry cacheEntry)Writes cached data to the persistent cache A previous record will be overwritten
 
- 
- 
- 
Constructor Detail- 
DatabaseBasedAdaptiveLabelCacheDaoImplpublic DatabaseBasedAdaptiveLabelCacheDaoImpl(org.hibernate.SessionFactory sessionFactory, SpaceDao spaceDao)
 
- 
 - 
Method Detail- 
readpublic LiteSearchResultCacheEntry read(long spaceId) Reads cached record by space id. If cached record is expired, it will be returned anyway- Specified by:
- readin interface- AdaptiveLabelCacheDao
- Parameters:
- spaceId- - space id
- Returns:
- cached data
 
 - 
clearpublic void clear() Clears all the records- Specified by:
- clearin interface- AdaptiveLabelCacheDao
 
 - 
removeRecordsExpiredAfterpublic void removeRecordsExpiredAfter(long timestamp) Clears expired records- Specified by:
- removeRecordsExpiredAfterin interface- AdaptiveLabelCacheDao
- Parameters:
- timestamp- - timestamp
 
 - 
removeRecordpublic void removeRecord(long spaceId) Description copied from interface:AdaptiveLabelCacheDaoRemoves a record- Specified by:
- removeRecordin interface- AdaptiveLabelCacheDao
- Parameters:
- spaceId- - space id
 
 - 
writepublic void write(long spaceId, LiteSearchResultCacheEntry cacheEntry)Writes cached data to the persistent cache A previous record will be overwritten- Specified by:
- writein interface- AdaptiveLabelCacheDao
- Parameters:
- spaceId- - space id
- cacheEntry- - cache entry
 
 - 
getSpaceKeyFromSpaceIdpublic String getSpaceKeyFromSpaceId(long spaceId) LabelManager does not work with space ids (only with space keys) So this method is required to retrieve spaces and get their keys Could be removed when LabelManager start supporting finding most used labels by space id- Specified by:
- getSpaceKeyFromSpaceIdin interface- AdaptiveLabelCacheDao
- Parameters:
- spaceId- - space id
- Returns:
- space key
- Since:
- 7.7.0
 
 - 
getSpaceIdByKeypublic long getSpaceIdByKey(String spaceKey) LabelManager does not work with space ids (only with space keys) So this method is required to retrieve spaces and get their ids Could be removed when LabelManager start supporting finding most used labels by space id- Specified by:
- getSpaceIdByKeyin interface- AdaptiveLabelCacheDao
- Parameters:
- spaceKey- - space key
- Returns:
- space key
- Since:
- 7.7.0
 
 
- 
 
-