KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > snmp4j > agent > NotificationOriginator


1 /*_############################################################################
2   _##
3   _## SNMP4J-Agent - NotificationOriginator.java
4   _##
5   _## Copyright (C) 2005-2007 Frank Fock (SNMP4J.org)
6   _##
7   _## Licensed under the Apache License, Version 2.0 (the "License");
8   _## you may not use this file except in compliance with the License.
9   _## 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
22
23 package org.snmp4j.agent;
24
25 import org.snmp4j.smi.OctetString;
26 import org.snmp4j.smi.OID;
27 import org.snmp4j.smi.VariableBinding;
28 import org.snmp4j.smi.TimeTicks;
29
30 /**
31  * The <code>NotificationOriginator</code> specifies the interface for
32  * classes providing notification sending.
33  *
34  * <p>
35  * See also RFC 3411 for a description of notification originators.
36  * </p>
37  * @author Frank Fock
38  * @version 1.0
39  */

40 public interface NotificationOriginator {
41
42   /**
43    * Sends notifications (traps) to all appropriate notification targets.
44    * The targets to notify are determined through the SNMP-TARGET-MIB and
45    * the SNMP-NOTIFICATION-MIB.
46    *
47    * @param context
48    * the context name of the context on whose behalf this notification has
49    * been generated.
50    * @param notificationID
51    * the object ID that uniquely identifies this notification. For SNMPv1
52    * traps, the notification ID has to be build using the rules provided
53    * by RFC 2576.
54    * @param vbs
55    * an array of <code>VariableBinding</code> instances representing the
56    * payload of the notification.
57    * @return
58    * an array of ResponseEvent instances. Since the
59    * <code>NotificationOriginator</code> determines on behalf of the
60    * SNMP-NOTIFICTON-MIB contents whether a notification is sent as
61    * trap/notification or as inform request, the returned array contains
62    * an element for each addressed target, but only a response PDU for
63    * inform targets.
64    */

65   Object JavaDoc notify(OctetString context,
66                 OID notificationID, VariableBinding[] vbs);
67
68   /**
69    * Sends notifications (traps) to all appropriate notification targets.
70    * The targets to notify are determined through the SNMP-TARGET-MIB and
71    * the SNMP-NOTIFICATION-MIB.
72    *
73    * @param context
74    * the context name of the context on whose behalf this notification has
75    * been generated.
76    * @param notificationID
77    * the object ID that uniquely identifies this notification. For SNMPv1
78    * traps, the notification ID has to be build using the rules provided
79    * by RFC 2576.
80    * @param sysUpTime
81    * the value of the sysUpTime for the context <code>context</code>. This
82    * value will be included in the generated notification as
83    * <code>sysUpTime.0</code>.
84    * @param vbs
85    * an array of <code>VariableBinding</code> instances representing the
86    * payload of the notification.
87    * @return
88    * an array of ResponseEvent instances. Since the
89    * <code>NotificationOriginator</code> determines on behalf of the
90    * SNMP-NOTIFICTON-MIB contents whether a notification is sent as
91    * trap/notification or as inform request, the returned array contains
92    * an element for each addressed target, but only a response PDU for
93    * inform targets.
94    */

95   Object JavaDoc notify(OctetString context,
96                 OID notificationID,
97                 TimeTicks sysUpTime,
98                 VariableBinding[] vbs);
99
100 }
101
Popular Tags