Class EventUtilDaoImpl

    • Constructor Detail

      • EventUtilDaoImpl

        public EventUtilDaoImpl()
      • EventUtilDaoImpl

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

      • getNodeLabel

        public 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 String getPrimaryInterface​(long nodeId)
      • getNodeLocation

        public 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 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 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 String getIfAlias​(long nodeId,
                                 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 String getAssetFieldValue​(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 String getHardwareFieldValue​(String parm,
                                            long nodeId)
      • 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 ID
        hostip - The event host
        Returns:
        The hostname
      • expandParms

        public String expandParms​(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 String expandParms​(String input,
                                  Event event,
                                  Map<String,​Map<String,​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