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:04 UTC

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

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());
   }