public void list(final String base, NameClassPairCallbackHandler handler) { SearchExecutor searchExecutor = new SearchExecutor() { public NamingEnumeration executeSearch(DirContext ctx) throws NamingException { return ctx.list(base); } }; search(searchExecutor, handler); }
/** * @param contextSource The contextSource to set. */ public void setContextSource(ContextSource contextSource) { this.contextSource = contextSource; this.ldapTemplate = new LdapTemplate(this.contextSource); } }
private void closeContextAndNamingEnumeration(DirContext ctx, NamingEnumeration results) { closeNamingEnumeration(results); closeContext(ctx); }
public void search(Name base, String filter, int searchScope, boolean returningObjFlag, NameClassPairCallbackHandler handler) { search(base, filter, getDefaultSearchControls(searchScope, returningObjFlag, ALL_ATTRIBUTES), handler); }
public void unbind(final Name dn, boolean recursive) throws DataAccessException { if (!recursive) { doUnbind(dn); } else { doUnbindRecursively(dn); } }
public List search(Name base, String filter, SearchControls controls, ContextMapper mapper, DirContextProcessor processor) { assureReturnObjFlagSet(controls); ContextMapperCallbackHandler handler = new ContextMapperCallbackHandler( mapper); search(base, filter, controls, handler, processor); return handler.getList(); }
public Object lookup(final Name dn, final ContextMapper mapper) { return executeReadOnly(new ContextExecutor() { public Object executeWithContext(DirContext ctx) throws NamingException { Object object = ctx.lookup(dn); return mapper.mapFromContext(object); } }); }
private Object executeWithContext(ContextExecutor ce, DirContext ctx) { try { return ce.executeWithContext(ctx); } catch (NamingException e) { throw getExceptionTranslator().translate(e); } finally { closeContext(ctx); } }
log.debug("PartialResultException encountered and ignored", e); } else { throw getExceptionTranslator().translate(e); throw getExceptionTranslator().translate(e); } finally { closeContextAndNamingEnumeration(ctx, results);
.getName()); childName.prepend((DistinguishedName) name); deleteRecursively(ctx, childName); throw getExceptionTranslator().translate(e); } finally { try {
public Object executeWithContext(DirContext ctx) throws NamingException { deleteRecursively(ctx, new DistinguishedName(dn)); return null; } });
public void unbind(final Name dn) { doUnbind(dn); }
public List search(String base, String filter, int searchScope, String[] attrs, AttributesMapper mapper) throws DataAccessException { return search(base, filter, getDefaultSearchControls(searchScope, DONT_RETURN_OBJ_FLAG, attrs), mapper); }
public List search(String base, String filter, SearchControls controls, ContextMapper mapper, DirContextProcessor processor) { assureReturnObjFlagSet(controls); ContextMapperCallbackHandler handler = new ContextMapperCallbackHandler( mapper); search(base, filter, controls, handler, processor); return handler.getList(); }
public Object lookup(final Name dn, final AttributesMapper mapper) { return executeReadOnly(new ContextExecutor() { public Object executeWithContext(DirContext ctx) throws NamingException { Attributes attributes = ctx.getAttributes(dn); return mapper.mapFromAttributes(attributes); } }); }
public void unbind(final String dn, boolean recursive) throws DataAccessException { if (!recursive) { doUnbind(dn); } else { doUnbindRecursively(dn); } }
public Object executeWithContext(DirContext ctx) throws NamingException { deleteRecursively(ctx, new DistinguishedName(dn)); return null; } });
public void unbind(final String dn) throws DataAccessException { doUnbind(dn); }
public void listBindings(final String base, NameClassPairCallbackHandler handler) { SearchExecutor searchExecutor = new SearchExecutor() { public NamingEnumeration executeSearch(DirContext ctx) throws NamingException { return ctx.listBindings(base); } }; search(searchExecutor, handler); }
public List search(String base, String filter, int searchScope, String[] attrs, ContextMapper mapper) throws DataAccessException { return search(base, filter, getDefaultSearchControls(searchScope, RETURN_OBJ_FLAG, attrs), mapper); }