use of org.ldaptive.DeleteOperation in project cas by apereo.
the class LdapUtils method executeDeleteOperation.
/**
* Execute delete operation boolean.
*
* @param connectionFactory the connection factory
* @param entry the entry
* @return true/false
*/
public static boolean executeDeleteOperation(final ConnectionFactory connectionFactory, final LdapEntry entry) {
try {
val delete = new DeleteOperation(connectionFactory);
val request = new DeleteRequest(entry.getDn());
val response = delete.execute(request);
LOGGER.debug("Result code [{}], message: [{}]", response.getResultCode(), response.getDiagnosticMessage());
return response.getResultCode() == ResultCode.SUCCESS;
} catch (final Exception e) {
LoggingUtils.error(LOGGER, e);
}
return false;
}
Aggregations