/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2009 Sun Microsystems Inc. All Rights Reserved
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (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
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* at opensso/legal/CDDLv1.0.txt.
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* $Id: LinkTrapGenerator.java,v 1.1 2009/06/19 02:23:15 bigfatrat Exp $
*
*/
/*
* Portions Copyrighted 2011 ForgeRock AS
*/
/**
* The LinkTrapGenerator class is used by the agent to trigger the
* emission of SNMP v1 or v3 traps at a specific rate and according
* to a specific entry from the "IfTable".
*/
implements LinkTrapGeneratorMBean, MBeanRegistration {
// MBean properties.
//
/**
* Constructors.
*/
}
}
/**
* MBean registration interface implementation.
*/
throws Exception {
// Create an object name if it was not given.
//
ifIndex);
}
// Extract the value of ifIndex from the object name.
//
try {
} catch (NumberFormatException nfe){
ifIndex = 1;
}
"returned\n");
return name;
}
}
// Stop the thread.
//
interrupt();
try {
// Wait until the thread die.
//
join();
} catch (InterruptedException ie) {
}
}
public void postDeregister() {
}
}
}
}
}
}
}
public void run() {
// If nbTraps = -1, the link trap generator will trigger traps
// continuously.
// Otherwise, the link trap generator will trigger traps nbTraps
// times.
//
int remainingTraps = nbTraps;
try {
} catch (InterruptedException ie) {
}
triggerTrap();
}
}
public void triggerTrap() {
// TODO
//IfEntryImpl ifEntryImpl = InterfacesImpl.find(ifIndex);
//if (ifEntryImpl == null) {
//java.lang.System.err.println(
//"ERROR: LinkTrapGenerator.triggerTrap(): " +
//"ifIndex " + ifIndex + " not found");
//errors++;
//return;
//}
//ifEntryImpl.switchifOperStatus();
successes++;
}
}