I am working on the PersistentSearch example supplied with the
Netscape LDAP JDK 4.0 with my Netscap Directory Server 4.0. The search
returns changed entries as expected. However,I am not able to get
LDAPEntryChangeControl back to get the previousDN.
In the constructor of LDAPPersistSearchControl, argument
returnControls is set to true, but getResponseControls() always
returns null. I even tried calling parseResponse() as below, the
LDAPEntryChangeControl is null as well.
What am I missing to get a LDAPEntryChangeControl back in LDAP persist
search?
LDAPConnection ld = new LDAPConnection();
ld.connect(Host, Port, User, Pwd);
LDAPPersistSearchControl persistCtrl = new
LDAPPersistSearchControl( op, true, true, true);
LDAPSearchConstraints cons = ld.getSearchConstraints();
cons.setServerControls( persistCtrl );
LDAPSearchResults res = ld.search(base,LDAPv3.SCOPE_SUB, filter, null,
false, cons );
while ( res.hasMoreElements() ) {
LDAPEntry findEntry = res.next();
LDAPControl[] responseCtrls = res.getResponseControls();
LDAPEntryChangeControl entryCtrl =
persistCtrl.parseResponse(responseCtrls);
}
Any help is greatly appreciated.