/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at
* trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
* add the following below this CDDL HEADER, with the fields enclosed
* by brackets "[]" replaced with your own identifying information:
* Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
*
* Copyright 2008 Sun Microsystems, Inc.
*/
/**
* SNMP trap test.
*/
super.setUp();
}
public void checkTraps() {
try {
// Create a taskServer for processing traps.
// This is an optional step. However using a DaemonTaskServer
// to process incomming PDUs makes it possible to empty
// the trap socket faster, thus reducing the hazards
// of trap loss.
// We set the priority of the DaemonTaskServer to
// Thread.NORM_PRIORITY so that emptying the socket takes
// precedence over trap processing.
//
// Create a listener and dispatcher for SNMP traps
// (SnmpEventReportDispatcher).
// SnmpEventReportDispatcher is run as a thread and listens
// 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()),
trapThread.start();
// One Trap
this.setDown();
// Should received 1 traps
return;
} catch (Exception e) {
fail("SyncManager::main: " +
"Exception occurred:" + e);
}
}
this.numberV1Traps++;
}
this.numberV2Traps++;
}
this.numberV3Traps++;
}
public int getNumberV1Traps() {
return this.numberV1Traps;
}
public int getNumberV2Traps() {
return this.numberV3Traps;
}
}
}