Class CacheBackedNotificationDao
java.lang.Object
com.atlassian.confluence.plugins.like.notifications.dao.CacheBackedNotificationDao
- All Implemented Interfaces:
NotificationDao
,org.springframework.beans.factory.InitializingBean
public class CacheBackedNotificationDao
extends Object
implements NotificationDao, org.springframework.beans.factory.InitializingBean
Employs a cache to provide temporary caching of notifications.
Given the current key implementation and a max cache size of 10,000, a full cache consumes about ~4.5Mb of heap. (See ehcache.xml for configuration.)
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
boolean
exists
(LikeNotification notification) Returns true if the specified notification exists, false otherwise.void
save
(LikeNotification notification) Persist the specified notification.
-
Constructor Details
-
CacheBackedNotificationDao
public CacheBackedNotificationDao(com.atlassian.cache.CacheManager cacheFactory)
-
-
Method Details
-
afterPropertiesSet
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
Exception
-
exists
Description copied from interface:NotificationDao
Returns true if the specified notification exists, false otherwise.- Specified by:
exists
in interfaceNotificationDao
- Parameters:
notification
- the notification- Returns:
- true if the specified notification exists, false otherwise.
-
save
Description copied from interface:NotificationDao
Persist the specified notification.- Specified by:
save
in interfaceNotificationDao
- Parameters:
notification
- the notification
-