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 intALERTS_PER_HTTP_TRANSACTIONConstantALERTS_PER_HTTP_TRANSACTION=200static StringPARAMETER_PREFIX_HYPERIC_SOURCEConstantPARAMETER_PREFIX_HYPERIC_SOURCE="source:"static StringREADER_NAME_HYPERICConstantREADER_NAME_HYPERIC="HypericReader"
-
Constructor Summary
Constructors Constructor Description HypericAckProcessor()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()afterPropertiesSetstatic List<org.opennms.netmgt.ackd.readers.HypericAckProcessor.HypericAlertStatus>fetchHypericAlerts(String hypericUrl, List<String> alertIds)fetchHypericAlertsList<OnmsAlarm>fetchUnclearedHypericAlarms()fetchUnclearedHypericAlarmsstatic OnmsAlarmfindAlarmForHypericAlert(List<OnmsAlarm> alarms, String platformId, org.opennms.netmgt.ackd.readers.HypericAckProcessor.HypericAlertStatus alert)findAlarmForHypericAlertstatic StringgetAlertIdParmValue(OnmsAlarm alarm)getAlertIdParmValuestatic StringgetAlertSourceParmValue(OnmsAlarm alarm)getAlertSourceParmValuestatic StringgetParmValueByRegex(OnmsAlarm alarm, String regex)Some parameter values that you might be interested in inside this class:StringgetUrlForHypericSource(String source)getUrlForHypericSourcestatic List<org.opennms.netmgt.ackd.readers.HypericAckProcessor.HypericAlertStatus>parseHypericAlerts(Reader reader)parseHypericAlertsvoidreloadConfigs()reloadConfigsvoidrun()runvoidsetAckdConfigDao(AckdConfigurationDao configDao)setAckdConfigDaovoidsetAcknowledgmentDao(AcknowledgmentDao ackDao)voidsetAlarmDao(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:
reloadConfigsin interfaceAckProcessor
-
fetchUnclearedHypericAlarms
public List<OnmsAlarm> fetchUnclearedHypericAlarms()
fetchUnclearedHypericAlarms
- Returns:
- a
Listobject.
-
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- aStringobject.alertIds- aListobject.- Returns:
- a
Listobject. - 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- aReaderobject.- Returns:
- a
Listobject. - Throws:
JAXBException- if any.XMLStreamException- if any.
-
setAckdConfigDao
public void setAckdConfigDao(AckdConfigurationDao configDao)
setAckdConfigDao
- Parameters:
configDao- aAckdConfigurationDaoobject.
-
setAcknowledgmentDao
public void setAcknowledgmentDao(AcknowledgmentDao ackDao)
- Parameters:
ackDao- aAcknowledgmentDaoobject.
-
afterPropertiesSet
public void afterPropertiesSet() throws ExceptionafterPropertiesSet
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
Exception- if any.
-
-