/** * Processes the provided delete request. * * @param deleteRequest The delete request to be processed. It must not be * {@code null}. * * @return The result of processing the delete operation. * * @throws LDAPException If the server rejects the delete request, or if a * problem is encountered while sending the request or * reading the response. */ public LDAPResult delete(final ReadOnlyDeleteRequest deleteRequest) throws LDAPException { return delete((DeleteRequest) deleteRequest); }
/** * Processes the provided delete request. * * @param deleteRequest The delete request to be processed. It must not be * {@code null}. * * @return The result of processing the delete operation. * * @throws LDAPException If the server rejects the delete request, or if a * problem is encountered while sending the request or * reading the response. */ public LDAPResult delete(final ReadOnlyDeleteRequest deleteRequest) throws LDAPException { return delete((DeleteRequest) deleteRequest); }
@Override protected LDAPResult run() throws Exception { return getConnection().delete(deleteRequest); }
/** * Deletes the entry with the specified DN. * * @param dn The DN of the entry to delete. It must not be {@code null}. * * @return The result of processing the delete operation. * * @throws LDAPException If the server rejects the delete request, or if a * problem is encountered while sending the request or * reading the response. */ public LDAPResult delete(final String dn) throws LDAPException { return delete(new DeleteRequest(dn)); }
/** * Deletes the entry with the specified DN. * * @param dn The DN of the entry to delete. It must not be {@code null}. * * @return The result of processing the delete operation. * * @throws LDAPException If the server rejects the delete request, or if a * problem is encountered while sending the request or * reading the response. */ public LDAPResult delete(final String dn) throws LDAPException { return delete(new DeleteRequest(dn)); }
/** * Attempts to delete the task with the specified task ID. * * @param taskID The task ID of the task to be deleted. * @param connection The connection to the Directory Server in which to * perform the operation. * * @throws LDAPException If a problem occurs while communicating with the * Directory Server. */ public static void deleteTask(final String taskID, final LDAPConnection connection) throws LDAPException { connection.delete(getTaskDN(taskID)); }
@Override public void removeGroup(String groupName) throws LdapSystemException { try (LDAPConnection conn = ldapPool.getConnection()) { String groupDN = getGroupDN(groupName); SearchResultEntry entry = conn.getEntry(groupDN, GROUP_NAME_ATTR); if (entry != null) { conn.delete(groupDN); } } catch (LDAPException e) { throw new LdapSystemException(e); } }
@Override public void removeGroupMember(String accountDN, String groupName) throws LdapSystemException { try (LDAPConnection conn = ldapPool.getConnection()) { LdapGroup group = getGroup(groupName, conn); if (group == null || !group.getMembersDn().contains(accountDN)) { log.info("Nothing to do. Account {} is not member of group {}", accountDN, groupName); } else { Modification mod = new Modification(DELETE, config.getLdapGroupsMemberAttr(), accountDN); conn.modify(new ModifyRequest(group.getDn(), mod)); log.info("Remove membership {} from {}", accountDN, group.getName()); if (group.getMembersDn().size() == 1) { log.info("Removing group {}", group.getName()); conn.delete(group.getDn()); } } } catch (LDAPException e) { throw new LdapSystemException(e); } }
/** * Removes an entry from the directory. * * @param dn The DN of the entry to delete. * @param constraints The constraints to use for the delete operation. * * @throws LDAPException If a problem occurs while processing the delete. */ public void delete(final String dn, final LDAPConstraints constraints) throws LDAPException { final DeleteRequest deleteRequest = new DeleteRequest(dn); update(deleteRequest, constraints); try { final LDAPResult result = conn.delete(deleteRequest); setResponseControls(result); } catch (com.unboundid.ldap.sdk.LDAPException le) { debugException(le); setResponseControls(le); throw new LDAPException(le); } }
try deleteResult = ldapConnection.delete(deleteRequest);
try deleteResult = connection.delete(new DeleteRequest(dn, deleteControls));
try deleteResult = sourceConnection.delete( new DeleteRequest(dn, deleteControls));