Package org.opennms.netmgt.eventd
Class EventUtilDaoImpl
- java.lang.Object
-
- org.opennms.netmgt.eventd.AbstractEventUtil
-
- org.opennms.netmgt.eventd.EventUtilDaoImpl
-
- All Implemented Interfaces:
EventUtil
public class EventUtilDaoImpl extends AbstractEventUtil
-
-
Field Summary
-
Fields inherited from class org.opennms.netmgt.eventd.AbstractEventUtil
ASSET_BEGIN, ASSET_END_SUFFIX, ATTRIB_DELIM, HARDWARE_BEGIN, HARDWARE_END_SUFFIX, NAME_VAL_DELIM, NUM_PARMS_STR, PARM_BEGIN, PARM_BEGIN_LENGTH, PARM_END_SUFFIX, PARM_NAME_NUMBERED_PREFIX, PARM_NAME_NUMBERED_PREFIX_LENGTH, PARM_NUM_PREFIX, PARM_NUM_PREFIX_LENGTH, PARM_REGEX, PARMS_ALL, PARMS_NAMES, PARMS_VALUES, SPACE_DELIM, TAG_DESCR, TAG_DPNAME, TAG_EVENT_DB_ID, TAG_FOREIGNID, TAG_FOREIGNSOURCE, TAG_HOST, TAG_IFALIAS, TAG_IFINDEX, TAG_INTERFACE, TAG_INTERFACE_RESOLVE, TAG_LOGMSG, TAG_MOUSEOVERTEXT, TAG_NODEID, TAG_NODELABEL, TAG_NODELOCATION, TAG_OPERINSTR, TAG_PERCENT_SIGN, TAG_PRIMARY_INTERFACE_ADDRESS, TAG_SERVICE, TAG_SEVERITY, TAG_SHORT_TIME, TAG_SNMP, TAG_SNMP_COMMUNITY, TAG_SNMP_GENERIC, TAG_SNMP_ID, TAG_SNMP_IDTEXT, TAG_SNMP_SPECIFIC, TAG_SNMP_TRAP_OID, TAG_SNMP_VERSION, TAG_SNMPHOST, TAG_SOURCE, TAG_TIME, TAG_TTICKET_ID, TAG_UEI
-
-
Constructor Summary
Constructors Constructor Description EventUtilDaoImpl()EventUtilDaoImpl(com.codahale.metrics.MetricRegistry registry)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringexpandParms(String inp, Event event)Expand the value if it has parms in one of the following formats - %element% values are expanded to have the value of the element where 'element' is an element in the event DTD - %parm[values-all]% is expanded to a delimited list of all parmblock values - %parm[names-all]% is expanded to a list of all parm names - %parm[all]% is expanded to a full dump of all parmblocks - %parm[name]% is expanded to the value of the parameter named 'name' - %parm[]% is replaced by the value of the parameter named 'name', if present - %parm[# ]% is replaced by the value of the parameter number 'num', if present - %parm[##]% is replaced by the number of parameters StringexpandParms(String input, Event event, Map<String,Map<String,String>> decode)Expand the value if it has parms in one of the following formats - %element% values are expanded to have the value of the element where 'element' is an element in the event DTD - %parm[values-all]% is expanded to a delimited list of all parmblock values - %parm[names-all]% is expanded to a list of all parm names - %parm[all]% is expanded to a full dump of all parmblocks - %parm[name]% is expanded to the value of the parameter named 'name' - %parm[]% is replaced by the value of the parameter named 'name', if present - %parm[# ]% is replaced by the value of the parameter number 'num', if present - %parm[##]% is replaced by the number of parameters StringgetAssetFieldValue(String parm, long nodeId)Helper method.StringgetForeignId(long nodeId)Retrieve foreign id from the node table of the database given a particular nodeId.StringgetForeignSource(long nodeId)Retrieve foreign source from the node table of the database given a particular nodeId.StringgetHardwareFieldValue(String parm, long nodeId)StringgetHostName(int nodeId, String hostip)This method is used to convert the event host into a hostname id by performing a lookup in the database.StringgetIfAlias(long nodeId, String ipaddr)Retrieve ifAlias from the snmpinterface table of the database given a particular nodeId and ipAddr.StringgetNodeLabel(long nodeId)Retrieve nodeLabel from the node table of the database given a particular nodeId.StringgetNodeLocation(long nodeId)Retrieve nodeLocation from the node table of the database given a particular nodeId.StringgetPrimaryInterface(long nodeId)-
Methods inherited from class org.opennms.netmgt.eventd.AbstractEventUtil
decodeSnmpV2TcDateAndTime, escape, expandMapValues, getAllParamValues, getAllParmNames, getAllParmValues, getEventHost, getInstance, getNamedParmValue, getNumParmName, getNumParmValue, getResolver, setInstance, splitAndExtract
-
-
-
-
Method Detail
-
getNodeLabel
public String getNodeLabel(long nodeId)
Description copied from interface:EventUtilRetrieve nodeLabel from the node table of the database given a particular nodeId.- Parameters:
nodeId- Node identifier- Returns:
- nodeLabel Retreived nodeLabel
-
getPrimaryInterface
public String getPrimaryInterface(long nodeId)
-
getNodeLocation
public String getNodeLocation(long nodeId)
Description copied from interface:EventUtilRetrieve nodeLocation from the node table of the database given a particular nodeId.- Parameters:
nodeId- Node identifier- Returns:
- nodeLocation Retrieved nodeLocation
-
getForeignSource
public String getForeignSource(long nodeId)
Description copied from interface:EventUtilRetrieve foreign source from the node table of the database given a particular nodeId.- Parameters:
nodeId- Node identifier- Returns:
- foreignSource Retrieved foreign source
-
getForeignId
public String getForeignId(long nodeId)
Description copied from interface:EventUtilRetrieve foreign id from the node table of the database given a particular nodeId.- Parameters:
nodeId- Node identifier- Returns:
- foreignId Retrieved foreign id
-
getIfAlias
public String getIfAlias(long nodeId, String ipaddr)
Description copied from interface:EventUtilRetrieve ifAlias from the snmpinterface table of the database given a particular nodeId and ipAddr.- Parameters:
nodeId- Node identifieripaddr- Interface IP address- Returns:
- ifAlias Retreived ifAlias
-
getAssetFieldValue
public String getAssetFieldValue(String parm, long nodeId)
Description copied from interface:EventUtilHelper method.- Returns:
- The value of an asset field based on the nodeid of the event
-
getHostName
public String getHostName(int nodeId, String hostip)
This method is used to convert the event host into a hostname id by performing a lookup in the database. If the conversion is successful then the corresponding hostname will be returned to the caller.- Parameters:
nodeId- Node IDhostip- The event host- Returns:
- The hostname
-
expandParms
public String expandParms(String inp, Event event)
Description copied from class:AbstractEventUtilExpand the value if it has parms in one of the following formats - %element% values are expanded to have the value of the element where 'element' is an element in the event DTD - %parm[values-all]% is expanded to a delimited list of all parmblock values - %parm[names-all]% is expanded to a list of all parm names - %parm[all]% is expanded to a full dump of all parmblocks - %parm[name]% is expanded to the value of the parameter named 'name' - %parm[]% is replaced by the value of the parameter named 'name', if present - %parm[# ]% is replaced by the value of the parameter number 'num', if present - %parm[##]% is replaced by the number of parameters - Specified by:
expandParmsin interfaceEventUtil- Overrides:
expandParmsin classAbstractEventUtil- Parameters:
inp- the input string in which parm values are to be expandedevent- aEventobject.- Returns:
- expanded value if the value had any parameter to expand, null otherwise
-
expandParms
public String expandParms(String input, Event event, Map<String,Map<String,String>> decode)
Description copied from class:AbstractEventUtilExpand the value if it has parms in one of the following formats - %element% values are expanded to have the value of the element where 'element' is an element in the event DTD - %parm[values-all]% is expanded to a delimited list of all parmblock values - %parm[names-all]% is expanded to a list of all parm names - %parm[all]% is expanded to a full dump of all parmblocks - %parm[name]% is expanded to the value of the parameter named 'name' - %parm[]% is replaced by the value of the parameter named 'name', if present - %parm[# ]% is replaced by the value of the parameter number 'num', if present - %parm[##]% is replaced by the number of parameters - Specified by:
expandParmsin interfaceEventUtil- Overrides:
expandParmsin classAbstractEventUtil- Parameters:
input- the input string in which parm values are to be expandedevent- aEventobject.decode- the varbind decode for this- Returns:
- expanded value if the value had any parameter to expand, null otherwise
-
-