|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.vt.middleware.ldap.handler.AbstractResultHandler<T,T>
edu.vt.middleware.ldap.handler.CopyResultHandler<SearchResult>
edu.vt.middleware.ldap.handler.CopySearchResultHandler
edu.vt.middleware.ldap.handler.RecursiveSearchResultHandler
public class RecursiveSearchResultHandler
RecursiveSearchResultHandler recursively searches based on a
supplied attribute and merges those results into the original result set. For
the following LDIF:
dn: uugid=group1,ou=groups,dc=vt,dc=edu uugid: group1 member: uugid=group2,ou=groups,dc=vt,dc=edu dn: uugid=group2,ou=groups,dc=vt,dc=edu uugid: group2
With the following code:
RecursiveSearchResultHandler rsh = new RecurseSearchResultHandler(
ldap, "member", new String[]{"uugid"});
Will produce this result for the query (uugid=group1):
dn: uugid=group1,ou=groups,dc=vt,dc=edu uugid: group1 uugid: group2 member: uugid=group2,ou=groups,dc=vt,dc=edu
| Field Summary |
|---|
| Fields inherited from class edu.vt.middleware.ldap.handler.AbstractResultHandler |
|---|
logger |
| Constructor Summary | |
|---|---|
RecursiveSearchResultHandler()
Default constructor. |
|
RecursiveSearchResultHandler(Ldap l,
String searchAttr,
String[] mergeAttrs)
Creates a new RecursiveAttributeHandler with the supplied
ldap, search attribute, and merge attributes. |
|
RecursiveSearchResultHandler(String searchAttr,
String[] mergeAttrs)
Creates a new RecursiveAttributeHandler with the supplied
search attribute and merge attributes. |
|
| Method Summary | |
|---|---|
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. |
Ldap |
getSearchResultLdap()
Gets the Ldap used by the search operation invoking this
handler. |
protected void |
initalizeReturnAttributes()
Initializes the return attributes array. |
List<SearchResult> |
process(SearchCriteria sc,
List<? extends SearchResult> l)
This will enumerate through the supplied List and return a
List of those results. |
List<SearchResult> |
process(SearchCriteria sc,
NamingEnumeration<? extends SearchResult> en,
Class<?>[] ignore)
This will enumerate through the supplied NamingEnumeration and
return a List of those results. |
void |
setMergeAttributes(String[] s)
Sets the attribute name that will be merged by the recursive search. |
void |
setSearchAttribute(String s)
Sets the attribute name that will be recursively searched on. |
void |
setSearchResultLdap(Ldap l)
Sets the Ldap used by the search operation invoking this
handler. |
| Methods inherited from class edu.vt.middleware.ldap.handler.CopySearchResultHandler |
|---|
getAttributeHandler, processAttributes, processDn, processResult, setAttributeHandler |
| Methods inherited from class edu.vt.middleware.ldap.handler.AbstractResultHandler |
|---|
process |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface edu.vt.middleware.ldap.handler.SearchResultHandler |
|---|
getAttributeHandler, setAttributeHandler |
| Methods inherited from interface edu.vt.middleware.ldap.handler.ResultHandler |
|---|
process |
| Constructor Detail |
|---|
public RecursiveSearchResultHandler()
public RecursiveSearchResultHandler(String searchAttr,
String[] mergeAttrs)
RecursiveAttributeHandler with the supplied
search attribute and merge attributes.
searchAttr - StringmergeAttrs - String[]
public RecursiveSearchResultHandler(Ldap l,
String searchAttr,
String[] mergeAttrs)
RecursiveAttributeHandler with the supplied
ldap, search attribute, and merge attributes.
l - LdapsearchAttr - StringmergeAttrs - String[]| Method Detail |
|---|
public Ldap getSearchResultLdap()
Ldap used by the search operation invoking this
handler.
getSearchResultLdap in interface ExtendedSearchResultHandlerLdappublic void setSearchResultLdap(Ldap l)
Ldap used by the search operation invoking this
handler.
setSearchResultLdap in interface ExtendedSearchResultHandlerl - Ldappublic String getSearchAttribute()
String attribute namepublic void setSearchAttribute(String s)
s - Stringpublic String[] getMergeAttributes()
String[] attribute namespublic void setMergeAttributes(String[] s)
s - String[]protected void initalizeReturnAttributes()
public List<SearchResult> process(SearchCriteria sc,
NamingEnumeration<? extends SearchResult> en,
Class<?>[] ignore)
throws NamingException
NamingEnumeration and
return a List of those results. The results are unaltered and the dn is
ignored. Any exceptions passed into this method will be ignored and results
will be returned as if no exception occurred.
process in interface ResultHandler<SearchResult,SearchResult>process in class AbstractResultHandler<SearchResult,SearchResult>sc - SearchCriteria used to find enumerationen - NamingEnumeration LDAP resultsignore - Class[] of exception types to ignore
List - LDAP results
NamingException - if the LDAP returns an error
public List<SearchResult> process(SearchCriteria sc,
List<? extends SearchResult> l)
throws NamingException
List and return a
List of those results. The results are unaltered and the dn is ignored.
process in interface ResultHandler<SearchResult,SearchResult>process in class AbstractResultHandler<SearchResult,SearchResult>sc - SearchCriteria used to find enumerationl - List LDAP results
List - LDAP results
NamingException - if the LDAP returns an error
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||