|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opennms.netmgt.trapd.TrapHandler
public class TrapHandler
The Trapd listens for SNMP traps on the standard port(162). Creates a SnmpTrapSession and implements the SnmpTrapHandler to get callbacks when traps are received
The received traps are converted into XML and sent to eventd
Note: Trapd is a PausableFiber so as to receive control events. However, a 'pause' on Trapd has no impact on the receiving and processing of traps
| Field Summary |
|---|
| Fields inherited from interface org.opennms.core.fiber.PausableFiber |
|---|
PAUSE_PENDING, PAUSED, RESUME_PENDING |
| Fields inherited from interface org.opennms.core.fiber.Fiber |
|---|
RUNNING, START_PENDING, STARTING, STATUS_NAMES, STOP_PENDING, STOPPED |
| Constructor Summary | |
|---|---|
TrapHandler()
Constructs a new Trapd object that receives and forwards trap messages via JSDT. |
|
| Method Summary | |
|---|---|
org.opennms.netmgt.snmp.TrapProcessor |
createTrapProcessor()
|
EventIpcManager |
getEventManager()
|
static TrapHandler |
getInstance()
Returns the singular instance of the trapd daemon. |
java.lang.String |
getName()
Returns the name of the service. |
int |
getStatus()
Returns the current status of the service. |
void |
init()
|
void |
pause()
Pauses Trapd |
void |
resume()
Resumes Trapd |
void |
setEventManager(EventIpcManager eventMgr)
|
void |
setTrapdConfig(TrapdConfig trapdConfig)
|
void |
start()
Create the SNMP trap session and create the communication channel to communicate with eventd. |
void |
stop()
Stops the currently running service. |
void |
trapError(int error,
java.lang.String msg)
|
void |
trapReceived(org.opennms.netmgt.snmp.TrapNotification trapNotification)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TrapHandler()
Constructs a new Trapd object that receives and forwards trap messages via JSDT. The session is initialized with the default client name of OpenNMS.trapd. The trap session is started on the default port, as defined by the SNMP libarary.
SnmpTrapSession| Method Detail |
|---|
public void setTrapdConfig(TrapdConfig trapdConfig)
public org.opennms.netmgt.snmp.TrapProcessor createTrapProcessor()
createTrapProcessor in interface org.opennms.netmgt.snmp.TrapProcessorFactorypublic void trapReceived(org.opennms.netmgt.snmp.TrapNotification trapNotification)
trapReceived in interface org.opennms.netmgt.snmp.TrapNotificationListenerpublic void init()
public void start()
start in interface org.opennms.core.fiber.Fiberjava.lang.reflect.UndeclaredThrowableException - if an unexpected database, or IO exception occurs.SnmpTrapSession,
SnmpTrapHandlerpublic void pause()
pause in interface org.opennms.core.fiber.PausableFiberpublic void resume()
resume in interface org.opennms.core.fiber.PausableFiberpublic void stop()
stop in interface org.opennms.core.fiber.Fiberpublic int getStatus()
getStatus in interface org.opennms.core.fiber.Fiberpublic static TrapHandler getInstance()
public java.lang.String getName()
getName in interface org.opennms.core.fiber.Fiberpublic EventIpcManager getEventManager()
public void setEventManager(EventIpcManager eventMgr)
public void trapError(int error,
java.lang.String msg)
trapError in interface org.opennms.netmgt.snmp.TrapNotificationListener
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||