[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: draft Java-api-12



Steve Sonntag wrote:
 I have been thinking about the specification forunsolicited notifications in the Java api draft version 12. The draft has two methods in LDAPConnectionthat are concerned with Unsolicited Notifications: one sets a flag indicating whether to keep or discardunsolicited notifications:    setUnsolocitedNotifications(boolean flag)the other gets the value of the flag Unsolicited notifications are retrieved by callingthe getResponse(0) method from one of theListener classes.  the "0" indicates message ID 0. The problem is that a listener has association witha connection only when a request is in progressusing that listener.  A listener in an application with5 connections open could be servicing requestson all five connections or on none of them.  UsinggetResponse from the listener class to getUnsolicited notifications is problematic.  If no requestsare outstanding on the listener, there is no associationwith a connection, so it is not possible to checkfor unsolicited notifications. It would seem that the only reliable way to check forand get unsolicited notifications would be throughthe LDAPConnection class itself and not through the listener.classes. Two more LDAPConnection methods - ugh, butperhaps necessary? Anyone have any better ideas? -Steve   ------------------------
Steve Sonntag
Novell, Inc., the leading provider of Net services software  


  It might be better instead to eliminate the current unsolicited notification methods and instead have methods to add and remove listeners for usolicited notifications. The implementation can then discard unsolicited notifications if there are no listeners. For example (I haven't thought this through completely yet):

LDAPConnection

public LDAPResponseListener addUnsolicitedNotificationListener( LDAPResponseListener listener )

public void addUnsolicitedNotificationListener( LDAPResponseListener listener )

Rob