Examples of SnmpEventReportDispatcher


Examples of com.sun.management.snmp.SnmpEventReportDispatcher

   */
  public int run() {
    int rc = 0;

    try {
      SnmpEventReportDispatcher trapAgent = new SnmpEventReportDispatcher(port);
      trapAgent.addTrapListener(this);

      Thread t = new Thread(trapAgent);
      t.start();

      System.out.println(
View Full Code Here

Examples of com.sun.management.snmp.SnmpEventReportDispatcher

            // for traps in UDP port = agent port + 1.
            // Add TrapListenerImpl as SnmpTrapListener.
            // TrapListenerImpl will receive a callback when a valid trap
            // PDU is received.
            //
            final SnmpEventReportDispatcher trapAgent =
                    new SnmpEventReportDispatcher((this.getTrapSnmpPort()),
                    null, taskServer, null);
            SNMPTrapListenerImpl trapListener = new SNMPTrapListenerImpl();
            trapAgent.addTrapListener(trapListener);
            final Thread trapThread = new Thread(trapAgent);
            trapThread.setPriority(Thread.MAX_PRIORITY);
            trapThread.start();
           
            // One Trap
            this.setDown();
           
            int trapNumbers = trapListener.getNumberV1Traps();
           
            // Should received 1 traps
            assertEquals(trapNumbers, 1);
           
            trapAgent.close();
            taskServer.terminate();

            return;

        } catch (Exception e) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.