I have a case that I have to use DirContext search API to return attributes for ldap search. The reason is the attribute I want to get is Operational Attribute, and it wont return if I don't specifically set the attribute name on search command.
Can anyone tell me how to specify the search scope and also returning attribute(s) at the same time?
I don't see there are any APIs allowing me to do that. They either allow me to specify SearchControls, or to specify the attributesToReturn, but not both at the same time.
search(Name name, Attributes matchingAttributes)
search(Name name, Attributes matchingAttributes, String[] attributesToReturn)
search(Name name, String filterExpr, Object[] filterArgs, SearchControls cons)
search(Name name, String filter, SearchControls cons)
search(String name, Attributes matchingAttributes)
search(String name, Attributes matchingAttributes, String[] attributesToReturn)
search(String name, String filterExpr, Object[] filterArgs, SearchControls cons)
search(String name, String filter, SearchControls cons)