class ProductResource extends AbstractResource {

    @DELETE
    @Path("/{name}" + ServerAPI.GET_DELIVERIES+"/{commercialName}"+"/{commercialVersion}")
    @Produces(MediaType.APPLICATION_JSON)
    public Response deleteDelivery(@Auth final DbCredential credential, @PathParam("name") final String name, @PathParam("commercialName") final String commercialName, @PathParam("commercialVersion") final String commercialVersion){
        if(!credential.getRoles().contains(DbCredential.AvailableRoles.DATA_DELETER)){
            throw new WebApplicationException(Response.status(Response.Status.UNAUTHORIZED).build());
        }

        if(LOG.isInfoEnabled()) {
            LOG.info(String.format("Got a delete delivery request for product [%s]", name));
        }

        final DbProduct dbProduct = getProductHandler().getProduct(name);

        final Delivery delivery = dbProduct.getDelivery(commercialName, commercialVersion);
        
        if(! dbProduct.getDeliveries().contains(delivery)){
            throw new WebApplicationException(Response.serverError().status(HttpStatus.NOT_FOUND_404)
                    .entity(String.format(DELIVERY_MSG_TEMPLATE, commercialName, commercialVersion, " does not exist for ", name)).build());
        }

        dbProduct.getDeliveries().remove(delivery);
        getProductHandler().update(dbProduct);

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

    public  ProductResource(final RepositoryHandler repositoryHandler, final GrapesServerConfig configuration);

}