Class DatabaseBasedAdaptiveLabelCacheDaoImpl
java.lang.Object
com.atlassian.confluence.impl.labels.adaptivelabelcache.dao.DatabaseBasedAdaptiveLabelCacheDaoImpl
- All Implemented Interfaces:
AdaptiveLabelCacheDao
An implementation which uses a separate table for storing persisted data
- Since:
- 7.7.0
-
Constructor Summary
ConstructorsConstructorDescriptionDatabaseBasedAdaptiveLabelCacheDaoImpl(org.hibernate.SessionFactory sessionFactory, SpaceDao spaceDao) -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()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 idgetSpaceKeyFromSpaceId(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 idread(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 Details
-
DatabaseBasedAdaptiveLabelCacheDaoImpl
public DatabaseBasedAdaptiveLabelCacheDaoImpl(org.hibernate.SessionFactory sessionFactory, SpaceDao spaceDao)
-
-
Method Details
-
read
Description copied from interface:AdaptiveLabelCacheDaoReads cached record by space id. If cached record is expired, it will be returned anyway- Specified by:
readin interfaceAdaptiveLabelCacheDao- Parameters:
spaceId- - space id- Returns:
- cached data
-
clear
public void clear()Description copied from interface:AdaptiveLabelCacheDaoClears all the records- Specified by:
clearin interfaceAdaptiveLabelCacheDao
-
removeRecordsExpiredAfter
public void removeRecordsExpiredAfter(long timestamp) Description copied from interface:AdaptiveLabelCacheDaoClears expired records- Specified by:
removeRecordsExpiredAfterin interfaceAdaptiveLabelCacheDao- Parameters:
timestamp- - timestamp
-
removeRecord
public void removeRecord(long spaceId) Description copied from interface:AdaptiveLabelCacheDaoRemoves a record- Specified by:
removeRecordin interfaceAdaptiveLabelCacheDao- Parameters:
spaceId- - space id
-
write
Description copied from interface:AdaptiveLabelCacheDaoWrites cached data to the persistent cache A previous record will be overwritten- Specified by:
writein interfaceAdaptiveLabelCacheDao- Parameters:
spaceId- - space idcacheEntry- - cache entry
-
getSpaceKeyFromSpaceId
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 interfaceAdaptiveLabelCacheDao- Parameters:
spaceId- - space id- Returns:
- space key
- Since:
- 7.7.0
-
getSpaceIdByKey
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 interfaceAdaptiveLabelCacheDao- Parameters:
spaceKey- - space key- Returns:
- space key
- Since:
- 7.7.0
-