private NamingEnumeration search ( String base , String filter , String [ ] returnAttrs ) throws NamingException { SearchControls constraints = new SearchControls ( ) ; constraints . setSearchScope ( SearchControls . SUBTREE_SCOPE ) ; constraints . setReturningAttributes ( returnAttrs ) ; // search the directory based on base, filter, and contraints //logger.debug("searching, base: " + base + " using filter: " + filter); DirContext dirContext = context ( ) ; // get established jndi connection return dirContext . search ( base , filter , constraints ) ; }
search using search base filter and declared return attributes