class ProductResource extends AbstractResource {

    @POST
    public Response createProduct(@Auth final DbCredential credential, final String productName){
        if(!credential.getRoles().contains(DbCredential.AvailableRoles.DATA_UPDATER)){
            throw new WebApplicationException(Response.status(Response.Status.UNAUTHORIZED).build());
        }

        LOG.info("Got a create product request.");

        if(productName == null || productName.isEmpty()){
            throw new WebApplicationException(Response.status(Response.Status.BAD_REQUEST).entity("Product name should neither be null nor empty.").build());
        }

        final DbProduct dbProduct = new DbProduct();
        dbProduct.setName(productName);
        getProductHandler().create(dbProduct);

        return Response.ok().status(HttpStatus.CREATED_201).build();
    }

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

}