org.opennms.netmgt.ackd.readers
Class HypericAckProcessor

java.lang.Object
  extended by org.opennms.netmgt.ackd.readers.HypericAckProcessor
All Implemented Interfaces:
Runnable, AckProcessor, org.springframework.beans.factory.InitializingBean

public class HypericAckProcessor
extends Object
implements AckProcessor

HypericAckProcessor class.

Version:
$Id: $
Author:
ranger

Field Summary
static int ALERTS_PER_HTTP_TRANSACTION
          Constant ALERTS_PER_HTTP_TRANSACTION=200
static String PARAMETER_PREFIX_HYPERIC_SOURCE
          Constant PARAMETER_PREFIX_HYPERIC_SOURCE="source:"
static String READER_NAME_HYPERIC
          Constant READER_NAME_HYPERIC="HypericReader"
 
Constructor Summary
HypericAckProcessor()
           
 
Method Summary
 void afterPropertiesSet()
          afterPropertiesSet
static List<org.opennms.netmgt.ackd.readers.HypericAckProcessor.HypericAlertStatus> fetchHypericAlerts(String hypericUrl, List<String> alertIds)
          fetchHypericAlerts
 List<OnmsAlarm> fetchUnclearedHypericAlarms()
          fetchUnclearedHypericAlarms
static OnmsAlarm findAlarmForHypericAlert(List<OnmsAlarm> alarms, String platformId, org.opennms.netmgt.ackd.readers.HypericAckProcessor.HypericAlertStatus alert)
          findAlarmForHypericAlert
static String getAlertIdParmValue(OnmsAlarm alarm)
          getAlertIdParmValue
static String getAlertSourceParmValue(OnmsAlarm alarm)
          getAlertSourceParmValue
static String getParmValueByRegex(OnmsAlarm alarm, String regex)
          Some parameter values that you might be interested in inside this class:
 String getUrlForHypericSource(String source)
          getUrlForHypericSource
static List<org.opennms.netmgt.ackd.readers.HypericAckProcessor.HypericAlertStatus> parseHypericAlerts(Reader reader)
          parseHypericAlerts
 void reloadConfigs()
          reloadConfigs
 void run()
          run
 void setAckdConfigDao(AckdConfigurationDao configDao)
          setAckdConfigDao
 void setAckService(AckService ackService)
          setAckService
 void setAlarmDao(AlarmDao dao)
          setAlarmDao
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

READER_NAME_HYPERIC

public static final String READER_NAME_HYPERIC
Constant READER_NAME_HYPERIC="HypericReader"

See Also:
Constant Field Values

PARAMETER_PREFIX_HYPERIC_SOURCE

public static final String PARAMETER_PREFIX_HYPERIC_SOURCE
Constant PARAMETER_PREFIX_HYPERIC_SOURCE="source:"

See Also:
Constant Field Values

ALERTS_PER_HTTP_TRANSACTION

public static final int ALERTS_PER_HTTP_TRANSACTION
Constant ALERTS_PER_HTTP_TRANSACTION=200

See Also:
Constant Field Values
Constructor Detail

HypericAckProcessor

public HypericAckProcessor()
Method Detail

reloadConfigs

public void reloadConfigs()

reloadConfigs

Specified by:
reloadConfigs in interface AckProcessor

fetchUnclearedHypericAlarms

public List<OnmsAlarm> fetchUnclearedHypericAlarms()

fetchUnclearedHypericAlarms

Returns:
a List object.

getUrlForHypericSource

public String getUrlForHypericSource(String source)

getUrlForHypericSource

Parameters:
source - a String object.
Returns:
a String object.

run

public void run()

run

Specified by:
run in interface Runnable

findAlarmForHypericAlert

public static OnmsAlarm findAlarmForHypericAlert(List<OnmsAlarm> alarms,
                                                 String platformId,
                                                 org.opennms.netmgt.ackd.readers.HypericAckProcessor.HypericAlertStatus alert)

findAlarmForHypericAlert

Parameters:
alarms - a List object.
platformId - a String object.
alert - a HypericAckProcessor.HypericAlertStatus object.
Returns:
a OnmsAlarm object.

getAlertSourceParmValue

public static String getAlertSourceParmValue(OnmsAlarm alarm)

getAlertSourceParmValue

Parameters:
alarm - a OnmsAlarm object.
Returns:
a String object.

getAlertIdParmValue

public static String getAlertIdParmValue(OnmsAlarm alarm)

getAlertIdParmValue

Parameters:
alarm - a OnmsAlarm object.
Returns:
a String object.

getParmValueByRegex

public static String getParmValueByRegex(OnmsAlarm alarm,
                                         String regex)

Some parameter values that you might be interested in inside this class:

Parameters:
alarm - The alarm to fetch parameters from
regex - Java regex expression with a () group that will be returned
Returns:
The matching group from the regex

fetchHypericAlerts

public static List<org.opennms.netmgt.ackd.readers.HypericAckProcessor.HypericAlertStatus> fetchHypericAlerts(String hypericUrl,
                                                                                                              List<String> alertIds)
                                                                                                       throws IOException,
                                                                                                              JAXBException,
                                                                                                              XMLStreamException

fetchHypericAlerts

Parameters:
hypericUrl - a String object.
alertIds - a List object.
Returns:
a List object.
Throws:
org.apache.commons.httpclient.HttpException - if any.
IOException - if any.
JAXBException - if any.
XMLStreamException - if any.

parseHypericAlerts

public static List<org.opennms.netmgt.ackd.readers.HypericAckProcessor.HypericAlertStatus> parseHypericAlerts(Reader reader)
                                                                                                       throws JAXBException,
                                                                                                              XMLStreamException

parseHypericAlerts

Parameters:
reader - a Reader object.
Returns:
a List object.
Throws:
JAXBException - if any.
XMLStreamException - if any.

setAckdConfigDao

public void setAckdConfigDao(AckdConfigurationDao configDao)

setAckdConfigDao

Parameters:
configDao - a AckdConfigurationDao object.

setAckService

public void setAckService(AckService ackService)

setAckService

Parameters:
ackService - a AckService object.

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception

afterPropertiesSet

Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
Exception - if any.

setAlarmDao

public void setAlarmDao(AlarmDao dao)

setAlarmDao

Parameters:
dao - a AlarmDao object.


Copyright © 2011. All Rights Reserved.