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

Java LDAP API: Unsolicited notifications



RFC 2251 (page 24)  says that unsolicited notifications are essentially LDAP Extended Response type LDAPMessage(es).  It might be cleaner to change the prototype for the "messageReceived" method in the new  "LDAPUnsolicitedNotificationListener" class to:

public void messageReceived(LDAPExtendedResponse msg); 

instead of

public void messageReceived(LDAPMessage msg);

This way the listener sub-class can easily get access to the OID and any other data in the unsolicited notification by using the access methods already defined in the LDAPExtendedResponse class.  After all the OID and data field are the only interesting piece of information in the unsolicited notification.

Javed
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 5.50.4134.600" name=GENERATOR></HEAD>
<BODY style="MARGIN-TOP: 2px; FONT: 8pt Tahoma; MARGIN-LEFT: 2px"><FONT size=1>
<DIV><FONT size=1>RFC 2251 (page 24)&nbsp; says that unsolicited notifications 
are essentially LDAP Extended Response type LDAPMessage(es).&nbsp; It might 
be&nbsp;cleaner to change the prototype for the&nbsp;"messageReceived" method in 
the new &nbsp;"LDAPUnsolicitedNotificationListener" class to:</FONT></DIV>
<DIV><FONT size=1></FONT>&nbsp;</DIV>
<DIV><FONT size=1>public void messageReceived(LDAPExtendedResponse msg); 
</FONT></DIV>
<DIV><FONT size=1></FONT>&nbsp;</DIV>
<DIV><FONT size=1>instead of</FONT></DIV>
<DIV><FONT size=1></FONT>&nbsp;</DIV>
<DIV><FONT size=1>public void messageReceived(LDAPMessage msg);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=1>This way the listener sub-class can easily get access to the 
OID and any other data in the unsolicited notification by using the 
access&nbsp;methods already defined in the LDAPExtendedResponse class.&nbsp; 
After all the OID and data field&nbsp;are the only&nbsp;interesting piece of 
information in the unsolicited notification.</FONT></DIV>
<DIV><FONT size=1></FONT>&nbsp;</DIV>
<DIV><FONT size=1>Javed</FONT></DIV></FONT></BODY></HTML>