1. /*
  2. * @(#)file SnmpTableEntryNotification.java
  3. * @(#)author Sun Microsystems, Inc.
  4. * @(#)version 4.14
  5. * @(#)date 04/09/15
  6. *
  7. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  8. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  9. *
  10. */
  11. package com.sun.jmx.snmp.agent;
  12. // jmx imports
  13. //
  14. import javax.management.Notification;
  15. import javax.management.ObjectName;
  16. /**
  17. * Represents a notification emitted when an
  18. * entry is added or deleted from an SNMP table.
  19. * <P>
  20. * The <CODE>SnmpTableEntryNotification</CODE> object contains
  21. * the reference to the entry added or removed from the table.
  22. * <P>
  23. * The list of notifications fired by the <CODE>SnmpMibTable</CODE> is
  24. * the following:
  25. * <UL>
  26. * <LI>A new entry has been added to the SNMP table.
  27. * <LI>An existing entry has been removed from the SNMP table.
  28. </UL>
  29. *
  30. * <p><b>This API is a Sun Microsystems internal API and is subject
  31. * to change without notice.</b></p>
  32. * @version 4.14 12/19/03
  33. * @author Sun Microsystems, Inc
  34. */
  35. public class SnmpTableEntryNotification extends Notification {
  36. /**
  37. * Creates and initializes a table entry notification object.
  38. *
  39. * @param type The notification type.
  40. * @param source The notification producer.
  41. * @param sequenceNumber The notification sequence number within the
  42. * source object.
  43. * @param timeStamp The notification emission date.
  44. * @param entry The entry object (may be null if the entry is
  45. * registered in the MBeanServer).
  46. * @param entryName The ObjectName entry object (may be null if the
  47. * entry is not registered in the MBeanServer).
  48. * @since 1.5
  49. */
  50. SnmpTableEntryNotification(String type, Object source,
  51. long sequenceNumber, long timeStamp,
  52. Object entry, ObjectName entryName) {
  53. super(type, source, sequenceNumber, timeStamp);
  54. this.entry = entry;
  55. this.name = entryName;
  56. }
  57. /**
  58. * Gets the entry object.
  59. * May be null if the entry is registered in the MBeanServer, and the
  60. * MIB is using the generic MetaData (see mibgen).
  61. *
  62. * @return The entry.
  63. */
  64. public Object getEntry() {
  65. return entry;
  66. }
  67. /**
  68. * Gets the ObjectName of the entry.
  69. * May be null if the entry is not registered in the MBeanServer.
  70. *
  71. * @return The ObjectName of the entry.
  72. * @since 1.5
  73. */
  74. public ObjectName getEntryName() {
  75. return name;
  76. }
  77. // PUBLIC VARIABLES
  78. //-----------------
  79. /**
  80. * Notification type denoting that a new entry has been added to the
  81. * SNMP table.
  82. * <BR>The value of this notification type is
  83. * <CODE>jmx.snmp.table.entry.added</CODE>.
  84. */
  85. public static final String SNMP_ENTRY_ADDED =
  86. new String("jmx.snmp.table.entry.added");
  87. /**
  88. * Notification type denoting that an entry has been removed from the
  89. * SNMP table.
  90. * <BR>The value of this notification type is
  91. * <CODE>jmx.snmp.table.entry.removed</CODE>.
  92. */
  93. public static final String SNMP_ENTRY_REMOVED =
  94. new String("jmx.snmp.table.entry.removed");
  95. // PRIVATE VARIABLES
  96. //------------------
  97. /**
  98. * The entry object.
  99. * @serial
  100. */
  101. private final Object entry;
  102. /**
  103. * The entry name.
  104. * @serial
  105. * @since 1.5
  106. */
  107. private final ObjectName name;
  108. // Ensure compatibility
  109. //
  110. private static final long serialVersionUID = 5832592016227890252L;
  111. }