Class RecursiveResultHandler

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

    public class RecursiveResultHandler
    extends AbstractEntryHandler<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 Detail

      • HASH_CODE_SEED

        private static final int HASH_CODE_SEED
        hash code seed.
        See Also:
        Constant Field Values
      • 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 Detail

      • 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