You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by ze...@apache.org on 2022/11/17 20:16:03 UTC

[incubator-streampipes] branch STREAMPIPES-633 created (now 327ab1407)

This is an automated email from the ASF dual-hosted git repository.

zehnder pushed a change to branch STREAMPIPES-633
in repository https://gitbox.apache.org/repos/asf/incubator-streampipes.git


      at 327ab1407 [STREAMPIPES-633] Add new default get method to PipelineResource

This branch includes the following new commits:

     new 327ab1407 [STREAMPIPES-633] Add new default get method to PipelineResource

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[incubator-streampipes] 01/01: [STREAMPIPES-633] Add new default get method to PipelineResource

Posted by ze...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

zehnder pushed a commit to branch STREAMPIPES-633
in repository https://gitbox.apache.org/repos/asf/incubator-streampipes.git

commit 327ab1407398de6ef73154811443614b27e9cd4d
Author: Philipp Zehnder <ze...@fzi.de>
AuthorDate: Thu Nov 17 21:15:41 2022 +0100

    [STREAMPIPES-633] Add new default get method to PipelineResource
---
 .../streampipes/rest/impl/PipelineResource.java    | 26 ++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineResource.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineResource.java
index 61f862e5c..fe7bb1afa 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineResource.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineResource.java
@@ -73,6 +73,27 @@ public class PipelineResource extends AbstractAuthGuardedRestResource {
 
   @GET
   @Produces(MediaType.APPLICATION_JSON)
+  @Path("/")
+  @JacksonSerialized
+  @Operation(summary = "Get all pipelines of the current user",
+      tags = {"Pipeline"},
+      responses = {
+          @ApiResponse(content = {
+              @Content(
+                  mediaType = "application/json",
+                  array = @ArraySchema(schema = @Schema(implementation = Pipeline.class)))
+          })})
+  @PreAuthorize(AuthConstants.HAS_READ_PIPELINE_PRIVILEGE)
+  @PostFilter("hasPermission(filterObject.pipelineId, 'READ')")
+  public List<Pipeline> get() {
+    return PipelineManager.getAllPipelines();
+  }
+
+  /**
+   * @deprecated use {@link #get()} instead.
+   */
+  @GET
+  @Produces(MediaType.APPLICATION_JSON)
   @Path("/own")
   @JacksonSerialized
   @Operation(summary = "Get all pipelines assigned to the current user",
@@ -85,10 +106,14 @@ public class PipelineResource extends AbstractAuthGuardedRestResource {
           })})
   @PreAuthorize(AuthConstants.HAS_READ_PIPELINE_PRIVILEGE)
   @PostFilter("hasPermission(filterObject.pipelineId, 'READ')")
+  @Deprecated(since = "0.71.0", forRemoval = true)
   public List<Pipeline> getOwn() {
     return PipelineManager.getAllPipelines();
   }
 
+  /**
+   * @deprecated use {@link #get()} instead.
+   */
   @GET
   @Produces(MediaType.APPLICATION_JSON)
   @Path("/system")
@@ -96,6 +121,7 @@ public class PipelineResource extends AbstractAuthGuardedRestResource {
   @Operation(summary = "Get all system pipelines assigned to the current user",
       tags = {"Pipeline"})
   @PreAuthorize(AuthConstants.HAS_READ_PIPELINE_PRIVILEGE)
+  @Deprecated(since = "0.71.0", forRemoval = true)
   public Response getSystemPipelines() {
     return ok(getPipelineStorage().getSystemPipelines());
   }