Connectionconn=DefaultConnectionFactory.getConnection("ldap://directory.ldaptive.org");try{conn.open();// only return changed entries, return the entry change controlPersistentSearchClientclient=newPersistentSearchClient(conn,EnumSet.allOf(PersistentSearchChangeType.class),true,true);SearchRequestrequest=SearchRequest.newObjectScopeSearchRequest("dc=ldaptive,dc=org");BlockingQueue<PersistentSearchItem>results=client.execute(request);while(true){PersistentSearchItemitem=results.take();// blocks until result is receivedif(item.isEntry()){EntryChangeNotificationControlnc=item.getEntry().getEntryChangeNotificationControl();LdapEntryentry=item.getEntry().getSearchEntry();// process this entry with the entry change control data}elseif(item.isResponse()){// response receivedbreak;}elseif(item.isAsyncRequest()){// request has begunAsyncRequestar=item.getAsyncRequest();}elseif(item.isException()){// an error has occurredthrowitem.getException();}}}finally{conn.close();}
Provider Support
JNDI
JLDAP
Apache LDAP
UnboundID
OpenDJ
✗
✓
✓
✓
✓
✓
Functionality exists in the provider API and has been confirmed
✗
Functionality does not exist in the provider API
✶
Functionality exists in the provider API, but did not work in our test environment
?
Functionality exists in the provider API, but has not been integrated into the ldaptive provider