Class NotificationTask
java.lang.Object
org.snmp4j.agent.NotificationTask
- All Implemented Interfaces:
Runnable, org.snmp4j.util.WorkerTask
The
NotificationTask is a Runnable that sends a notification or a series of
notifications/traps/informs - depending on the configuration associated with the supplied
NotificationOriginator.- Version:
- 1.9
- Author:
- Frank Fock
-
Constructor Summary
ConstructorsConstructorDescriptionNotificationTask(NotificationOriginator notificationOriginator, org.snmp4j.smi.OctetString context, org.snmp4j.smi.OID notificationID, org.snmp4j.smi.TimeTicks sysUptime, org.snmp4j.smi.VariableBinding[] vbs) -
Method Summary
Modifier and TypeMethodDescriptionorg.snmp4j.smi.OctetStringorg.snmp4j.smi.OIDorg.snmp4j.event.ResponseEvent<?>[]Returns an array of ResponseEvent instances.org.snmp4j.smi.TimeTicksorg.snmp4j.smi.VariableBinding[]voidvoidjoin()booleanjoin(long timeout) voidrun()Send the notification a notify this object afterwards.voidshutdown()This method does nothing by default because this task cannot be terminated gracefully while being executed.voidThis method does nothing by default because this task cannot be terminated gracefully while being executed.
-
Constructor Details
-
NotificationTask
public NotificationTask(NotificationOriginator notificationOriginator, org.snmp4j.smi.OctetString context, org.snmp4j.smi.OID notificationID, org.snmp4j.smi.TimeTicks sysUptime, org.snmp4j.smi.VariableBinding[] vbs)
-
-
Method Details
-
run
-
getContext
public org.snmp4j.smi.OctetString getContext() -
getNotificationID
public org.snmp4j.smi.OID getNotificationID() -
getNotificationOriginator
-
getResponses
public org.snmp4j.event.ResponseEvent<?>[] getResponses()Returns an array of ResponseEvent instances. Since theNotificationOriginatordetermines on behalf of the SNMP-NOTIFICTON-MIB contents whether a notification is sent as trap/notification or as inform request, the returned array contains an element for each addressed target, but only a response PDU for inform targets.- Returns:
- an array of ResponseEvent instances (informs) or
nullvalues (for traps/notifications).
-
getSysUpTime
public org.snmp4j.smi.TimeTicks getSysUpTime() -
getVariableBindings
public org.snmp4j.smi.VariableBinding[] getVariableBindings() -
shutdown
public void shutdown()This method does nothing by default because this task cannot be terminated gracefully while being executed.- Specified by:
shutdownin interfaceorg.snmp4j.util.WorkerTask
-
terminate
public void terminate()This method does nothing by default because this task cannot be terminated gracefully while being executed.- Specified by:
terminatein interfaceorg.snmp4j.util.WorkerTask
-
join
- Specified by:
joinin interfaceorg.snmp4j.util.WorkerTask- Throws:
InterruptedException
-
join
- Specified by:
joinin interfaceorg.snmp4j.util.WorkerTask- Throws:
InterruptedException
-
interrupt
public void interrupt()- Specified by:
interruptin interfaceorg.snmp4j.util.WorkerTask
-