Class RecursiveResultHandler

  • All Implemented Interfaces:
    Function<SearchResponse,​SearchResponse>, Freezable, SearchResultHandler

    public class RecursiveResultHandler
    extends AbstractMessageFunctionalEntryHandler<SearchResponse>
    implements SearchResultHandler
    This recursively searches based on a supplied attribute and merges those results into the original entry. For the following LDIF:
       dn: uugid=group1,ou=groups,dc=ldaptive,dc=org
       uugid: group1
       member: uugid=group2,ou=groups,dc=ldaptive,dc=org
    
       dn: uugid=group2,ou=groups,dc=ldaptive,dc=org
       uugid: group2
     

    With the following code:

       RecursiveResultHandler reh = new RecursiveResultHandler("member", "uugid");
     

    Will produce this result for the query (uugid=group1):

       dn: uugid=group1,ou=groups,dc=ldaptive,dc=org
       uugid: group1
       uugid: group2
       member: uugid=group2,ou=groups,dc=ldaptive,dc=org
     
    This handler should only be used with the SearchOperation.execute() method since it leverages the connection to make further searches.