Class SnmpTrapHelper


  • public class SnmpTrapHelper
    extends java.lang.Object
    The Class SnmpTrapHelper.

    Inspired by org.opennms.netmgt.scriptd.helper.SnmpTrapHelper from opennms-services

    Author:
    Alejandro Galue
    • Constructor Summary

      Constructors 
      Constructor Description
      SnmpTrapHelper()
      Constructs a new SNMPTrapHelper.
    • Constructor Detail

      • SnmpTrapHelper

        public SnmpTrapHelper()
        Constructs a new SNMPTrapHelper.
    • Method Detail

      • getEstimatedPacketSize

        public int getEstimatedPacketSize​(SnmpTrapConfig trapConfig,
                                          SnmpAgentConfig agentConfig)
        Gets the estimated packet size.
        Parameters:
        trapConfig - the trap configuration object
        agentConfig - the agent configuration object
        Returns:
        the estimated packet size
      • forwardTrap

        public void forwardTrap​(SnmpTrapConfig trapConfig)
                         throws SnmpTrapException
        Create an SNMP trap based on the content of the specified trap configuration, and send it to the appropriate destination.
        Parameters:
        trapConfig - The trap configuration mapping object
        Throws:
        SnmpTrapException - if any.