Package org.opennms.netmgt.ackd.readers
Class HypericAckProcessor
- java.lang.Object
-
- 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
Fields Modifier and Type Field Description static int
ALERTS_PER_HTTP_TRANSACTION
ConstantALERTS_PER_HTTP_TRANSACTION=200
static String
PARAMETER_PREFIX_HYPERIC_SOURCE
ConstantPARAMETER_PREFIX_HYPERIC_SOURCE="source:"
static String
READER_NAME_HYPERIC
ConstantREADER_NAME_HYPERIC="HypericReader"
-
Constructor Summary
Constructors Constructor Description HypericAckProcessor()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterPropertiesSet()
afterPropertiesSetstatic List<org.opennms.netmgt.ackd.readers.HypericAckProcessor.HypericAlertStatus>
fetchHypericAlerts(String hypericUrl, List<String> alertIds)
fetchHypericAlertsList<OnmsAlarm>
fetchUnclearedHypericAlarms()
fetchUnclearedHypericAlarmsstatic OnmsAlarm
findAlarmForHypericAlert(List<OnmsAlarm> alarms, String platformId, org.opennms.netmgt.ackd.readers.HypericAckProcessor.HypericAlertStatus alert)
findAlarmForHypericAlertstatic String
getAlertIdParmValue(OnmsAlarm alarm)
getAlertIdParmValuestatic String
getAlertSourceParmValue(OnmsAlarm alarm)
getAlertSourceParmValuestatic String
getParmValueByRegex(OnmsAlarm alarm, String regex)
Some parameter values that you might be interested in inside this class:String
getUrlForHypericSource(String source)
getUrlForHypericSourcestatic List<org.opennms.netmgt.ackd.readers.HypericAckProcessor.HypericAlertStatus>
parseHypericAlerts(Reader reader)
parseHypericAlertsvoid
reloadConfigs()
reloadConfigsvoid
run()
runvoid
setAckdConfigDao(AckdConfigurationDao configDao)
setAckdConfigDaovoid
setAcknowledgmentDao(AcknowledgmentDao ackDao)
void
setAlarmDao(AlarmDao dao)
setAlarmDao
-
-
-
Field Detail
-
READER_NAME_HYPERIC
public static final String READER_NAME_HYPERIC
ConstantREADER_NAME_HYPERIC="HypericReader"
- See Also:
- Constant Field Values
-
PARAMETER_PREFIX_HYPERIC_SOURCE
public static final String PARAMETER_PREFIX_HYPERIC_SOURCE
ConstantPARAMETER_PREFIX_HYPERIC_SOURCE="source:"
- See Also:
- Constant Field Values
-
ALERTS_PER_HTTP_TRANSACTION
public static final int ALERTS_PER_HTTP_TRANSACTION
ConstantALERTS_PER_HTTP_TRANSACTION=200
- See Also:
- Constant Field Values
-
-
Method Detail
-
reloadConfigs
public void reloadConfigs()
reloadConfigs
- Specified by:
reloadConfigs
in interfaceAckProcessor
-
fetchUnclearedHypericAlarms
public List<OnmsAlarm> fetchUnclearedHypericAlarms()
fetchUnclearedHypericAlarms
- Returns:
- a
List
object.
-
findAlarmForHypericAlert
public static OnmsAlarm findAlarmForHypericAlert(List<OnmsAlarm> alarms, String platformId, org.opennms.netmgt.ackd.readers.HypericAckProcessor.HypericAlertStatus alert)
findAlarmForHypericAlert
-
getAlertSourceParmValue
public static String getAlertSourceParmValue(OnmsAlarm alarm)
getAlertSourceParmValue
-
getParmValueByRegex
public static String getParmValueByRegex(OnmsAlarm alarm, String regex)
Some parameter values that you might be interested in inside this class:
alert.id
: ID of the alert in the remote Hyperic HQ systemalert.baseURL
: Base URL of the Hyperic HQ service that generated the alertalert.source
: String key that identifies the Hyperic HQ service that generated the alert
- Parameters:
alarm
- The alarm to fetch parameters fromregex
- 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
- aString
object.alertIds
- aList
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
- aReader
object.- Returns:
- a
List
object. - Throws:
JAXBException
- if any.XMLStreamException
- if any.
-
setAckdConfigDao
public void setAckdConfigDao(AckdConfigurationDao configDao)
setAckdConfigDao
- Parameters:
configDao
- aAckdConfigurationDao
object.
-
setAcknowledgmentDao
public void setAcknowledgmentDao(AcknowledgmentDao ackDao)
- Parameters:
ackDao
- aAcknowledgmentDao
object.
-
afterPropertiesSet
public void afterPropertiesSet() throws Exception
afterPropertiesSet
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
Exception
- if any.
-
-