class MembershipResource {

  @Path("/clients/{clientId}/groups/{groupId}")
  @Timed @ExceptionMetered
  @PUT
  public Response enrollClient(
    @Auth User user,
    @PathParam("clientId") LongParam clientId,
    @PathParam("groupId") LongParam groupId) {

    logger.info("User {} enrolling clientId {} in groupId {}.", user.getName(), clientId, groupId);

    try {
      aclDAO.findAndEnrollClient(clientId.get(), groupId.get(), auditLog, user.getName(), new HashMap<>());
    } catch (IllegalStateException e) {
      throw new NotFoundException();
    }

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

  @Inject public  MembershipResource(AclDAOFactory aclDAOFactory, AuditLog auditLog);
  @VisibleForTesting  MembershipResource(AclDAO aclDAO, AuditLog auditLog);

}