KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > jmx > snmp > agent > SnmpTableEntryNotification


1 /*
2  * @(#)file SnmpTableEntryNotification.java
3  * @(#)author Sun Microsystems, Inc.
4  * @(#)version 4.14
5  * @(#)date 08/02/09
6  *
7  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
8  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
9  *
10  */

11
12
13 package com.sun.jmx.snmp.agent;
14
15
16
17 // jmx imports
18
//
19
import javax.management.Notification JavaDoc;
20 import javax.management.ObjectName JavaDoc;
21
22 /**
23  * Represents a notification emitted when an
24  * entry is added or deleted from an SNMP table.
25  * <P>
26  * The <CODE>SnmpTableEntryNotification</CODE> object contains
27  * the reference to the entry added or removed from the table.
28  * <P>
29  * The list of notifications fired by the <CODE>SnmpMibTable</CODE> is
30  * the following:
31  * <UL>
32  * <LI>A new entry has been added to the SNMP table.
33  * <LI>An existing entry has been removed from the SNMP table.
34   </UL>
35  *
36  * <p><b>This API is a Sun Microsystems internal API and is subject
37  * to change without notice.</b></p>
38  * @version 4.14 12/19/03
39  * @author Sun Microsystems, Inc
40  */

41
42 public class SnmpTableEntryNotification extends Notification JavaDoc {
43   
44     /**
45      * Creates and initializes a table entry notification object.
46      *
47      * @param type The notification type.
48      * @param source The notification producer.
49      * @param sequenceNumber The notification sequence number within the
50      * source object.
51      * @param timeStamp The notification emission date.
52      * @param entry The entry object (may be null if the entry is
53      * registered in the MBeanServer).
54      * @param entryName The ObjectName entry object (may be null if the
55      * entry is not registered in the MBeanServer).
56      * @since 1.5
57      */

58     SnmpTableEntryNotification(String JavaDoc type, Object JavaDoc source,
59                    long sequenceNumber, long timeStamp,
60                    Object JavaDoc entry, ObjectName JavaDoc entryName) {
61         
62         super(type, source, sequenceNumber, timeStamp);
63         this.entry = entry;
64     this.name = entryName;
65     }
66     
67     /**
68      * Gets the entry object.
69      * May be null if the entry is registered in the MBeanServer, and the
70      * MIB is using the generic MetaData (see mibgen).
71      *
72      * @return The entry.
73      */

74     public Object JavaDoc getEntry() {
75         return entry;
76     }
77   
78     /**
79      * Gets the ObjectName of the entry.
80      * May be null if the entry is not registered in the MBeanServer.
81      *
82      * @return The ObjectName of the entry.
83      * @since 1.5
84      */

85     public ObjectName JavaDoc getEntryName() {
86         return name;
87     }
88   
89     // PUBLIC VARIABLES
90
//-----------------
91

92     /**
93      * Notification type denoting that a new entry has been added to the
94      * SNMP table.
95      * <BR>The value of this notification type is
96      * <CODE>jmx.snmp.table.entry.added</CODE>.
97      */

98     public static final String JavaDoc SNMP_ENTRY_ADDED =
99     new String JavaDoc("jmx.snmp.table.entry.added");
100
101     /**
102      * Notification type denoting that an entry has been removed from the
103      * SNMP table.
104      * <BR>The value of this notification type is
105      * <CODE>jmx.snmp.table.entry.removed</CODE>.
106      */

107     public static final String JavaDoc SNMP_ENTRY_REMOVED =
108     new String JavaDoc("jmx.snmp.table.entry.removed");
109     
110     // PRIVATE VARIABLES
111
//------------------
112

113     /**
114      * The entry object.
115      * @serial
116      */

117     private final Object JavaDoc entry;
118
119     /**
120      * The entry name.
121      * @serial
122      * @since 1.5
123      */

124     private final ObjectName JavaDoc name;
125
126     // Ensure compatibility
127
//
128
private static final long serialVersionUID = 5832592016227890252L;
129 }
130
Popular Tags