com.atlassian.confluence.plugins.like.notifications.dao
Class EhCacheNotificationDao

java.lang.Object
  extended by com.atlassian.confluence.plugins.like.notifications.dao.EhCacheNotificationDao
All Implemented Interfaces:
NotificationDao, org.springframework.beans.factory.InitializingBean

public class EhCacheNotificationDao
extends Object
implements NotificationDao, org.springframework.beans.factory.InitializingBean

Employs an EhCache cache with a 2 week TTL to provide temporary persistence of notifications. Given the current CacheKey implementation and a max cache size of 10,000, a full cache consumes about ~4.5Mb of heap.


Nested Class Summary
static class EhCacheNotificationDao.CacheKey
           
 
Field Summary
static String CACHE_NAME
           
static int CACHE_SIZE
           
static long TWO_WEEKS_SECONDS
           
 
Constructor Summary
EhCacheNotificationDao(ClusterManager clusterManager, net.sf.ehcache.CacheManager cacheManager)
           
 
Method Summary
 void afterPropertiesSet()
           
 boolean exists(LikeNotification notification)
          Returns true if the specified notification exists, false otherwise.
 void save(LikeNotification notification)
          Persist the specified notification.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TWO_WEEKS_SECONDS

public static final long TWO_WEEKS_SECONDS
See Also:
Constant Field Values

CACHE_SIZE

public static final int CACHE_SIZE
See Also:
Constant Field Values

CACHE_NAME

public static final String CACHE_NAME
Constructor Detail

EhCacheNotificationDao

public EhCacheNotificationDao(ClusterManager clusterManager,
                              net.sf.ehcache.CacheManager cacheManager)
Method Detail

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
Exception

exists

public boolean exists(LikeNotification notification)
Description copied from interface: NotificationDao
Returns true if the specified notification exists, false otherwise.

Specified by:
exists in interface NotificationDao
Parameters:
notification - the notification
Returns:
true if the specified notification exists, false otherwise.

save

public void save(LikeNotification notification)
Description copied from interface: NotificationDao
Persist the specified notification.

Specified by:
save in interface NotificationDao
Parameters:
notification - the notification


Copyright © 2003-2012 Atlassian. All Rights Reserved.