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.
  • Field Details

    • HASH_CODE_SEED

      private static final int HASH_CODE_SEED
      hash code seed.
      See Also:
    • searchAttribute

      private String searchAttribute
      Attribute to recursively search on.
    • mergeAttributes

      private String[] mergeAttributes
      Attribute(s) to merge.
    • retAttrs

      private String[] retAttrs
      Attributes to return when searching, mergeAttributes + searchAttribute.
  • Constructor Details

    • RecursiveResultHandler

      public RecursiveResultHandler()
      Default constructor.
    • RecursiveResultHandler

      public RecursiveResultHandler(String searchAttr, String... mergeAttrs)
      Creates a new recursive entry handler.
      Parameters:
      searchAttr - attribute to search on
      mergeAttrs - attribute names to merge
  • Method Details