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