01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: package javax.naming.ldap;
19:
20: import java.util.EventObject;
21:
22: /**
23: * This event is fired when an LDAP server sends an unsolicited notification.
24: * (See RFC2251).
25: */
26: public class UnsolicitedNotificationEvent extends EventObject {
27:
28: /*
29: * This constant is used during deserialization to check the version which
30: * created the serialized object.
31: */
32: static final long serialVersionUID = -2382603380799883705L;
33:
34: /**
35: * The specific notification.
36: *
37: * @serial
38: */
39: private UnsolicitedNotification notice;
40:
41: /**
42: * Constructs an <code>UnsolicitedNotificationEvent</code> instance using
43: * the supplied <code>UnsolicitedNotification</code> instance.
44: *
45: * @param o
46: * the source of the event which cannot be null
47: * @param un
48: * the <code>UnsolicitedNotification</code> instance which
49: * cannot be null
50: */
51: public UnsolicitedNotificationEvent(Object o,
52: UnsolicitedNotification un) {
53: super (o);
54: this .notice = un;
55: }
56:
57: /**
58: * Returns the <code>UnsolicitedNotification</code> instance associated
59: * with this event.
60: *
61: * @return the <code>UnsolicitedNotification</code> instance associated
62: * with this event
63: */
64: public UnsolicitedNotification getNotification() {
65: return notice;
66: }
67:
68: /**
69: * Uses this event to trigger a notification received on the supplied
70: * listener.
71: *
72: * @param unl
73: * the listener to dispatch this event to. It cannot be null.
74: */
75: public void dispatch(UnsolicitedNotificationListener unl) {
76: unl.notificationReceived(this);
77: }
78:
79: }
|