if (connInstance == null) {
throw new NotFoundException("Connector '" + connInstanceId + "'");
}
if (!connInstance.getResources().isEmpty()) {
SyncopeClientCompositeErrorException scce =
new SyncopeClientCompositeErrorException(HttpStatus.BAD_REQUEST);
SyncopeClientException associatedResources =
new SyncopeClientException(SyncopeClientExceptionType.AssociatedResources);
for (ExternalResource resource : connInstance.getResources()) {
associatedResources.addElement(resource.getName());
}
scce.addException(associatedResources);
throw scce;
}
ConnInstanceTO connToDelete = binder.getConnInstanceTO(connInstance);
connInstanceDAO.delete(connInstanceId);