class ModelBean {

    @POST
    @Consumes({"application/xml", "text/xml", "application/json", "text/yaml", "text/x-yaml", "application/x-yaml"})
    @Produces({"application/xml", "text/xml", "application/json", "text/yaml", "text/x-yaml", "application/x-yaml", "application/x-protobuf",
            "application/x-protostuff"})
    @Path("/import")
    @GZIP
    @RolesAllowed({"Administrator", "JBossAdministrator"})
    @Interceptors(ResponseInterceptor.class)
    public VoidResponse importModel(datawave.webservice.model.Model model, @QueryParam("modelTableName") String modelTableName) {
        
        if (modelTableName == null) {
            modelTableName = defaultModelTableName;
        }
        
        if (log.isDebugEnabled()) {
            log.debug("modelTableName: " + (null == modelTableName ? "" : modelTableName));
        }
        VoidResponse response = new VoidResponse();
        
        ModelList models = listModelNames(modelTableName);
        if (models.getNames().contains(model.getName()))
            throw new PreConditionFailedException(null, response);
        
        insertMapping(model, modelTableName);
        
        return response;
    }

}