@Test public void delete() { SocialPerson liz = personRepo.findOne("liz"); Assert.assertNotNull(liz); personRepo.delete("liz"); SocialPerson deletedLiz = personRepo.findOne("liz"); Assert.assertNull(deletedLiz); }
@Override public boolean delete(String id) { final String dn = toDn(id); log.info("Deleting LDAP Entry {} recursively", dn); try { return withConnection(new Function<LdapConnection, Boolean>() { @Override @Nullable public Boolean apply(@Nullable LdapConnection conn) { return LdapUtils.deleteRecursively(conn, dn) >= 1; } }); } catch (Exception e) { throw new LdapRepositoryException(e, "Error deleting LDAP Entry %s", dn); } }
PooledLdapRepository extends CrudRepositoryBase<T, String> implements LdapRepository<T> { @Override public boolean delete(String id) { final String dn = toDn(id); log.info("Deleting LDAP Entry {} recursively", dn); try { return withConnection(new Function<LdapConnection, Boolean>() { @Override @Nullable public Boolean apply(@Nullable LdapConnection conn) { return LdapUtils.deleteRecursively(conn, dn) >= 1; } }); } catch (Exception e) { throw new LdapRepositoryException(e, "Error deleting LDAP Entry %s", dn); } } }
PooledLdapRepository extends CrudRepositoryBase<T, String> implements LdapRepository<T> { @Override public boolean delete(String id) { final String dn = toDn(id); log.info("Deleting LDAP Entry {} recursively", dn); try { return withConnection(new Function<LdapConnection, Boolean>() { @Override @Nullable public Boolean apply(@Nullable LdapConnection conn) { return LdapUtils.deleteRecursively(conn, dn) >= 1; } }); } catch (Exception e) { throw new LdapRepositoryException(e, "Error deleting LDAP Entry %s", dn); } } PooledLdapRepository(final Class<? extends T> entityClass, final ObjectPool<LdapConnection> pool, final String baseDn); }
PooledLdapRepository extends CrudRepositoryBase<T, String> implements LdapRepository<T> { @Override public boolean delete(String id) { final String dn = toDn(id); log.info("Deleting LDAP Entry {} recursively", dn); try { return withConnection(new Function<LdapConnection, Boolean>() { @Override @Nullable public Boolean apply(@Nullable LdapConnection conn) { return LdapUtils.deleteRecursively(conn, dn) >= 1; } }); } catch (Exception e) { throw new LdapRepositoryException(e, "Error deleting LDAP Entry %s", dn); } } PooledLdapRepository(final Class<? extends T> entityClass, final ObjectPool<LdapConnection> pool, final String baseDn); @Override @Deprecated void init(); @Override S add(S entity); @Override @Nonnull T modify(final T entity); @Override S modify(String id, final S entity); @Override boolean delete(String id); @SuppressWarnings("unchecked") @Override U findOne(String id); @Override String toDn(String id); @Override T findOneByAttribute(String attribute, String value); @Override List<String> findIdsByAttribute(String attribute, String value); @Override List<T> findAll(); @Override String getBaseDn(); @Override Class<? extends T> getEntityClass(); @Override LdapMapper<T> getMapper(); ObjectPool<LdapConnection> getPool(); @Override boolean exists(@Nullable String id); @Override List<T> search(@Nullable String searchText); @Override boolean existsByAttribute(String attribute, String value); @Override List<T> findAllByFilter(String filter); @Override long count(); @Override long countByAttribute(String attribute, String value); @Override Page<T> findAll(final Pageable pageable); @Override List<String> findIdsByFilter(String filter); }
PooledLdapRepository extends CrudRepositoryBase<T, String> implements LdapRepository<T> { @Override public boolean delete(String id) { final String dn = toDn(id); log.info("Deleting LDAP Entry {} recursively", dn); try { return withConnection(new Function<LdapConnection, Boolean>() { @Override @Nullable public Boolean apply(@Nullable LdapConnection conn) { return LdapUtils.deleteRecursively(conn, dn) >= 1; } }); } catch (Exception e) { throw new LdapRepositoryException(e, "Error deleting LDAP Entry %s", dn); } } PooledLdapRepository(final Class<? extends T> entityClass, final ObjectPool<LdapConnection> pool, final String baseDn); @Override @Deprecated void init(); @Override S add(S entity); @Override @Nonnull T modify(final T entity); @Override S modify(String id, final S entity); @Override boolean delete(String id); @SuppressWarnings("unchecked") @Override U findOne(String id); @Override String toDn(String id); @Override T findOneByAttribute(String attribute, String value); @Override List<String> findIdsByAttribute(String attribute, String value); @Override List<T> findAll(); @Override String getBaseDn(); @Override Class<? extends T> getEntityClass(); @Override LdapMapper<T> getMapper(); ObjectPool<LdapConnection> getPool(); @Override boolean exists(@Nullable String id); @Override List<T> search(@Nullable String searchText); @Override boolean existsByAttribute(String attribute, String value); @Override List<T> findAllByFilter(String filter); @Override long count(); @Override long countByAttribute(String attribute, String value); @Override Page<T> findAll(final Pageable pageable); @Override List<String> findIdsByFilter(String filter);  }