public class NotificationOriginatorImpl extends Object implements NotificationOriginator
NotificationOriginatorImpl class implements a notification originator application for SNMP4J.
See also RFC 3411 for a description of notification originators.
| Constructor and Description |
|---|
NotificationOriginatorImpl(org.snmp4j.Session session,
VACM vacm,
SysUpTime sysUpTime,
SnmpTargetMIB targetMIB,
SnmpNotificationMIB notificationMIB)
Creates a notification originator.
|
NotificationOriginatorImpl(org.snmp4j.Session session,
VACM vacm,
SysUpTime sysUpTime,
SnmpTargetMIB targetMIB,
SnmpNotificationMIB notificationMIB,
SnmpCommunityMIB communityMIB)
Creates a notification originator.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addNotificationLogListener(NotificationLogListener l) |
protected void |
fireNotificationLogEvent(NotificationLogEvent event) |
Object |
notify(org.snmp4j.smi.OctetString context,
org.snmp4j.smi.OID notificationID,
org.snmp4j.smi.TimeTicks sysUpTime,
org.snmp4j.smi.VariableBinding[] vbs)
Sends notifications (traps) to all appropriate notification targets.
|
Object |
notify(org.snmp4j.smi.OctetString context,
org.snmp4j.smi.OID notificationID,
org.snmp4j.smi.VariableBinding[] vbs)
Sends notifications (traps) to all appropriate notification targets.
|
void |
removeNotificationLogListener(NotificationLogListener l) |
protected void |
setContextEngineID(org.snmp4j.ScopedPDU scopedPDU,
org.snmp4j.smi.OctetString context,
org.snmp4j.smi.OID notificationID)
Sets the context engine ID of the scoped PDU to the local engine ID provided by the
targetMIB
member. |
void |
setSession(org.snmp4j.Session snmpSession)
Sets the SNMP session to used by this notification originator for sending notifications.
|
public NotificationOriginatorImpl(org.snmp4j.Session session,
VACM vacm,
SysUpTime sysUpTime,
SnmpTargetMIB targetMIB,
SnmpNotificationMIB notificationMIB)
session - the SNMP Session instance to be used to send the notifications/informs.vacm - the VACM to be used to check access for notifications.sysUpTime - the sysUpTime instance to be used to determine sysUpTime.0 when sending notifications without
specifically specified sysUpTime.targetMIB - the SnmpTargetMIB containing notification target information.notificationMIB - SnmpNotificationMIBpublic NotificationOriginatorImpl(org.snmp4j.Session session,
VACM vacm,
SysUpTime sysUpTime,
SnmpTargetMIB targetMIB,
SnmpNotificationMIB notificationMIB,
SnmpCommunityMIB communityMIB)
session - the Snmp instance to be used to send the notifications/informs.vacm - the VACM to be used to check access for notifications.sysUpTime - the sysUpTime instance to be used to determine sysUpTime.0 when sending notifications without
specifically specified sysUpTime.targetMIB - the SnmpTargetMIB containing notification target information.notificationMIB - the SnmpNotificationMIB containing notification filtering information.communityMIB - the community MIB for coexistence information.public Object notify(org.snmp4j.smi.OctetString context, org.snmp4j.smi.OID notificationID, org.snmp4j.smi.VariableBinding[] vbs)
notify in interface NotificationOriginatorcontext - the context name of the context on whose behalf this notification has been generated.notificationID - the object ID that uniquely identifies this notification. For SNMPv1 traps, the notification ID has to be
build using the rules provided by RFC 2576.vbs - an array of VariableBinding instances representing the payload of the notification.NotificationOriginator determines 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.protected void setContextEngineID(org.snmp4j.ScopedPDU scopedPDU,
org.snmp4j.smi.OctetString context,
org.snmp4j.smi.OID notificationID)
targetMIB
member.scopedPDU - the scopedPDU to modify.context - the context associated with the notification/inform PDU.notificationID - the notification ID of the notification/inform PDU.public Object notify(org.snmp4j.smi.OctetString context, org.snmp4j.smi.OID notificationID, org.snmp4j.smi.TimeTicks sysUpTime, org.snmp4j.smi.VariableBinding[] vbs)
NotificationOriginatornotify in interface NotificationOriginatorcontext - the context name of the context on whose behalf this notification has
been generated.notificationID - the object ID that uniquely identifies this notification. For SNMPv1
traps, the notification ID has to be build using the rules provided
by RFC 2576.sysUpTime - the value of the sysUpTime for the context context. This
value will be included in the generated notification as
sysUpTime.0.vbs - an array of VariableBinding instances representing the
payload of the notification.NotificationOriginator determines 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.public void setSession(org.snmp4j.Session snmpSession)
snmpSession - the Snmp instance to be used to send the notifications/informs.public void addNotificationLogListener(NotificationLogListener l)
public void removeNotificationLogListener(NotificationLogListener l)
protected void fireNotificationLogEvent(NotificationLogEvent event)
Copyright © 2020 SNMP4J.org. All rights reserved.