public class RecursiveEntryHandler extends AbstractSearchEntryHandler
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:
RecursiveEntryHandler reh = new RecursiveEntryHandler("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
| Modifier and Type | Field and Description |
|---|---|
private static int |
HASH_CODE_SEED
hash code seed.
|
private String[] |
mergeAttributes
Attribute(s) to merge.
|
private String[] |
retAttrs
Attributes to return when searching, mergeAttributes + searchAttribute.
|
private String |
searchAttribute
Attribute to recursively search on.
|
logger| Constructor and Description |
|---|
RecursiveEntryHandler()
Default constructor.
|
RecursiveEntryHandler(String searchAttr,
String... mergeAttrs)
Creates a new recursive entry handler.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
String[] |
getMergeAttributes()
Returns the attribute names that will be merged by the recursive search.
|
String |
getSearchAttribute()
Returns the attribute name that will be recursively searched on.
|
HandlerResult<SearchEntry> |
handle(Connection conn,
SearchRequest request,
SearchEntry entry)
Handle the supplied result.
|
int |
hashCode() |
protected void |
initalizeReturnAttributes()
Initializes the return attributes array.
|
private void |
readSearchAttribute(Connection conn,
LdapEntry entry,
List<String> searchedDns)
Reads the values of
searchAttribute from the supplied attributes and calls recursiveSearch(org.ldaptive.Connection, java.lang.String, org.ldaptive.LdapEntry, java.util.List<java.lang.String>) for
each. |
private void |
recursiveSearch(Connection conn,
String dn,
LdapEntry entry,
List<String> searchedDns)
Recursively gets the attribute(s)
mergeAttributes for the supplied dn and adds the values to the supplied
attributes. |
void |
setMergeAttributes(String... mergeAttrs)
Sets the attribute name that will be merged by the recursive search.
|
void |
setSearchAttribute(String name)
Sets the attribute name that will be recursively searched on.
|
String |
toString() |
handleAttribute, handleAttributeName, handleAttributes, handleAttributeValue, handleAttributeValue, handleDn, initializeRequestprivate static final int HASH_CODE_SEED
private String searchAttribute
private String[] mergeAttributes
private String[] retAttrs
public String getSearchAttribute()
public void setSearchAttribute(String name)
name - of the search attributepublic String[] getMergeAttributes()
public void setMergeAttributes(String... mergeAttrs)
mergeAttrs - attribute names to mergeprotected void initalizeReturnAttributes()
public HandlerResult<SearchEntry> handle(Connection conn, SearchRequest request, SearchEntry entry) throws LdapException
Handlerhandle in interface Handler<SearchRequest,SearchEntry>handle in interface SearchEntryHandlerhandle in class AbstractSearchEntryHandlerconn - connection the operation was executed onrequest - executed by the operationentry - produced from the operationLdapException - if handling failsprivate void readSearchAttribute(Connection conn, LdapEntry entry, List<String> searchedDns) throws LdapException
searchAttribute from the supplied attributes and calls recursiveSearch(org.ldaptive.Connection, java.lang.String, org.ldaptive.LdapEntry, java.util.List<java.lang.String>) for
each.conn - to perform search operation onentry - to readsearchedDns - list of DNs whose attributes have been readLdapException - if a search error occursprivate void recursiveSearch(Connection conn, String dn, LdapEntry entry, List<String> searchedDns) throws LdapException
mergeAttributes for the supplied dn and adds the values to the supplied
attributes.conn - to perform search operation ondn - to get attribute(s) forentry - to merge withsearchedDns - list of DNs that have been searched forLdapException - if a search error occurspublic boolean equals(Object o)
equals in class AbstractSearchEntryHandlerpublic int hashCode()
hashCode in class AbstractSearchEntryHandlerCopyright © 2003-2019 Virginia Tech. All Rights Reserved.