01: /*_############################################################################
02: _##
03: _## SNMP4J-Agent - NotificationOriginator.java
04: _##
05: _## Copyright (C) 2005-2007 Frank Fock (SNMP4J.org)
06: _##
07: _## Licensed under the Apache License, Version 2.0 (the "License");
08: _## you may not use this file except in compliance with the License.
09: _## You may obtain a copy of the License at
10: _##
11: _## http://www.apache.org/licenses/LICENSE-2.0
12: _##
13: _## Unless required by applicable law or agreed to in writing, software
14: _## distributed under the License is distributed on an "AS IS" BASIS,
15: _## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16: _## See the License for the specific language governing permissions and
17: _## limitations under the License.
18: _##
19: _##########################################################################*/
20:
21: package org.snmp4j.agent;
22:
23: import org.snmp4j.smi.OctetString;
24: import org.snmp4j.smi.OID;
25: import org.snmp4j.smi.VariableBinding;
26: import org.snmp4j.smi.TimeTicks;
27:
28: /**
29: * The <code>NotificationOriginator</code> specifies the interface for
30: * classes providing notification sending.
31: *
32: * <p>
33: * See also RFC 3411 for a description of notification originators.
34: * </p>
35: * @author Frank Fock
36: * @version 1.0
37: */
38: public interface NotificationOriginator {
39:
40: /**
41: * Sends notifications (traps) to all appropriate notification targets.
42: * The targets to notify are determined through the SNMP-TARGET-MIB and
43: * the SNMP-NOTIFICATION-MIB.
44: *
45: * @param context
46: * the context name of the context on whose behalf this notification has
47: * been generated.
48: * @param notificationID
49: * the object ID that uniquely identifies this notification. For SNMPv1
50: * traps, the notification ID has to be build using the rules provided
51: * by RFC 2576.
52: * @param vbs
53: * an array of <code>VariableBinding</code> instances representing the
54: * payload of the notification.
55: * @return
56: * an array of ResponseEvent instances. Since the
57: * <code>NotificationOriginator</code> determines on behalf of the
58: * SNMP-NOTIFICTON-MIB contents whether a notification is sent as
59: * trap/notification or as inform request, the returned array contains
60: * an element for each addressed target, but only a response PDU for
61: * inform targets.
62: */
63: Object notify(OctetString context, OID notificationID,
64: VariableBinding[] vbs);
65:
66: /**
67: * Sends notifications (traps) to all appropriate notification targets.
68: * The targets to notify are determined through the SNMP-TARGET-MIB and
69: * the SNMP-NOTIFICATION-MIB.
70: *
71: * @param context
72: * the context name of the context on whose behalf this notification has
73: * been generated.
74: * @param notificationID
75: * the object ID that uniquely identifies this notification. For SNMPv1
76: * traps, the notification ID has to be build using the rules provided
77: * by RFC 2576.
78: * @param sysUpTime
79: * the value of the sysUpTime for the context <code>context</code>. This
80: * value will be included in the generated notification as
81: * <code>sysUpTime.0</code>.
82: * @param vbs
83: * an array of <code>VariableBinding</code> instances representing the
84: * payload of the notification.
85: * @return
86: * an array of ResponseEvent instances. Since the
87: * <code>NotificationOriginator</code> determines on behalf of the
88: * SNMP-NOTIFICTON-MIB contents whether a notification is sent as
89: * trap/notification or as inform request, the returned array contains
90: * an element for each addressed target, but only a response PDU for
91: * inform targets.
92: */
93: Object notify(OctetString context, OID notificationID,
94: TimeTicks sysUpTime, VariableBinding[] vbs);
95:
96: }
|