@DELETE @Path("/{pipelineId}") @Produces(MediaType.APPLICATION_JSON) @GsonWithIds public Response removeOwn(@PathParam("username") String username, @PathParam("pipelineId") String elementUri) { getPipelineStorage().deletePipeline(elementUri); return statusMessage(Notifications.success("Pipeline deleted")); }
@PUT @Path("/{pipelineId}") @Produces(MediaType.APPLICATION_JSON) @GsonWithIds @Override public Response overwritePipeline(@PathParam("username") String username, org.streampipes.model.client.pipeline.Pipeline pipeline) { getPipelineStorage().updatePipeline(pipeline); return statusMessage(Notifications.success("Pipeline modified")); }
@DELETE @Path("/{categoryId}") @Produces(MediaType.APPLICATION_JSON) public Response removeCategory(@PathParam("username") String username, @PathParam("categoryId") String categoryId) { boolean success = getPipelineCategoryStorage() .deletePipelineCategory(categoryId); if (success) return ok(Notifications.success("Category successfully deleted. ")); else return ok(Notifications.error("Could not delete category.")); }
@Override @Path("/instances/{instanceId}") @PUT @Produces(MediaType.APPLICATION_JSON) public Response updateInstance(@PathParam("instanceId") String instanceId, Instance instance) { boolean success = StorageManager .INSTANCE .getBackgroundKnowledgeStorage() .updateInstance(instance); if (success) return ok(Notifications.success("Instance successfully updated.")); else return ok(Notifications.error("Could not update instance. ")); }
@Override @Path("/types/{typeId}") @DELETE @Produces(MediaType.APPLICATION_JSON) public Response deleteType(@PathParam("typeId") String typeId) { boolean success = StorageManager.INSTANCE.getBackgroundKnowledgeStorage().deleteResource(typeId); if (success) return ok(Notifications.success("Concept successfully deleted.")); else return ok(Notifications.error("Could not delete concept. ")); }
@Override @Path("/properties/{propertyId}") @DELETE @Produces(MediaType.APPLICATION_JSON) public Response deleteProperty(@PathParam("propertyId") String propertyId) { boolean success = StorageManager.INSTANCE.getBackgroundKnowledgeStorage().deleteResource(propertyId); if (success) return ok(Notifications.success("Property successfully deleted.")); else return ok(Notifications.error("Could not delete property. ")); }
private Message addRdfEndpoints() { RdfEndpointStorageImpl rdfEndpointStorage = new RdfEndpointStorageImpl(); initRdfEndpointPorts .forEach(p -> rdfEndpointStorage .addRdfEndpoint(new RdfEndpoint(initRdfEndpointHost + p))); return Notifications.success("Creating RDF endpoints..."); }
@POST @Path("/favorites") @RequiresAuthentication @Produces(MediaType.APPLICATION_JSON) @GsonWithIds @Override public Response addFavorite(@PathParam("username") String username, @FormParam("uri") String elementUri) { getUserService().addSourceAsFavorite(username, decode(elementUri)); return statusMessage(Notifications.success(NotificationType.OPERATION_SUCCESS)); }
private Message addRdfEndpoints() { RdfEndpointStorageImpl rdfEndpointStorage = new RdfEndpointStorageImpl(); initRdfEndpointPorts .forEach(p -> rdfEndpointStorage .addRdfEndpoint(new RdfEndpoint(initRdfEndpointHost + p))); return Notifications.success("Creating RDF endpoints..."); }
@DELETE @Produces(MediaType.APPLICATION_JSON) @Path("/{notificationId}") @Override public Response deleteNotification(@PathParam("notificationId") String notificationId) { boolean success = getNotificationStorage() .deleteNotification(notificationId); if (success) { return ok(Notifications.success("Notification deleted")); } else { return ok(Notifications.error("Could not delete notification")); } }
@DELETE @Path("/{contextId}") @Produces(MediaType.APPLICATION_JSON) @Override public Response deleteContext(@PathParam("contextId") String contextId) { boolean success = StorageManager.INSTANCE.getContextStorage().deleteContext(contextId); if (success) { return ok(Notifications.success("Context successfully deleted.")); } else { return ok(Notifications.error("Could not delete context.")); } }
@Override @Path("/instances/{instanceId}") @DELETE @Produces(MediaType.APPLICATION_JSON) public Response deleteInstance(@PathParam("instanceId") String instanceId) { boolean success = StorageManager.INSTANCE.getBackgroundKnowledgeStorage().deleteResource(instanceId); if (success) return ok(Notifications.success("Instance successfully deleted.")); else return ok(Notifications.error("Could not delete instance. ")); }
@POST @Path("/favorites") @RequiresAuthentication @Produces(MediaType.APPLICATION_JSON) @GsonWithIds @Override public Response addFavorite(@PathParam("username") String username, @FormParam("uri") String elementUri) { getUserService().addSepaAsFavorite(username, decode(elementUri)); return statusMessage(Notifications.success(NotificationType.OPERATION_SUCCESS)); }
@DELETE @Path("/favorites/{elementUri}") @RequiresAuthentication @Produces(MediaType.APPLICATION_JSON) @GsonWithIds @Override public Response removeFavorite(@PathParam("username") String username, @PathParam("elementUri") String elementUri) { getUserService().removeActionFromFavorites(username, decode(elementUri)); return statusMessage(Notifications.success(NotificationType.OPERATION_SUCCESS)); }
@DELETE @Path("/favorites/{elementUri}") @RequiresAuthentication @Produces(MediaType.APPLICATION_JSON) @GsonWithIds @Override public Response removeFavorite(@PathParam("username") String username, @PathParam("elementUri") String elementUri) { getUserService().removeSepaFromFavorites(username, decode(elementUri)); return statusMessage(Notifications.success(NotificationType.OPERATION_SUCCESS)); }
@POST @Path("/favorites") @RequiresAuthentication @Produces(MediaType.APPLICATION_JSON) @GsonWithIds @Override public Response addFavorite(@PathParam("username") String username, @FormParam("uri") String elementUri) { getUserService().addActionAsFavorite(username, decode(elementUri)); return statusMessage(Notifications.success(NotificationType.OPERATION_SUCCESS)); }
@DELETE @Path("/favorites/{elementUri}") @RequiresAuthentication @Produces(MediaType.APPLICATION_JSON) @GsonWithIds @Override public Response removeFavorite(@PathParam("username") String username, @PathParam("elementUri") String elementUri) { getUserService().removeSourceFromFavorites(username, decode(elementUri)); return statusMessage(Notifications.success(NotificationType.OPERATION_SUCCESS)); }
@POST @Produces(MediaType.APPLICATION_JSON) public Response addCategory(@PathParam("username") String username, org.streampipes.model.client.pipeline.PipelineCategory pipelineCategory) { boolean success = getPipelineCategoryStorage() .addPipelineCategory(pipelineCategory); if (success) return ok(Notifications.success("Category successfully stored. ")); else return ok(Notifications.error("Could not create category.")); }
@Override public List<Message> install() { try { String encryptedPassword = PasswordUtil.encryptPassword(adminPassword); StorageDispatcher.INSTANCE.getNoSqlStore().getUserStorageAPI().storeUser(new User(adminEmail, encryptedPassword, roles)); return Arrays.asList(Notifications.success(getTitle())); } catch (NoSuchAlgorithmException | InvalidKeySpecException e) { e.printStackTrace(); return Arrays.asList(Notifications.error("Could not encrypt password")); } }
@Override public List<Message> install() { try { String encryptedPassword = PasswordUtil.encryptPassword(adminPassword); StorageDispatcher.INSTANCE.getNoSqlStore().getUserStorageAPI().storeUser(new User(adminEmail, encryptedPassword, roles)); return Arrays.asList(Notifications.success(getTitle())); } catch (NoSuchAlgorithmException | InvalidKeySpecException e) { e.printStackTrace(); return Arrays.asList(Notifications.error("Could not encrypt password")); } }