SearchEntryHandler support when using DirSyncClient

11 views
Skip to first unread message

Wesley King

unread,
May 28, 2020, 3:03:11 PM5/28/20
to ldaptive
In a previous version of ldaptive (1.2.1) there was the capability to register a SearchEntryHandler on a SearchRequest for use with the DirSyncClient. 
In the latest version of the library only a SearchOperation allows for registering SearchEntryHandlers. 
Since the DirSyncClient only accepts a SearchRequest there is no longer support for processing binary attributes such as objectGUID with the ObjectGuidHandler.

In order to workaround this I am using a combination of:

SearchRequest searchRequest = new SearchRequest(getBaseDistinguishedName(), getSearchFilter());
searchRequest
.setBinaryAttributes("objectGUID");


and 

for (LdapEntry entry : response.getEntries()) {
    objectGuidHandler
.apply(entry);
   ....
}

Alternatively I could check the type and do the conversion manually:

instanceof byte[]


Is there a better approach for getting the "objectGUID" as a string using the DirSyncClient?

dfisher

unread,
Jul 24, 2020, 10:58:36 PM7/24/20
to ldaptive
Sorry for the delay, it looks like google decided to filter these messages to spam.
You're correct that's a gap in the current API.
I've added a property to the DirSyncClient in the latest snapshot to set LdapEntryHandlers.
That should allow you to do DirSyncClient#setEntryHandlers(new ObjectGuidHandler());
Let me know if that doesn't fix your issue.

--Daniel Fisher
Reply all
Reply to author
Forward
0 new messages