@Override public void deleteSchemaBranch(Long schemaBranchId) throws SchemaBranchNotFoundException, InvalidSchemaBranchDeletionException { schemaRegistry.deleteSchemaBranch(schemaBranchId); }
@DELETE @Path("/schemas/branch/{branchId}") @ApiOperation(value = "Delete a branch give its name", tags = OPERATION_GROUP_SCHEMA) @UnitOfWork public Response deleteSchemaBranch(@ApiParam(value = "Schema Branch Name", required = true) @PathParam("branchId") Long schemaBranchId) { try { schemaRegistry.deleteSchemaBranch(schemaBranchId); return WSUtils.respond(Response.Status.OK); } catch (SchemaBranchNotFoundException e) { return WSUtils.respond(Response.Status.NOT_FOUND, CatalogResponse.ResponseMessage.ENTITY_NOT_FOUND, schemaBranchId.toString()); } catch (InvalidSchemaBranchDeletionException e) { return WSUtils.respond(Response.Status.BAD_REQUEST, CatalogResponse.ResponseMessage.BAD_REQUEST_WITH_MESSAGE, e.getMessage()); } catch (Exception ex) { LOG.error("Encountered error while deleting a branch with name: [{}]", schemaBranchId, ex); return WSUtils.respond(Response.Status.INTERNAL_SERVER_ERROR, CatalogResponse.ResponseMessage.EXCEPTION, ex.getMessage()); } }
@DELETE @Path("/schemas/branch/{branchId}") @ApiOperation(value = "Delete a branch give its name", tags = OPERATION_GROUP_SCHEMA) @UnitOfWork public Response deleteSchemaBranch(@ApiParam(value = "Schema Branch Name", required = true) @PathParam("branchId") Long schemaBranchId) { try { schemaRegistry.deleteSchemaBranch(schemaBranchId); return WSUtils.respond(Response.Status.OK); } catch (SchemaBranchNotFoundException e) { return WSUtils.respond(Response.Status.NOT_FOUND, CatalogResponse.ResponseMessage.ENTITY_NOT_FOUND, schemaBranchId.toString()); } catch (InvalidSchemaBranchDeletionException e) { return WSUtils.respond(Response.Status.BAD_REQUEST, CatalogResponse.ResponseMessage.BAD_REQUEST_WITH_MESSAGE, e.getMessage()); } catch (Exception ex) { LOG.error("Encountered error while deleting a branch with name: [{}]", schemaBranchId, ex); return WSUtils.respond(Response.Status.INTERNAL_SERVER_ERROR, CatalogResponse.ResponseMessage.EXCEPTION, ex.getMessage()); } }