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 java.lang.String[] |
mergeAttributes
Attribute(s) to merge.
|
private java.lang.String[] |
retAttrs
Attributes to return when searching, mergeAttributes + searchAttribute.
|
private java.lang.String |
searchAttribute
Attribute to recursively search on.
|
logger| Constructor and Description |
|---|
RecursiveEntryHandler()
Default constructor.
|
RecursiveEntryHandler(java.lang.String searchAttr,
java.lang.String... mergeAttrs)
Creates a new recursive entry handler.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String[] |
getMergeAttributes()
Returns the attribute names that will be merged by the recursive search.
|
java.lang.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,
java.util.List<java.lang.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,
java.lang.String dn,
LdapEntry entry,
java.util.List<java.lang.String> searchedDns)
Recursively gets the attribute(s)
mergeAttributes for the supplied dn and adds the values to the supplied
attributes. |
void |
setMergeAttributes(java.lang.String... mergeAttrs)
Sets the attribute name that will be merged by the recursive search.
|
void |
setSearchAttribute(java.lang.String name)
Sets the attribute name that will be recursively searched on.
|
java.lang.String |
toString() |
equals, handleAttribute, handleAttributeName, handleAttributes, handleAttributeValue, handleAttributeValue, handleDn, initializeRequestprivate static final int HASH_CODE_SEED
private java.lang.String searchAttribute
private java.lang.String[] mergeAttributes
private java.lang.String[] retAttrs
public RecursiveEntryHandler()
public RecursiveEntryHandler(java.lang.String searchAttr,
java.lang.String... mergeAttrs)
searchAttr - attribute to search onmergeAttrs - attribute names to mergepublic java.lang.String getSearchAttribute()
public void setSearchAttribute(java.lang.String name)
name - of the search attributepublic java.lang.String[] getMergeAttributes()
public void setMergeAttributes(java.lang.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, java.util.List<java.lang.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, java.lang.String dn, LdapEntry entry, java.util.List<java.lang.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 int hashCode()
hashCode in class AbstractSearchEntryHandlerpublic java.lang.String toString()
toString in class java.lang.Object