1. /*
  2. * @(#)UnsolicitedNotificationEvent.java 1.8 03/12/19
  3. *
  4. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package javax.naming.ldap;
  8. /**
  9. * This class represents an event fired in response to an unsolicited
  10. * notification sent by the LDAP server.
  11. *
  12. * @author Rosanna Lee
  13. * @author Scott Seligman
  14. * @author Vincent Ryan
  15. * @version 1.8 03/12/19
  16. *
  17. * @see UnsolicitedNotification
  18. * @see UnsolicitedNotificationListener
  19. * @see javax.naming.event.EventContext#addNamingListener
  20. * @see javax.naming.event.EventDirContext#addNamingListener
  21. * @see javax.naming.event.EventContext#removeNamingListener
  22. * @since 1.3
  23. */
  24. public class UnsolicitedNotificationEvent extends java.util.EventObject {
  25. /**
  26. * The notification that caused this event to be fired.
  27. * @serial
  28. */
  29. private UnsolicitedNotification notice;
  30. /**
  31. * Constructs a new instance of <tt>UnsolicitedNotificationEvent</tt>.
  32. *
  33. * @param src The non-null source that fired the event.
  34. * @param notice The non-null unsolicited notification.
  35. */
  36. public UnsolicitedNotificationEvent(Object src,
  37. UnsolicitedNotification notice) {
  38. super(src);
  39. this.notice = notice;
  40. }
  41. /**
  42. * Returns the unsolicited notification.
  43. * @return The non-null unsolicited notification that caused this
  44. * event to be fired.
  45. */
  46. public UnsolicitedNotification getNotification() {
  47. return notice;
  48. }
  49. /**
  50. * Invokes the <tt>notificationReceived()</tt> method on
  51. * a listener using this event.
  52. * @param listener The non-null listener on which to invoke
  53. * <tt>notificationReceived</tt>.
  54. */
  55. public void dispatch(UnsolicitedNotificationListener listener) {
  56. listener.notificationReceived(this);
  57. }
  58. private static final long serialVersionUID = -2382603380799883705L;
  59. }