/** {@inheritDoc} */ @Override public HandlerResult<SearchEntry> handle( final Connection conn, final SearchRequest request, final SearchEntry entry) throws LdapException { // Recursively searches a list of attributes and merges those results with // the existing entry. final List<String> searchedDns = new ArrayList<String>(); if (entry.getAttribute(searchAttribute) != null) { searchedDns.add(entry.getDn()); readSearchAttribute(conn, entry, searchedDns); } else { recursiveSearch(conn, entry.getDn(), entry, searchedDns); } return new HandlerResult<SearchEntry>(entry); }
/** * Handle the attributes of a search entry. * * @param conn the search was performed on * @param request used to find the search entry * @param entry search entry to extract the attributes from * @throws LdapException if the LDAP returns an error */ protected void handleAttributes( final Connection conn, final SearchRequest request, final SearchEntry entry) throws LdapException { for (LdapAttribute la : entry.getAttributes()) { handleAttribute(conn, request, la); } }
/** {@inheritDoc} */ @Override public HandlerResult<SearchEntry> handle( final Connection conn, final SearchRequest request, final SearchEntry entry) throws LdapException { if (entry != null) { entry.setDn(handleDn(conn, request, entry)); handleAttributes(conn, request, entry); } return new HandlerResult<SearchEntry>(entry); }
/** * Handle the dn of a search entry. * * @param conn the search was performed on * @param request used to find the search entry * @param entry search entry to extract the dn from * @return handled dn */ protected String handleDn( final Connection conn, final SearchRequest request, final SearchEntry entry) { return entry.getDn(); }