org.opennms.netmgt.dao.castor
Class DefaultAckdConfigurationDao

java.lang.Object
  extended by org.opennms.netmgt.dao.castor.AbstractCastorConfigDao<AckdConfiguration,AckdConfiguration>
      extended by org.opennms.netmgt.dao.castor.DefaultAckdConfigurationDao
All Implemented Interfaces:
AckdConfigurationDao, org.springframework.beans.factory.InitializingBean

public class DefaultAckdConfigurationDao
extends AbstractCastorConfigDao<AckdConfiguration,AckdConfiguration>
implements AckdConfigurationDao

Default implementation of AckdConfiguration containing utility methods for manipulating the Ackd and AckdReaders.

Version:
$Id: $
Author:
David Hustace

Nested Class Summary
 
Nested classes/interfaces inherited from class org.opennms.netmgt.dao.castor.AbstractCastorConfigDao
AbstractCastorConfigDao.CastorReloadCallback
 
Constructor Summary
DefaultAckdConfigurationDao()
          Constructor for DefaultAckdConfigurationDao.
 
Method Summary
 Boolean acknowledgmentMatch(List<String> messageText)
          Utility method for determining if a reply email should acknowledge an acknowledgable
 Boolean clearMatch(List<String> messageText)
          Utility method for determining if a reply email should clear an acknowledgable
 Boolean escalationMatch(List<String> messageText)
          Utility method for determining if a reply email should escalate an acknowledgable
 AckdConfiguration getConfig()
          getConfig
 int getEnabledReaderCount()
          getEnabledReaderCount
 List<Parameter> getParametersForReader(String name)
          getParametersForReader
 Reader getReader(String readerName)
          Utility method to retrieve a readers configuration by name.
 ReaderSchedule getReaderSchedule(String readerName)
          Utility method to retrieve a schedule defined for a reader.
 boolean isReaderEnabled(String readerName)
          Utility method that determines if a named reader's configuration is enabled.
 void reloadConfiguration()
          The exception boils up from the container class The container class should indicate this.
 AckdConfiguration translateConfig(AckdConfiguration castorConfig)
          translateConfig
 Boolean unAcknowledgmentMatch(List<String> messageText)
          Utility method for determining if a reply email should unacknoweledge an acknowledgable
 
Methods inherited from class org.opennms.netmgt.dao.castor.AbstractCastorConfigDao
afterPropertiesSet, createLoadedLogMessage, getConfigResource, getContainer, getDescription, getReloadCheckInterval, loadConfig, log, setConfigResource, setReloadCheckInterval
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultAckdConfigurationDao

public DefaultAckdConfigurationDao()

Constructor for DefaultAckdConfigurationDao.

Method Detail

getConfig

public AckdConfiguration getConfig()

getConfig

Specified by:
getConfig in interface AckdConfigurationDao
Returns:
a AckdConfiguration object.

translateConfig

public AckdConfiguration translateConfig(AckdConfiguration castorConfig)

translateConfig

Specified by:
translateConfig in class AbstractCastorConfigDao<AckdConfiguration,AckdConfiguration>
Parameters:
castorConfig - a K object.
Returns:
a V object.

acknowledgmentMatch

public Boolean acknowledgmentMatch(List<String> messageText)
Utility method for determining if a reply email should acknowledge an acknowledgable

Specified by:
acknowledgmentMatch in interface AckdConfigurationDao
Parameters:
messageText - a List object.
Returns:
Boolean

clearMatch

public Boolean clearMatch(List<String> messageText)
Utility method for determining if a reply email should clear an acknowledgable

Specified by:
clearMatch in interface AckdConfigurationDao
Parameters:
messageText - a List object.
Returns:
Boolean

escalationMatch

public Boolean escalationMatch(List<String> messageText)
Utility method for determining if a reply email should escalate an acknowledgable

Specified by:
escalationMatch in interface AckdConfigurationDao
Parameters:
messageText - a List object.
Returns:
Boolean

unAcknowledgmentMatch

public Boolean unAcknowledgmentMatch(List<String> messageText)
Utility method for determining if a reply email should unacknoweledge an acknowledgable

Specified by:
unAcknowledgmentMatch in interface AckdConfigurationDao
Parameters:
messageText - a List object.
Returns:
Boolean

getReader

public Reader getReader(String readerName)
Utility method to retrieve a readers configuration by name. Each AckdReader requires that a name property is defined and the configuration uses that name to retrieve configuration details for that named reader.

Specified by:
getReader in interface AckdConfigurationDao
Parameters:
readerName - a String object.
Returns:
a Reader configuration

getReaderSchedule

public ReaderSchedule getReaderSchedule(String readerName)
Utility method to retrieve a schedule defined for a reader. Each AckdReader requires that a name property is defined and the configuration uses that name to retrieve configuration details for that named reader.

Specified by:
getReaderSchedule in interface AckdConfigurationDao
Parameters:
readerName - a String object.
Returns:
a ReaderSchedule

isReaderEnabled

public boolean isReaderEnabled(String readerName)
Utility method that determines if a named reader's configuration is enabled. Each AckdReader requires that a name property is defined and the configuration uses that name to retrieve configuration details for that named reader.

Specified by:
isReaderEnabled in interface AckdConfigurationDao
Parameters:
readerName - a String object.
Returns:
a boolean.

reloadConfiguration

public void reloadConfiguration()
                         throws org.springframework.dao.DataAccessResourceFailureException
The exception boils up from the container class The container class should indicate this.

Specified by:
reloadConfiguration in interface AckdConfigurationDao
Throws:
org.springframework.dao.DataAccessResourceFailureException - if any.

getEnabledReaderCount

public int getEnabledReaderCount()

getEnabledReaderCount

Specified by:
getEnabledReaderCount in interface AckdConfigurationDao
Returns:
a int.

getParametersForReader

public List<Parameter> getParametersForReader(String name)

getParametersForReader

Specified by:
getParametersForReader in interface AckdConfigurationDao
Parameters:
name - a String object.
Returns:
a List object.


Copyright © 2011. All Rights Reserved.