public class DatabaseBasedAdaptiveLabelCacheDaoImpl extends Object implements AdaptiveLabelCacheDao
Constructor and Description |
---|
DatabaseBasedAdaptiveLabelCacheDaoImpl(org.hibernate.SessionFactory sessionFactory,
SpaceDao spaceDao) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears all the records
|
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
|
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
|
LiteSearchResultCacheEntry |
read(long spaceId)
Reads cached record by space id.
|
void |
removeRecord(long spaceId)
Removes a record
|
void |
removeRecordsExpiredAfter(long timestamp)
Clears expired records
|
void |
write(long spaceId,
LiteSearchResultCacheEntry cacheEntry)
Writes cached data to the persistent cache
A previous record will be overwritten
|
public DatabaseBasedAdaptiveLabelCacheDaoImpl(org.hibernate.SessionFactory sessionFactory, SpaceDao spaceDao)
public LiteSearchResultCacheEntry read(long spaceId)
read
in interface AdaptiveLabelCacheDao
spaceId
- - space idpublic void clear()
clear
in interface AdaptiveLabelCacheDao
public void removeRecordsExpiredAfter(long timestamp)
removeRecordsExpiredAfter
in interface AdaptiveLabelCacheDao
timestamp
- - timestamppublic void removeRecord(long spaceId)
AdaptiveLabelCacheDao
removeRecord
in interface AdaptiveLabelCacheDao
spaceId
- - space idpublic void write(long spaceId, LiteSearchResultCacheEntry cacheEntry)
write
in interface AdaptiveLabelCacheDao
spaceId
- - space idcacheEntry
- - cache entrypublic String getSpaceKeyFromSpaceId(long spaceId)
getSpaceKeyFromSpaceId
in interface AdaptiveLabelCacheDao
spaceId
- - space idpublic long getSpaceIdByKey(String spaceKey)
getSpaceIdByKey
in interface AdaptiveLabelCacheDao
spaceKey
- - space keyCopyright © 2003–2021 Atlassian. All rights reserved.