org.jboss.shotoku.cache.service.monitor
Class DummyRenewableCacheMonitorService

java.lang.Object
  extended by org.jboss.shotoku.cache.service.monitor.DummyRenewableCacheMonitorService
All Implemented Interfaces:
RenewableCacheMonitorServiceMBean

public class DummyRenewableCacheMonitorService
extends java.lang.Object
implements RenewableCacheMonitorServiceMBean

Author:
Adam Warski

Constructor Summary
DummyRenewableCacheMonitorService()
           
 
Method Summary
 void clearAlerts()
          Clears all alerts.
 java.lang.String getAlertEmail()
           
 java.util.List<CacheAlert> getAlertsForCacheItem(CacheItemOperations<?,?> rcid)
           
 java.util.Set<CacheItemOperations<?,?>> getCacheItemsWithAlerts()
           
 long getInterval()
           
 int getMaximumNumberOfAlerts()
           
 RenewableCacheServiceMBean getRenewableCacheService()
           
 java.lang.String getSmtpPassword()
           
 java.lang.String getSmtpServer()
           
 java.lang.String getSmtpUser()
           
 int getUpdateAlertIntervalMultiplier()
           
 void setAlertEmail(java.lang.String alertEmail)
           
 void setInterval(long interval)
           
 void setMaximumNumberOfAlerts(int maximumNumberOfAlerts)
           
 void setRenewableCacheService(RenewableCacheServiceMBean renewableCacheService)
           
 void setSmtpPassword(java.lang.String smtpPassword)
           
 void setSmtpServer(java.lang.String smtpServer)
           
 void setSmtpUser(java.lang.String smtpUser)
           
 void setUpdateAlertIntervalMultiplier(int updateAlertIntervalMultiplier)
           
 void start()
           
 void stop()
           
 void update()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DummyRenewableCacheMonitorService

public DummyRenewableCacheMonitorService()
Method Detail

clearAlerts

public void clearAlerts()
Description copied from interface: RenewableCacheMonitorServiceMBean
Clears all alerts.

Specified by:
clearAlerts in interface RenewableCacheMonitorServiceMBean

getAlertsForCacheItem

public java.util.List<CacheAlert> getAlertsForCacheItem(CacheItemOperations<?,?> rcid)
Specified by:
getAlertsForCacheItem in interface RenewableCacheMonitorServiceMBean
Parameters:
rcid - CacheItem} for which to get alerts.
Returns:
A list of alerts for the given CacheItem, sorted from the newest alert, or null is there are no alerts for the given cache item.

getCacheItemsWithAlerts

public java.util.Set<CacheItemOperations<?,?>> getCacheItemsWithAlerts()
Specified by:
getCacheItemsWithAlerts in interface RenewableCacheMonitorServiceMBean
Returns:
A set of CacheItemOperations, for which there are any alerts.

getInterval

public long getInterval()
Specified by:
getInterval in interface RenewableCacheMonitorServiceMBean
Returns:
Interval at which cache items will be checked, if there are no errors.

getMaximumNumberOfAlerts

public int getMaximumNumberOfAlerts()
Specified by:
getMaximumNumberOfAlerts in interface RenewableCacheMonitorServiceMBean
Returns:
Maximum number of alerts stored. After this number is exceeded, no new alerts are recorded.

getRenewableCacheService

public RenewableCacheServiceMBean getRenewableCacheService()
Specified by:
getRenewableCacheService in interface RenewableCacheMonitorServiceMBean

getUpdateAlertIntervalMultiplier

public int getUpdateAlertIntervalMultiplier()
Specified by:
getUpdateAlertIntervalMultiplier in interface RenewableCacheMonitorServiceMBean
Returns:
How many times the interval of a cache item must be exceeded, before an "key not updated" or "key too long in update" alert is issued.

setInterval

public void setInterval(long interval)
Specified by:
setInterval in interface RenewableCacheMonitorServiceMBean
Parameters:
interval - Interval at which cache items will be checked, if there are no errors.

setMaximumNumberOfAlerts

public void setMaximumNumberOfAlerts(int maximumNumberOfAlerts)
Specified by:
setMaximumNumberOfAlerts in interface RenewableCacheMonitorServiceMBean
Parameters:
maximumNumberOfAlerts - Maximum number of alerts stored. After this number is exceeded, no new alerts are recorded.

setRenewableCacheService

public void setRenewableCacheService(RenewableCacheServiceMBean renewableCacheService)
Specified by:
setRenewableCacheService in interface RenewableCacheMonitorServiceMBean

setUpdateAlertIntervalMultiplier

public void setUpdateAlertIntervalMultiplier(int updateAlertIntervalMultiplier)
Specified by:
setUpdateAlertIntervalMultiplier in interface RenewableCacheMonitorServiceMBean
Parameters:
updateAlertIntervalMultiplier - How many times the interval of a cache item must be exceeded, before an "key not updated" or "key too long in update" alert is issued.

start

public void start()
Specified by:
start in interface RenewableCacheMonitorServiceMBean

stop

public void stop()
Specified by:
stop in interface RenewableCacheMonitorServiceMBean

update

public void update()
Specified by:
update in interface RenewableCacheMonitorServiceMBean

getAlertEmail

public java.lang.String getAlertEmail()
Specified by:
getAlertEmail in interface RenewableCacheMonitorServiceMBean
Returns:
E-mail address, to whicha alerts will be sent. If this is an empty string or null, no attemps of sending alerts will be sent.

getSmtpPassword

public java.lang.String getSmtpPassword()
Specified by:
getSmtpPassword in interface RenewableCacheMonitorServiceMBean
Returns:
Smtp password to use, when sending alert e-mails.

getSmtpServer

public java.lang.String getSmtpServer()
Specified by:
getSmtpServer in interface RenewableCacheMonitorServiceMBean
Returns:
Smtp server to use, when sending alert e-mails.

getSmtpUser

public java.lang.String getSmtpUser()
Specified by:
getSmtpUser in interface RenewableCacheMonitorServiceMBean
Returns:
Smtp user to use, when sending alert e-mails. If the server does not require authentication, an empty string or null.

setAlertEmail

public void setAlertEmail(java.lang.String alertEmail)
Specified by:
setAlertEmail in interface RenewableCacheMonitorServiceMBean
Parameters:
alertEmail - E-mail address, to whicha alerts will be sent. If this is an empty string or null, no attemps of sending alerts will be sent.

setSmtpPassword

public void setSmtpPassword(java.lang.String smtpPassword)
Specified by:
setSmtpPassword in interface RenewableCacheMonitorServiceMBean
Parameters:
smtpPassword - Smtp password to use, when sending alert e-mails.

setSmtpServer

public void setSmtpServer(java.lang.String smtpServer)
Specified by:
setSmtpServer in interface RenewableCacheMonitorServiceMBean
Parameters:
smtpServer - Smtp server to use, when sending alert e-mails.

setSmtpUser

public void setSmtpUser(java.lang.String smtpUser)
Specified by:
setSmtpUser in interface RenewableCacheMonitorServiceMBean
Parameters:
smtpUser - Smtp user to use, when sending alert e-mails. If the server does not require authentication, an empty string or null.