Class EventUtilDaoImpl

    • Constructor Detail

      • EventUtilDaoImpl

        public EventUtilDaoImpl()
      • EventUtilDaoImpl

        public EventUtilDaoImpl​(com.codahale.metrics.MetricRegistry registry)
    • Method Detail

      • getNodeLabel

        public java.lang.String getNodeLabel​(long nodeId)
        Description copied from interface: EventUtil
        Retrieve nodeLabel from the node table of the database given a particular nodeId.
        Parameters:
        nodeId - Node identifier
        Returns:
        nodeLabel Retreived nodeLabel
      • getPrimaryInterface

        public java.lang.String getPrimaryInterface​(long nodeId)
      • getNodeLocation

        public java.lang.String getNodeLocation​(long nodeId)
        Description copied from interface: EventUtil
        Retrieve nodeLocation from the node table of the database given a particular nodeId.
        Parameters:
        nodeId - Node identifier
        Returns:
        nodeLocation Retrieved nodeLocation
      • getForeignSource

        public java.lang.String getForeignSource​(long nodeId)
        Description copied from interface: EventUtil
        Retrieve foreign source from the node table of the database given a particular nodeId.
        Parameters:
        nodeId - Node identifier
        Returns:
        foreignSource Retrieved foreign source
      • getForeignId

        public java.lang.String getForeignId​(long nodeId)
        Description copied from interface: EventUtil
        Retrieve foreign id from the node table of the database given a particular nodeId.
        Parameters:
        nodeId - Node identifier
        Returns:
        foreignId Retrieved foreign id
      • getIfAlias

        public java.lang.String getIfAlias​(long nodeId,
                                           java.lang.String ipaddr)
        Description copied from interface: EventUtil
        Retrieve ifAlias from the snmpinterface table of the database given a particular nodeId and ipAddr.
        Parameters:
        nodeId - Node identifier
        ipaddr - Interface IP address
        Returns:
        ifAlias Retreived ifAlias
      • getAssetFieldValue

        public java.lang.String getAssetFieldValue​(java.lang.String parm,
                                                   long nodeId)
        Description copied from interface: EventUtil
        Helper method.
        Returns:
        The value of an asset field based on the nodeid of the event
      • getHardwareFieldValue

        public java.lang.String getHardwareFieldValue​(java.lang.String parm,
                                                      long nodeId)
      • getHostName

        public java.lang.String getHostName​(int nodeId,
                                            java.lang.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 ID
        hostip - The event host
        Returns:
        The hostname
      • expandParms

        public java.lang.String expandParms​(java.lang.String inp,
                                            Event event)
        Description copied from class: AbstractEventUtil
        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
        Specified by:
        expandParms in interface EventUtil
        Overrides:
        expandParms in class AbstractEventUtil
        Parameters:
        inp - the input string in which parm values are to be expanded
        event - a Event object.
        Returns:
        expanded value if the value had any parameter to expand, null otherwise
      • expandParms

        public java.lang.String expandParms​(java.lang.String input,
                                            Event event,
                                            java.util.Map<java.lang.String,​java.util.Map<java.lang.String,​java.lang.String>> decode)
        Description copied from class: AbstractEventUtil
        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
        Specified by:
        expandParms in interface EventUtil
        Overrides:
        expandParms in class AbstractEventUtil
        Parameters:
        input - the input string in which parm values are to be expanded
        event - a Event object.
        decode - the varbind decode for this
        Returns:
        expanded value if the value had any parameter to expand, null otherwise