class ClientsResource {

  @Path("{clientId}")
  @Timed @ExceptionMetered
  @DELETE
  public Response deleteClient(@Auth User user, @PathParam("clientId") LongParam clientId) {
    logger.info("User '{}' deleting client id={}.", user, clientId);

    Optional<Client> client = clientDAO.getClientById(clientId.get());
    if (!client.isPresent()) {
      throw new NotFoundException("Client not found.");
    }

    clientDAO.deleteClient(client.get());

    auditLog.recordEvent(
        new Event(Instant.now(), EventTag.CLIENT_DELETE, user.getName(), client.get().getName()));

    return Response.noContent().build();
  }

  @Inject public  ClientsResource(AclDAOFactory aclDAOFactory, ClientDAOFactory clientDAOFactory,
      AuditLog auditLog);
  @VisibleForTesting  ClientsResource(AclDAO aclDAO, ClientDAO clientDAO, AuditLog auditLog);

}