@Override public boolean deleteSEPA(DataProcessorDescription sepa) { boolean success = sesameStorage.deleteSEPA(sepa); initializeSEPAStorage(); return success; }
@Override public boolean deleteSEPA(DataProcessorDescription sepa) { boolean success = sesameStorage.deleteSEPA(sepa); initializeSEPAStorage(); return success; }
@DELETE @Path("/own/{elementUri}") @RequiresAuthentication @Produces(MediaType.APPLICATION_JSON) @GsonWithIds @Override public Response removeOwn(@PathParam("username") String username, @PathParam("elementUri") String elementUri) { try { getUserService().deleteOwnSepa(username, elementUri); getPipelineElementRdfStorage().deleteSEPA(getPipelineElementRdfStorage().getSEPAById(elementUri)); } catch (URISyntaxException e) { return constructErrorMessage(Notifications.create(NotificationType.STORAGE_ERROR, e.getMessage())); } return constructSuccessMessage(NotificationType.STORAGE_SUCCESS.uiNotification()); }
@POST @Path("/update") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.MULTIPART_FORM_DATA) public Response directUpdate(@PathParam("username") String username, @FormDataParam("config") String config, @FormDataParam("model") String model) { DeploymentConfiguration deploymentConfig = fromJson(config); boolean success; if (deploymentConfig.getElementType().equals("Sepa")) { DataProcessorDescription sepa = GsonSerializer.getGsonWithIds().fromJson(model, DataProcessorDescription.class); success = StorageManager.INSTANCE.getStorageAPI().deleteSEPA(sepa.getElementId()); StorageManager.INSTANCE.getStorageAPI().storeSEPA(sepa); } else { DataSinkDescription sec = new DataSinkDescription(GsonSerializer.getGsonWithIds().fromJson(model, DataSinkDescription.class)); success = StorageManager.INSTANCE.getStorageAPI().update(sec); } if (success) return ok(Notifications.success("Element description updated.")); else return ok(Notifications.error("Could not update element description.")); }
@Path("/{id}") @DELETE @Produces(MediaType.APPLICATION_JSON) public Response deleteElement(@PathParam("username") String username, @PathParam("id") String elementId) { UserService userService = getUserService(); IPipelineElementDescriptionStorage requestor = getPipelineElementRdfStorage(); try { if (requestor.getSEPAById(elementId) != null) { requestor.deleteSEPA(requestor.getSEPAById(elementId)); userService.deleteOwnSepa(username, elementId); } else if (requestor.getSEPById(elementId) != null) { requestor.deleteSEP(requestor.getSEPById(elementId)); userService.deleteOwnSource(username, elementId); } else if (requestor.getSECById(elementId) != null) { requestor.deleteSEC(requestor.getSECById(elementId)); userService.deleteOwnAction(username, elementId); } else { return constructErrorMessage(new Notification(NotificationType.STORAGE_ERROR.title(), NotificationType.STORAGE_ERROR.description())); } } catch (URISyntaxException e) { return constructErrorMessage(new Notification(NotificationType.STORAGE_ERROR.title(), NotificationType.STORAGE_ERROR.description())); } return constructSuccessMessage(NotificationType.STORAGE_SUCCESS.uiNotification()); }