You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by ri...@apache.org on 2021/09/24 13:26:14 UTC

[incubator-streampipes] branch dev updated (63938ea -> 8124c21)

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

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


    from 63938ea  [STREAMPIPES-402] Improve modification of widgets
     new a453b87  [STREAMPIPES-427] Add streampipes-rest-core-base module, extract AuthGuardedResource to separate module, refactor pipeline API
     new b20b383  [STREAMPIPES-427] Modify path of category and remote options resource
     new dc178b8  [STREAMPIPES-427] Remove obsolete CouchDB resource
     new a5e62d4  [STREAMPIPES-427] Modify paths of deployment resource and extensions resource
     new cde6123  [STREAMPIPES-427] Modify paths of dashboard and measurement unit resources
     new e1ee3e3  [STREAMPIPES-427] Modify paths of notifications and pipeline cache resources
     new 08ec202  [STREAMPIPES-427] Modify paths of file resource
     new 9a90b5b  [STREAMPIPES-427] Modify paths of pipeline element import, preview and monitoring resources
     new ad12673  [STREAMPIPES-427] Modify paths of pipeline template resource
     new 13ff877  [STREAMPIPES-427] Modify paths of pipeline element resources
     new fb4808e  [STREAMPIPES-427] Remove virtual sensor resource
     new 8124c21  [STREAMPIPES-427] Modify paths of StreamPipes connect resources

The 12 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.


Summary of changes:
 pom.xml                                            |   1 +
 .../backend/StreamPipesResourceConfig.java         |   5 +-
 .../master/management/SourcesManagement.java       |   6 +-
 .../master/management/SourcesManagementTest.java   |  10 +-
 .../streampipes/model/pipeline/Pipeline.java       |   1 +
 .../apache/streampipes/ps/DataLakeResourceV3.java  |   2 +-
 .../apache/streampipes/ps/DataLakeResourceV4.java  |   2 +-
 .../ps/PipelineElementTemplateResource.java        |   2 +-
 .../pom.xml                                        |  20 +-
 .../impl/AbstractAuthGuardedRestResource.java      |   7 +-
 .../rest/core/base}/impl/AbstractRestResource.java |   2 +-
 streampipes-rest/pom.xml                           |   5 +
 .../apache/streampipes/rest}/ResetManagement.java  |   2 +-
 .../streampipes/rest/api/IPipelineElement.java     |  14 +-
 .../streampipes/rest/impl/AssetDashboard.java      |   3 +-
 .../streampipes/rest/impl/Authentication.java      |   1 +
 .../apache/streampipes/rest/impl/AutoComplete.java |   1 +
 .../streampipes/rest/impl/CategoryResource.java    |   3 +-
 .../apache/streampipes/rest/impl/ConsulConfig.java |   1 +
 .../rest/impl/ContainerProvidedOptions.java        |   3 +-
 .../org/apache/streampipes/rest/impl/Couchdb.java  |  53 ---
 .../apache/streampipes/rest/impl/DataStream.java   |   3 +-
 .../apache/streampipes/rest/impl/Deployment.java   |   8 +-
 .../impl/ExtensionsServiceEndpointResource.java    |   3 +-
 .../rest/impl/InternalPipelineTemplates.java       |  14 +-
 .../streampipes/rest/impl/LabelResource.java       |   3 +-
 .../rest/impl/MeasurementUnitResource.java         |   3 +-
 .../apache/streampipes/rest/impl/Notification.java |   9 +-
 .../rest/impl/OntologyMeasurementUnit.java         |   1 +
 .../rest/impl/OntologyPipelineElement.java         |   1 +
 .../streampipes/rest/impl/PipelineCache.java       |  18 +-
 .../rest/impl/PipelineCanvasMetadataCache.java     |  18 +-
 .../rest/impl/PipelineCanvasMetadataResource.java  |   3 +-
 .../streampipes/rest/impl/PipelineCategory.java    |   9 +-
 .../rest/impl/PipelineElementAsset.java            |   1 +
 .../rest/impl/PipelineElementCategory.java         |   1 +
 .../streampipes/rest/impl/PipelineElementFile.java |  10 +-
 .../rest/impl/PipelineElementImport.java           |  24 +-
 .../rest/impl/PipelineElementPreview.java          |   3 +-
 .../rest/impl/PipelineElementRuntimeInfo.java      |   3 +-
 .../streampipes/rest/impl/PipelineMonitoring.java  |   3 +-
 .../streampipes/rest/impl/PipelineResource.java    |  58 +---
 .../streampipes/rest/impl/PipelineTemplate.java    |  10 +-
 .../streampipes/rest/impl/ResetResource.java       |  10 +-
 .../rest/impl/SemanticEventConsumer.java           |  33 +-
 .../rest/impl/SemanticEventProcessingAgent.java    |  32 +-
 .../rest/impl/SemanticEventProducer.java           |  32 +-
 .../org/apache/streampipes/rest/impl/Setup.java    |   1 +
 .../org/apache/streampipes/rest/impl/User.java     |   1 +
 .../org/apache/streampipes/rest/impl/Version.java  |   1 +
 .../streampipes/rest/impl/VirtualSensor.java       |  47 ---
 .../streampipes/rest/impl/Visualization.java       |  36 --
 .../impl/connect}/AbstractAdapterResource.java     |   6 +-
 .../rest/impl/connect}/AdapterResource.java        |  22 +-
 .../impl/connect}/AdapterTemplateResource.java     |  20 +-
 .../rest/impl/connect}/DescriptionResource.java    |  10 +-
 .../rest/impl/connect}/GuessResource.java          |   4 +-
 .../impl/connect}/RuntimeResolvableResource.java   |   4 +-
 .../rest/impl/connect}/SourcesResource.java        |  11 +-
 .../rest/impl/connect}/UnitResource.java           |   4 +-
 .../rest/impl/connect}/WelcomePageMaster.java      |   2 +-
 .../connect}/WorkerAdministrationResource.java     |   4 +-
 .../impl/dashboard/AbstractDashboardResource.java  |   2 +-
 .../AbstractPipelineExtractionResource.java        |   2 +-
 .../streampipes/rest/impl/dashboard/Dashboard.java |   2 +-
 .../rest/impl/dashboard/DashboardWidget.java       |   4 +-
 .../dashboard/VisualizablePipelineResource.java    |   2 +-
 .../impl/datalake/DataLakeNoUserResourceV3.java    |   2 +-
 .../rest/impl/datalake/DataLakeWidgetResource.java |   2 +-
 .../rest/impl/nouser/FileServingResource.java      |   2 +-
 .../impl/nouser/PipelineElementImportNoUser.java   |   2 +-
 .../rest/impl/nouser/PipelineNoUserResource.java   |   2 +-
 .../rest/management/PipelineManagement.java        |   2 +-
 ui/src/app/add/services/add.service.ts             |  29 +-
 .../app-asset-monitoring/services/rest.service.ts  |  94 +++---
 ui/src/app/connect/services/connect.service.ts     |   2 +-
 .../connect/services/data-marketplace.service.ts   |  64 ++--
 ui/src/app/connect/services/rest.service.ts        | 193 ++++++-----
 .../app/core-ui/labels/services/label.service.ts   |   2 +-
 .../runtime-resolvable.service.ts                  |  26 +-
 ui/src/app/dashboard/services/dashboard.service.ts | 216 ++++++------
 ui/src/app/editor/services/editor.service.ts       |  74 +++--
 .../file-overview/file-overview.component.ts       |  35 +-
 .../file-upload/file-upload-dialog.component.ts    |  20 +-
 ui/src/app/home/components/status.component.html   |   4 +-
 ui/src/app/home/components/status.component.ts     |  40 ++-
 ui/src/app/home/home.component.ts                  |  14 +-
 .../notifications/service/notifications.service.ts |  42 ++-
 .../pipeline-overview.component.ts                 |  26 +-
 ui/src/app/pipelines/pipelines.component.html      |   2 +-
 ui/src/app/pipelines/pipelines.component.ts        | 335 ++++++++++---------
 .../app/platform-services/apis/commons.service.ts  |   4 +
 ui/src/app/platform-services/apis/files.service.ts |  28 +-
 .../apis/measurement-units.service.ts              |  18 +-
 .../apis/pipeline-canvas-metadata.service.ts       |  22 +-
 .../apis/pipeline-element-endpoint.service.ts      |  10 +-
 .../apis/pipeline-element.service.ts               |  41 +--
 .../app/platform-services/apis/pipeline.service.ts |  71 ++--
 ui/src/app/platform-services/platform.module.ts    |  24 +-
 ui/src/app/services/rest-api.service.ts            | 362 ++++++---------------
 100 files changed, 1063 insertions(+), 1389 deletions(-)
 copy {streampipes-container-extensions => streampipes-rest-core-base}/pom.xml (77%)
 rename {streampipes-rest/src/main/java/org/apache/streampipes/rest => streampipes-rest-core-base/src/main/java/org/apache/streampipes/rest/core/base}/impl/AbstractAuthGuardedRestResource.java (85%)
 rename {streampipes-rest/src/main/java/org/apache/streampipes/rest => streampipes-rest-core-base/src/main/java/org/apache/streampipes/rest/core/base}/impl/AbstractRestResource.java (99%)
 rename {streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/general => streampipes-rest/src/main/java/org/apache/streampipes/rest}/ResetManagement.java (98%)
 delete mode 100644 streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/Couchdb.java
 delete mode 100644 streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/VirtualSensor.java
 delete mode 100644 streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/Visualization.java
 rename {streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest => streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect}/AbstractAdapterResource.java (82%)
 rename {streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest => streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect}/AdapterResource.java (90%)
 rename {streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest => streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect}/AdapterTemplateResource.java (77%)
 rename {streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest => streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect}/DescriptionResource.java (95%)
 rename {streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest => streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect}/GuessResource.java (95%)
 rename {streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest => streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect}/RuntimeResolvableResource.java (96%)
 rename {streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest => streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect}/SourcesResource.java (93%)
 rename {streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest => streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect}/UnitResource.java (94%)
 rename {streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest => streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect}/WelcomePageMaster.java (97%)
 rename {streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest => streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect}/WorkerAdministrationResource.java (93%)

[incubator-streampipes] 11/12: [STREAMPIPES-427] Remove virtual sensor resource

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

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

commit fb4808efec2d111be4c8c5f8e18b3f365efa8c2c
Author: Dominik Riemer <ri...@fzi.de>
AuthorDate: Fri Sep 24 14:53:44 2021 +0200

    [STREAMPIPES-427] Remove virtual sensor resource
---
 .../backend/StreamPipesResourceConfig.java         |  1 -
 .../streampipes/rest/impl/VirtualSensor.java       | 48 ----------------------
 2 files changed, 49 deletions(-)

diff --git a/streampipes-backend/src/main/java/org/apache/streampipes/backend/StreamPipesResourceConfig.java b/streampipes-backend/src/main/java/org/apache/streampipes/backend/StreamPipesResourceConfig.java
index 5f5b17b..dde7dcd 100644
--- a/streampipes-backend/src/main/java/org/apache/streampipes/backend/StreamPipesResourceConfig.java
+++ b/streampipes-backend/src/main/java/org/apache/streampipes/backend/StreamPipesResourceConfig.java
@@ -101,7 +101,6 @@ public class StreamPipesResourceConfig extends ResourceConfig {
         register(FileServingResource.class);
         register(DashboardWidget.class);
         register(Dashboard.class);
-        register(VirtualSensor.class);
         register(VisualizablePipelineResource.class);
 
         // Serializers
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/VirtualSensor.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/VirtualSensor.java
deleted file mode 100644
index 2b094f2..0000000
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/VirtualSensor.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.streampipes.rest.impl;
-
-import org.apache.streampipes.model.message.NotificationType;
-import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
-import org.apache.streampipes.serializers.json.Utils;
-
-import javax.ws.rs.*;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-@Path("/v2/users/{username}/block")
-public class VirtualSensor extends AbstractRestResource {
-
-	@GET
-	@Produces(MediaType.APPLICATION_JSON)
-	public Response getVirtualSensors(@PathParam("username") String username) {
-		return ok(getPipelineStorage().getVirtualSensors(username));
-	}
-
-	@POST
-	@Produces(MediaType.APPLICATION_JSON)
-	public Response addVirtualSensor(@PathParam("username") String username, String virtualSensorDescription) {
-		org.apache.streampipes.model.VirtualSensor vs = Utils.getGson().fromJson(virtualSensorDescription, org.apache.streampipes.model.VirtualSensor.class);
-		//vs.setPipelineId(UUID.randomUUID().toString());
-		vs.setCreatedBy(username);
-		getPipelineStorage().storeVirtualSensor(username, vs);
-		return constructSuccessMessage(NotificationType.VIRTUAL_SENSOR_STORAGE_SUCCESS.uiNotification());
-	}
-
-}

[incubator-streampipes] 01/12: [STREAMPIPES-427] Add streampipes-rest-core-base module, extract AuthGuardedResource to separate module, refactor pipeline API

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

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

commit a453b87803cf23b48cbf54f96e16a13c9f390d36
Author: Dominik Riemer <ri...@fzi.de>
AuthorDate: Fri Sep 24 13:41:03 2021 +0200

    [STREAMPIPES-427] Add streampipes-rest-core-base module, extract AuthGuardedResource to separate module, refactor pipeline API
---
 pom.xml                                            |   1 +
 .../backend/StreamPipesResourceConfig.java         |   2 +-
 .../streampipes/model/pipeline/Pipeline.java       |   1 +
 .../apache/streampipes/ps/DataLakeResourceV3.java  |   2 +-
 .../apache/streampipes/ps/DataLakeResourceV4.java  |   2 +-
 .../ps/PipelineElementTemplateResource.java        |   2 +-
 streampipes-rest-core-base/pom.xml                 |  55 ++++
 .../impl/AbstractAuthGuardedRestResource.java      |   7 +-
 .../rest/core/base}/impl/AbstractRestResource.java |   2 +-
 streampipes-rest/pom.xml                           |   5 +
 .../apache/streampipes/rest}/ResetManagement.java  |   2 +-
 .../streampipes/rest/impl/AssetDashboard.java      |   3 +-
 .../streampipes/rest/impl/Authentication.java      |   1 +
 .../apache/streampipes/rest/impl/AutoComplete.java |   1 +
 .../streampipes/rest/impl/CategoryResource.java    |   1 +
 .../apache/streampipes/rest/impl/ConsulConfig.java |   1 +
 .../rest/impl/ContainerProvidedOptions.java        |   1 +
 .../org/apache/streampipes/rest/impl/Couchdb.java  |   1 +
 .../apache/streampipes/rest/impl/DataStream.java   |   1 +
 .../apache/streampipes/rest/impl/Deployment.java   |   1 +
 .../impl/ExtensionsServiceEndpointResource.java    |   1 +
 .../rest/impl/InternalPipelineTemplates.java       |   1 +
 .../streampipes/rest/impl/LabelResource.java       |   1 +
 .../rest/impl/MeasurementUnitResource.java         |   1 +
 .../apache/streampipes/rest/impl/Notification.java |   1 +
 .../rest/impl/OntologyMeasurementUnit.java         |   1 +
 .../rest/impl/OntologyPipelineElement.java         |   1 +
 .../streampipes/rest/impl/PipelineCache.java       |   1 +
 .../rest/impl/PipelineCanvasMetadataCache.java     |   1 +
 .../rest/impl/PipelineCanvasMetadataResource.java  |   1 +
 .../streampipes/rest/impl/PipelineCategory.java    |   9 +-
 .../rest/impl/PipelineElementAsset.java            |   1 +
 .../rest/impl/PipelineElementCategory.java         |   1 +
 .../streampipes/rest/impl/PipelineElementFile.java |   1 +
 .../rest/impl/PipelineElementImport.java           |   1 +
 .../rest/impl/PipelineElementPreview.java          |   1 +
 .../rest/impl/PipelineElementRuntimeInfo.java      |   1 +
 .../streampipes/rest/impl/PipelineMonitoring.java  |   1 +
 .../streampipes/rest/impl/PipelineResource.java    |  58 ++--
 .../streampipes/rest/impl/PipelineTemplate.java    |   1 +
 .../streampipes/rest/impl/ResetResource.java       |   3 +-
 .../rest/impl/SemanticEventConsumer.java           |   1 +
 .../rest/impl/SemanticEventProcessingAgent.java    |   1 +
 .../rest/impl/SemanticEventProducer.java           |   1 +
 .../org/apache/streampipes/rest/impl/Setup.java    |   1 +
 .../org/apache/streampipes/rest/impl/User.java     |   1 +
 .../org/apache/streampipes/rest/impl/Version.java  |   1 +
 .../streampipes/rest/impl/VirtualSensor.java       |   1 +
 .../streampipes/rest/impl/Visualization.java       |   2 +
 .../impl/connect}/AbstractAdapterResource.java     |   2 +-
 .../rest/impl/connect}/AdapterResource.java        |   2 +-
 .../impl/connect}/AdapterTemplateResource.java     |   2 +-
 .../rest/impl/connect}/DescriptionResource.java    |   2 +-
 .../rest/impl/connect}/GuessResource.java          |   2 +-
 .../impl/connect}/RuntimeResolvableResource.java   |   2 +-
 .../rest/impl/connect}/SourcesResource.java        |   2 +-
 .../rest/impl/connect}/UnitResource.java           |   2 +-
 .../rest/impl/connect}/WelcomePageMaster.java      |   2 +-
 .../connect}/WorkerAdministrationResource.java     |   2 +-
 .../impl/dashboard/AbstractDashboardResource.java  |   2 +-
 .../AbstractPipelineExtractionResource.java        |   2 +-
 .../rest/impl/dashboard/DashboardWidget.java       |   2 +-
 .../impl/datalake/DataLakeNoUserResourceV3.java    |   2 +-
 .../rest/impl/datalake/DataLakeWidgetResource.java |   2 +-
 .../rest/impl/nouser/FileServingResource.java      |   2 +-
 .../impl/nouser/PipelineElementImportNoUser.java   |   2 +-
 .../rest/impl/nouser/PipelineNoUserResource.java   |   2 +-
 .../rest/management/PipelineManagement.java        |   2 +-
 .../app-asset-monitoring/services/rest.service.ts  |  94 +++---
 ui/src/app/home/components/status.component.html   |   4 +-
 ui/src/app/home/components/status.component.ts     |  40 ++-
 ui/src/app/home/home.component.ts                  |  14 +-
 .../pipeline-overview.component.ts                 |  26 +-
 ui/src/app/pipelines/pipelines.component.html      |   2 +-
 ui/src/app/pipelines/pipelines.component.ts        | 335 ++++++++++-----------
 .../app/platform-services/apis/commons.service.ts  |   4 +
 .../app/platform-services/apis/pipeline.service.ts |  71 +++--
 77 files changed, 441 insertions(+), 376 deletions(-)

diff --git a/pom.xml b/pom.xml
index 36ecdb4..f571c6e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -855,6 +855,7 @@
         <module>streampipes-service-discovery-api</module>
         <module>streampipes-connect-api</module>
         <module>streampipes-service-extensions-base</module>
+        <module>streampipes-rest-core-base</module>
     </modules>
 
     <profiles>
diff --git a/streampipes-backend/src/main/java/org/apache/streampipes/backend/StreamPipesResourceConfig.java b/streampipes-backend/src/main/java/org/apache/streampipes/backend/StreamPipesResourceConfig.java
index a429102..e140797 100644
--- a/streampipes-backend/src/main/java/org/apache/streampipes/backend/StreamPipesResourceConfig.java
+++ b/streampipes-backend/src/main/java/org/apache/streampipes/backend/StreamPipesResourceConfig.java
@@ -19,11 +19,11 @@
 package org.apache.streampipes.backend;
 
 import io.swagger.v3.jaxrs2.integration.resources.OpenApiResource;
-import org.apache.streampipes.connect.container.master.rest.*;
 import org.apache.streampipes.ps.DataLakeResourceV3;
 import org.apache.streampipes.ps.DataLakeResourceV4;
 import org.apache.streampipes.ps.PipelineElementTemplateResource;
 import org.apache.streampipes.rest.impl.*;
+import org.apache.streampipes.rest.impl.connect.*;
 import org.apache.streampipes.rest.impl.dashboard.Dashboard;
 import org.apache.streampipes.rest.impl.dashboard.DashboardWidget;
 import org.apache.streampipes.rest.impl.dashboard.VisualizablePipelineResource;
diff --git a/streampipes-model/src/main/java/org/apache/streampipes/model/pipeline/Pipeline.java b/streampipes-model/src/main/java/org/apache/streampipes/model/pipeline/Pipeline.java
index 3249a65..fa2aca2 100644
--- a/streampipes-model/src/main/java/org/apache/streampipes/model/pipeline/Pipeline.java
+++ b/streampipes-model/src/main/java/org/apache/streampipes/model/pipeline/Pipeline.java
@@ -58,6 +58,7 @@ public class Pipeline extends ElementComposition {
     super();
     this.actions = new ArrayList<>();
     this.pipelineNotifications = new ArrayList<>();
+    this.pipelineCategories = new ArrayList<>();
   }
 
   public List<DataSinkInvocation> getActions() {
diff --git a/streampipes-platform-services/src/main/java/org/apache/streampipes/ps/DataLakeResourceV3.java b/streampipes-platform-services/src/main/java/org/apache/streampipes/ps/DataLakeResourceV3.java
index d8d814c..0f8bfff 100644
--- a/streampipes-platform-services/src/main/java/org/apache/streampipes/ps/DataLakeResourceV3.java
+++ b/streampipes-platform-services/src/main/java/org/apache/streampipes/ps/DataLakeResourceV3.java
@@ -25,7 +25,7 @@ import org.apache.streampipes.model.datalake.DataResult;
 import org.apache.streampipes.model.datalake.GroupedDataResult;
 import org.apache.streampipes.model.datalake.PageResult;
 import org.apache.streampipes.model.message.Notification;
-import org.apache.streampipes.rest.impl.AbstractRestResource;
+import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
 import org.apache.streampipes.rest.shared.annotation.GsonWithIds;
 import org.apache.streampipes.rest.shared.annotation.JacksonSerialized;
 
diff --git a/streampipes-platform-services/src/main/java/org/apache/streampipes/ps/DataLakeResourceV4.java b/streampipes-platform-services/src/main/java/org/apache/streampipes/ps/DataLakeResourceV4.java
index 1589b4f..e2efc0b 100644
--- a/streampipes-platform-services/src/main/java/org/apache/streampipes/ps/DataLakeResourceV4.java
+++ b/streampipes-platform-services/src/main/java/org/apache/streampipes/ps/DataLakeResourceV4.java
@@ -30,7 +30,7 @@ import org.apache.streampipes.dataexplorer.v4.ProvidedQueryParams;
 import org.apache.streampipes.model.datalake.DataLakeConfiguration;
 import org.apache.streampipes.model.datalake.DataLakeMeasure;
 import org.apache.streampipes.model.datalake.DataResult;
-import org.apache.streampipes.rest.impl.AbstractRestResource;
+import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
diff --git a/streampipes-platform-services/src/main/java/org/apache/streampipes/ps/PipelineElementTemplateResource.java b/streampipes-platform-services/src/main/java/org/apache/streampipes/ps/PipelineElementTemplateResource.java
index d405b5b..5f6faf1 100644
--- a/streampipes-platform-services/src/main/java/org/apache/streampipes/ps/PipelineElementTemplateResource.java
+++ b/streampipes-platform-services/src/main/java/org/apache/streampipes/ps/PipelineElementTemplateResource.java
@@ -29,7 +29,7 @@ import org.apache.streampipes.manager.template.DataSinkTemplateHandler;
 import org.apache.streampipes.model.graph.DataProcessorInvocation;
 import org.apache.streampipes.model.graph.DataSinkInvocation;
 import org.apache.streampipes.model.template.PipelineElementTemplate;
-import org.apache.streampipes.rest.impl.AbstractRestResource;
+import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
 import org.apache.streampipes.rest.shared.annotation.JacksonSerialized;
 
 import javax.ws.rs.*;
diff --git a/streampipes-rest-core-base/pom.xml b/streampipes-rest-core-base/pom.xml
new file mode 100644
index 0000000..91e1596
--- /dev/null
+++ b/streampipes-rest-core-base/pom.xml
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements.  See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You under the Apache License, Version 2.0
+  ~ (the "License"); you may not use this file except in compliance with
+  ~ the License.  You may obtain a copy of the License at
+  ~
+  ~    http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  ~
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>streampipes-parent</artifactId>
+        <groupId>org.apache.streampipes</groupId>
+        <version>0.69.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>streampipes-rest-core-base</artifactId>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.streampipes</groupId>
+            <artifactId>streampipes-rest-shared</artifactId>
+            <version>0.69.0-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.streampipes</groupId>
+            <artifactId>streampipes-user-management</artifactId>
+            <version>0.69.0-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.streampipes</groupId>
+            <artifactId>streampipes-storage-management</artifactId>
+            <version>0.69.0-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.streampipes</groupId>
+            <artifactId>streampipes-pipeline-management</artifactId>
+            <version>0.69.0-SNAPSHOT</version>
+        </dependency>
+    </dependencies>
+
+</project>
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/AbstractAuthGuardedRestResource.java b/streampipes-rest-core-base/src/main/java/org/apache/streampipes/rest/core/base/impl/AbstractAuthGuardedRestResource.java
similarity index 85%
rename from streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/AbstractAuthGuardedRestResource.java
rename to streampipes-rest-core-base/src/main/java/org/apache/streampipes/rest/core/base/impl/AbstractAuthGuardedRestResource.java
index c1d73c0..c42e0a4 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/AbstractAuthGuardedRestResource.java
+++ b/streampipes-rest-core-base/src/main/java/org/apache/streampipes/rest/core/base/impl/AbstractAuthGuardedRestResource.java
@@ -15,9 +15,7 @@
  * limitations under the License.
  *
  */
-package org.apache.streampipes.rest.impl;
-
-import org.apache.streampipes.model.client.user.User;
+package org.apache.streampipes.rest.core.base.impl;
 
 import javax.ws.rs.core.Context;
 import javax.ws.rs.core.SecurityContext;
@@ -35,7 +33,4 @@ public class AbstractAuthGuardedRestResource extends AbstractRestResource {
     return this.securityContext.getUserPrincipal().getName();
   }
 
-  protected User getAuthenticatedUser() {
-    return getUserStorage().getUser(getAuthenticatedUsername());
-  }
 }
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/AbstractRestResource.java b/streampipes-rest-core-base/src/main/java/org/apache/streampipes/rest/core/base/impl/AbstractRestResource.java
similarity index 99%
rename from streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/AbstractRestResource.java
rename to streampipes-rest-core-base/src/main/java/org/apache/streampipes/rest/core/base/impl/AbstractRestResource.java
index 71d3112..1ae36f9 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/AbstractRestResource.java
+++ b/streampipes-rest-core-base/src/main/java/org/apache/streampipes/rest/core/base/impl/AbstractRestResource.java
@@ -16,7 +16,7 @@
  *
  */
 
-package org.apache.streampipes.rest.impl;
+package org.apache.streampipes.rest.core.base.impl;
 
 import org.apache.http.client.ClientProtocolException;
 import org.apache.shiro.SecurityUtils;
diff --git a/streampipes-rest/pom.xml b/streampipes-rest/pom.xml
index 0b2bb05..0d0bd26 100644
--- a/streampipes-rest/pom.xml
+++ b/streampipes-rest/pom.xml
@@ -92,6 +92,11 @@
         </dependency>
         <dependency>
             <groupId>org.apache.streampipes</groupId>
+            <artifactId>streampipes-rest-core-base</artifactId>
+            <version>0.69.0-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.streampipes</groupId>
             <artifactId>streampipes-connect-container-master</artifactId>
             <version>0.69.0-SNAPSHOT</version>
         </dependency>
diff --git a/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/general/ResetManagement.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/ResetManagement.java
similarity index 98%
rename from streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/general/ResetManagement.java
rename to streampipes-rest/src/main/java/org/apache/streampipes/rest/ResetManagement.java
index fb33d62..d0b77ed 100644
--- a/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/general/ResetManagement.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/ResetManagement.java
@@ -16,7 +16,7 @@
  *
  */
 
-package org.apache.streampipes.connect.container.master.general;
+package org.apache.streampipes.rest;
 
 import org.apache.streampipes.connect.api.exception.AdapterException;
 import org.apache.streampipes.connect.container.master.management.AdapterMasterManagement;
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/AssetDashboard.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/AssetDashboard.java
index 5cdabe0..6114d20 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/AssetDashboard.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/AssetDashboard.java
@@ -19,6 +19,7 @@ package org.apache.streampipes.rest.impl;
 
 import org.apache.commons.io.FileUtils;
 import org.apache.streampipes.model.client.assetdashboard.AssetDashboardConfig;
+import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
 import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
 import org.glassfish.jersey.media.multipart.FormDataParam;
 
@@ -33,7 +34,7 @@ import java.net.URLConnection;
 import java.nio.file.Files;
 import java.nio.file.Paths;
 
-@Path("/v2/users/{username}/asset-dashboards")
+@Path("/v2/asset-dashboards")
 public class AssetDashboard extends AbstractRestResource {
 
   private static final String APP_ID = "org.apache.streampipes.apps.assetdashboard";
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/Authentication.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/Authentication.java
index 5af79b7..aa9f0b4 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/Authentication.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/Authentication.java
@@ -29,6 +29,7 @@ import org.apache.streampipes.model.message.ErrorMessage;
 import org.apache.streampipes.model.message.NotificationType;
 import org.apache.streampipes.model.message.Notifications;
 import org.apache.streampipes.model.message.SuccessMessage;
+import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
 import org.apache.streampipes.rest.shared.annotation.GsonWithIds;
 
 import javax.servlet.http.HttpServletRequest;
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/AutoComplete.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/AutoComplete.java
index 7253fd6..b18c4a3 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/AutoComplete.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/AutoComplete.java
@@ -18,6 +18,7 @@
 
 package org.apache.streampipes.rest.impl;
 
+import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
 import org.apache.streampipes.vocabulary.SemanticTypeRegistry;
 
 import javax.ws.rs.GET;
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/CategoryResource.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/CategoryResource.java
index 9ea8ac6..25c6df6 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/CategoryResource.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/CategoryResource.java
@@ -20,6 +20,7 @@ package org.apache.streampipes.rest.impl;
 
 
 import org.apache.streampipes.model.labeling.Category;
+import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
 import org.apache.streampipes.rest.shared.annotation.JacksonSerialized;
 import org.apache.streampipes.storage.management.StorageDispatcher;
 
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/ConsulConfig.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/ConsulConfig.java
index d3c7c6d..fe4167d 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/ConsulConfig.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/ConsulConfig.java
@@ -22,6 +22,7 @@ import com.google.gson.Gson;
 import com.google.gson.JsonObject;
 import org.apache.streampipes.config.backend.BackendConfig;
 import org.apache.streampipes.config.backend.MessagingSettings;
+import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
 import org.apache.streampipes.svcdiscovery.consul.ConsulSpConfig;
 import org.apache.streampipes.svcdiscovery.api.model.ConfigItem;
 import org.apache.streampipes.svcdiscovery.api.model.PeConfig;
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/ContainerProvidedOptions.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/ContainerProvidedOptions.java
index 4eca9d4..aabea60 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/ContainerProvidedOptions.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/ContainerProvidedOptions.java
@@ -19,6 +19,7 @@ package org.apache.streampipes.rest.impl;
 
 import org.apache.streampipes.manager.operations.Operations;
 import org.apache.streampipes.model.runtime.RuntimeOptionsRequest;
+import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
 import org.apache.streampipes.rest.shared.annotation.JacksonSerialized;
 
 import javax.ws.rs.Consumes;
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/Couchdb.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/Couchdb.java
index 524b650..9191c9b 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/Couchdb.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/Couchdb.java
@@ -20,6 +20,7 @@ package org.apache.streampipes.rest.impl;
 
 import com.google.gson.Gson;
 import com.google.gson.JsonObject;
+import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
 import org.apache.streampipes.rest.shared.annotation.GsonWithIds;
 import org.apache.streampipes.storage.couchdb.utils.Utils;
 import org.lightcouch.CouchDbClient;
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/DataStream.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/DataStream.java
index db9f7fc..747da3b 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/DataStream.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/DataStream.java
@@ -19,6 +19,7 @@ package org.apache.streampipes.rest.impl;
 
 import org.apache.streampipes.manager.operations.Operations;
 import org.apache.streampipes.model.SpDataStream;
+import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
 import org.apache.streampipes.rest.shared.annotation.GsonWithIds;
 
 import javax.ws.rs.POST;
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/Deployment.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/Deployment.java
index 7de0f80..f6d9c93 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/Deployment.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/Deployment.java
@@ -26,6 +26,7 @@ import org.apache.streampipes.model.graph.DataProcessorDescription;
 import org.apache.streampipes.model.graph.DataSinkDescription;
 import org.apache.streampipes.model.graph.DataSourceDescription;
 import org.apache.streampipes.model.message.Notifications;
+import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
 import org.apache.streampipes.serializers.json.GsonSerializer;
 import org.apache.streampipes.storage.management.StorageManager;
 import org.glassfish.jersey.media.multipart.FormDataParam;
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/ExtensionsServiceEndpointResource.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/ExtensionsServiceEndpointResource.java
index f056477..11403a8 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/ExtensionsServiceEndpointResource.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/ExtensionsServiceEndpointResource.java
@@ -25,6 +25,7 @@ import org.apache.streampipes.model.SpDataSet;
 import org.apache.streampipes.model.base.NamedStreamPipesEntity;
 import org.apache.streampipes.model.client.endpoint.ExtensionsServiceEndpoint;
 import org.apache.streampipes.model.client.endpoint.ExtensionsServiceEndpointItem;
+import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
 import org.apache.streampipes.rest.shared.annotation.GsonWithIds;
 import org.apache.streampipes.sdk.utils.Assets;
 import org.apache.streampipes.storage.api.IExtensionsServiceEndpointStorage;
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/InternalPipelineTemplates.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/InternalPipelineTemplates.java
index 5cbc743..e9cdbf4 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/InternalPipelineTemplates.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/InternalPipelineTemplates.java
@@ -25,6 +25,7 @@ import org.apache.streampipes.model.graph.DataSinkDescription;
 import org.apache.streampipes.model.pipeline.PipelineOperationStatus;
 import org.apache.streampipes.model.template.PipelineTemplateDescription;
 import org.apache.streampipes.model.template.PipelineTemplateInvocation;
+import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
 import org.apache.streampipes.sdk.builder.BoundPipelineElementBuilder;
 import org.apache.streampipes.sdk.builder.PipelineTemplateBuilder;
 import org.apache.streampipes.storage.api.IPipelineElementDescriptionStorage;
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/LabelResource.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/LabelResource.java
index d0b5a40..81332c5 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/LabelResource.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/LabelResource.java
@@ -20,6 +20,7 @@ package org.apache.streampipes.rest.impl;
 
 import org.apache.streampipes.model.labeling.Category;
 import org.apache.streampipes.model.labeling.Label;
+import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
 import org.apache.streampipes.rest.shared.annotation.JacksonSerialized;
 import org.apache.streampipes.storage.management.StorageDispatcher;
 
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/MeasurementUnitResource.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/MeasurementUnitResource.java
index 630fbf7..9b0814f 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/MeasurementUnitResource.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/MeasurementUnitResource.java
@@ -16,6 +16,7 @@
  */
 package org.apache.streampipes.rest.impl;
 
+import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
 import org.apache.streampipes.rest.shared.annotation.GsonWithIds;
 import org.apache.streampipes.rest.shared.annotation.JacksonSerialized;
 import org.apache.streampipes.units.UnitProvider;
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/Notification.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/Notification.java
index 6a03bfd..ff1d413 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/Notification.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/Notification.java
@@ -19,6 +19,7 @@
 package org.apache.streampipes.rest.impl;
 
 import org.apache.streampipes.model.message.Notifications;
+import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
 import org.apache.streampipes.rest.shared.annotation.GsonWithIds;
 
 import javax.ws.rs.*;
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/OntologyMeasurementUnit.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/OntologyMeasurementUnit.java
index 0bcbd81..a6056e6 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/OntologyMeasurementUnit.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/OntologyMeasurementUnit.java
@@ -18,6 +18,7 @@
 
 package org.apache.streampipes.rest.impl;
 
+import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
 import org.apache.streampipes.units.UnitProvider;
 
 import javax.ws.rs.GET;
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/OntologyPipelineElement.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/OntologyPipelineElement.java
index ea9bf2d..b30062b 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/OntologyPipelineElement.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/OntologyPipelineElement.java
@@ -24,6 +24,7 @@ import com.google.gson.JsonPrimitive;
 import org.apache.streampipes.model.SpDataStream;
 import org.apache.streampipes.model.graph.DataProcessorDescription;
 import org.apache.streampipes.model.graph.DataSinkDescription;
+import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
 import org.apache.streampipes.rest.shared.annotation.GsonWithIds;
 import org.apache.streampipes.storage.management.StorageManager;
 
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineCache.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineCache.java
index ddafe60..53c3dbd 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineCache.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineCache.java
@@ -18,6 +18,7 @@
 package org.apache.streampipes.rest.impl;
 
 import org.apache.streampipes.manager.pipeline.PipelineCacheManager;
+import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
 
 import javax.ws.rs.*;
 import javax.ws.rs.core.MediaType;
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineCanvasMetadataCache.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineCanvasMetadataCache.java
index 022d5e2..e0f3754 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineCanvasMetadataCache.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineCanvasMetadataCache.java
@@ -18,6 +18,7 @@
 package org.apache.streampipes.rest.impl;
 
 import org.apache.streampipes.manager.pipeline.PipelineCanvasMetadataCacheManager;
+import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
 
 import javax.ws.rs.*;
 import javax.ws.rs.core.MediaType;
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineCanvasMetadataResource.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineCanvasMetadataResource.java
index 0aaaa00..4754060 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineCanvasMetadataResource.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineCanvasMetadataResource.java
@@ -18,6 +18,7 @@
 package org.apache.streampipes.rest.impl;
 
 import org.apache.streampipes.model.canvas.PipelineCanvasMetadata;
+import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
 import org.apache.streampipes.rest.shared.annotation.JacksonSerialized;
 import org.apache.streampipes.storage.api.IPipelineCanvasMetadataStorage;
 
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineCategory.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineCategory.java
index c55fcf0..9ef53d9 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineCategory.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineCategory.java
@@ -19,6 +19,7 @@
 package org.apache.streampipes.rest.impl;
 
 import org.apache.streampipes.model.message.Notifications;
+import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
 import org.apache.streampipes.rest.shared.annotation.JacksonSerialized;
 import org.apache.streampipes.storage.api.IPipelineCategoryStorage;
 
@@ -26,13 +27,13 @@ import javax.ws.rs.*;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
-@Path("/v2/users/{username}/pipelinecategories")
+@Path("/v2/pipelinecategories")
 public class PipelineCategory extends AbstractRestResource {
 
 	@GET
 	@Produces(MediaType.APPLICATION_JSON)
 	@JacksonSerialized
-	public Response getCategories(@PathParam("username") String username) {
+	public Response getCategories() {
 		return ok(getPipelineCategoryStorage()
 				.getPipelineCategories());
 	}
@@ -41,7 +42,7 @@ public class PipelineCategory extends AbstractRestResource {
 	@Produces(MediaType.APPLICATION_JSON)
 	@Consumes(MediaType.APPLICATION_JSON)
 	@JacksonSerialized
-	public Response addCategory(@PathParam("username") String username, org.apache.streampipes.model.pipeline.PipelineCategory pipelineCategory) {
+	public Response addCategory(org.apache.streampipes.model.pipeline.PipelineCategory pipelineCategory) {
 		boolean success = getPipelineCategoryStorage()
 				.addPipelineCategory(pipelineCategory);
 		if (success) return ok(Notifications.success("Category successfully stored. "));
@@ -52,7 +53,7 @@ public class PipelineCategory extends AbstractRestResource {
 	@Path("/{categoryId}")
 	@Produces(MediaType.APPLICATION_JSON)
 	@JacksonSerialized
-	public Response removeCategory(@PathParam("username") String username, @PathParam("categoryId") String categoryId) {
+	public Response removeCategory(@PathParam("categoryId") String categoryId) {
 		boolean success = getPipelineCategoryStorage()
 				.deletePipelineCategory(categoryId);
 		if (success) return ok(Notifications.success("Category successfully deleted. "));
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineElementAsset.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineElementAsset.java
index dff9b4a..68e1432 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineElementAsset.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineElementAsset.java
@@ -18,6 +18,7 @@
 package org.apache.streampipes.rest.impl;
 
 import org.apache.streampipes.manager.assets.AssetManager;
+import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineElementCategory.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineElementCategory.java
index c83e341..715c843 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineElementCategory.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineElementCategory.java
@@ -23,6 +23,7 @@ import org.apache.streampipes.model.DataProcessorType;
 import org.apache.streampipes.model.DataSinkType;
 import org.apache.streampipes.model.SpDataStream;
 import org.apache.streampipes.model.client.Category;
+import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
 import org.apache.streampipes.rest.shared.annotation.JacksonSerialized;
 import org.apache.streampipes.storage.management.StorageManager;
 
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineElementFile.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineElementFile.java
index 4a30550..e57a26d 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineElementFile.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineElementFile.java
@@ -19,6 +19,7 @@ package org.apache.streampipes.rest.impl;
 
 import org.apache.streampipes.manager.file.FileManager;
 import org.apache.streampipes.model.client.file.FileMetadata;
+import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
 import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
 import org.glassfish.jersey.media.multipart.FormDataParam;
 
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineElementImport.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineElementImport.java
index 9673cf0..0b2184b 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineElementImport.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineElementImport.java
@@ -32,6 +32,7 @@ import org.apache.streampipes.model.message.Message;
 import org.apache.streampipes.model.message.Notification;
 import org.apache.streampipes.model.message.NotificationType;
 import org.apache.streampipes.model.message.Notifications;
+import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
 import org.apache.streampipes.storage.api.IPipelineElementDescriptionStorageCache;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineElementPreview.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineElementPreview.java
index 1b21aa2..c5187ae 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineElementPreview.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineElementPreview.java
@@ -20,6 +20,7 @@ package org.apache.streampipes.rest.impl;
 import org.apache.streampipes.manager.preview.PipelinePreview;
 import org.apache.streampipes.model.pipeline.Pipeline;
 import org.apache.streampipes.model.preview.PipelinePreviewModel;
+import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
 import org.apache.streampipes.rest.shared.annotation.JacksonSerialized;
 
 import javax.ws.rs.*;
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineElementRuntimeInfo.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineElementRuntimeInfo.java
index 76f7e81..d654f70 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineElementRuntimeInfo.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineElementRuntimeInfo.java
@@ -21,6 +21,7 @@ import org.apache.streampipes.commons.exceptions.SpRuntimeException;
 import org.apache.streampipes.manager.operations.Operations;
 import org.apache.streampipes.model.SpDataStream;
 import org.apache.streampipes.model.message.Notifications;
+import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
 import org.apache.streampipes.rest.shared.annotation.JacksonSerialized;
 
 import javax.ws.rs.Consumes;
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineMonitoring.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineMonitoring.java
index e25f35e..336068d 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineMonitoring.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineMonitoring.java
@@ -19,6 +19,7 @@ package org.apache.streampipes.rest.impl;
 
 import org.apache.streampipes.manager.monitoring.pipeline.PipelineExecutionStatusCollector;
 import org.apache.streampipes.rest.api.IPipelineMonitoring;
+import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
 import org.apache.streampipes.rest.shared.annotation.JacksonSerialized;
 
 import javax.ws.rs.GET;
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 2a9b702..737757f 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
@@ -37,6 +37,7 @@ import org.apache.streampipes.model.message.Notifications;
 import org.apache.streampipes.model.message.SuccessMessage;
 import org.apache.streampipes.model.pipeline.Pipeline;
 import org.apache.streampipes.model.pipeline.PipelineOperationStatus;
+import org.apache.streampipes.rest.core.base.impl.AbstractAuthGuardedRestResource;
 import org.apache.streampipes.rest.shared.annotation.JacksonSerialized;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -45,21 +46,11 @@ import javax.ws.rs.*;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
-@Path("/v2/users/{username}/pipelines")
+@Path("/v2/pipelines")
 public class PipelineResource extends AbstractAuthGuardedRestResource {
 
   private static final Logger logger = LoggerFactory.getLogger(PipelineResource.class);
 
-  public Response getAvailable(String username) {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  public Response getFavorites(String username) {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
   @GET
   @Produces(MediaType.APPLICATION_JSON)
   @Path("/own")
@@ -72,8 +63,8 @@ public class PipelineResource extends AbstractAuthGuardedRestResource {
                                   mediaType = "application/json",
                                   array = @ArraySchema(schema = @Schema(implementation = Pipeline.class)))
                   })})
-  public Response getOwn(@PathParam("username") String username) {
-    return ok(PipelineManager.getOwnPipelines(username));
+  public Response getOwn() {
+    return ok(PipelineManager.getOwnPipelines(getAuthenticatedUsername()));
   }
 
   @GET
@@ -86,23 +77,13 @@ public class PipelineResource extends AbstractAuthGuardedRestResource {
     return ok(getPipelineStorage().getSystemPipelines());
   }
 
-  public Response addFavorite(String username, String elementUri) {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  public Response removeFavorite(String username, String elementUri) {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
   @GET
   @Produces(MediaType.APPLICATION_JSON)
   @Path("/{pipelineId}/status")
   @JacksonSerialized
   @Operation(summary = "Get the pipeline status of a given pipeline",
           tags = {"Pipeline"})
-  public Response getPipelineStatus(@PathParam("username") String username, @PathParam("pipelineId") String pipelineId) {
+  public Response getPipelineStatus(@PathParam("pipelineId") String pipelineId) {
     return ok(PipelineStatusManager.getPipelineStatus(pipelineId, 5));
   }
 
@@ -112,7 +93,7 @@ public class PipelineResource extends AbstractAuthGuardedRestResource {
   @JacksonSerialized
   @Operation(summary = "Delete a pipeline with a given id",
           tags = {"Pipeline"})
-  public Response removeOwn(@PathParam("username") String username, @PathParam("pipelineId") String pipelineId) {
+  public Response removeOwn(@PathParam("pipelineId") String pipelineId) {
     PipelineManager.deletePipeline(pipelineId);
     return statusMessage(Notifications.success("Pipeline deleted"));
   }
@@ -123,7 +104,7 @@ public class PipelineResource extends AbstractAuthGuardedRestResource {
   @JacksonSerialized
   @Operation(summary = "Get a specific pipeline with the given id",
           tags = {"Pipeline"})
-  public Response getElement(@PathParam("username") String username, @PathParam("pipelineId") String pipelineId) {
+  public Response getElement(@PathParam("pipelineId") String pipelineId) {
     return ok(PipelineManager.getPipeline(pipelineId));
   }
 
@@ -133,7 +114,7 @@ public class PipelineResource extends AbstractAuthGuardedRestResource {
   @JacksonSerialized
   @Operation(summary = "Start the pipeline with the given id",
           tags = {"Pipeline"})
-  public Response start(@PathParam("username") String username, @PathParam("pipelineId") String pipelineId) {
+  public Response start(@PathParam("pipelineId") String pipelineId) {
     try {
       PipelineOperationStatus status = PipelineManager.startPipeline(pipelineId);
 
@@ -150,11 +131,8 @@ public class PipelineResource extends AbstractAuthGuardedRestResource {
   @JacksonSerialized
   @Operation(summary = "Stop the pipeline with the given id",
           tags = {"Pipeline"})
-  public Response stop(@PathParam("username") String username,
-                       @PathParam("pipelineId") String pipelineId,
+  public Response stop(@PathParam("pipelineId") String pipelineId,
                        @QueryParam("forceStop") @DefaultValue("false") boolean forceStop) {
-    logger.info("User: " + username + " stopped pipeline: " + pipelineId);
-
     try {
       PipelineOperationStatus status = PipelineManager.stopPipeline(pipelineId, forceStop);
       return ok(status);
@@ -170,9 +148,9 @@ public class PipelineResource extends AbstractAuthGuardedRestResource {
   @JacksonSerialized
   @Operation(summary = "Store a new pipeline",
           tags = {"Pipeline"})
-  public Response addPipeline(@PathParam("username") String username, Pipeline pipeline) {
+  public Response addPipeline(Pipeline pipeline) {
 
-    String pipelineId = PipelineManager.addPipeline(username, pipeline);
+    String pipelineId = PipelineManager.addPipeline(getAuthenticatedUsername(), pipeline);
     SuccessMessage message = Notifications.success("Pipeline stored");
     message.addNotification(new Notification("id", pipelineId));
     return ok(message);
@@ -183,9 +161,9 @@ public class PipelineResource extends AbstractAuthGuardedRestResource {
   @Produces(MediaType.APPLICATION_JSON)
   @JacksonSerialized
   @Hidden
-  public Response recommend(@PathParam("username") String email, Pipeline pipeline) {
+  public Response recommend(Pipeline pipeline) {
     try {
-      return ok(Operations.findRecommendedElements(email, pipeline));
+      return ok(Operations.findRecommendedElements(getAuthenticatedUsername(), pipeline));
     } catch (JsonSyntaxException e) {
       return constructErrorMessage(new Notification(NotificationType.UNKNOWN_ERROR,
               e.getMessage()));
@@ -205,8 +183,7 @@ public class PipelineResource extends AbstractAuthGuardedRestResource {
   @Consumes(MediaType.APPLICATION_JSON)
   @JacksonSerialized
   @Hidden
-  public Response updateDataSet(SpDataSet spDataSet, @PathParam("username")
-          String username) {
+  public Response updateDataSet(SpDataSet spDataSet) {
     return ok(Operations.updateDataSet(spDataSet));
   }
 
@@ -216,9 +193,9 @@ public class PipelineResource extends AbstractAuthGuardedRestResource {
   @Consumes(MediaType.APPLICATION_JSON)
   @JacksonSerialized
   @Hidden
-  public Response update(Pipeline pipeline, @PathParam("username") String username) {
+  public Response update(Pipeline pipeline) {
     try {
-      return ok(Operations.validatePipeline(pipeline, true, username));
+      return ok(Operations.validatePipeline(pipeline, true));
     } catch (JsonSyntaxException e) {
       return badRequest(new Notification(NotificationType.UNKNOWN_ERROR,
               e.getMessage()));
@@ -249,8 +226,7 @@ public class PipelineResource extends AbstractAuthGuardedRestResource {
   @JacksonSerialized
   @Operation(summary = "Update an existing pipeline",
           tags = {"Pipeline"})
-  public Response overwritePipeline(@PathParam("username") String username,
-                                    @PathParam("pipelineId") String pipelineId,
+  public Response overwritePipeline(@PathParam("pipelineId") String pipelineId,
                                     Pipeline pipeline) {
     Pipeline storedPipeline = getPipelineStorage().getPipeline(pipelineId);
     if (!storedPipeline.isRunning()) {
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineTemplate.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineTemplate.java
index 9d6caa7..8e7f6b8 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineTemplate.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineTemplate.java
@@ -25,6 +25,7 @@ import org.apache.streampipes.model.pipeline.PipelineOperationStatus;
 import org.apache.streampipes.model.template.PipelineTemplateDescription;
 import org.apache.streampipes.model.template.PipelineTemplateDescriptionContainer;
 import org.apache.streampipes.model.template.PipelineTemplateInvocation;
+import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
 import org.apache.streampipes.rest.shared.util.SpMediaType;
 
 import javax.ws.rs.*;
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/ResetResource.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/ResetResource.java
index cfd629c..4024c39 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/ResetResource.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/ResetResource.java
@@ -19,9 +19,10 @@
 package org.apache.streampipes.rest.impl;
 
 import io.swagger.v3.oas.annotations.Operation;
-import org.apache.streampipes.connect.container.master.general.ResetManagement;
+import org.apache.streampipes.rest.ResetManagement;
 import org.apache.streampipes.model.message.Notifications;
 import org.apache.streampipes.model.message.SuccessMessage;
+import org.apache.streampipes.rest.core.base.impl.AbstractAuthGuardedRestResource;
 import org.apache.streampipes.rest.shared.annotation.JacksonSerialized;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/SemanticEventConsumer.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/SemanticEventConsumer.java
index 8709483..f3fccd6 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/SemanticEventConsumer.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/SemanticEventConsumer.java
@@ -24,6 +24,7 @@ import org.apache.streampipes.model.graph.DataSinkInvocation;
 import org.apache.streampipes.model.message.NotificationType;
 import org.apache.streampipes.model.message.Notifications;
 import org.apache.streampipes.rest.api.IPipelineElement;
+import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
 import org.apache.streampipes.rest.shared.annotation.GsonWithIds;
 import org.apache.streampipes.rest.shared.annotation.JacksonSerialized;
 import org.apache.streampipes.rest.shared.util.SpMediaType;
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/SemanticEventProcessingAgent.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/SemanticEventProcessingAgent.java
index 372ac4f..82b429c 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/SemanticEventProcessingAgent.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/SemanticEventProcessingAgent.java
@@ -24,6 +24,7 @@ import org.apache.streampipes.model.graph.DataProcessorInvocation;
 import org.apache.streampipes.model.message.NotificationType;
 import org.apache.streampipes.model.message.Notifications;
 import org.apache.streampipes.rest.api.IPipelineElement;
+import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
 import org.apache.streampipes.rest.shared.annotation.GsonWithIds;
 import org.apache.streampipes.rest.shared.annotation.JacksonSerialized;
 import org.apache.streampipes.rest.shared.util.SpMediaType;
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/SemanticEventProducer.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/SemanticEventProducer.java
index e737a4c..1599b9a 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/SemanticEventProducer.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/SemanticEventProducer.java
@@ -24,6 +24,7 @@ import org.apache.streampipes.model.message.NotificationType;
 import org.apache.streampipes.model.message.Notifications;
 import org.apache.streampipes.model.util.Cloner;
 import org.apache.streampipes.rest.api.IPipelineElement;
+import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
 import org.apache.streampipes.rest.shared.annotation.GsonWithIds;
 import org.apache.streampipes.rest.shared.annotation.JacksonSerialized;
 import org.apache.streampipes.rest.shared.util.SpMediaType;
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/Setup.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/Setup.java
index e7c45a9..8f028b6 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/Setup.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/Setup.java
@@ -24,6 +24,7 @@ import org.apache.streampipes.manager.setup.Installer;
 import org.apache.streampipes.model.client.setup.InitialSettings;
 import org.apache.streampipes.model.message.Notifications;
 import org.apache.streampipes.model.message.SetupStatusMessage;
+import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
 import org.apache.streampipes.rest.notifications.NotificationListener;
 import org.apache.streampipes.rest.shared.annotation.GsonWithIds;
 import org.apache.streampipes.rest.shared.annotation.JacksonSerialized;
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/User.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/User.java
index 8350f46..80879e9 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/User.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/User.java
@@ -20,6 +20,7 @@ package org.apache.streampipes.rest.impl;
 
 import org.apache.streampipes.model.client.user.RawUserApiToken;
 import org.apache.streampipes.model.message.Notifications;
+import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
 import org.apache.streampipes.rest.shared.annotation.JacksonSerialized;
 import org.apache.streampipes.user.management.service.TokenService;
 
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/Version.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/Version.java
index 1bacd77..733b434 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/Version.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/Version.java
@@ -19,6 +19,7 @@ package org.apache.streampipes.rest.impl;
 
 import org.apache.streampipes.manager.info.SystemInfoProvider;
 import org.apache.streampipes.manager.info.VersionInfoProvider;
+import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
 
 import javax.ws.rs.GET;
 import javax.ws.rs.Path;
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/VirtualSensor.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/VirtualSensor.java
index 07a70d3..2b094f2 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/VirtualSensor.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/VirtualSensor.java
@@ -19,6 +19,7 @@
 package org.apache.streampipes.rest.impl;
 
 import org.apache.streampipes.model.message.NotificationType;
+import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
 import org.apache.streampipes.serializers.json.Utils;
 
 import javax.ws.rs.*;
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/Visualization.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/Visualization.java
index 1bd075e..f4570cb 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/Visualization.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/Visualization.java
@@ -18,6 +18,8 @@
 
 package org.apache.streampipes.rest.impl;
 
+import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
+
 import javax.ws.rs.GET;
 import javax.ws.rs.Path;
 import javax.ws.rs.Produces;
diff --git a/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest/AbstractAdapterResource.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/AbstractAdapterResource.java
similarity index 94%
rename from streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest/AbstractAdapterResource.java
rename to streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/AbstractAdapterResource.java
index f9a1045..06d6323 100644
--- a/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest/AbstractAdapterResource.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/AbstractAdapterResource.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  *
  */
-package org.apache.streampipes.connect.container.master.rest;
+package org.apache.streampipes.rest.impl.connect;
 
 import org.apache.streampipes.rest.shared.impl.AbstractSharedRestInterface;
 
diff --git a/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest/AdapterResource.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/AdapterResource.java
similarity index 98%
rename from streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest/AdapterResource.java
rename to streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/AdapterResource.java
index b887d98..4b4363c 100644
--- a/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest/AdapterResource.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/AdapterResource.java
@@ -16,7 +16,7 @@
  *
  */
 
-package org.apache.streampipes.connect.container.master.rest;
+package org.apache.streampipes.rest.impl.connect;
 
 import org.apache.streampipes.commons.exceptions.NoServiceEndpointsAvailableException;
 import org.apache.streampipes.connect.api.exception.AdapterException;
diff --git a/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest/AdapterTemplateResource.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/AdapterTemplateResource.java
similarity index 98%
rename from streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest/AdapterTemplateResource.java
rename to streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/AdapterTemplateResource.java
index 3b2d0bd..ea20e6e 100644
--- a/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest/AdapterTemplateResource.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/AdapterTemplateResource.java
@@ -16,7 +16,7 @@
  *
  */
 
-package org.apache.streampipes.connect.container.master.rest;
+package org.apache.streampipes.rest.impl.connect;
 
 import org.apache.streampipes.connect.api.exception.AdapterException;
 import org.apache.streampipes.connect.container.master.management.AdapterTemplateMasterManagement;
diff --git a/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest/DescriptionResource.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/DescriptionResource.java
similarity index 99%
rename from streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest/DescriptionResource.java
rename to streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/DescriptionResource.java
index a247193..d848cc3 100644
--- a/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest/DescriptionResource.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/DescriptionResource.java
@@ -15,7 +15,7 @@
  *   limitations under the License.
  */
 
-package org.apache.streampipes.connect.container.master.rest;
+package org.apache.streampipes.rest.impl.connect;
 
 import org.apache.streampipes.commons.exceptions.NoServiceEndpointsAvailableException;
 import org.apache.streampipes.connect.api.exception.AdapterException;
diff --git a/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest/GuessResource.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/GuessResource.java
similarity index 97%
rename from streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest/GuessResource.java
rename to streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/GuessResource.java
index 340a7b3..b5724cd 100644
--- a/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest/GuessResource.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/GuessResource.java
@@ -16,7 +16,7 @@
  *
  */
 
-package org.apache.streampipes.connect.container.master.rest;
+package org.apache.streampipes.rest.impl.connect;
 
 import org.apache.streampipes.connect.api.exception.ParseException;
 import org.apache.streampipes.connect.api.exception.WorkerAdapterException;
diff --git a/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest/RuntimeResolvableResource.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/RuntimeResolvableResource.java
similarity index 97%
rename from streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest/RuntimeResolvableResource.java
rename to streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/RuntimeResolvableResource.java
index 0294dcb..eff352f 100644
--- a/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest/RuntimeResolvableResource.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/RuntimeResolvableResource.java
@@ -16,7 +16,7 @@
  *
  */
 
-package org.apache.streampipes.connect.container.master.rest;
+package org.apache.streampipes.rest.impl.connect;
 
 import org.apache.streampipes.commons.exceptions.NoServiceEndpointsAvailableException;
 import org.apache.streampipes.connect.api.exception.AdapterException;
diff --git a/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest/SourcesResource.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/SourcesResource.java
similarity index 98%
rename from streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest/SourcesResource.java
rename to streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/SourcesResource.java
index 3d6a67a..f9a4414 100644
--- a/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest/SourcesResource.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/SourcesResource.java
@@ -16,7 +16,7 @@
  *
  */
 
-package org.apache.streampipes.connect.container.master.rest;
+package org.apache.streampipes.rest.impl.connect;
 
 import org.apache.streampipes.commons.exceptions.NoServiceEndpointsAvailableException;
 import org.apache.streampipes.connect.api.exception.AdapterException;
diff --git a/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest/UnitResource.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/UnitResource.java
similarity index 97%
rename from streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest/UnitResource.java
rename to streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/UnitResource.java
index 888803d..5a0433f 100644
--- a/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest/UnitResource.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/UnitResource.java
@@ -16,7 +16,7 @@
  *
  */
 
-package org.apache.streampipes.connect.container.master.rest;
+package org.apache.streampipes.rest.impl.connect;
 
 import org.apache.streampipes.connect.api.exception.AdapterException;
 import org.apache.streampipes.connect.container.master.management.UnitMasterManagement;
diff --git a/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest/WelcomePageMaster.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/WelcomePageMaster.java
similarity index 97%
rename from streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest/WelcomePageMaster.java
rename to streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/WelcomePageMaster.java
index 7fa69da..1dd5b12 100644
--- a/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest/WelcomePageMaster.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/WelcomePageMaster.java
@@ -16,7 +16,7 @@
  *
  */
 
-package org.apache.streampipes.connect.container.master.rest;
+package org.apache.streampipes.rest.impl.connect;
 
 
 import org.apache.streampipes.connect.adapter.GroundingService;
diff --git a/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest/WorkerAdministrationResource.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/WorkerAdministrationResource.java
similarity index 97%
rename from streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest/WorkerAdministrationResource.java
rename to streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/WorkerAdministrationResource.java
index b601d60..866146f 100644
--- a/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest/WorkerAdministrationResource.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/WorkerAdministrationResource.java
@@ -16,7 +16,7 @@
  *
  */
 
-package org.apache.streampipes.connect.container.master.rest;
+package org.apache.streampipes.rest.impl.connect;
 
 import org.apache.streampipes.connect.container.master.management.WorkerAdministrationManagement;
 import org.apache.streampipes.model.connect.worker.ConnectWorkerContainer;
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/dashboard/AbstractDashboardResource.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/dashboard/AbstractDashboardResource.java
index e8df60e..6279f82 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/dashboard/AbstractDashboardResource.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/dashboard/AbstractDashboardResource.java
@@ -19,7 +19,7 @@
 package org.apache.streampipes.rest.impl.dashboard;
 
 import org.apache.streampipes.model.dashboard.DashboardModel;
-import org.apache.streampipes.rest.impl.AbstractRestResource;
+import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
 import org.apache.streampipes.storage.api.IDashboardStorage;
 
 import javax.ws.rs.*;
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/dashboard/AbstractPipelineExtractionResource.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/dashboard/AbstractPipelineExtractionResource.java
index b1f8db6..21ea073 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/dashboard/AbstractPipelineExtractionResource.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/dashboard/AbstractPipelineExtractionResource.java
@@ -20,7 +20,7 @@ package org.apache.streampipes.rest.impl.dashboard;
 import org.apache.streampipes.model.graph.DataSinkInvocation;
 import org.apache.streampipes.model.pipeline.Pipeline;
 import org.apache.streampipes.model.staticproperty.FreeTextStaticProperty;
-import org.apache.streampipes.rest.impl.AbstractRestResource;
+import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
 
 import javax.ws.rs.core.Response;
 import java.util.ArrayList;
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/dashboard/DashboardWidget.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/dashboard/DashboardWidget.java
index d3809ed..e4ac40b 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/dashboard/DashboardWidget.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/dashboard/DashboardWidget.java
@@ -19,7 +19,7 @@
 package org.apache.streampipes.rest.impl.dashboard;
 
 import org.apache.streampipes.model.dashboard.DashboardWidgetModel;
-import org.apache.streampipes.rest.impl.AbstractRestResource;
+import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
 import org.apache.streampipes.rest.shared.annotation.JacksonSerialized;
 import org.apache.streampipes.storage.api.IDashboardWidgetStorage;
 
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/datalake/DataLakeNoUserResourceV3.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/datalake/DataLakeNoUserResourceV3.java
index 0736e99..bc8220e 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/datalake/DataLakeNoUserResourceV3.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/datalake/DataLakeNoUserResourceV3.java
@@ -20,7 +20,7 @@ package org.apache.streampipes.rest.impl.datalake;
 
 import org.apache.streampipes.dataexplorer.DataLakeNoUserManagementV3;
 import org.apache.streampipes.model.schema.EventSchema;
-import org.apache.streampipes.rest.impl.AbstractRestResource;
+import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
 import org.apache.streampipes.rest.shared.annotation.JacksonSerialized;
 
 import javax.ws.rs.*;
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/datalake/DataLakeWidgetResource.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/datalake/DataLakeWidgetResource.java
index e8a2525..5ddefd2 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/datalake/DataLakeWidgetResource.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/datalake/DataLakeWidgetResource.java
@@ -19,7 +19,7 @@
 package org.apache.streampipes.rest.impl.datalake;
 
 import org.apache.streampipes.model.datalake.DataExplorerWidgetModel;
-import org.apache.streampipes.rest.impl.AbstractRestResource;
+import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
 import org.apache.streampipes.rest.shared.annotation.JacksonSerialized;
 import org.apache.streampipes.storage.api.IDataExplorerWidgetStorage;
 
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/nouser/FileServingResource.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/nouser/FileServingResource.java
index 5467889..3e7c332 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/nouser/FileServingResource.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/nouser/FileServingResource.java
@@ -18,7 +18,7 @@
 package org.apache.streampipes.rest.impl.nouser;
 
 import org.apache.streampipes.manager.file.FileManager;
-import org.apache.streampipes.rest.impl.AbstractRestResource;
+import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
 
 import javax.ws.rs.GET;
 import javax.ws.rs.Path;
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/nouser/PipelineElementImportNoUser.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/nouser/PipelineElementImportNoUser.java
index 8644811..fd67989 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/nouser/PipelineElementImportNoUser.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/nouser/PipelineElementImportNoUser.java
@@ -23,7 +23,7 @@ import org.apache.streampipes.manager.storage.UserService;
 import org.apache.streampipes.model.message.Message;
 import org.apache.streampipes.model.message.Notification;
 import org.apache.streampipes.model.message.NotificationType;
-import org.apache.streampipes.rest.impl.AbstractRestResource;
+import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
 import org.apache.streampipes.storage.api.IPipelineElementDescriptionStorageCache;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/nouser/PipelineNoUserResource.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/nouser/PipelineNoUserResource.java
index 8a31a1c..b1228dc 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/nouser/PipelineNoUserResource.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/nouser/PipelineNoUserResource.java
@@ -20,7 +20,7 @@ package org.apache.streampipes.rest.impl.nouser;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.apache.streampipes.rest.impl.AbstractRestResource;
+import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
 import org.apache.streampipes.rest.management.PipelineManagement;
 import org.apache.streampipes.rest.shared.annotation.GsonWithIds;
 import org.apache.streampipes.rest.shared.annotation.NoAuthenticationRequired;
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/management/PipelineManagement.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/management/PipelineManagement.java
index f90fd89..f3619f5 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/management/PipelineManagement.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/management/PipelineManagement.java
@@ -23,7 +23,7 @@ import org.apache.streampipes.model.message.Notification;
 import org.apache.streampipes.model.message.NotificationType;
 import org.apache.streampipes.model.pipeline.Pipeline;
 import org.apache.streampipes.model.pipeline.PipelineOperationStatus;
-import org.apache.streampipes.rest.impl.AbstractRestResource;
+import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
 
 import javax.ws.rs.core.Response;
 
diff --git a/ui/src/app/app-asset-monitoring/services/rest.service.ts b/ui/src/app/app-asset-monitoring/services/rest.service.ts
index 59e161e..2797cc5 100644
--- a/ui/src/app/app-asset-monitoring/services/rest.service.ts
+++ b/ui/src/app/app-asset-monitoring/services/rest.service.ts
@@ -16,65 +16,63 @@
  *
  */
 
-import {HttpClient} from "@angular/common/http";
-import {Injectable} from "@angular/core";
-import {map} from "rxjs/operators";
-import {Observable} from "rxjs";
-import {AuthStatusService} from "../../services/auth-status.service";
-import {DashboardConfiguration} from "../model/dashboard-configuration.model";
+import { HttpClient } from '@angular/common/http';
+import { Injectable } from '@angular/core';
+import { map } from 'rxjs/operators';
+import { Observable } from 'rxjs';
+import { AuthStatusService } from '../../services/auth-status.service';
+import { DashboardConfiguration } from '../model/dashboard-configuration.model';
+import { PlatformServicesCommons } from '../../platform-services/apis/commons.service';
 
 @Injectable()
 export class RestService {
 
+  constructor(private http: HttpClient,
+              private authStatusService: AuthStatusService,
+              private platformServicesCommons: PlatformServicesCommons) {
+  }
 
-    constructor(private http: HttpClient, private authStatusService: AuthStatusService) {
-    }
+  getVisualizablePipelines(): Observable<any> {
+    return this.http.get('/visualizablepipeline/_all_docs?include_docs=true');
+  }
 
-    getVisualizablePipelines(): Observable<any> {
-        return this.http.get('/visualizablepipeline/_all_docs?include_docs=true');
-    }
+  getPipeline(pipelineId): Observable<any> {
+    return this.http.get('/pipeline/' + pipelineId);
+  }
 
-    getPipeline(pipelineId): Observable<any> {
-        return this.http.get('/pipeline/' + pipelineId);
-    }
-
-    storeImage(file: File): Observable<any> {
-        const data: FormData = new FormData();
-        data.append('file_upload', file, file.name);
-        return this.http.post(this.imagePath, data)
-            .pipe(map(res => {
-                return res;
-            }));
-    }
-
-    deleteDashboard(dashboardId: string) {
-        return this.http.delete(this.url + "/" +dashboardId);
-    }
+  storeImage(file: File): Observable<any> {
+    const data: FormData = new FormData();
+    data.append('file_upload', file, file.name);
+    return this.http.post(this.imagePath, data)
+        .pipe(map(res => {
+          return res;
+        }));
+  }
 
-    storeDashboard(dashboardConfig: DashboardConfiguration) {
-        return this.http.post(this.url, dashboardConfig);
-    }
+  deleteDashboard(dashboardId: string) {
+    return this.http.delete(`${this.url}/${dashboardId}`);
+  }
 
-    getDashboards(): Observable<DashboardConfiguration[]> {
-        return this.http.get(this.url).pipe(map(response => {
-            return response as DashboardConfiguration[];
-        }));
-    }
+  storeDashboard(dashboardConfig: DashboardConfiguration) {
+    return this.http.post(this.url, dashboardConfig);
+  }
 
-    getImageUrl(imageName: string): string {
-        return this.imagePath + "/" + imageName;
-    }
+  getDashboards(): Observable<DashboardConfiguration[]> {
+    return this.http.get(this.url).pipe(map(response => {
+      return response as DashboardConfiguration[];
+    }));
+  }
 
-    private get baseUrl() {
-        return '/streampipes-backend';
-    }
+  getImageUrl(imageName: string): string {
+    return `${this.imagePath}/${imageName}`;
+  }
 
-    private get url() {
-        return this.baseUrl + '/api/v2/users/' + this.authStatusService.email + '/asset-dashboards'
-    }
+  private get url() {
+    return `${this.platformServicesCommons.apiBasePath()}/asset-dashboards`;
+  }
 
-    private get imagePath() {
-        return this.url + "/images";
-    }
+  private get imagePath() {
+    return `${this.url}/images`;
+  }
 
-}
\ No newline at end of file
+}
diff --git a/ui/src/app/home/components/status.component.html b/ui/src/app/home/components/status.component.html
index 1eef874..1441e63 100644
--- a/ui/src/app/home/components/status.component.html
+++ b/ui/src/app/home/components/status.component.html
@@ -31,7 +31,7 @@
     </div>
     <div fxFlex="25" class="status-container notifications mr-20" (click)="navigate('notifications')">
         <div fxFill="100" fxLayout="column" fxLayoutAlign="center center">
-            <div class="status-container-number" fxLayoutAlign="start center">{{NotificationCountService.unreadNotificationCount}}</div>
+            <div class="status-container-number" fxLayoutAlign="start center">{{notificationCountService.unreadNotificationCount}}</div>
             <div class="status-container-text">unread notifications</div>
         </div>
     </div>
@@ -41,4 +41,4 @@
             <div class="status-container-text">installed pipeline elements</div>
         </div>
     </div>
-</div>
\ No newline at end of file
+</div>
diff --git a/ui/src/app/home/components/status.component.ts b/ui/src/app/home/components/status.component.ts
index c10ee51..ee636cb 100644
--- a/ui/src/app/home/components/status.component.ts
+++ b/ui/src/app/home/components/status.component.ts
@@ -16,29 +16,27 @@
  *
  */
 
-import {Component} from "@angular/core";
-import {RestApi} from "../../services/rest-api.service";
-import {Router} from "@angular/router";
-import {NotificationCountService} from "../../services/notification-count-service";
-import {PipelineElementService} from "../../platform-services/apis/pipeline-element.service";
+import { Component, OnInit } from '@angular/core';
+import { Router } from '@angular/router';
+import { NotificationCountService } from '../../services/notification-count-service';
+import { PipelineElementService } from '../../platform-services/apis/pipeline-element.service';
+import { PipelineService } from '../../platform-services/apis/pipeline.service';
 
 @Component({
     selector: 'status',
     templateUrl: './status.component.html',
     styleUrls: ['./status.component.css']
 })
-export class StatusComponent {
+export class StatusComponent implements OnInit {
 
-    pipelines: number = 0;
-    runningPipelines: number = 0;
-    installedPipelineElements: number = 0;
+    pipelines = 0;
+    runningPipelines = 0;
+    installedPipelineElements = 0;
 
     constructor(private pipelineElementService: PipelineElementService,
-                private RestApi: RestApi,
-                private Router: Router,
-                public NotificationCountService: NotificationCountService) {
-
-    }
+                private router: Router,
+                public notificationCountService: NotificationCountService,
+                private pipelineService: PipelineService) { }
 
     ngOnInit() {
         this.getPipelines();
@@ -48,7 +46,7 @@ export class StatusComponent {
     }
 
     getPipelines() {
-        this.RestApi.getOwnPipelines().subscribe(pipelines => {
+        this.pipelineService.getOwnPipelines().subscribe(pipelines => {
            this.pipelines = pipelines.length;
            this.runningPipelines = pipelines.filter(p => p.running).length;
         });
@@ -58,27 +56,27 @@ export class StatusComponent {
         this.pipelineElementService.getDataStreams().subscribe(streams => {
             this.addPipelineElementList(streams);
         });
-    };
+    }
 
     getProcessors() {
-        this.RestApi.getOwnSepas()
+        this.pipelineElementService.getDataProcessors()
             .subscribe(msg => {
                 this.addPipelineElementList(msg);
             });
-    };
+    }
 
     getSinks() {
-        this.RestApi.getOwnActions()
+        this.pipelineElementService.getDataSinks()
             .subscribe(msg => {
                this.addPipelineElementList(msg);
             });
-    };
+    }
 
     addPipelineElementList(msg) {
         this.installedPipelineElements += msg.length;
     }
 
     navigate(url: string) {
-        this.Router.navigate([url]);
+        this.router.navigate([url]);
     }
 }
diff --git a/ui/src/app/home/home.component.ts b/ui/src/app/home/home.component.ts
index f1b7c35..a00a516 100644
--- a/ui/src/app/home/home.component.ts
+++ b/ui/src/app/home/home.component.ts
@@ -16,11 +16,11 @@
  *
  */
 
-import {Component} from '@angular/core';
-import {DomSanitizer} from '@angular/platform-browser';
-import {HomeService} from './home.service';
-import {Router} from "@angular/router";
-import {AppConstants} from "../services/app.constants";
+import { Component } from '@angular/core';
+import { DomSanitizer } from '@angular/platform-browser';
+import { HomeService } from './home.service';
+import { Router } from '@angular/router';
+import { AppConstants } from '../services/app.constants';
 
 @Component({
     templateUrl: './home.component.html',
@@ -32,7 +32,7 @@ export class HomeComponent {
 
     constructor(private homeService: HomeService,
                 private sanitizer: DomSanitizer,
-                private Router: Router,
+                private router: Router,
                 public appConstants: AppConstants) {
         this.serviceLinks = this.homeService.getServiceLinks();
     }
@@ -45,7 +45,7 @@ export class HomeComponent {
         if (link.link.newWindow) {
             window.open(link.link.value);
         } else {
-            this.Router.navigate([link.link.value]);
+            this.router.navigate([link.link.value]);
         }
     }
 
diff --git a/ui/src/app/pipelines/components/pipeline-overview/pipeline-overview.component.ts b/ui/src/app/pipelines/components/pipeline-overview/pipeline-overview.component.ts
index f11fe1e..a63da8f 100644
--- a/ui/src/app/pipelines/components/pipeline-overview/pipeline-overview.component.ts
+++ b/ui/src/app/pipelines/components/pipeline-overview/pipeline-overview.component.ts
@@ -16,12 +16,12 @@
  *
  */
 
-import {Pipeline} from "../../../core-model/gen/streampipes-model";
-import {Component, EventEmitter, Input, OnInit, Output, ViewChild} from "@angular/core";
-import {PipelineOperationsService} from "../../services/pipeline-operations.service";
-import {MatTableDataSource} from "@angular/material/table";
-import {MatPaginator} from "@angular/material/paginator";
-import {MatSort} from "@angular/material/sort";
+import { Pipeline } from '../../../core-model/gen/streampipes-model';
+import { Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';
+import { PipelineOperationsService } from '../../services/pipeline-operations.service';
+import { MatTableDataSource } from '@angular/material/table';
+import { MatPaginator } from '@angular/material/paginator';
+import { MatSort } from '@angular/material/sort';
 
 
 @Component({
@@ -31,10 +31,10 @@ import {MatSort} from "@angular/material/sort";
 })
 export class PipelineOverviewComponent implements OnInit {
 
-  _pipelines: Array<Pipeline>;
+  _pipelines: Pipeline[];
   _activeCategoryId: string;
 
-  filteredPipelinesAvailable: boolean = false;
+  filteredPipelinesAvailable = false;
 
   @Input()
   pipelineToStart: Pipeline;
@@ -47,7 +47,7 @@ export class PipelineOverviewComponent implements OnInit {
   dataSource: MatTableDataSource<Pipeline>;
 
   @ViewChild(MatPaginator) paginator: MatPaginator;
-  pageSize: number = 1;
+  pageSize = 1;
 
   @ViewChild(MatSort) sort: MatSort;
 
@@ -79,7 +79,7 @@ export class PipelineOverviewComponent implements OnInit {
 
   openPipelineNotificationsDialog(pipeline: Pipeline) {
     this.pipelineOperationsService.showPipelineNotificationsDialog(pipeline,
-        this.refreshPipelinesEmitter)
+        this.refreshPipelinesEmitter);
   }
 
   get pipelines() {
@@ -87,7 +87,7 @@ export class PipelineOverviewComponent implements OnInit {
   }
 
   @Input()
-  set pipelines(pipelines: Array<Pipeline>) {
+  set pipelines(pipelines: Pipeline[]) {
     this._pipelines = pipelines;
     this.addPipelinesToTable();
   }
@@ -113,7 +113,9 @@ export class PipelineOverviewComponent implements OnInit {
   }
 
   filterPipelines(): Pipeline[] {
-    let filteredPipelines: Pipeline[] = this._pipelines.filter(pipeline => !(this._activeCategoryId) || (pipeline.pipelineCategories && pipeline.pipelineCategories.some(pc => pc === this.activeCategoryId)));
+    const filteredPipelines: Pipeline[] = this._pipelines
+        .filter(pipeline => !(this._activeCategoryId) ||
+            (pipeline.pipelineCategories && pipeline.pipelineCategories.some(pc => pc === this.activeCategoryId)));
     this.filteredPipelinesAvailable = filteredPipelines.length > 0;
     return filteredPipelines.sort((a, b) => a.name.localeCompare(b.name));
   }
diff --git a/ui/src/app/pipelines/pipelines.component.html b/ui/src/app/pipelines/pipelines.component.html
index b5f48ad..5e0796f 100644
--- a/ui/src/app/pipelines/pipelines.component.html
+++ b/ui/src/app/pipelines/pipelines.component.html
@@ -17,7 +17,7 @@
   -->
 
 <div fxLayout="column" class="page-container">
-    <div fxLayout="row" class="border sp-tab-bg" style="padding:0px;">
+    <div fxLayout="row" class="border sp-tab-bg" style="padding:0;">
         <div fxFlex="100" class="page-container-nav">
             <div fxFlex="100" fxLayout="row">
                 <button mat-button mat-flat-button color="accent" (click)="showPipelineCategoriesDialog()">Manage Categories</button>
diff --git a/ui/src/app/pipelines/pipelines.component.ts b/ui/src/app/pipelines/pipelines.component.ts
index 777a713..aeb3962 100644
--- a/ui/src/app/pipelines/pipelines.component.ts
+++ b/ui/src/app/pipelines/pipelines.component.ts
@@ -17,180 +17,175 @@
  */
 
 import * as FileSaver from 'file-saver';
-import {Component, OnInit} from "@angular/core";
-import {PipelineService} from "../platform-services/apis/pipeline.service";
-import {Pipeline, PipelineCategory} from '../core-model/gen/streampipes-model';
-import {DialogService} from "../core-ui/dialog/base-dialog/base-dialog.service";
-import {PanelType} from "../core-ui/dialog/base-dialog/base-dialog.model";
-import {ImportPipelineDialogComponent} from "./dialog/import-pipeline/import-pipeline-dialog.component";
-import {DialogRef} from "../core-ui/dialog/base-dialog/dialog-ref";
-import {StartAllPipelinesDialogComponent} from "./dialog/start-all-pipelines/start-all-pipelines-dialog.component";
-import {PipelineCategoriesDialogComponent} from "./dialog/pipeline-categories/pipeline-categories-dialog.component";
-import {zip} from "rxjs";
-import {ActivatedRoute} from "@angular/router";
+import { Component, OnInit } from '@angular/core';
+import { PipelineService } from '../platform-services/apis/pipeline.service';
+import { Pipeline, PipelineCategory } from '../core-model/gen/streampipes-model';
+import { DialogService } from '../core-ui/dialog/base-dialog/base-dialog.service';
+import { PanelType } from '../core-ui/dialog/base-dialog/base-dialog.model';
+import { ImportPipelineDialogComponent } from './dialog/import-pipeline/import-pipeline-dialog.component';
+import { DialogRef } from '../core-ui/dialog/base-dialog/dialog-ref';
+import { StartAllPipelinesDialogComponent } from './dialog/start-all-pipelines/start-all-pipelines-dialog.component';
+import { PipelineCategoriesDialogComponent } from './dialog/pipeline-categories/pipeline-categories-dialog.component';
+import { zip } from 'rxjs';
+import { ActivatedRoute } from '@angular/router';
 
 @Component({
-    selector: 'pipelines',
-    templateUrl: './pipelines.component.html',
-    styleUrls: ['./pipelines.component.scss']
+  selector: 'pipelines',
+  templateUrl: './pipelines.component.html',
+  styleUrls: ['./pipelines.component.scss']
 })
 export class PipelinesComponent implements OnInit {
 
-    pipeline: Pipeline;
-    pipelines: Array<Pipeline> = [];
-    systemPipelines: Array<Pipeline> = [];
-    starting: boolean;
-    stopping: boolean;
-    pipelineCategories: Array<PipelineCategory>;
-    activeCategoryId: string;
-
-    pipelineIdToStart: string;
-
-    pipelineToStart: Pipeline;
-    systemPipelineToStart: Pipeline;
-
-    pipelinesReady: boolean = false;
-
-    selectedCategoryIndex: number = 0;
-
-    constructor(private pipelineService: PipelineService,
-                private DialogService: DialogService,
-                private ActivatedRoute: ActivatedRoute) {
-        this.pipelineCategories = [];
-        this.starting = false;
-        this.stopping = false;
-    }
-
-    ngOnInit() {
-        this.ActivatedRoute.queryParams.subscribe(params => {
-            if (params['pipeline']) {
-                this.pipelineIdToStart = params['pipeline'];
-            }
-            this.getPipelineCategories();
-            this.getPipelines();
-        });
-    }
-
-    setSelectedTab(index) {
-        if (index == 0) {
-            this.activeCategoryId = undefined;
-        } else {
-            this.activeCategoryId = this.pipelineCategories[index - 1]._id;
+  pipeline: Pipeline;
+  pipelines: Pipeline[] = [];
+  systemPipelines: Pipeline[] = [];
+  starting: boolean;
+  stopping: boolean;
+  pipelineCategories: PipelineCategory[];
+  activeCategoryId: string;
+
+  pipelineIdToStart: string;
+
+  pipelineToStart: Pipeline;
+  systemPipelineToStart: Pipeline;
+
+  pipelinesReady = false;
+
+  selectedCategoryIndex = 0;
+
+  constructor(private pipelineService: PipelineService,
+              private dialogService: DialogService,
+              private activatedRoute: ActivatedRoute) {
+    this.pipelineCategories = [];
+    this.starting = false;
+    this.stopping = false;
+  }
+
+  ngOnInit() {
+    this.activatedRoute.queryParams.subscribe(params => {
+      if (params['pipeline']) {
+        this.pipelineIdToStart = params['pipeline'];
+      }
+      this.getPipelineCategories();
+      this.getPipelines();
+    });
+  }
+
+  setSelectedTab(index) {
+    this.activeCategoryId =  index === 0 ? undefined : this.pipelineCategories[index - 1]._id;
+  }
+
+  exportPipelines() {
+    const blob = new Blob([JSON.stringify(this.pipelines)], {type: 'application/json'});
+    FileSaver.saveAs(blob, 'pipelines.json');
+  }
+
+  getPipelines() {
+    this.pipelines = [];
+    zip(this.pipelineService.getOwnPipelines(), this.pipelineService.getSystemPipelines()).subscribe(allPipelines => {
+      this.pipelines = allPipelines[0];
+      this.systemPipelines = allPipelines[1];
+      this.checkForImmediateStart(allPipelines);
+      this.pipelinesReady = true;
+    });
+  }
+
+  checkForImmediateStart(allPipelines: Pipeline[][]) {
+    this.pipelineToStart = undefined;
+    allPipelines.forEach((pipelines, index) => {
+      pipelines.forEach(pipeline => {
+        if (pipeline._id === this.pipelineIdToStart) {
+          if (index === 0) {
+            this.pipelineToStart = pipeline;
+          } else {
+            this.systemPipelineToStart = pipeline;
+          }
         }
-    }
-
-    exportPipelines() {
-        let blob = new Blob([JSON.stringify(this.pipelines)], {type: "application/json"})
-        FileSaver.saveAs(blob, "pipelines.json");
-    }
-
-
-    getPipelines() {
-        this.pipelines = [];
-        zip(this.pipelineService.getOwnPipelines(), this.pipelineService.getSystemPipelines()).subscribe(allPipelines => {
-            this.pipelines = allPipelines[0];
-            this.systemPipelines = allPipelines[1];
-            this.checkForImmediateStart(allPipelines);
-            this.pipelinesReady = true;
-        });
-    };
-
-    checkForImmediateStart(allPipelines: Pipeline[][]) {
-        this.pipelineToStart = undefined;
-        allPipelines.forEach((pipelines , index) => {
-           pipelines.forEach(pipeline => {
-               if (pipeline._id == this.pipelineIdToStart) {
-                   if (index == 0) {
-                       this.pipelineToStart = pipeline;
-                   } else {
-                       this.systemPipelineToStart = pipeline;
-                   }
-               }
-           })
-        });
-        this.pipelineIdToStart = undefined;
-    }
-
-    getPipelineCategories() {
-        this.pipelineService.getPipelineCategories()
-            .subscribe(pipelineCategories => {
-                this.pipelineCategories = pipelineCategories;
-            });
-    };
-
-    activeClass(pipeline) {
-        return 'active-pipeline';
-    }
-
-    checkCurrentSelectionStatus(status) {
-        var active = true;
-        this.pipelines.forEach(pipeline => {
-            if (!this.activeCategoryId || pipeline.pipelineCategories.some(pc => pc === this.activeCategoryId)) {
-                if (pipeline.running == status) {
-                    active = false;
-                }
-            }
-        });
-        return active;
-    }
-
-    openImportPipelinesDialog() {
-        let dialogRef: DialogRef<ImportPipelineDialogComponent> = this.DialogService.open(ImportPipelineDialogComponent, {
-            panelType: PanelType.STANDARD_PANEL,
-            title: "Import Pipeline",
-            width: "70vw",
-            data: {
-                "pipelines": this.pipelines
-            }
-        });
-        dialogRef.afterClosed().subscribe(data => {
-            if (data) {
-                this.refreshPipelines();
-            }
-        })
-    }
-
-    startAllPipelines(action) {
-        let dialogRef: DialogRef<StartAllPipelinesDialogComponent> = this.DialogService.open(StartAllPipelinesDialogComponent, {
-            panelType: PanelType.STANDARD_PANEL,
-            title: (action ? "Start" : "Stop") + " all pipelines",
-            width: "70vw",
-            data: {
-                "pipelines": this.pipelines,
-                "action": action,
-                "activeCategoryId": this.activeCategoryId
-            }
+      });
+    });
+    this.pipelineIdToStart = undefined;
+  }
+
+  getPipelineCategories() {
+    this.pipelineService.getPipelineCategories()
+        .subscribe(pipelineCategories => {
+          this.pipelineCategories = pipelineCategories;
         });
-
-        dialogRef.afterClosed().subscribe(data => {
-           if (data) {
-               this.refreshPipelines();
-           }
-        });
-    }
-
-    showPipelineCategoriesDialog() {
-        let dialogRef: DialogRef<PipelineCategoriesDialogComponent> = this.DialogService.open(PipelineCategoriesDialogComponent, {
-            panelType: PanelType.STANDARD_PANEL,
-            title: "Pipeline Categories",
-            width: "70vw",
-            data: {
-                "pipelines": this.pipelines,
-                "systemPipelines": this.systemPipelines
-            }
-        });
-
-        dialogRef.afterClosed().subscribe(data => {
-            this.getPipelineCategories();
-            this.refreshPipelines();
-        });
-    };
-
-    refreshPipelines() {
-        this.getPipelines();
-    }
-
-    showPipeline(pipeline) {
-        pipeline.display = !pipeline.display;
-    }
-}
\ No newline at end of file
+  }
+
+  activeClass(pipeline) {
+    return 'active-pipeline';
+  }
+
+  checkCurrentSelectionStatus(status) {
+    let active = true;
+    this.pipelines.forEach(pipeline => {
+      if (!this.activeCategoryId || pipeline.pipelineCategories.some(pc => pc === this.activeCategoryId)) {
+        if (pipeline.running === status) {
+          active = false;
+        }
+      }
+    });
+    return active;
+  }
+
+  openImportPipelinesDialog() {
+    const dialogRef: DialogRef<ImportPipelineDialogComponent> = this.dialogService.open(ImportPipelineDialogComponent, {
+      panelType: PanelType.STANDARD_PANEL,
+      title: 'Import Pipeline',
+      width: '70vw',
+      data: {
+        'pipelines': this.pipelines
+      }
+    });
+    dialogRef.afterClosed().subscribe(data => {
+      if (data) {
+        this.refreshPipelines();
+      }
+    });
+  }
+
+  startAllPipelines(action) {
+    const dialogRef: DialogRef<StartAllPipelinesDialogComponent> = this.dialogService.open(StartAllPipelinesDialogComponent, {
+      panelType: PanelType.STANDARD_PANEL,
+      title: (action ? 'Start' : 'Stop') + ' all pipelines',
+      width: '70vw',
+      data: {
+        'pipelines': this.pipelines,
+        'action': action,
+        'activeCategoryId': this.activeCategoryId
+      }
+    });
+
+    dialogRef.afterClosed().subscribe(data => {
+      if (data) {
+        this.refreshPipelines();
+      }
+    });
+  }
+
+  showPipelineCategoriesDialog() {
+    const dialogRef: DialogRef<PipelineCategoriesDialogComponent> = this.dialogService.open(PipelineCategoriesDialogComponent, {
+      panelType: PanelType.STANDARD_PANEL,
+      title: 'Pipeline Categories',
+      width: '70vw',
+      data: {
+        'pipelines': this.pipelines,
+        'systemPipelines': this.systemPipelines
+      }
+    });
+
+    dialogRef.afterClosed().subscribe(data => {
+      this.getPipelineCategories();
+      this.refreshPipelines();
+    });
+  }
+
+  refreshPipelines() {
+    this.getPipelines();
+  }
+
+  showPipeline(pipeline) {
+    pipeline.display = !pipeline.display;
+  }
+}
diff --git a/ui/src/app/platform-services/apis/commons.service.ts b/ui/src/app/platform-services/apis/commons.service.ts
index c4781ba..dbf307a 100644
--- a/ui/src/app/platform-services/apis/commons.service.ts
+++ b/ui/src/app/platform-services/apis/commons.service.ts
@@ -30,6 +30,10 @@ export class PlatformServicesCommons {
     return '/streampipes-backend';
   }
 
+  apiBasePath() {
+    return this.basePath + '/api/v2';
+  }
+
   authUserBasePath() {
     return this.basePath + '/api/v2/users/' + this.authStatusService.email;
   }
diff --git a/ui/src/app/platform-services/apis/pipeline.service.ts b/ui/src/app/platform-services/apis/pipeline.service.ts
index 060c911..3796bbc 100644
--- a/ui/src/app/platform-services/apis/pipeline.service.ts
+++ b/ui/src/app/platform-services/apis/pipeline.service.ts
@@ -16,99 +16,96 @@
  *
  */
 
-import {Injectable} from "@angular/core";
-import {HttpClient} from "@angular/common/http";
-import {PlatformServicesCommons} from "./commons.service";
-import {Observable} from "rxjs";
+import { Injectable } from '@angular/core';
+import { HttpClient } from '@angular/common/http';
+import { PlatformServicesCommons } from './commons.service';
+import { Observable } from 'rxjs';
 import {
   Message,
   Pipeline,
-  PipelineCategory, PipelineElementStatus,
-  PipelineOperationStatus, PipelineStatusMessage
-} from "../../core-model/gen/streampipes-model";
-import {map} from "rxjs/operators";
-import {query} from "@angular/animations";
+  PipelineCategory,
+  PipelineOperationStatus,
+  PipelineStatusMessage
+} from '../../core-model/gen/streampipes-model';
+import { map } from 'rxjs/operators';
 
 @Injectable()
 export class PipelineService {
 
   constructor(private http: HttpClient,
-              private platformServicesCommons: PlatformServicesCommons) {
-
-  }
+              private platformServicesCommons: PlatformServicesCommons) { }
 
   getPipelineCategories(): Observable<PipelineCategory[]> {
-    return this.http.get(this.platformServicesCommons.authUserBasePath() + "/pipelinecategories")
+    return this.http.get(`${this.apiBasePath}/pipelinecategories`)
         .pipe(map(response => {
           return (response as any[]).map(p => PipelineCategory.fromData(p));
         }));
-  };
+  }
 
   storePipelineCategory(pipelineCategory: PipelineCategory) {
-    return this.http.post(this.platformServicesCommons.authUserBasePath() + "/pipelinecategories", pipelineCategory);
-  };
+    return this.http.post(`${this.apiBasePath}/pipelinecategories`, pipelineCategory);
+  }
 
   deletePipelineCategory(categoryId: string) {
-    return this.http.delete(this.platformServicesCommons.authUserBasePath() + "/pipelinecategories/" + categoryId);
+    return this.http.delete(`${this.apiBasePath}/pipelinecategories/${categoryId}`);
   }
 
   startPipeline(pipelineId): Observable<PipelineOperationStatus> {
-    return this.http.get(this.platformServicesCommons.authUserBasePath() + "/pipelines/" + pipelineId + "/start")
+    return this.http.get(`${this.apiBasePath}/pipelines/${pipelineId}/start`)
         .pipe(map(result => PipelineOperationStatus.fromData(result as PipelineOperationStatus)));
   }
 
   stopPipeline(pipelineId: string, forceStop?: boolean): Observable<PipelineOperationStatus> {
-    let queryAppendix = "";
-    if (forceStop) {
-      queryAppendix = "?forceStop=" + forceStop;
-    }
-    return this.http.get(this.platformServicesCommons.authUserBasePath()
-        + "/pipelines/" + pipelineId
-        + "/stop" + queryAppendix)
+    const queryAppendix = forceStop ? '?forceStop=' + forceStop : '';
+    return this.http.get(`${this.apiBasePath}/pipelines/${pipelineId}/stop${queryAppendix}`)
         .pipe(map(result => PipelineOperationStatus.fromData(result as PipelineOperationStatus)));
   }
 
-  getPipelineById(pipelineId): Observable<Pipeline> {
-    return this.http.get(this.platformServicesCommons.authUserBasePath() + "/pipelines/" + pipelineId)
+  getPipelineById(pipelineId: string): Observable<Pipeline> {
+    return this.http.get(`${this.apiBasePath}/pipelines/${pipelineId}`)
         .pipe(map(response => Pipeline.fromData(response as Pipeline)));
   }
 
   storePipeline(pipeline: Pipeline): Observable<Message> {
-    return this.http.post(this.platformServicesCommons.authUserBasePath() + "/pipelines", pipeline)
+    return this.http.post(`${this.apiBasePath}/pipelines`, pipeline)
         .pipe(map(response => {
           return Message.fromData(response as Message);
         }));
   }
 
   updatePipeline(pipeline: Pipeline): Observable<Message> {
-    var pipelineId = pipeline._id;
-    return this.http.put(this.platformServicesCommons.authUserBasePath() + "/pipelines/" + pipelineId, pipeline)
+    const pipelineId = pipeline._id;
+    return this.http.put(`${this.apiBasePath}/pipelines/${pipelineId}`, pipeline)
         .pipe(map(response => {
           return Message.fromData(response as Message);
         }));
   }
 
   getOwnPipelines(): Observable<Pipeline[]> {
-    return this.http.get(this.platformServicesCommons.authUserBasePath() + "/pipelines/own").pipe(map(response => {
+    return this.http.get(`${this.apiBasePath}/pipelines/own`).pipe(map(response => {
       return (response as any[]).map(p => Pipeline.fromData(p));
     }));
-  };
+  }
 
   deleteOwnPipeline(pipelineId): Observable<any> {
-    return this.http.delete(this.platformServicesCommons.authUserBasePath() + "/pipelines/" + pipelineId);
+    return this.http.delete(`${this.apiBasePath}/pipelines/${pipelineId}`);
   }
 
   getSystemPipelines(): Observable<Pipeline[]> {
-    return this.http.get(this.platformServicesCommons.authUserBasePath() + "/pipelines/system").pipe(map(response => {
+    return this.http.get(`${this.apiBasePath}/pipelines/system`).pipe(map(response => {
       return (response as any[]).map(p => Pipeline.fromData(p));
-    }))
-  };
+    }));
+  }
 
   getPipelineStatusById(pipelineId): Observable<PipelineStatusMessage[]> {
-    return this.http.get(this.platformServicesCommons.authUserBasePath() + "/pipelines/" + pipelineId + "/status")
+    return this.http.get(`${this.apiBasePath}/pipelines/${pipelineId}/status`)
         .pipe(map(response => {
           return (response as any[]).map(r => PipelineStatusMessage.fromData(r));
         }));
   }
 
+  get apiBasePath() {
+    return this.platformServicesCommons.apiBasePath();
+  }
+
 }

[incubator-streampipes] 06/12: [STREAMPIPES-427] Modify paths of notifications and pipeline cache resources

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

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

commit e1ee3e30ed7df861dfbcadde328abefcedb47c03
Author: Dominik Riemer <ri...@fzi.de>
AuthorDate: Fri Sep 24 14:31:39 2021 +0200

    [STREAMPIPES-427] Modify paths of notifications and pipeline cache resources
---
 .../apache/streampipes/rest/impl/Notification.java | 10 +--
 .../streampipes/rest/impl/PipelineCache.java       | 19 +++---
 .../rest/impl/PipelineCanvasMetadataCache.java     | 19 +++---
 .../rest/impl/PipelineCanvasMetadataResource.java  |  2 +-
 ui/src/app/editor/services/editor.service.ts       | 74 ++++++++++++----------
 .../notifications/service/notifications.service.ts | 42 ++++++------
 .../app/platform-services/apis/commons.service.ts  |  2 +-
 .../apis/pipeline-canvas-metadata.service.ts       | 22 +++----
 ui/src/app/services/rest-api.service.ts            | 16 +++--
 9 files changed, 103 insertions(+), 103 deletions(-)

diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/Notification.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/Notification.java
index ff1d413..ea0c02b 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/Notification.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/Notification.java
@@ -19,15 +19,15 @@
 package org.apache.streampipes.rest.impl;
 
 import org.apache.streampipes.model.message.Notifications;
-import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
+import org.apache.streampipes.rest.core.base.impl.AbstractAuthGuardedRestResource;
 import org.apache.streampipes.rest.shared.annotation.GsonWithIds;
 
 import javax.ws.rs.*;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
-@Path("/v2/users/{username}/notifications")
-public class Notification extends AbstractRestResource {
+@Path("/v2/notifications")
+public class Notification extends AbstractAuthGuardedRestResource {
 
     @GET
     @Produces(MediaType.APPLICATION_JSON)
@@ -42,9 +42,9 @@ public class Notification extends AbstractRestResource {
     @GET
     @Produces(MediaType.APPLICATION_JSON)
     @Path("/count")
-    public Response getUnreadNotificationsCount(@PathParam("username") String username) {
+    public Response getUnreadNotificationsCount() {
         return ok(getNotificationStorage()
-                .getUnreadNotificationsCount(username));
+                .getUnreadNotificationsCount(getAuthenticatedUsername()));
     }
 
     @GET
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineCache.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineCache.java
index 53c3dbd..f2b8d16 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineCache.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineCache.java
@@ -18,27 +18,26 @@
 package org.apache.streampipes.rest.impl;
 
 import org.apache.streampipes.manager.pipeline.PipelineCacheManager;
-import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
+import org.apache.streampipes.rest.core.base.impl.AbstractAuthGuardedRestResource;
 
 import javax.ws.rs.*;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
-@Path("/v2/users/{username}/pipeline-cache")
-public class PipelineCache extends AbstractRestResource {
+@Path("/v2/pipeline-cache")
+public class PipelineCache extends AbstractAuthGuardedRestResource {
 
   @POST
   @Produces(MediaType.APPLICATION_JSON)
-  public Response updateCachedPipeline(@PathParam("username") String userName,
-                                       String rawPipelineModel) {
-    PipelineCacheManager.updateCachedPipeline(userName, rawPipelineModel);
+  public Response updateCachedPipeline(String rawPipelineModel) {
+    PipelineCacheManager.updateCachedPipeline(getAuthenticatedUsername(), rawPipelineModel);
     return ok();
   }
 
   @GET
   @Produces(MediaType.APPLICATION_JSON)
-  public Response getCachedPipeline(@PathParam("username") String userName) {
-    String result = PipelineCacheManager.getCachedPipeline(userName);
+  public Response getCachedPipeline() {
+    String result = PipelineCacheManager.getCachedPipeline(getAuthenticatedUsername());
     if (result != null) {
       return ok(result);
     } else {
@@ -48,8 +47,8 @@ public class PipelineCache extends AbstractRestResource {
 
   @DELETE
   @Produces(MediaType.APPLICATION_JSON)
-  public Response removePipelineFromCache(@PathParam("username") String userName) {
-    PipelineCacheManager.removeCachedPipeline(userName);
+  public Response removePipelineFromCache() {
+    PipelineCacheManager.removeCachedPipeline(getAuthenticatedUsername());
     return ok();
   }
 }
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineCanvasMetadataCache.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineCanvasMetadataCache.java
index e0f3754..4659b76 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineCanvasMetadataCache.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineCanvasMetadataCache.java
@@ -18,27 +18,26 @@
 package org.apache.streampipes.rest.impl;
 
 import org.apache.streampipes.manager.pipeline.PipelineCanvasMetadataCacheManager;
-import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
+import org.apache.streampipes.rest.core.base.impl.AbstractAuthGuardedRestResource;
 
 import javax.ws.rs.*;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
-@Path("/v2/users/{username}/pipeline-canvas-cache")
-public class PipelineCanvasMetadataCache extends AbstractRestResource {
+@Path("/v2/pipeline-canvas-cache")
+public class PipelineCanvasMetadataCache extends AbstractAuthGuardedRestResource {
 
   @POST
   @Produces(MediaType.APPLICATION_JSON)
-  public Response updateCachedCanvasMetadata(@PathParam("username") String user,
-                                             String canvasMetadata) {
-    PipelineCanvasMetadataCacheManager.updateCachedCanvasMetadata(user, canvasMetadata);
+  public Response updateCachedCanvasMetadata(String canvasMetadata) {
+    PipelineCanvasMetadataCacheManager.updateCachedCanvasMetadata(getAuthenticatedUsername(), canvasMetadata);
     return ok();
   }
 
   @GET
   @Produces(MediaType.APPLICATION_JSON)
-  public Response getCachedCanvasMetadata(@PathParam("username") String user) {
-      String result = PipelineCanvasMetadataCacheManager.getCachedCanvasMetadata(user);
+  public Response getCachedCanvasMetadata() {
+      String result = PipelineCanvasMetadataCacheManager.getCachedCanvasMetadata(getAuthenticatedUsername());
     if (result != null) {
       return ok(result);
     } else {
@@ -48,8 +47,8 @@ public class PipelineCanvasMetadataCache extends AbstractRestResource {
 
   @DELETE
   @Produces(MediaType.APPLICATION_JSON)
-  public Response removeCanvasMetadataFromCache(@PathParam("username") String user) {
-    PipelineCanvasMetadataCacheManager.removeCanvasMetadataFromCache(user);
+  public Response removeCanvasMetadataFromCache() {
+    PipelineCanvasMetadataCacheManager.removeCanvasMetadataFromCache(getAuthenticatedUsername());
     return ok();
   }
 }
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineCanvasMetadataResource.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineCanvasMetadataResource.java
index 4754060..2ecf4c6 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineCanvasMetadataResource.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineCanvasMetadataResource.java
@@ -26,7 +26,7 @@ import javax.ws.rs.*;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
-@Path("/v2/users/{username}/pipeline-canvas-metadata")
+@Path("/v2/pipeline-canvas-metadata")
 public class PipelineCanvasMetadataResource extends AbstractRestResource {
 
   @GET
diff --git a/ui/src/app/editor/services/editor.service.ts b/ui/src/app/editor/services/editor.service.ts
index a3f244a..8a76279 100644
--- a/ui/src/app/editor/services/editor.service.ts
+++ b/ui/src/app/editor/services/editor.service.ts
@@ -16,8 +16,8 @@
  *
  */
 
-import {Injectable} from "@angular/core";
-import {HttpClient} from "@angular/common/http";
+import { Injectable } from '@angular/core';
+import { HttpClient } from '@angular/common/http';
 import {
   DataProcessorInvocation,
   DataSetModificationMessage,
@@ -29,14 +29,14 @@ import {
   PipelinePreviewModel,
   SpDataSet,
   SpDataStream
-} from "../../core-model/gen/streampipes-model";
-import {Observable, Subject} from "rxjs";
-import {PlatformServicesCommons} from "../../platform-services/apis/commons.service";
-import {PipelineElementConfig, PipelineElementUnion} from "../model/editor.model";
-import {PanelType} from "../../core-ui/dialog/base-dialog/base-dialog.model";
-import {DialogService} from "../../core-ui/dialog/base-dialog/base-dialog.service";
-import {HelpComponent} from "../dialog/help/help.component";
-import {map} from "rxjs/operators";
+} from '../../core-model/gen/streampipes-model';
+import { Observable, Subject } from 'rxjs';
+import { PlatformServicesCommons } from '../../platform-services/apis/commons.service';
+import { PipelineElementConfig, PipelineElementUnion } from '../model/editor.model';
+import { PanelType } from '../../core-ui/dialog/base-dialog/base-dialog.model';
+import { DialogService } from '../../core-ui/dialog/base-dialog/base-dialog.service';
+import { HelpComponent } from '../dialog/help/help.component';
+import { map } from 'rxjs/operators';
 
 @Injectable()
 export class EditorService {
@@ -45,32 +45,36 @@ export class EditorService {
 
     public pipelineElementConfigured$ = this.pipelineElementConfigured.asObservable();
 
-    pipelineAssemblyEmpty: boolean = true;
+    pipelineAssemblyEmpty = true;
 
     constructor(private http: HttpClient,
                 private platformServicesCommons: PlatformServicesCommons,
-                private DialogService: DialogService) {
+                private dialogService: DialogService) {
+    }
+
+    get apiBasePath() {
+      return this.platformServicesCommons.apiBasePath();
     }
 
     recommendPipelineElement(pipeline): Observable<PipelineElementRecommendationMessage> {
-        return this.http.post(this.pipelinesResourceUrl +"/recommend", pipeline)
+        return this.http.post(this.pipelinesResourceUrl + '/recommend', pipeline)
             .pipe(map(data => PipelineElementRecommendationMessage.fromData(data as any)));
     }
 
     updatePartialPipeline(pipeline): Observable<PipelineModificationMessage> {
-        return this.http.post(this.pipelinesResourceUrl +"/update", pipeline)
+        return this.http.post(this.pipelinesResourceUrl + '/update', pipeline)
             .pipe(map(data => {
                 return PipelineModificationMessage.fromData(data as any);
             }));
     }
 
   updateDataSet(dataSet): Observable<DataSetModificationMessage> {
-    return this.http.post(this.platformServicesCommons.authUserBasePath() +"/pipelines/update/dataset", dataSet)
+    return this.http.post(this.platformServicesCommons.authUserBasePath() + '/pipelines/update/dataset', dataSet)
         .pipe(map(data => DataSetModificationMessage.fromData(data as DataSetModificationMessage)));
   }
 
     getCachedPipeline(): Observable<PipelineElementConfig[]> {
-        return this.http.get(this.platformServicesCommons.authUserBasePath() + '/pipeline-cache')
+        return this.http.get(this.apiBasePath + '/pipeline-cache')
             .pipe(map(result => {
               if (result === null) {
                 return [];
@@ -83,18 +87,18 @@ export class EditorService {
     }
 
     getCachedPipelineCanvasMetadata(): Observable<PipelineCanvasMetadata> {
-      return this.http.get(this.platformServicesCommons.authUserBasePath() + "/pipeline-canvas-cache")
+      return this.http.get(this.apiBasePath + '/pipeline-canvas-cache')
           .pipe(map(response => {
             return PipelineCanvasMetadata.fromData(response as any);
       }));
     }
 
     convert(payload: any) {
-      if (payload['@class'] === "org.apache.streampipes.model.SpDataSet") {
+      if (payload['@class'] === 'org.apache.streampipes.model.SpDataSet') {
         return SpDataSet.fromData(payload as SpDataSet);
-      } else if (payload['@class'] === "org.apache.streampipes.model.SpDataStream") {
+      } else if (payload['@class'] === 'org.apache.streampipes.model.SpDataStream') {
         return SpDataStream.fromData(payload as SpDataStream);
-      } else if (payload['@class'] === "org.apache.streampipes.model.graph.DataProcessorInvocation") {
+      } else if (payload['@class'] === 'org.apache.streampipes.model.graph.DataProcessorInvocation') {
         return DataProcessorInvocation.fromData(payload as DataProcessorInvocation);
       } else {
         return DataSinkInvocation.fromData(payload as DataSinkInvocation);
@@ -102,15 +106,15 @@ export class EditorService {
     }
 
     getEpCategories() {
-        return this.http.get(this.platformServicesCommons.unauthenticatedBasePath + "/categories/ep");
+        return this.http.get(this.platformServicesCommons.unauthenticatedBasePath + '/categories/ep');
     }
 
     getEpaCategories() {
-        return this.http.get(this.platformServicesCommons.unauthenticatedBasePath + "/categories/epa");
+        return this.http.get(this.platformServicesCommons.unauthenticatedBasePath + '/categories/epa');
     }
 
     getEcCategories() {
-        return this.http.get(this.platformServicesCommons.unauthenticatedBasePath + "/categories/ec");
+        return this.http.get(this.platformServicesCommons.unauthenticatedBasePath + '/categories/ec');
     }
 
     getUserDetails(): Observable<any> {
@@ -122,24 +126,24 @@ export class EditorService {
     }
 
     updateCachedPipeline(rawPipelineModel: any) {
-        return this.http.post(this.platformServicesCommons.authUserBasePath() + "/pipeline-cache", rawPipelineModel);
+        return this.http.post(this.apiBasePath + '/pipeline-cache', rawPipelineModel);
     }
 
     updateCachedCanvasMetadata(pipelineCanvasMetadata: PipelineCanvasMetadata) {
       return this.http.post(this.platformServicesCommons.authUserBasePath()
-          + "/pipeline-canvas-cache", pipelineCanvasMetadata)
+          + '/pipeline-canvas-cache', pipelineCanvasMetadata);
     }
 
     removePipelineFromCache() {
-        return this.http.delete(this.platformServicesCommons.authUserBasePath() + "/pipeline-cache");
+        return this.http.delete(this.apiBasePath + '/pipeline-cache');
     }
 
     removeCanvasMetadataFromCache() {
-      return this.http.delete(this.platformServicesCommons.authUserBasePath() + "/pipeline-canvas-cache");
+      return this.http.delete(this.apiBasePath + '/pipeline-canvas-cache');
     }
 
     private get pipelinesResourceUrl() {
-        return this.platformServicesCommons.authUserBasePath() + '/pipelines'
+        return this.platformServicesCommons.authUserBasePath() + '/pipelines';
     }
 
     announceConfiguredElement(pipelineElementDomId: string) {
@@ -151,12 +155,12 @@ export class EditorService {
     }
 
     openHelpDialog(pipelineElement: PipelineElementUnion) {
-        this.DialogService.open(HelpComponent,{
+        this.dialogService.open(HelpComponent, {
             panelType: PanelType.STANDARD_PANEL,
             title: pipelineElement.name,
-            width: "70vw",
+            width: '70vw',
             data: {
-                "pipelineElement": pipelineElement
+                'pipelineElement': pipelineElement
             }
         });
     }
@@ -167,17 +171,17 @@ export class EditorService {
     }
 
   deletePipelinePreviewRequest(previewId: string): Observable<any> {
-      return this.http.delete(this.pipelinePreviewBasePath + "/" + previewId);
+      return this.http.delete(this.pipelinePreviewBasePath + '/' + previewId);
   }
 
   getPipelinePreviewResult(previewId: string, pipelineElementDomId: string): Observable<any> {
       return this.http.get(this.pipelinePreviewBasePath
-          + "/"
+          + '/'
           + previewId
-          + "/" + pipelineElementDomId, {headers: { ignoreLoadingBar: '' }});
+          + '/' + pipelineElementDomId, {headers: { ignoreLoadingBar: '' }});
   }
 
   get pipelinePreviewBasePath() {
-      return this.platformServicesCommons.authUserBasePath() + "/pipeline-element-preview";
+      return this.apiBasePath + '/pipeline-element-preview';
   }
 }
diff --git a/ui/src/app/notifications/service/notifications.service.ts b/ui/src/app/notifications/service/notifications.service.ts
index 26d36d3..2c60ca2 100644
--- a/ui/src/app/notifications/service/notifications.service.ts
+++ b/ui/src/app/notifications/service/notifications.service.ts
@@ -15,23 +15,25 @@
  *   limitations under the License.
  */
 
-import {HttpClient} from "@angular/common/http";
-import {AuthStatusService} from "../../services/auth-status.service";
-import {Observable} from "rxjs";
-import {ExistingNotification, NotificationCount, NotificationItem} from "../model/notifications.model";
-import {Injectable} from "@angular/core";
-import {NotificationUtils} from "../utils/notifications.utils";
-import {map} from "rxjs/operators";
+import { HttpClient } from '@angular/common/http';
+import { AuthStatusService } from '../../services/auth-status.service';
+import { Observable } from 'rxjs';
+import { ExistingNotification, NotificationCount, NotificationItem } from '../model/notifications.model';
+import { Injectable } from '@angular/core';
+import { NotificationUtils } from '../utils/notifications.utils';
+import { map } from 'rxjs/operators';
+import { PlatformServicesCommons } from '../../platform-services/apis/commons.service';
 
 @Injectable()
 export class NotificationsService {
 
     constructor(private http: HttpClient,
-                private authStatusService: AuthStatusService) {
+                private authStatusService: AuthStatusService,
+                private platformServicesCommons: PlatformServicesCommons) {
     }
 
     getUnreadNotificationsCount(): Observable<NotificationCount> {
-        return this.http.get(this.notificationUrl + "/count").pipe(map(data => {
+        return this.http.get(this.notificationUrl + '/count').pipe(map(data => {
             return data as NotificationCount;
         }));
     }
@@ -39,28 +41,24 @@ export class NotificationsService {
     getNotifications(existingNotification: ExistingNotification, offset: number, limit: number): Observable<NotificationItem[]> {
         return this.http
             .get(this.notificationUrl
-                + "?"
-                + "notificationType=" + NotificationUtils.makeNotificationIdFromNotification(existingNotification)
-                + "&"
-                + "offset=" + offset
-                + "&"
-                + "count=" + limit)
+                + '?'
+                + 'notificationType=' + NotificationUtils.makeNotificationIdFromNotification(existingNotification)
+                + '&'
+                + 'offset=' + offset
+                + '&'
+                + 'count=' + limit)
             .pipe(map(data => {
                 return data as NotificationItem[];
             }));
     }
 
     updateNotification(notificationItem: NotificationItem): Observable<any> {
-        return this.http.put(this.notificationUrl + "/" + notificationItem._id, notificationItem, {
+        return this.http.put(this.notificationUrl + '/' + notificationItem._id, notificationItem, {
             headers: { ignoreLoadingBar: '' }
         });
     }
 
-    private get baseUrl() {
-        return '/streampipes-backend';
-    }
-
     private get notificationUrl() {
-        return this.baseUrl + '/api/v2/users/' + this.authStatusService.email + '/notifications'
+        return this.platformServicesCommons.apiBasePath() + '/notifications';
     }
-}
\ No newline at end of file
+}
diff --git a/ui/src/app/platform-services/apis/commons.service.ts b/ui/src/app/platform-services/apis/commons.service.ts
index dbf307a..6ed5b73 100644
--- a/ui/src/app/platform-services/apis/commons.service.ts
+++ b/ui/src/app/platform-services/apis/commons.service.ts
@@ -33,7 +33,7 @@ export class PlatformServicesCommons {
   apiBasePath() {
     return this.basePath + '/api/v2';
   }
-
+  
   authUserBasePath() {
     return this.basePath + '/api/v2/users/' + this.authStatusService.email;
   }
diff --git a/ui/src/app/platform-services/apis/pipeline-canvas-metadata.service.ts b/ui/src/app/platform-services/apis/pipeline-canvas-metadata.service.ts
index 09d1d5c..b7f72df 100644
--- a/ui/src/app/platform-services/apis/pipeline-canvas-metadata.service.ts
+++ b/ui/src/app/platform-services/apis/pipeline-canvas-metadata.service.ts
@@ -16,16 +16,12 @@
  *
  */
 
-import {Injectable} from "@angular/core";
-import {HttpClient} from "@angular/common/http";
-import {Observable} from "rxjs";
-import {
-  DataProcessorInvocation,
-  DataSinkInvocation,
-  DataSourceDescription, PipelineCanvasMetadata, SpDataSet, SpDataStream
-} from "../../core-model/gen/streampipes-model";
-import {PlatformServicesCommons} from "./commons.service";
-import {map} from "rxjs/operators";
+import { Injectable } from '@angular/core';
+import { HttpClient } from '@angular/common/http';
+import { Observable } from 'rxjs';
+import { PipelineCanvasMetadata } from '../../core-model/gen/streampipes-model';
+import { PlatformServicesCommons } from './commons.service';
+import { map } from 'rxjs/operators';
 
 @Injectable()
 export class PipelineCanvasMetadataService {
@@ -46,7 +42,7 @@ export class PipelineCanvasMetadataService {
 
   updatePipelineCanvasMetadata(pipelineCanvasMetadata: PipelineCanvasMetadata) {
     return this.http.put(this.pipelineCanvasMetadataBasePath
-        + "/"
+        + '/'
         + pipelineCanvasMetadata.pipelineId, pipelineCanvasMetadata);
   }
 
@@ -56,10 +52,10 @@ export class PipelineCanvasMetadataService {
   }
 
   private get pipelineCanvasMetadataBasePath() {
-    return this.platformServicesCommons.authUserBasePath() + "/pipeline-canvas-metadata";
+    return this.platformServicesCommons.apiBasePath() + '/pipeline-canvas-metadata';
   }
 
   private get pipelineCanvasMetadataPipelinePath() {
-    return this.pipelineCanvasMetadataBasePath + "/pipeline/";
+    return this.pipelineCanvasMetadataBasePath + '/pipeline/';
   }
 }
diff --git a/ui/src/app/services/rest-api.service.ts b/ui/src/app/services/rest-api.service.ts
index 3cd3c20..00e9abe 100644
--- a/ui/src/app/services/rest-api.service.ts
+++ b/ui/src/app/services/rest-api.service.ts
@@ -44,6 +44,10 @@ export class RestApi {
         return this.platformServicesCommons.authUserBasePath();
     };
 
+    urlApiBase() {
+        return this.platformServicesCommons.apiBasePath();
+    }
+
     getAssetUrl(appId) {
         return this.getServerUrl() +"/pe/" +appId +"/assets";
     }
@@ -223,15 +227,15 @@ export class RestApi {
     }
 
     getNotifications() {
-        return this.$http.get(this.urlBase() +"/notifications");
+        return this.$http.get(this.urlApiBase() +"/notifications");
     }
 
     getUnreadNotificationsCount(): Observable<any> {
-        return this.$http.get(this.urlBase() +"/notifications/count");
+        return this.$http.get(this.urlApiBase() +"/notifications/count");
     }
 
     getUnreadNotifications() {
-        return this.$http.get(this.urlBase() +"/notifications/unread");
+        return this.$http.get(this.urlApiBase() +"/notifications/unread");
     }
 
     getSepaById(elementId) {
@@ -445,15 +449,15 @@ export class RestApi {
     }
 
     getCachedPipeline() {
-        return this.$http.get(this.urlBase() + "/pipeline-cache");
+        return this.$http.get(this.urlApiBase() + "/pipeline-cache");
     }
 
     updateCachedPipeline(rawPipelineModel: any) {
-        return this.$http.post(this.urlBase() + "/pipeline-cache", rawPipelineModel);
+        return this.$http.post(this.urlApiBase() + "/pipeline-cache", rawPipelineModel);
     }
 
     removePipelineFromCache() {
-        return this.$http.delete(this.urlBase() + "/pipeline-cache");
+        return this.$http.delete(this.urlApiBase() + "/pipeline-cache");
     }
 
     getVersionInfo() {

[incubator-streampipes] 08/12: [STREAMPIPES-427] Modify paths of pipeline element import, preview and monitoring resources

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

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

commit 9a90b5bd6a57960af2fa177bad9110481125d7a3
Author: Dominik Riemer <ri...@fzi.de>
AuthorDate: Fri Sep 24 14:45:12 2021 +0200

    [STREAMPIPES-427] Modify paths of pipeline element import, preview and monitoring resources
---
 .../rest/impl/PipelineElementImport.java           | 25 ++++++++++---------
 .../rest/impl/PipelineElementPreview.java          |  2 +-
 .../rest/impl/PipelineElementRuntimeInfo.java      |  2 +-
 .../streampipes/rest/impl/PipelineMonitoring.java  |  2 +-
 ui/src/app/connect/services/rest.service.ts        | 28 ++++++++++++----------
 .../apis/pipeline-element-endpoint.service.ts      | 10 ++++----
 ui/src/app/services/rest-api.service.ts            |  2 +-
 7 files changed, 36 insertions(+), 35 deletions(-)

diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineElementImport.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineElementImport.java
index 0b2184b..2834dd4 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineElementImport.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineElementImport.java
@@ -32,7 +32,7 @@ import org.apache.streampipes.model.message.Message;
 import org.apache.streampipes.model.message.Notification;
 import org.apache.streampipes.model.message.NotificationType;
 import org.apache.streampipes.model.message.Notifications;
-import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
+import org.apache.streampipes.rest.core.base.impl.AbstractAuthGuardedRestResource;
 import org.apache.streampipes.storage.api.IPipelineElementDescriptionStorageCache;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -46,16 +46,15 @@ import java.net.URLDecoder;
 import java.util.ArrayList;
 import java.util.List;
 
-@Path("/v2/users/{username}/element")
-public class PipelineElementImport extends AbstractRestResource {
+@Path("/v2/element")
+public class PipelineElementImport extends AbstractAuthGuardedRestResource {
 
   private static final Logger LOG = LoggerFactory.getLogger(PipelineElementImport.class);
 
   @POST
   @Path("/batch")
   @Produces(MediaType.APPLICATION_JSON)
-  public Response addBatch(@PathParam("username") String username,
-                           @FormParam("uri") String uri,
+  public Response addBatch(@FormParam("uri") String uri,
                            @FormParam("publicElement") boolean publicElement) {
     try {
       uri = URLDecoder.decode(uri, "UTF-8");
@@ -63,7 +62,7 @@ public class PipelineElementImport extends AbstractRestResource {
       List<Message> messages = new ArrayList<>();
       if (element.isJsonArray()) {
         for (JsonElement jsonObj : element.getAsJsonArray()) {
-          messages.add(verifyAndAddElement(jsonObj.getAsString(), username, publicElement));
+          messages.add(verifyAndAddElement(jsonObj.getAsString(), getAuthenticatedUsername(), publicElement));
         }
       }
       return ok(messages);
@@ -75,13 +74,12 @@ public class PipelineElementImport extends AbstractRestResource {
 
   @POST
   @Produces(MediaType.APPLICATION_JSON)
-  public Response addElement(@PathParam("username") String username,
-                             @FormParam("uri") String uri,
+  public Response addElement(@FormParam("uri") String uri,
                              @FormParam("publicElement") boolean publicElement) {
-    if (!authorized(username)) {
+    if (!authorized(getAuthenticatedUsername())) {
       return ok(Notifications.error(NotificationType.UNAUTHORIZED));
     }
-    return ok(verifyAndAddElement(uri, username, publicElement));
+    return ok(verifyAndAddElement(uri, getAuthenticatedUsername(), publicElement));
   }
 
   private Message verifyAndAddElement(String uri, String username, boolean publicElement) {
@@ -91,7 +89,8 @@ public class PipelineElementImport extends AbstractRestResource {
   @PUT
   @Path("/{id}")
   @Produces(MediaType.APPLICATION_JSON)
-  public Response updateElement(@PathParam("username") String username, @PathParam("id") String elementId) {
+  public Response updateElement(@PathParam("id") String elementId) {
+    String username = getAuthenticatedUsername();
     if (!authorized(username)) {
       return ok(Notifications.error(NotificationType.UNAUTHORIZED));
     }
@@ -109,8 +108,8 @@ public class PipelineElementImport extends AbstractRestResource {
   @Path("/{id}")
   @DELETE
   @Produces(MediaType.APPLICATION_JSON)
-  public Response deleteElement(@PathParam("username") String username, @PathParam("id") String elementId) {
-
+  public Response deleteElement(@PathParam("id") String elementId) {
+    String username = getAuthenticatedUsername();
     UserService userService = getUserService();
     IPipelineElementDescriptionStorageCache requestor = getPipelineElementRdfStorage();
     String appId;
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineElementPreview.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineElementPreview.java
index c5187ae..bd91ca3 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineElementPreview.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineElementPreview.java
@@ -27,7 +27,7 @@ import javax.ws.rs.*;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
-@Path("/v2/users/{username}/pipeline-element-preview")
+@Path("/v2/pipeline-element-preview")
 public class PipelineElementPreview extends AbstractRestResource {
 
 
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineElementRuntimeInfo.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineElementRuntimeInfo.java
index d654f70..7806bca 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineElementRuntimeInfo.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineElementRuntimeInfo.java
@@ -31,7 +31,7 @@ import javax.ws.rs.Produces;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
-@Path("/v2/users/{username}/pipeline-element/runtime")
+@Path("/v2/pipeline-element/runtime")
 public class PipelineElementRuntimeInfo extends AbstractRestResource {
 
   @POST
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineMonitoring.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineMonitoring.java
index 336068d..9cd2d95 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineMonitoring.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineMonitoring.java
@@ -29,7 +29,7 @@ import javax.ws.rs.Produces;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
-@Path("/v2/users/{username}/pipeline-monitoring")
+@Path("/v2/pipeline-monitoring")
 public class PipelineMonitoring extends AbstractRestResource implements IPipelineMonitoring {
 
   @JacksonSerialized
diff --git a/ui/src/app/connect/services/rest.service.ts b/ui/src/app/connect/services/rest.service.ts
index 70d1330..48c4f04 100644
--- a/ui/src/app/connect/services/rest.service.ts
+++ b/ui/src/app/connect/services/rest.service.ts
@@ -16,24 +16,25 @@
  *
  */
 
-import {Injectable} from '@angular/core';
+import { Injectable } from '@angular/core';
 
-import {HttpClient} from '@angular/common/http';
+import { HttpClient } from '@angular/common/http';
 
-import {from, Observable} from 'rxjs';
-import {map} from 'rxjs/operators';
+import { from, Observable } from 'rxjs';
+import { map } from 'rxjs/operators';
 
 
-import {AuthStatusService} from '../../services/auth-status.service';
-import {UnitDescription} from '../model/UnitDescription';
+import { AuthStatusService } from '../../services/auth-status.service';
+import { UnitDescription } from '../model/UnitDescription';
 import {
     AdapterDescription,
-    DataSourceDescription,
     FormatDescriptionList,
     GuessSchema,
     Message,
-    ProtocolDescriptionList, SpDataStream
-} from "../../core-model/gen/streampipes-model";
+    ProtocolDescriptionList,
+    SpDataStream
+} from '../../core-model/gen/streampipes-model';
+import { PlatformServicesCommons } from '../../platform-services/apis/commons.service';
 
 @Injectable()
 export class RestService {
@@ -41,7 +42,8 @@ export class RestService {
 
     constructor(
         private http: HttpClient,
-        private authStatusService: AuthStatusService) { }
+        private authStatusService: AuthStatusService,
+        private platformServicesCommons: PlatformServicesCommons) { }
 
     addAdapter(adapter: AdapterDescription): Observable<Message> {
         return this.addAdapterDescription(adapter, '/master/adapters');
@@ -81,13 +83,13 @@ export class RestService {
 
     getSourceDetails(sourceElementId): Observable<SpDataStream> {
         return this.http
-            .get(this.makeUserDependentBaseUrl() + '/streams/' + encodeURIComponent(sourceElementId)).pipe(map(response => {
+            .get(this.platformServicesCommons.apiBasePath() + '/streams/' + encodeURIComponent(sourceElementId)).pipe(map(response => {
                 return SpDataStream.fromData(response as SpDataStream);
             }));
     }
 
     getRuntimeInfo(sourceDescription): Observable<any> {
-        return this.http.post(this.makeUserDependentBaseUrl() + '/pipeline-element/runtime', sourceDescription, {
+        return this.http.post(this.platformServicesCommons.apiBasePath() + '/pipeline-element/runtime', sourceDescription, {
             headers: { ignoreLoadingBar: '' }
         });
     }
@@ -121,7 +123,7 @@ export class RestService {
             .post<UnitDescription[]>(this.host + this.authStatusService.email + '/master/unit', unitDescription)
             .pipe(map(response => {
                 const descriptions = response as UnitDescription[];
-                return descriptions.filter(entry => entry.resource != unitDescription.resource)
+                return descriptions.filter(entry => entry.resource != unitDescription.resource);
             }));
     }
 
diff --git a/ui/src/app/platform-services/apis/pipeline-element-endpoint.service.ts b/ui/src/app/platform-services/apis/pipeline-element-endpoint.service.ts
index f8f78b5..d62d230 100644
--- a/ui/src/app/platform-services/apis/pipeline-element-endpoint.service.ts
+++ b/ui/src/app/platform-services/apis/pipeline-element-endpoint.service.ts
@@ -32,21 +32,21 @@ export class PipelineElementEndpointService {
     const payload = new HttpParams()
         .set('uri', elementUri)
         .set('publicElement', ispublic);
-    return this.http.post(this.platformServicesCommons.authUserBasePath() + "/element", payload);
+    return this.http.post(this.platformServicesCommons.apiBasePath() + "/element", payload);
   }
 
   addBatch(elementUris, ispublic): Observable<any> {
     const payload = new HttpParams()
         .set('uri', elementUris)
         .set('publicElement', ispublic);
-    return this.http.post(this.platformServicesCommons.authUserBasePath() + "/element/batch", payload);
+    return this.http.post(this.platformServicesCommons.apiBasePath() + "/element/batch", payload);
   }
 
   update(elementUri): Observable<any> {
-    return this.http.put(this.platformServicesCommons.authUserBasePath() + "/element/" + encodeURIComponent(elementUri), undefined);
+    return this.http.put(this.platformServicesCommons.apiBasePath() + "/element/" + encodeURIComponent(elementUri), undefined);
   }
 
   del(elementUri): Observable<any> {
-    return this.http.delete(this.platformServicesCommons.authUserBasePath() + "/element/" + encodeURIComponent(elementUri));
+    return this.http.delete(this.platformServicesCommons.apiBasePath() + "/element/" + encodeURIComponent(elementUri));
   }
-}
\ No newline at end of file
+}
diff --git a/ui/src/app/services/rest-api.service.ts b/ui/src/app/services/rest-api.service.ts
index dbf50c4..db0d4c8 100644
--- a/ui/src/app/services/rest-api.service.ts
+++ b/ui/src/app/services/rest-api.service.ts
@@ -101,7 +101,7 @@ export class RestApi {
     }
 
     jsonld(elementUri) {
-        return this.$http.get(this.urlBase() + '/element/' + encodeURIComponent(elementUri) + '/jsonld');
+        return this.$http.get(this.urlApiBase() + '/element/' + encodeURIComponent(elementUri) + '/jsonld');
     }
 
     configured(): Observable<any> {

[incubator-streampipes] 04/12: [STREAMPIPES-427] Modify paths of deployment resource and extensions resource

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

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

commit a5e62d41de6fe0cfac21fabde92a672dd9eff60e
Author: Dominik Riemer <ri...@fzi.de>
AuthorDate: Fri Sep 24 13:59:19 2021 +0200

    [STREAMPIPES-427] Modify paths of deployment resource and extensions resource
---
 .../apache/streampipes/rest/impl/DataStream.java   |  2 +-
 .../apache/streampipes/rest/impl/Deployment.java   |  7 +++---
 .../impl/ExtensionsServiceEndpointResource.java    |  2 +-
 ui/src/app/add/services/add.service.ts             | 28 +++++++++++-----------
 4 files changed, 19 insertions(+), 20 deletions(-)

diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/DataStream.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/DataStream.java
index 747da3b..3e2aa7d 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/DataStream.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/DataStream.java
@@ -28,7 +28,7 @@ import javax.ws.rs.Produces;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
-@Path("/v2/users/{username}/streams")
+@Path("/v2/streams")
 public class DataStream extends AbstractRestResource {
 
   @Path("/update")
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/Deployment.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/Deployment.java
index f6d9c93..e4dd8fc 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/Deployment.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/Deployment.java
@@ -37,7 +37,7 @@ import javax.ws.rs.core.Response;
 import java.io.File;
 
 
-@Path("/v2/users/{username}/deploy")
+@Path("/v2/deploy")
 public class Deployment extends AbstractRestResource {
 
     @POST
@@ -81,8 +81,7 @@ public class Deployment extends AbstractRestResource {
     @Path("/import")
     @Produces(MediaType.APPLICATION_JSON)
     @Consumes(MediaType.MULTIPART_FORM_DATA)
-    public Response directImport(@PathParam("username") String username,
-                                 @FormDataParam("config") String config,
+    public Response directImport(@FormDataParam("config") String config,
                                  @FormDataParam("model") String model) {
 // TODO check if this can be deleted
 //        DataSourceDescription sep = new DataSourceDescription(GsonSerializer.getGsonWithIds().fromJson(model, DataSourceDescription.class));
@@ -104,7 +103,7 @@ public class Deployment extends AbstractRestResource {
     @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) {
+    public Response directUpdate(@FormDataParam("config") String config, @FormDataParam("model") String model) {
 
         DeploymentConfiguration deploymentConfig = fromJson(config);
 
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/ExtensionsServiceEndpointResource.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/ExtensionsServiceEndpointResource.java
index 11403a8..6d8d35e 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/ExtensionsServiceEndpointResource.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/ExtensionsServiceEndpointResource.java
@@ -38,7 +38,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.stream.Collectors;
 
-@Path("/v2/users/{username}/rdfendpoints")
+@Path("/v2/rdfendpoints")
 public class ExtensionsServiceEndpointResource extends AbstractRestResource {
 
   @GET
diff --git a/ui/src/app/add/services/add.service.ts b/ui/src/app/add/services/add.service.ts
index 0747e91..f8b2577 100644
--- a/ui/src/app/add/services/add.service.ts
+++ b/ui/src/app/add/services/add.service.ts
@@ -16,13 +16,13 @@
  *
  */
 
-import {Injectable} from "@angular/core";
-import {HttpClient} from "@angular/common/http";
-import {AuthStatusService} from "../../services/auth-status.service";
-import {PlatformServicesCommons} from "../../platform-services/apis/commons.service";
-import {Observable} from "rxjs";
-import {map} from "rxjs/operators";
-import {ExtensionsServiceEndpointItem} from "../../core-model/gen/streampipes-model-client";
+import { Injectable } from '@angular/core';
+import { HttpClient } from '@angular/common/http';
+import { AuthStatusService } from '../../services/auth-status.service';
+import { PlatformServicesCommons } from '../../platform-services/apis/commons.service';
+import { Observable } from 'rxjs';
+import { map } from 'rxjs/operators';
+import { ExtensionsServiceEndpointItem } from '../../core-model/gen/streampipes-model-client';
 
 @Injectable()
 export class AddService {
@@ -34,28 +34,28 @@ export class AddService {
   }
 
   getRdfEndpoints(): Observable<any> {
-    return this.http.get(this.platformServicesCommons.authUserBasePath() + "/rdfendpoints");
+    return this.http.get(this.platformServicesCommons.apiBasePath() + '/rdfendpoints');
   }
 
-  getRdfEndpointItems(): Observable<Array<ExtensionsServiceEndpointItem>> {
+  getRdfEndpointItems(): Observable<ExtensionsServiceEndpointItem[]> {
     return this
         .http
-        .get(this.platformServicesCommons.authUserBasePath() + "/rdfendpoints/items")
+        .get(this.platformServicesCommons.apiBasePath() + '/rdfendpoints/items')
         .pipe(map(response => {
           return (response as any[]).map(item => ExtensionsServiceEndpointItem.fromData(item));
         }));
   }
 
   addRdfEndpoint(rdfEndpoint): Observable<any> {
-    return this.http.post(this.platformServicesCommons.authUserBasePath() + "/rdfendpoints", rdfEndpoint);
+    return this.http.post(this.platformServicesCommons.apiBasePath() + '/rdfendpoints', rdfEndpoint);
   }
 
   removeRdfEndpoint(rdfEndpointId): Observable<any> {
-    return this.http.delete(this.platformServicesCommons.authUserBasePath() + "/rdfendpoints/" + rdfEndpointId);
+    return this.http.delete(this.platformServicesCommons.apiBasePath() + '/rdfendpoints/' + rdfEndpointId);
   }
 
   getRdfEndpointIcon(item: ExtensionsServiceEndpointItem): Observable<any> {
-    return this.http.post(this.platformServicesCommons.authUserBasePath()
-        + "/rdfendpoints/items/icon", item, { responseType: 'blob' });
+    return this.http.post(this.platformServicesCommons.apiBasePath()
+        + '/rdfendpoints/items/icon', item, { responseType: 'blob' });
   }
 }

[incubator-streampipes] 10/12: [STREAMPIPES-427] Modify paths of pipeline element resources

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

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

commit 13ff877031c97e993077858d7292c66241128403
Author: Dominik Riemer <ri...@fzi.de>
AuthorDate: Fri Sep 24 14:51:58 2021 +0200

    [STREAMPIPES-427] Modify paths of pipeline element resources
---
 .../streampipes/rest/api/IPipelineElement.java     | 14 ++++----
 .../rest/impl/SemanticEventConsumer.java           | 34 +++++++++---------
 .../rest/impl/SemanticEventProcessingAgent.java    | 33 +++++++++--------
 .../rest/impl/SemanticEventProducer.java           | 33 +++++++++--------
 .../apis/pipeline-element.service.ts               | 41 +++++++++++-----------
 5 files changed, 76 insertions(+), 79 deletions(-)

diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/api/IPipelineElement.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/api/IPipelineElement.java
index 8978e0b..0c0cffa 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/api/IPipelineElement.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/api/IPipelineElement.java
@@ -23,16 +23,16 @@ import javax.ws.rs.core.Response;
 
 public interface IPipelineElement {
 
-	Response getAvailable(String username);
-	Response getFavorites(String username);
-	Response getOwn(String username);
+	Response getAvailable();
+	Response getFavorites();
+	Response getOwn();
 
-	Response addFavorite(String username, String elementUri);
+	Response addFavorite(String elementUri);
 
-	Response removeFavorite(String username, String elementUri);
-	Response removeOwn(String username, String elementUri);
+	Response removeFavorite(String elementUri);
+	Response removeOwn(String elementUri);
 
-	Response getElement(String username, String elementUri);
+	Response getElement(String elementUri);
 	
 	
 }
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/SemanticEventConsumer.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/SemanticEventConsumer.java
index f3fccd6..8df882e 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/SemanticEventConsumer.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/SemanticEventConsumer.java
@@ -24,7 +24,7 @@ import org.apache.streampipes.model.graph.DataSinkInvocation;
 import org.apache.streampipes.model.message.NotificationType;
 import org.apache.streampipes.model.message.Notifications;
 import org.apache.streampipes.rest.api.IPipelineElement;
-import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
+import org.apache.streampipes.rest.core.base.impl.AbstractAuthGuardedRestResource;
 import org.apache.streampipes.rest.shared.annotation.GsonWithIds;
 import org.apache.streampipes.rest.shared.annotation.JacksonSerialized;
 import org.apache.streampipes.rest.shared.util.SpMediaType;
@@ -37,8 +37,8 @@ import javax.ws.rs.core.Response;
 import java.util.List;
 import java.util.stream.Collectors;
 
-@Path("/v2/users/{username}/actions")
-public class SemanticEventConsumer extends AbstractRestResource implements IPipelineElement {
+@Path("/v2/actions")
+public class SemanticEventConsumer extends AbstractAuthGuardedRestResource implements IPipelineElement {
 
   @GET
   @Path("/available")
@@ -46,9 +46,9 @@ public class SemanticEventConsumer extends AbstractRestResource implements IPipe
   @Produces(MediaType.APPLICATION_JSON)
   @GsonWithIds
   @Override
-  public Response getAvailable(@PathParam("username") String username) {
+  public Response getAvailable() {
     List<DataSinkDescription> secs = Filter.byUri(getPipelineElementRdfStorage().getAllDataSinks(),
-            getUserService().getAvailableActionUris(username));
+            getUserService().getAvailableActionUris(getAuthenticatedUsername()));
     return ok(secs);
   }
 
@@ -58,9 +58,9 @@ public class SemanticEventConsumer extends AbstractRestResource implements IPipe
   @Produces(MediaType.APPLICATION_JSON)
   @GsonWithIds
   @Override
-  public Response getFavorites(@PathParam("username") String username) {
+  public Response getFavorites() {
     List<DataSinkDescription> secs = Filter.byUri(getPipelineElementRdfStorage().getAllDataSinks(),
-            getUserService().getFavoriteActionUris(username));
+            getUserService().getFavoriteActionUris(getAuthenticatedUsername()));
     return ok(secs);
   }
 
@@ -70,9 +70,9 @@ public class SemanticEventConsumer extends AbstractRestResource implements IPipe
   @Produces({MediaType.APPLICATION_JSON, SpMediaType.JSONLD})
   @JacksonSerialized
   @Override
-  public Response getOwn(@PathParam("username") String username) {
+  public Response getOwn() {
     List<DataSinkDescription> secs = Filter.byUri(getPipelineElementRdfStorage().getAllDataSinks(),
-            getUserService().getOwnActionUris(username));
+            getUserService().getOwnActionUris(getAuthenticatedUsername()));
     List<DataSinkInvocation> si = secs.stream().map(s -> new DataSinkInvocation(new DataSinkInvocation(s))).collect(Collectors.toList());
     return ok(si);
   }
@@ -83,8 +83,8 @@ public class SemanticEventConsumer extends AbstractRestResource implements IPipe
   @Produces(MediaType.APPLICATION_JSON)
   @GsonWithIds
   @Override
-  public Response addFavorite(@PathParam("username") String username, @FormParam("uri") String elementUri) {
-    getUserService().addActionAsFavorite(username, decode(elementUri));
+  public Response addFavorite(@FormParam("uri") String elementUri) {
+    getUserService().addActionAsFavorite(getAuthenticatedUsername(), decode(elementUri));
     return statusMessage(Notifications.success(NotificationType.OPERATION_SUCCESS));
   }
 
@@ -94,9 +94,8 @@ public class SemanticEventConsumer extends AbstractRestResource implements IPipe
   @Produces(MediaType.APPLICATION_JSON)
   @GsonWithIds
   @Override
-  public Response removeFavorite(@PathParam("username") String username,
-                                 @PathParam("elementId") String elementId) {
-    getUserService().removeActionFromFavorites(username, decode(elementId));
+  public Response removeFavorite(@PathParam("elementId") String elementId) {
+    getUserService().removeActionFromFavorites(getAuthenticatedUsername(), decode(elementId));
     return statusMessage(Notifications.success(NotificationType.OPERATION_SUCCESS));
   }
 
@@ -106,10 +105,9 @@ public class SemanticEventConsumer extends AbstractRestResource implements IPipe
   @Produces(MediaType.APPLICATION_JSON)
   @GsonWithIds
   @Override
-  public Response removeOwn(@PathParam("username") String username,
-                            @PathParam("elementId") String elementId) {
+  public Response removeOwn(@PathParam("elementId") String elementId) {
     IPipelineElementDescriptionStorage requestor = getPipelineElementRdfStorage();
-    getUserService().deleteOwnAction(username, elementId);
+    getUserService().deleteOwnAction(getAuthenticatedUsername(), elementId);
     requestor.deleteDataSink(requestor.getDataSinkById(elementId));
     return constructSuccessMessage(NotificationType.STORAGE_SUCCESS.uiNotification());
   }
@@ -120,7 +118,7 @@ public class SemanticEventConsumer extends AbstractRestResource implements IPipe
   @Produces(MediaType.APPLICATION_JSON)
   @GsonWithIds
   @Override
-  public Response getElement(@PathParam("username") String username, @PathParam("elementUri") String elementUri) {
+  public Response getElement(@PathParam("elementUri") String elementUri) {
     return ok(new DataSinkInvocation(new DataSinkInvocation(getPipelineElementRdfStorage().getDataSinkById(elementUri))));
   }
 }
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/SemanticEventProcessingAgent.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/SemanticEventProcessingAgent.java
index 82b429c..1491506 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/SemanticEventProcessingAgent.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/SemanticEventProcessingAgent.java
@@ -24,7 +24,7 @@ import org.apache.streampipes.model.graph.DataProcessorInvocation;
 import org.apache.streampipes.model.message.NotificationType;
 import org.apache.streampipes.model.message.Notifications;
 import org.apache.streampipes.rest.api.IPipelineElement;
-import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
+import org.apache.streampipes.rest.core.base.impl.AbstractAuthGuardedRestResource;
 import org.apache.streampipes.rest.shared.annotation.GsonWithIds;
 import org.apache.streampipes.rest.shared.annotation.JacksonSerialized;
 import org.apache.streampipes.rest.shared.util.SpMediaType;
@@ -36,8 +36,8 @@ import javax.ws.rs.core.Response;
 import java.util.List;
 import java.util.stream.Collectors;
 
-@Path("/v2/users/{username}/sepas")
-public class SemanticEventProcessingAgent extends AbstractRestResource implements IPipelineElement {
+@Path("/v2/sepas")
+public class SemanticEventProcessingAgent extends AbstractAuthGuardedRestResource implements IPipelineElement {
 
 	@GET
 	@Path("/available")
@@ -45,9 +45,9 @@ public class SemanticEventProcessingAgent extends AbstractRestResource implement
 	@Produces(MediaType.APPLICATION_JSON)
 	@GsonWithIds
 	@Override
-	public Response getAvailable(@PathParam("username") String username) {
+	public Response getAvailable() {
 		List<DataProcessorDescription> sepas = Filter.byUri(getPipelineElementRdfStorage().getAllDataProcessors(),
-				getUserService().getAvailableSepaUris(username));
+				getUserService().getAvailableSepaUris(getAuthenticatedUsername()));
 		return ok(sepas);
 	}
 	
@@ -57,9 +57,9 @@ public class SemanticEventProcessingAgent extends AbstractRestResource implement
 	@Produces(MediaType.APPLICATION_JSON)
 	@GsonWithIds
 	@Override
-	public Response getFavorites(@PathParam("username") String username) {
+	public Response getFavorites() {
 		List<DataProcessorDescription> sepas = Filter.byUri(getPipelineElementRdfStorage().getAllDataProcessors(),
-				getUserService().getFavoriteSepaUris(username));
+				getUserService().getFavoriteSepaUris(getAuthenticatedUsername()));
 		return ok(sepas);
 	}
 
@@ -69,9 +69,9 @@ public class SemanticEventProcessingAgent extends AbstractRestResource implement
 	@JacksonSerialized
 	@Produces({MediaType.APPLICATION_JSON, SpMediaType.JSONLD})
 	@Override
-	public Response getOwn(@PathParam("username") String username) {
+	public Response getOwn() {
 		List<DataProcessorDescription> sepas = Filter.byUri(getPipelineElementRdfStorage().getAllDataProcessors(),
-				getUserService().getOwnSepaUris(username));
+				getUserService().getOwnSepaUris(getAuthenticatedUsername()));
 		List<DataProcessorInvocation> si = sepas
 						.stream()
 						.map(s -> new DataProcessorInvocation(new DataProcessorInvocation(s)))
@@ -86,8 +86,8 @@ public class SemanticEventProcessingAgent extends AbstractRestResource implement
 	@Produces(MediaType.APPLICATION_JSON)
 	@GsonWithIds
 	@Override
-	public Response addFavorite(@PathParam("username") String username, @FormParam("uri") String elementUri) {
-		getUserService().addSepaAsFavorite(username, decode(elementUri));
+	public Response addFavorite(@FormParam("uri") String elementUri) {
+		getUserService().addSepaAsFavorite(getAuthenticatedUsername(), decode(elementUri));
 		return statusMessage(Notifications.success(NotificationType.OPERATION_SUCCESS));
 	}
 
@@ -97,8 +97,8 @@ public class SemanticEventProcessingAgent extends AbstractRestResource implement
 	@Produces(MediaType.APPLICATION_JSON)
 	@GsonWithIds
 	@Override
-	public Response removeFavorite(@PathParam("username") String username, @PathParam("elementUri") String elementUri) {
-		getUserService().removeSepaFromFavorites(username, decode(elementUri));
+	public Response removeFavorite(@PathParam("elementUri") String elementUri) {
+		getUserService().removeSepaFromFavorites(getAuthenticatedUsername(), decode(elementUri));
 		return statusMessage(Notifications.success(NotificationType.OPERATION_SUCCESS));
 	}
 	
@@ -108,9 +108,8 @@ public class SemanticEventProcessingAgent extends AbstractRestResource implement
 	@Produces(MediaType.APPLICATION_JSON)
 	@GsonWithIds
 	@Override
-	public Response removeOwn(@PathParam("username") String username,
-														@PathParam("elementId") String elementId) {
-		getUserService().deleteOwnSepa(username, elementId);
+	public Response removeOwn(@PathParam("elementId") String elementId) {
+		getUserService().deleteOwnSepa(getAuthenticatedUsername(), elementId);
 		getPipelineElementRdfStorage().deleteDataProcessor(getPipelineElementRdfStorage().getDataProcessorById(elementId));
 		return constructSuccessMessage(NotificationType.STORAGE_SUCCESS.uiNotification());
 	}
@@ -120,7 +119,7 @@ public class SemanticEventProcessingAgent extends AbstractRestResource implement
 	@Produces(MediaType.APPLICATION_JSON)
 	@GsonWithIds
 	@Override
-	public Response getElement(@PathParam("username") String username, @PathParam("elementUri") String elementUri) {
+	public Response getElement(@PathParam("elementUri") String elementUri) {
 		// TODO Access rights
 		return ok(new DataProcessorInvocation(new DataProcessorInvocation(getPipelineElementRdfStorage().getDataProcessorById(elementUri))));
 	}
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/SemanticEventProducer.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/SemanticEventProducer.java
index 1599b9a..45c9d02 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/SemanticEventProducer.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/SemanticEventProducer.java
@@ -24,7 +24,7 @@ import org.apache.streampipes.model.message.NotificationType;
 import org.apache.streampipes.model.message.Notifications;
 import org.apache.streampipes.model.util.Cloner;
 import org.apache.streampipes.rest.api.IPipelineElement;
-import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
+import org.apache.streampipes.rest.core.base.impl.AbstractAuthGuardedRestResource;
 import org.apache.streampipes.rest.shared.annotation.GsonWithIds;
 import org.apache.streampipes.rest.shared.annotation.JacksonSerialized;
 import org.apache.streampipes.rest.shared.util.SpMediaType;
@@ -36,8 +36,8 @@ import javax.ws.rs.core.Response;
 import java.util.List;
 import java.util.stream.Collectors;
 
-@Path("/v2/users/{username}/streams")
-public class SemanticEventProducer extends AbstractRestResource implements IPipelineElement {
+@Path("/v2/streams")
+public class SemanticEventProducer extends AbstractAuthGuardedRestResource implements IPipelineElement {
 
 	@GET
 	@Path("/available")
@@ -45,9 +45,9 @@ public class SemanticEventProducer extends AbstractRestResource implements IPipe
 	@Produces(MediaType.APPLICATION_JSON)
 	@GsonWithIds
 	@Override
-	public Response getAvailable(@PathParam("username") String username) {
+	public Response getAvailable() {
 		List<SpDataStream> seps = Filter.byUri(getPipelineElementRdfStorage().getAllDataStreams(),
-				getUserService().getAvailableSourceUris(username));
+				getUserService().getAvailableSourceUris(getAuthenticatedUsername()));
 		return ok(seps);
 	}
 	
@@ -57,9 +57,9 @@ public class SemanticEventProducer extends AbstractRestResource implements IPipe
 	@Produces(MediaType.APPLICATION_JSON)
 	@GsonWithIds
 	@Override
-	public Response getFavorites(@PathParam("username") String username) {
+	public Response getFavorites() {
 		List<SpDataStream> seps = Filter.byUri(getPipelineElementRdfStorage().getAllDataStreams(),
-				getUserService().getFavoriteSourceUris(username));
+				getUserService().getFavoriteSourceUris(getAuthenticatedUsername()));
 		return ok(seps);
 	}
 
@@ -69,9 +69,9 @@ public class SemanticEventProducer extends AbstractRestResource implements IPipe
 	@Produces({MediaType.APPLICATION_JSON, SpMediaType.JSONLD})
 	@JacksonSerialized
 	@Override
-	public Response getOwn(@PathParam("username") String username) {
+	public Response getOwn() {
 		List<SpDataStream> seps = Filter.byUri(getPipelineElementRdfStorage().getAllDataStreams(),
-				getUserService().getOwnSourceUris(username));
+				getUserService().getOwnSourceUris(getAuthenticatedUsername()));
 		List<SpDataStream> si = seps.stream().map(s -> new Cloner().mapSequence(s)).collect(Collectors.toList());
 
 		return ok(si);
@@ -83,8 +83,8 @@ public class SemanticEventProducer extends AbstractRestResource implements IPipe
 	@Produces(MediaType.APPLICATION_JSON)
 	@GsonWithIds
 	@Override
-	public Response addFavorite(@PathParam("username") String username, @FormParam("uri") String elementUri) {
-		getUserService().addSourceAsFavorite(username, decode(elementUri));
+	public Response addFavorite(@FormParam("uri") String elementUri) {
+		getUserService().addSourceAsFavorite(getAuthenticatedUsername(), decode(elementUri));
 		return statusMessage(Notifications.success(NotificationType.OPERATION_SUCCESS));
 	}
 
@@ -94,8 +94,8 @@ public class SemanticEventProducer extends AbstractRestResource implements IPipe
 	@Produces(MediaType.APPLICATION_JSON)
 	@GsonWithIds
 	@Override
-	public Response removeFavorite(@PathParam("username") String username, @PathParam("elementUri") String elementUri) {
-		getUserService().removeSourceFromFavorites(username, decode(elementUri));
+	public Response removeFavorite(@PathParam("elementUri") String elementUri) {
+		getUserService().removeSourceFromFavorites(getAuthenticatedUsername(), decode(elementUri));
 		return statusMessage(Notifications.success(NotificationType.OPERATION_SUCCESS));
 	}
 	
@@ -105,9 +105,8 @@ public class SemanticEventProducer extends AbstractRestResource implements IPipe
 	@Produces(MediaType.APPLICATION_JSON)
 	@GsonWithIds
 	@Override
-	public Response removeOwn(@PathParam("username") String username,
-														@PathParam("elementId") String elementId) {
-		getUserService().deleteOwnSource(username, elementId);
+	public Response removeOwn(@PathParam("elementId") String elementId) {
+		getUserService().deleteOwnSource(getAuthenticatedUsername(), elementId);
 		getPipelineElementRdfStorage().deleteDataStream(getPipelineElementRdfStorage().getDataStreamById(elementId));
 		return constructSuccessMessage(NotificationType.STORAGE_SUCCESS.uiNotification());
 	}
@@ -117,7 +116,7 @@ public class SemanticEventProducer extends AbstractRestResource implements IPipe
 	@Produces(MediaType.APPLICATION_JSON)
 	@JacksonSerialized
 	@Override
-	public Response getElement(@PathParam("username") String username, @PathParam("elementUri") String elementUri) {
+	public Response getElement(@PathParam("elementUri") String elementUri) {
 		// TODO Access rights
 		return ok(new Cloner().mapSequence(getPipelineElementRdfStorage().getDataStreamById(elementUri)));
 	}
diff --git a/ui/src/app/platform-services/apis/pipeline-element.service.ts b/ui/src/app/platform-services/apis/pipeline-element.service.ts
index 3398059..1073385 100644
--- a/ui/src/app/platform-services/apis/pipeline-element.service.ts
+++ b/ui/src/app/platform-services/apis/pipeline-element.service.ts
@@ -16,16 +16,17 @@
  *
  */
 
-import {Injectable} from "@angular/core";
-import {HttpClient} from "@angular/common/http";
-import {Observable} from "rxjs";
+import { Injectable } from '@angular/core';
+import { HttpClient } from '@angular/common/http';
+import { Observable } from 'rxjs';
 import {
   DataProcessorInvocation,
   DataSinkInvocation,
-  DataSourceDescription, SpDataSet, SpDataStream
-} from "../../core-model/gen/streampipes-model";
-import {PlatformServicesCommons} from "./commons.service";
-import {map} from "rxjs/operators";
+  SpDataSet,
+  SpDataStream
+} from '../../core-model/gen/streampipes-model';
+import { PlatformServicesCommons } from './commons.service';
+import { map } from 'rxjs/operators';
 
 @Injectable()
 export class PipelineElementService {
@@ -34,23 +35,23 @@ export class PipelineElementService {
               private platformServicesCommons: PlatformServicesCommons) {
   }
 
-  getDataProcessors(): Observable<Array<DataProcessorInvocation>> {
-    return this.http.get(this.dataProcessorsUrl + "/own").pipe(map(data => {
+  getDataProcessors(): Observable<DataProcessorInvocation[]> {
+    return this.http.get(this.dataProcessorsUrl + '/own').pipe(map(data => {
       return (data as []).map(dpi => DataProcessorInvocation.fromData(dpi));
     }));
   }
 
-  getDataSinks(): Observable<Array<DataSinkInvocation>> {
-    return this.http.get(this.dataSinksUrl + "/own").pipe(map(data => {
+  getDataSinks(): Observable<DataSinkInvocation[]> {
+    return this.http.get(this.dataSinksUrl + '/own').pipe(map(data => {
       return (data as []).map(dpi => DataSinkInvocation.fromData(dpi));
     }));
   }
 
-  getDataStreams(): Observable<Array<SpDataStream>> {
-    return this.http.get(this.dataStreamsUrl + "/own").pipe(map(data => {
+  getDataStreams(): Observable<SpDataStream[]> {
+    return this.http.get(this.dataStreamsUrl + '/own').pipe(map(data => {
       return (data as []).map(dpi => {
-        if (dpi["@class"] == "org.apache.streampipes.model.SpDataSet") {
-          return SpDataSet.fromData(dpi)
+        if (dpi['@class'] === 'org.apache.streampipes.model.SpDataSet') {
+          return SpDataSet.fromData(dpi);
         } else {
           return SpDataStream.fromData(dpi);
         }
@@ -60,21 +61,21 @@ export class PipelineElementService {
 
   getDocumentation(appId) {
     return this.http.get(this.platformServicesCommons.unauthenticatedBasePath
-        + "/pe/"
+        + '/pe/'
         + appId
-        + "/assets/documentation", {responseType: 'text'});
+        + '/assets/documentation', {responseType: 'text'});
   }
 
   private get dataProcessorsUrl(): string {
-    return this.platformServicesCommons.authUserBasePath() + '/sepas'
+    return this.platformServicesCommons.apiBasePath() + '/sepas';
   }
 
   private get dataStreamsUrl(): string {
-    return this.platformServicesCommons.authUserBasePath() + '/streams'
+    return this.platformServicesCommons.apiBasePath() + '/streams';
   }
 
   private get dataSinksUrl(): string {
-    return this.platformServicesCommons.authUserBasePath() + '/actions'
+    return this.platformServicesCommons.apiBasePath() + '/actions';
   }
 
 }

[incubator-streampipes] 03/12: [STREAMPIPES-427] Remove obsolete CouchDB resource

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

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

commit dc178b8cbf991b622175a9a07653204a189925c6
Author: Dominik Riemer <ri...@fzi.de>
AuthorDate: Fri Sep 24 13:55:46 2021 +0200

    [STREAMPIPES-427] Remove obsolete CouchDB resource
---
 .../backend/StreamPipesResourceConfig.java         |  1 -
 .../org/apache/streampipes/rest/impl/Couchdb.java  | 54 ----------------------
 2 files changed, 55 deletions(-)

diff --git a/streampipes-backend/src/main/java/org/apache/streampipes/backend/StreamPipesResourceConfig.java b/streampipes-backend/src/main/java/org/apache/streampipes/backend/StreamPipesResourceConfig.java
index 8b415e1..5f5b17b 100644
--- a/streampipes-backend/src/main/java/org/apache/streampipes/backend/StreamPipesResourceConfig.java
+++ b/streampipes-backend/src/main/java/org/apache/streampipes/backend/StreamPipesResourceConfig.java
@@ -55,7 +55,6 @@ public class StreamPipesResourceConfig extends ResourceConfig {
         register(CategoryResource.class);
         register(ConsulConfig.class);
         register(ContainerProvidedOptions.class);
-        register(Couchdb.class);
         register(DashboardWidget.class);
         register(Dashboard.class);
         register(DataLakeResourceV3.class);
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/Couchdb.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/Couchdb.java
deleted file mode 100644
index 9191c9b..0000000
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/Couchdb.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.streampipes.rest.impl;
-
-import com.google.gson.Gson;
-import com.google.gson.JsonObject;
-import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
-import org.apache.streampipes.rest.shared.annotation.GsonWithIds;
-import org.apache.streampipes.storage.couchdb.utils.Utils;
-import org.lightcouch.CouchDbClient;
-
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import java.util.List;
-
-@Path("/v2/couchdb/{table}")
-public class Couchdb extends AbstractRestResource {
-
-
-    @GET
-    @Produces(MediaType.APPLICATION_JSON)
-    @GsonWithIds
-    public Response getAllData(@PathParam("table") String table) {
-        CouchDbClient couchDbClient = Utils.getCoucbDbClient(table);
-
-        List<JsonObject> result = couchDbClient.view("_all_docs").includeDocs(true).query(JsonObject.class);
-        String json = new Gson().toJson(result);
-
-        couchDbClient.shutdown();
-
-        return Response.ok(json).build();
-
-    }
-}

[incubator-streampipes] 02/12: [STREAMPIPES-427] Modify path of category and remote options resource

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

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

commit b20b383def487fdc8b58e5ff43f01152a5780ba4
Author: Dominik Riemer <ri...@fzi.de>
AuthorDate: Fri Sep 24 13:53:56 2021 +0200

    [STREAMPIPES-427] Modify path of category and remote options resource
---
 .../backend/StreamPipesResourceConfig.java         |  1 -
 .../streampipes/rest/impl/CategoryResource.java    |  2 +-
 .../rest/impl/ContainerProvidedOptions.java        |  2 +-
 .../streampipes/rest/impl/Visualization.java       | 38 ----------------------
 .../app/core-ui/labels/services/label.service.ts   |  2 +-
 .../runtime-resolvable.service.ts                  | 26 +++++++--------
 ui/src/app/services/rest-api.service.ts            | 14 --------
 7 files changed, 16 insertions(+), 69 deletions(-)

diff --git a/streampipes-backend/src/main/java/org/apache/streampipes/backend/StreamPipesResourceConfig.java b/streampipes-backend/src/main/java/org/apache/streampipes/backend/StreamPipesResourceConfig.java
index e140797..8b415e1 100644
--- a/streampipes-backend/src/main/java/org/apache/streampipes/backend/StreamPipesResourceConfig.java
+++ b/streampipes-backend/src/main/java/org/apache/streampipes/backend/StreamPipesResourceConfig.java
@@ -103,7 +103,6 @@ public class StreamPipesResourceConfig extends ResourceConfig {
         register(DashboardWidget.class);
         register(Dashboard.class);
         register(VirtualSensor.class);
-        register(Visualization.class);
         register(VisualizablePipelineResource.class);
 
         // Serializers
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/CategoryResource.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/CategoryResource.java
index 25c6df6..5bc62d4 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/CategoryResource.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/CategoryResource.java
@@ -30,7 +30,7 @@ import javax.ws.rs.core.Response;
 import java.util.HashMap;
 import java.util.Map;
 
-@Path("/v2/users/{username}/labeling/category")
+@Path("/v2/labeling/category")
 public class CategoryResource extends AbstractRestResource {
 
 
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/ContainerProvidedOptions.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/ContainerProvidedOptions.java
index aabea60..59be7c5 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/ContainerProvidedOptions.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/ContainerProvidedOptions.java
@@ -29,7 +29,7 @@ import javax.ws.rs.Produces;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
-@Path("/v2/users/{username}/pe/options")
+@Path("/v2/pe/options")
 public class ContainerProvidedOptions extends AbstractRestResource {
 
   @POST
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/Visualization.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/Visualization.java
deleted file mode 100644
index f4570cb..0000000
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/Visualization.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.streampipes.rest.impl;
-
-import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
-
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-@Path("/v2/visualizations")
-public class Visualization extends AbstractRestResource {
-
-	@GET
-	@Produces(MediaType.APPLICATION_JSON)
-	public Response getRunningVisualizations() {
-		return ok(getVisualizationStorage().getRunningVisualizations());
-	}
-
-}
diff --git a/ui/src/app/core-ui/labels/services/label.service.ts b/ui/src/app/core-ui/labels/services/label.service.ts
index f03a017..9281166 100644
--- a/ui/src/app/core-ui/labels/services/label.service.ts
+++ b/ui/src/app/core-ui/labels/services/label.service.ts
@@ -29,7 +29,7 @@ export class LabelService {
   private bufferedLabels = [];
 
   urlBase() {
-    return this.platformServicesCommons.authUserBasePath();
+    return this.platformServicesCommons.apiBasePath();
   }
 
   constructor(
diff --git a/ui/src/app/core-ui/static-properties/static-runtime-resolvable-input/runtime-resolvable.service.ts b/ui/src/app/core-ui/static-properties/static-runtime-resolvable-input/runtime-resolvable.service.ts
index 085523b..1f95fe6 100644
--- a/ui/src/app/core-ui/static-properties/static-runtime-resolvable-input/runtime-resolvable.service.ts
+++ b/ui/src/app/core-ui/static-properties/static-runtime-resolvable-input/runtime-resolvable.service.ts
@@ -16,16 +16,16 @@
  *
  */
 
-import {Observable} from "rxjs";
+import { Observable } from 'rxjs';
 import {
   RuntimeOptionsRequest,
   RuntimeOptionsResponse
-} from "../../../core-model/gen/streampipes-model";
-import {map} from "rxjs/operators";
-import {HttpClient} from "@angular/common/http";
-import {AuthStatusService} from "../../../services/auth-status.service";
-import {PlatformServicesCommons} from "../../../platform-services/apis/commons.service";
-import {Injectable} from "@angular/core";
+} from '../../../core-model/gen/streampipes-model';
+import { map } from 'rxjs/operators';
+import { HttpClient } from '@angular/common/http';
+import { AuthStatusService } from '../../../services/auth-status.service';
+import { PlatformServicesCommons } from '../../../platform-services/apis/commons.service';
+import { Injectable } from '@angular/core';
 
 @Injectable()
 export class RuntimeResolvableService {
@@ -37,25 +37,25 @@ export class RuntimeResolvableService {
   }
 
   fetchRemoteOptionsForAdapter(resolvableOptionsParameterRequest: RuntimeOptionsRequest, adapterId: string): Observable<RuntimeOptionsResponse> {
-    let url: string = "/streampipes-backend/api/v2/connect/"
+    const url: string = '/streampipes-backend/api/v2/connect/'
         + this.authStatusService.email
-        + "/master/resolvable/"
+        + '/master/resolvable/'
         + encodeURIComponent(adapterId)
-        + "/configurations";
+        + '/configurations';
     return this.fetchRemoteOptions(url, resolvableOptionsParameterRequest);
   }
 
   fetchRemoteOptionsForPipelineElement(resolvableOptionsParameterRequest: RuntimeOptionsRequest): Observable<RuntimeOptionsResponse> {
-    let url: string = this.platformServicesCommons.authUserBasePath() + "/pe/options";
+    const url: string = this.platformServicesCommons.apiBasePath() + '/pe/options';
     return this.fetchRemoteOptions(url, resolvableOptionsParameterRequest);
   }
 
   fetchRemoteOptions(url, resolvableOptionsParameterRequest) {
-    resolvableOptionsParameterRequest["@class"] = "org.apache.streampipes.model.runtime.RuntimeOptionsRequest";
+    resolvableOptionsParameterRequest['@class'] = 'org.apache.streampipes.model.runtime.RuntimeOptionsRequest';
     return this.http.post(url, resolvableOptionsParameterRequest)
         .pipe(map(response => {
           return RuntimeOptionsResponse.fromData(response as RuntimeOptionsResponse);
         }));
   }
 
-}
\ No newline at end of file
+}
diff --git a/ui/src/app/services/rest-api.service.ts b/ui/src/app/services/rest-api.service.ts
index 33879c9..3cd3c20 100644
--- a/ui/src/app/services/rest-api.service.ts
+++ b/ui/src/app/services/rest-api.service.ts
@@ -201,16 +201,6 @@ export class RestApi {
         return this.$http.post(this.urlBase() +"/pipelinecategories", pipelineCategory);
     };
 
-    fetchRemoteOptions(resolvableOptionsParameterRequest) {
-        return this.$http.post(this.urlBase() +"/pe/options", resolvableOptionsParameterRequest);
-    }
-
-
-
-    updateDataSet(dataSet) {
-        return this.$http.post(this.urlBase() +"/pipelines/update/dataset", dataSet);
-    }
-
     startPipeline(pipelineId) {
         return this.$http.get(this.urlBase() +"/pipelines/" +pipelineId +"/start");
     }
@@ -365,10 +355,6 @@ export class RestApi {
         return this.$http.get(this.getServerUrl() + "/ontology/actions/" + encodeURIComponent(uri) +"?keepIds=" +keepIds);
     }
 
-    getRunningVisualizations() {
-        return this.$http.get(this.getServerUrl() + "/visualizations");
-    }
-
     getAllUnits() {
         return this.$http.get(this.getServerUrl() + "/units/instances");
     }

[incubator-streampipes] 05/12: [STREAMPIPES-427] Modify paths of dashboard and measurement unit resources

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

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

commit cde6123891d4873ee890d362c521a3d5f2ceaa85
Author: Dominik Riemer <ri...@fzi.de>
AuthorDate: Fri Sep 24 14:20:08 2021 +0200

    [STREAMPIPES-427] Modify paths of dashboard and measurement unit resources
---
 .../rest/impl/InternalPipelineTemplates.java       |  15 +-
 .../streampipes/rest/impl/LabelResource.java       |   2 +-
 .../rest/impl/MeasurementUnitResource.java         |   2 +-
 .../streampipes/rest/impl/dashboard/Dashboard.java |   2 +-
 .../rest/impl/dashboard/DashboardWidget.java       |   2 +-
 .../dashboard/VisualizablePipelineResource.java    |   2 +-
 ui/src/app/add/services/add.service.ts             |   3 +-
 ui/src/app/dashboard/services/dashboard.service.ts | 216 +++++++++++----------
 .../apis/measurement-units.service.ts              |  18 +-
 ui/src/app/platform-services/platform.module.ts    |  24 +--
 10 files changed, 143 insertions(+), 143 deletions(-)

diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/InternalPipelineTemplates.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/InternalPipelineTemplates.java
index e9cdbf4..d9aec41 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/InternalPipelineTemplates.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/InternalPipelineTemplates.java
@@ -25,7 +25,7 @@ import org.apache.streampipes.model.graph.DataSinkDescription;
 import org.apache.streampipes.model.pipeline.PipelineOperationStatus;
 import org.apache.streampipes.model.template.PipelineTemplateDescription;
 import org.apache.streampipes.model.template.PipelineTemplateInvocation;
-import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
+import org.apache.streampipes.rest.core.base.impl.AbstractAuthGuardedRestResource;
 import org.apache.streampipes.sdk.builder.BoundPipelineElementBuilder;
 import org.apache.streampipes.sdk.builder.PipelineTemplateBuilder;
 import org.apache.streampipes.storage.api.IPipelineElementDescriptionStorage;
@@ -33,7 +33,10 @@ import org.apache.streampipes.storage.management.StorageDispatcher;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import javax.ws.rs.*;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 import java.net.URISyntaxException;
@@ -42,8 +45,8 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-@Path("/v2/users/{username}/internal-pipelines")
-public class InternalPipelineTemplates extends AbstractRestResource {
+@Path("/v2/internal-pipelines")
+public class InternalPipelineTemplates extends AbstractAuthGuardedRestResource {
 
     private static final Logger LOG = LoggerFactory.getLogger(InternalPipelineTemplates.class);
     private Map<String, Template> templates;
@@ -76,12 +79,12 @@ public class InternalPipelineTemplates extends AbstractRestResource {
 
     @POST
     @Produces(MediaType.APPLICATION_JSON)
-    public Response generatePipeline(@PathParam("username") String username, String pipelineId) {
+    public Response generatePipeline(String pipelineId) {
         try {
             PipelineTemplateDescription pipelineTemplateDescription = templates.get(pipelineId).makeTemplate();
 
             PipelineTemplateInvocation invocation = Operations.getPipelineInvocationTemplate(getLogDataStream(), pipelineTemplateDescription);
-            PipelineOperationStatus status = Operations.handlePipelineTemplateInvocation(username, invocation, pipelineTemplateDescription);
+            PipelineOperationStatus status = Operations.handlePipelineTemplateInvocation(getAuthenticatedUsername(), invocation, pipelineTemplateDescription);
 
             return ok(status);
         } catch (URISyntaxException e) {
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/LabelResource.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/LabelResource.java
index 81332c5..0f80f59 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/LabelResource.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/LabelResource.java
@@ -30,7 +30,7 @@ import javax.ws.rs.core.Response;
 import java.util.HashMap;
 import java.util.Map;
 
-@Path("/v2/users/{username}/labeling/label")
+@Path("/v2/labeling/label")
 public class LabelResource extends AbstractRestResource {
 
     @GET
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/MeasurementUnitResource.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/MeasurementUnitResource.java
index 9b0814f..d0b6de1 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/MeasurementUnitResource.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/MeasurementUnitResource.java
@@ -28,7 +28,7 @@ import javax.ws.rs.Produces;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
-@Path("/v2/users/{username}/measurement-units")
+@Path("/v2/measurement-units")
 public class MeasurementUnitResource extends AbstractRestResource {
 
   @GET
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/dashboard/Dashboard.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/dashboard/Dashboard.java
index ffb3bab..10d449a 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/dashboard/Dashboard.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/dashboard/Dashboard.java
@@ -22,7 +22,7 @@ import org.apache.streampipes.storage.api.IDashboardStorage;
 
 import javax.ws.rs.Path;
 
-@Path("/v2/users/{username}/dashboard/dashboards")
+@Path("/v2/dashboard/dashboards")
 public class Dashboard extends AbstractDashboardResource {
 
     protected IDashboardStorage getDashboardStorage() {
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/dashboard/DashboardWidget.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/dashboard/DashboardWidget.java
index e4ac40b..a3e0095 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/dashboard/DashboardWidget.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/dashboard/DashboardWidget.java
@@ -27,7 +27,7 @@ import javax.ws.rs.*;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
-@Path("/v2/users/{username}/dashboard/widgets")
+@Path("/v2/dashboard/widgets")
 public class DashboardWidget extends AbstractRestResource {
 
   @GET
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/dashboard/VisualizablePipelineResource.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/dashboard/VisualizablePipelineResource.java
index 9d0492a..70ce929 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/dashboard/VisualizablePipelineResource.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/dashboard/VisualizablePipelineResource.java
@@ -31,7 +31,7 @@ import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 import java.util.ArrayList;
 
-@Path("/v2/users/{username}/dashboard/pipelines")
+@Path("/v2/dashboard/pipelines")
 public class VisualizablePipelineResource extends AbstractPipelineExtractionResource<VisualizablePipeline> {
 
   private static final String DashboardAppId = "org.apache.streampipes.sinks.internal.jvm.dashboard";
diff --git a/ui/src/app/add/services/add.service.ts b/ui/src/app/add/services/add.service.ts
index f8b2577..2be78dc 100644
--- a/ui/src/app/add/services/add.service.ts
+++ b/ui/src/app/add/services/add.service.ts
@@ -27,7 +27,6 @@ import { ExtensionsServiceEndpointItem } from '../../core-model/gen/streampipes-
 @Injectable()
 export class AddService {
 
-
   constructor(private http: HttpClient,
               private authStatusService: AuthStatusService,
               private platformServicesCommons: PlatformServicesCommons) {
@@ -56,6 +55,6 @@ export class AddService {
 
   getRdfEndpointIcon(item: ExtensionsServiceEndpointItem): Observable<any> {
     return this.http.post(this.platformServicesCommons.apiBasePath()
-        + '/rdfendpoints/items/icon', item, { responseType: 'blob' });
+        + '/rdfendpoints/items/icon', item, {responseType: 'blob'});
   }
 }
diff --git a/ui/src/app/dashboard/services/dashboard.service.ts b/ui/src/app/dashboard/services/dashboard.service.ts
index 8297bc8..b436658 100644
--- a/ui/src/app/dashboard/services/dashboard.service.ts
+++ b/ui/src/app/dashboard/services/dashboard.service.ts
@@ -16,122 +16,124 @@
  *
  */
 
-import {HttpClient} from "@angular/common/http";
-import {Injectable} from "@angular/core";
-import {map} from "rxjs/operators";
-import {Observable} from "rxjs";
-import {AuthStatusService} from "../../services/auth-status.service";
-import {Dashboard} from "../models/dashboard.model";
-import {MeasurementUnit} from "../../core-model/measurement-unit/MeasurementUnit";
+import { HttpClient } from '@angular/common/http';
+import { Injectable } from '@angular/core';
+import { map } from 'rxjs/operators';
+import { Observable } from 'rxjs';
+import { AuthStatusService } from '../../services/auth-status.service';
+import { Dashboard } from '../models/dashboard.model';
+import { MeasurementUnit } from '../../core-model/measurement-unit/MeasurementUnit';
 import {
-    DashboardWidgetModel,
-    Pipeline,
-    VisualizablePipeline
-} from "../../core-model/gen/streampipes-model";
+  DashboardWidgetModel,
+  Pipeline,
+  VisualizablePipeline
+} from '../../core-model/gen/streampipes-model';
+import { PlatformServicesCommons } from '../../platform-services/apis/commons.service';
 
 @Injectable()
 export class DashboardService {
 
 
-    constructor(private http: HttpClient, 
-                private authStatusService: AuthStatusService) {
-    }
+  constructor(private http: HttpClient,
+              private authStatusService: AuthStatusService,
+              private platformServicesCommons: PlatformServicesCommons) {
+  }
 
-    getPipelineById(id: string): Observable<Pipeline> {
-        return this.http.get(this.pipelinesUrl + "/" +id).pipe(map(data => {
-            return Pipeline.fromData(data as any);
-        }));
-    }
-
-    getVisualizablePipelines(): Observable<Array<VisualizablePipeline>> {
-        return this.http
-            .get(this.visualizablePipelineUrl)
-            .pipe(map(data => {
-                return (data as []).map(p => VisualizablePipeline.fromData(p as VisualizablePipeline));
-            }));
-    }
-
-    getVisualizablePipelineByPipelineIdAndVisualizationName(pipelineId: string, visualizationName: string): Observable<VisualizablePipeline> {
-        return this.http
-            .get(this.visualizablePipelineUrl + "/" + pipelineId + "/" + visualizationName)
-            .pipe(map(data => {
-                return VisualizablePipeline.fromData(data as VisualizablePipeline);
-            }));
-    }
-
-    getDashboards(): Observable<Array<Dashboard>> {
-        return this.http.get(this.dashboardUrl).pipe(map(data => {
-           return data as Dashboard[];
-        }));
-    }
-
-    getDashboard(dashboardId: string): Observable<Dashboard> {
-        return this.http.get(this.dashboardUrl + "/" +dashboardId).pipe(map(data => {
-            return data as Dashboard;
-        }));
-    }
-
-    getMeasurementUnitInfo(measurementUnitResource: string): Observable<MeasurementUnit> {
-        return this.http.get(this.measurementUnitsUrl  + "/" + encodeURIComponent(measurementUnitResource)).pipe(map(data => {
-            return data as MeasurementUnit
-        }));
-    }
-
-    updateDashboard(dashboard: Dashboard): Observable<Dashboard> {
-        return this.http.put(this.dashboardUrl + "/" +dashboard._id, dashboard).pipe(map(data => {
-            return data as Dashboard;
-        }));
-    }
-
-    deleteDashboard(dashboard: Dashboard): Observable<any> {
-        return this.http.delete(this.dashboardUrl + "/" +dashboard._id);
-    }
+  getPipelineById(id: string): Observable<Pipeline> {
+    return this.http.get(this.pipelinesUrl + '/' + id).pipe(map(data => {
+      return Pipeline.fromData(data as any);
+    }));
+  }
 
-    saveDashboard(dashboard: Dashboard): Observable<any> {
-        return this.http.post(this.dashboardUrl, dashboard);
-    }
-
-    private get baseUrl() {
-        return '/streampipes-backend';
-    }
-
-    private get measurementUnitsUrl() {
-        return this.baseUrl + '/api/v2/users/' + this.authStatusService.email + '/measurement-units'
-    }
-
-    private get dashboardUrl() {
-        return this.baseUrl + '/api/v2/users/' + this.authStatusService.email + '/dashboard/dashboards'
-    }
-
-    private get pipelinesUrl() {
-        return this.baseUrl + '/api/v2/users/' + this.authStatusService.email + '/pipelines'
-    }
-
-    private get dashboardWidgetUrl() {
-        return this.baseUrl + '/api/v2/users/' + this.authStatusService.email + '/dashboard/widgets'
-    }
-
-    private get visualizablePipelineUrl() {
-        return this.baseUrl + '/api/v2/users/' + this.authStatusService.email + '/dashboard/pipelines'
-    }
-
-    getWidget(widgetId: string): Observable<DashboardWidgetModel> {
-        return this.http.get(this.dashboardWidgetUrl + "/" +widgetId).pipe(map(d => {
-            return DashboardWidgetModel.fromData(d as DashboardWidgetModel)
+  getVisualizablePipelines(): Observable<VisualizablePipeline[]> {
+    return this.http
+        .get(this.visualizablePipelineUrl)
+        .pipe(map(data => {
+          return (data as []).map(p => VisualizablePipeline.fromData(p as VisualizablePipeline));
         }));
-    }
+  }
 
-    saveWidget(widget: DashboardWidgetModel): Observable<DashboardWidgetModel> {
-        return this.http.post(this.dashboardWidgetUrl, widget).pipe(map(response => {
-            return DashboardWidgetModel.fromData(response as DashboardWidgetModel);
+  getVisualizablePipelineByPipelineIdAndVisualizationName(pipelineId: string, visualizationName: string): Observable<VisualizablePipeline> {
+    return this.http
+        .get(this.visualizablePipelineUrl + '/' + pipelineId + '/' + visualizationName)
+        .pipe(map(data => {
+          return VisualizablePipeline.fromData(data as VisualizablePipeline);
         }));
-    }
-
-    deleteWidget(widgetId: string): Observable<any> {
-        return this.http.delete(this.dashboardWidgetUrl + "/" +widgetId);
-    }
-
-    updateWidget(widget: DashboardWidgetModel): Observable<any> {
-        return this.http.put(this.dashboardWidgetUrl + "/" +widget._id, widget);
-    }
+  }
+
+  getDashboards(): Observable<Dashboard[]> {
+    return this.http.get(this.dashboardUrl).pipe(map(data => {
+      return data as Dashboard[];
+    }));
+  }
+
+  getDashboard(dashboardId: string): Observable<Dashboard> {
+    return this.http.get(this.dashboardUrl + '/' + dashboardId).pipe(map(data => {
+      return data as Dashboard;
+    }));
+  }
+
+  getMeasurementUnitInfo(measurementUnitResource: string): Observable<MeasurementUnit> {
+    return this.http.get(this.measurementUnitsUrl + '/' + encodeURIComponent(measurementUnitResource)).pipe(map(data => {
+      return data as MeasurementUnit;
+    }));
+  }
+
+  updateDashboard(dashboard: Dashboard): Observable<Dashboard> {
+    return this.http.put(this.dashboardUrl + '/' + dashboard._id, dashboard).pipe(map(data => {
+      return data as Dashboard;
+    }));
+  }
+
+  deleteDashboard(dashboard: Dashboard): Observable<any> {
+    return this.http.delete(this.dashboardUrl + '/' + dashboard._id);
+  }
+
+  saveDashboard(dashboard: Dashboard): Observable<any> {
+    return this.http.post(this.dashboardUrl, dashboard);
+  }
+
+  private get baseUrl() {
+    return this.platformServicesCommons.apiBasePath();
+  }
+
+  private get measurementUnitsUrl() {
+    return this.baseUrl + '/measurement-units';
+  }
+
+  private get dashboardUrl() {
+    return this.baseUrl + '/dashboard/dashboards';
+  }
+
+  private get pipelinesUrl() {
+    return this.baseUrl + '/pipelines';
+  }
+
+  private get dashboardWidgetUrl() {
+    return this.baseUrl + '/dashboard/widgets';
+  }
+
+  private get visualizablePipelineUrl() {
+    return this.baseUrl + '/dashboard/pipelines';
+  }
+
+  getWidget(widgetId: string): Observable<DashboardWidgetModel> {
+    return this.http.get(this.dashboardWidgetUrl + '/' + widgetId).pipe(map(d => {
+      return DashboardWidgetModel.fromData(d as DashboardWidgetModel);
+    }));
+  }
+
+  saveWidget(widget: DashboardWidgetModel): Observable<DashboardWidgetModel> {
+    return this.http.post(this.dashboardWidgetUrl, widget).pipe(map(response => {
+      return DashboardWidgetModel.fromData(response as DashboardWidgetModel);
+    }));
+  }
+
+  deleteWidget(widgetId: string): Observable<any> {
+    return this.http.delete(this.dashboardWidgetUrl + '/' + widgetId);
+  }
+
+  updateWidget(widget: DashboardWidgetModel): Observable<any> {
+    return this.http.put(this.dashboardWidgetUrl + '/' + widget._id, widget);
+  }
 }
diff --git a/ui/src/app/platform-services/apis/measurement-units.service.ts b/ui/src/app/platform-services/apis/measurement-units.service.ts
index 1cc3140..65b3e75 100644
--- a/ui/src/app/platform-services/apis/measurement-units.service.ts
+++ b/ui/src/app/platform-services/apis/measurement-units.service.ts
@@ -16,24 +16,20 @@
  *
  */
 
-import {Injectable} from "@angular/core";
-import {HttpClient, HttpEvent, HttpParams, HttpRequest} from "@angular/common/http";
-import {PlatformServicesCommons} from "./commons.service";
-import {Observable} from "rxjs";
-import {map} from "rxjs/operators";
-import {FileMetadata} from "../../core-model/gen/streampipes-model-client";
-import {Pipeline} from "../../core-model/gen/streampipes-model";
+import { Injectable } from '@angular/core';
+import { HttpClient } from '@angular/common/http';
+import { PlatformServicesCommons } from './commons.service';
+import { Observable } from 'rxjs';
+import { map } from 'rxjs/operators';
 
 @Injectable()
 export class MeasurementUnitsService {
 
   constructor(private http: HttpClient,
-              private platformServicesCommons: PlatformServicesCommons) {
-
-  }
+              private platformServicesCommons: PlatformServicesCommons) { }
 
   getAllMeasurementUnits(): Observable<any> {
-    return this.http.get(this.platformServicesCommons.authUserBasePath() + "/measurement-units").pipe(map(response => {
+    return this.http.get(this.platformServicesCommons.apiBasePath() + '/measurement-units').pipe(map(response => {
       return response;
     }));
   }
diff --git a/ui/src/app/platform-services/platform.module.ts b/ui/src/app/platform-services/platform.module.ts
index 85800cd..6177e6d 100644
--- a/ui/src/app/platform-services/platform.module.ts
+++ b/ui/src/app/platform-services/platform.module.ts
@@ -16,17 +16,17 @@
  *
  */
 
-import {NgModule} from '@angular/core';
-import {PipelineElementService} from "./apis/pipeline-element.service";
-import {PipelineService} from "./apis/pipeline.service";
-import {PlatformServicesCommons} from "./apis/commons.service";
-import {PipelineElementEndpointService} from "./apis/pipeline-element-endpoint.service";
-import {FilesService} from "./apis/files.service";
-import {MeasurementUnitsService} from "./apis/measurement-units.service";
-import {PipelineElementTemplateService} from "./apis/pipeline-element-template.service";
-import {PipelineMonitoringService} from "./apis/pipeline-monitoring.service";
-import {SemanticTypesService} from "./apis/semantic-types.service";
-import {PipelineCanvasMetadataService} from "./apis/pipeline-canvas-metadata.service";
+import { NgModule } from '@angular/core';
+import { PipelineElementService } from './apis/pipeline-element.service';
+import { PipelineService } from './apis/pipeline.service';
+import { PlatformServicesCommons } from './apis/commons.service';
+import { PipelineElementEndpointService } from './apis/pipeline-element-endpoint.service';
+import { FilesService } from './apis/files.service';
+import { MeasurementUnitsService } from './apis/measurement-units.service';
+import { PipelineElementTemplateService } from './apis/pipeline-element-template.service';
+import { PipelineMonitoringService } from './apis/pipeline-monitoring.service';
+import { SemanticTypesService } from './apis/semantic-types.service';
+import { PipelineCanvasMetadataService } from './apis/pipeline-canvas-metadata.service';
 
 @NgModule({
   imports: [],
@@ -38,7 +38,7 @@ import {PipelineCanvasMetadataService} from "./apis/pipeline-canvas-metadata.ser
     PipelineCanvasMetadataService,
     PipelineElementEndpointService,
     PipelineElementTemplateService,
-    //PipelineTemplateService,
+    // PipelineTemplateService,
     PipelineElementService,
     PipelineMonitoringService,
     PipelineService,

[incubator-streampipes] 07/12: [STREAMPIPES-427] Modify paths of file resource

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

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

commit 08ec202a66be22f7d53f957515477f045d92527a
Author: Dominik Riemer <ri...@fzi.de>
AuthorDate: Fri Sep 24 14:38:26 2021 +0200

    [STREAMPIPES-427] Modify paths of file resource
---
 .../streampipes/rest/impl/PipelineElementFile.java |  11 +-
 .../file-overview/file-overview.component.ts       |  35 +--
 .../file-upload/file-upload-dialog.component.ts    |  20 +-
 ui/src/app/platform-services/apis/files.service.ts |  28 +-
 ui/src/app/services/rest-api.service.ts            | 350 ++++++---------------
 5 files changed, 144 insertions(+), 300 deletions(-)

diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineElementFile.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineElementFile.java
index e57a26d..e27d16e 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineElementFile.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineElementFile.java
@@ -19,7 +19,7 @@ package org.apache.streampipes.rest.impl;
 
 import org.apache.streampipes.manager.file.FileManager;
 import org.apache.streampipes.model.client.file.FileMetadata;
-import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
+import org.apache.streampipes.rest.core.base.impl.AbstractAuthGuardedRestResource;
 import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
 import org.glassfish.jersey.media.multipart.FormDataParam;
 
@@ -28,16 +28,15 @@ import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 import java.io.InputStream;
 
-@Path("/v2/users/{username}/files")
-public class PipelineElementFile extends AbstractRestResource {
+@Path("/v2/files")
+public class PipelineElementFile extends AbstractAuthGuardedRestResource {
 
   @POST
   @Consumes(MediaType.MULTIPART_FORM_DATA)
-  public Response storeFile(@PathParam("username") String username,
-                            @FormDataParam("file_upload") InputStream uploadedInputStream,
+  public Response storeFile(@FormDataParam("file_upload") InputStream uploadedInputStream,
                             @FormDataParam("file_upload") FormDataContentDisposition fileDetail) {
     try {
-      FileMetadata metadata = FileManager.storeFile(username, fileDetail.getFileName(), uploadedInputStream);
+      FileMetadata metadata = FileManager.storeFile(getAuthenticatedUsername(), fileDetail.getFileName(), uploadedInputStream);
       return ok(metadata);
     } catch (Exception e) {
       return fail();
diff --git a/ui/src/app/files/components/file-overview/file-overview.component.ts b/ui/src/app/files/components/file-overview/file-overview.component.ts
index 80f53f7..06a6c56 100644
--- a/ui/src/app/files/components/file-overview/file-overview.component.ts
+++ b/ui/src/app/files/components/file-overview/file-overview.component.ts
@@ -16,14 +16,13 @@
  *
  */
 
-import {Component, OnInit, ViewChild} from "@angular/core";
-import {FilesService} from "../../../platform-services/apis/files.service";
-import {FileMetadata} from "../../../core-model/gen/streampipes-model-client";
-import {MatTableDataSource} from "@angular/material/table";
-import {MatPaginator} from "@angular/material/paginator";
-import {DialogService} from "../../../core-ui/dialog/base-dialog/base-dialog.service";
-import {ConfirmDialogComponent} from "../../../core-ui/dialog/confirm-dialog/confirm-dialog.component";
-import {MatDialog} from "@angular/material/dialog";
+import { Component, OnInit, ViewChild } from '@angular/core';
+import { FilesService } from '../../../platform-services/apis/files.service';
+import { FileMetadata } from '../../../core-model/gen/streampipes-model-client';
+import { MatTableDataSource } from '@angular/material/table';
+import { MatPaginator } from '@angular/material/paginator';
+import { ConfirmDialogComponent } from '../../../core-ui/dialog/confirm-dialog/confirm-dialog.component';
+import { MatDialog } from '@angular/material/dialog';
 
 @Component({
   selector: 'file-overview',
@@ -35,10 +34,10 @@ export class FileOverviewComponent implements OnInit {
   displayedColumns: string[] = ['filename', 'filetype', 'uploaded', 'action'];
 
   dataSource: MatTableDataSource<FileMetadata>;
-  filesAvailable: boolean = false;
+  filesAvailable = false;
 
   @ViewChild(MatPaginator) paginator: MatPaginator;
-  pageSize: number = 1;
+  pageSize = 1;
 
   constructor(private filesService: FilesService,
               private dialog: MatDialog) {
@@ -60,14 +59,14 @@ export class FileOverviewComponent implements OnInit {
   }
 
   deleteFile(fileMetadata: FileMetadata) {
-    let dialogRef = this.dialog.open(ConfirmDialogComponent, {
+    const dialogRef = this.dialog.open(ConfirmDialogComponent, {
       width: '500px',
       data: {
-        "title": "Do you really want to delete this file?",
-        "subtitle": "This cannot be undone.",
-        "cancelTitle": "No",
-        "okTitle": "Yes",
-        "confirmAndCancel": true
+        'title': 'Do you really want to delete this file?',
+        'subtitle': 'This cannot be undone.',
+        'cancelTitle': 'No',
+        'okTitle': 'Yes',
+        'confirmAndCancel': true
       },
     });
 
@@ -77,6 +76,6 @@ export class FileOverviewComponent implements OnInit {
           this.refreshFiles();
         });
       }
-    })
+    });
   }
-}
\ No newline at end of file
+}
diff --git a/ui/src/app/files/dialog/file-upload/file-upload-dialog.component.ts b/ui/src/app/files/dialog/file-upload/file-upload-dialog.component.ts
index 52b5ffa..d0ebec8 100644
--- a/ui/src/app/files/dialog/file-upload/file-upload-dialog.component.ts
+++ b/ui/src/app/files/dialog/file-upload/file-upload-dialog.component.ts
@@ -16,10 +16,10 @@
  *
  */
 
-import {Component, OnInit} from '@angular/core';
-import {DialogRef} from "../../../core-ui/dialog/base-dialog/dialog-ref";
-import {HttpEventType, HttpResponse} from "@angular/common/http";
-import {FilesService} from "../../../platform-services/apis/files.service";
+import { Component, OnInit } from '@angular/core';
+import { DialogRef } from '../../../core-ui/dialog/base-dialog/dialog-ref';
+import { HttpEventType, HttpResponse } from '@angular/common/http';
+import { FilesService } from '../../../platform-services/apis/files.service';
 
 @Component({
   selector: 'file-upload-dialog-component',
@@ -28,13 +28,13 @@ import {FilesService} from "../../../platform-services/apis/files.service";
 })
 export class FileUploadDialogComponent implements OnInit {
 
-  inputValue: String;
-  fileName: String;
+  inputValue: string;
+  fileName: string;
 
   selectedUploadFile: File;
 
-  hasInput: Boolean;
-  errorMessage = "Please enter a value";
+  hasInput: boolean;
+  errorMessage = 'Please enter a value';
 
   uploadStatus = 0;
 
@@ -57,7 +57,7 @@ export class FileUploadDialogComponent implements OnInit {
     if (this.selectedUploadFile !== undefined) {
       this.filesService.uploadFile(this.selectedUploadFile).subscribe(
           event => {
-            if (event.type == HttpEventType.UploadProgress) {
+            if (event.type === HttpEventType.UploadProgress) {
               this.uploadStatus = Math.round(100 * event.loaded / event.total);
             } else if (event instanceof HttpResponse) {
               this.dialogRef.close();
@@ -73,4 +73,4 @@ export class FileUploadDialogComponent implements OnInit {
     this.dialogRef.close();
   }
 
-}
\ No newline at end of file
+}
diff --git a/ui/src/app/platform-services/apis/files.service.ts b/ui/src/app/platform-services/apis/files.service.ts
index 017f193..480cc55 100644
--- a/ui/src/app/platform-services/apis/files.service.ts
+++ b/ui/src/app/platform-services/apis/files.service.ts
@@ -16,12 +16,12 @@
  *
  */
 
-import {Injectable} from "@angular/core";
-import {HttpClient, HttpEvent, HttpParams, HttpRequest} from "@angular/common/http";
-import {PlatformServicesCommons} from "./commons.service";
-import {Observable} from "rxjs";
-import {map} from "rxjs/operators";
-import {FileMetadata} from "../../core-model/gen/streampipes-model-client";
+import { Injectable } from '@angular/core';
+import { HttpClient, HttpEvent, HttpParams, HttpRequest } from '@angular/common/http';
+import { PlatformServicesCommons } from './commons.service';
+import { Observable } from 'rxjs';
+import { map } from 'rxjs/operators';
+import { FileMetadata } from '../../core-model/gen/streampipes-model-client';
 
 @Injectable()
 export class FilesService {
@@ -35,29 +35,29 @@ export class FilesService {
     const data: FormData = new FormData();
     data.append('file_upload', file, file.name);
 
-    let params = new HttpParams();
+    const params = new HttpParams();
     const options = {
-      params: params,
+      params,
       reportProgress: true,
     };
 
-    const req = new HttpRequest('POST', this.platformServicesCommons.authUserBasePath() + "/files", data, options);
+    const req = new HttpRequest('POST', this.platformServicesCommons.apiBasePath() + '/files', data, options);
     return this.http.request(req);
   }
 
   getFileMetadata(requiredFiletypes?: string[]): Observable<FileMetadata[]> {
-    let requiredFiletypeAppendix: string = "";
+    let requiredFiletypeAppendix = '';
     if (requiredFiletypes && requiredFiletypes.length > 0) {
-      requiredFiletypeAppendix = "?filetypes=" + requiredFiletypes.join();
+      requiredFiletypeAppendix = '?filetypes=' + requiredFiletypes.join();
     }
     return this.http
-        .get(this.platformServicesCommons.authUserBasePath() + "/files" + requiredFiletypeAppendix)
+        .get(this.platformServicesCommons.apiBasePath() + '/files' + requiredFiletypeAppendix)
         .pipe(map(response => {
           return (response as any[]).map(fm => FileMetadata.fromData(fm));
         }));
   }
 
   deleteFile(fileId: string) {
-    return this.http.delete(this.platformServicesCommons.authUserBasePath() + "/files/" + fileId);
+    return this.http.delete(this.platformServicesCommons.apiBasePath() + '/files/' + fileId);
   }
-}
\ No newline at end of file
+}
diff --git a/ui/src/app/services/rest-api.service.ts b/ui/src/app/services/rest-api.service.ts
index 00e9abe..dbf50c4 100644
--- a/ui/src/app/services/rest-api.service.ts
+++ b/ui/src/app/services/rest-api.service.ts
@@ -16,24 +16,23 @@
  *
  */
 
-//import _ from 'lodash';
+// import _ from 'lodash';
 
 
-import {Injectable} from "@angular/core";
-import {AuthStatusService} from "./auth-status.service";
-import {PlatformServicesCommons} from "../platform-services/apis/commons.service";
-import {HttpClient} from "@angular/common/http";
-import {Observable} from "rxjs";
+import { Injectable } from '@angular/core';
+import { AuthStatusService } from './auth-status.service';
+import { PlatformServicesCommons } from '../platform-services/apis/commons.service';
+import { HttpClient } from '@angular/common/http';
+import { Observable } from 'rxjs';
 
 @Injectable()
 export class RestApi {
 
     encodeURIComponent: any;
-    
-    constructor (private AuthStatusService: AuthStatusService,
+
+    constructor (private authStatusService: AuthStatusService,
                  private platformServicesCommons: PlatformServicesCommons,
                  private $http: HttpClient) {
-        this.AuthStatusService = AuthStatusService;
     }
 
     getServerUrl() {
@@ -42,22 +41,14 @@ export class RestApi {
 
     urlBase() {
         return this.platformServicesCommons.authUserBasePath();
-    };
+    }
 
     urlApiBase() {
         return this.platformServicesCommons.apiBasePath();
     }
 
     getAssetUrl(appId) {
-        return this.getServerUrl() +"/pe/" +appId +"/assets";
-    }
-
-    getFileUrl(appId) {
-        return this.getServerUrl() + "/pe/" + appId + "/file"
-    }
-
-    getUserDetails() {
-        return this.$http.get(this.urlBase());
+        return this.getServerUrl() + '/pe/' + appId + '/assets';
     }
 
     updateUserDetails(user) {
@@ -65,406 +56,261 @@ export class RestApi {
     }
 
     getBlocks() {
-        return this.$http.get(this.urlBase() + "/block");
-    };
-    saveBlock(block) {
-        return this.$http.post(this.urlBase() + "/block", block);
-    };
+        return this.$http.get(this.urlBase() + '/block');
+    }
 
     getOwnActions() {
-        return this.$http.get(this.urlBase() +"/actions/own");
-    };
+        return this.$http.get(this.urlBase() + '/actions/own');
+    }
 
     getAvailableActions() {
-        return this.$http.get(this.urlBase() +"/actions/available");
-    };
+        return this.$http.get(this.urlBase() + '/actions/available');
+    }
 
     getPreferredActions() {
-        return this.$http.get(this.urlBase() +"/actions/favorites");
-    };
-
-    // addPreferredAction(elementUri) {
-    //     return this.$http({
-    //         method: 'POST',
-    //         url: this.urlBase() + "/actions/favorites",
-    //         data: $.param({uri: elementUri}),
-    //         headers: {'Content-Type': 'application/x-www-form-urlencoded'}
-    //     })
-    // }
-    //
-    // removePreferredAction(elementUri) {
-    //     return this.$http({
-    //         method: 'DELETE',
-    //         url: this.urlBase() + "/actions/favorites/" + encodeURIComponent(elementUri)
-    //     })
-    // }
+        return this.$http.get(this.urlBase() + '/actions/favorites');
+    }
 
     getOwnSepas() {
-        return this.$http.get(this.urlBase() +"/sepas/own");
-    };
+        return this.$http.get(this.urlBase() + '/sepas/own');
+    }
 
     getAvailableSepas() {
-        return this.$http.get(this.urlBase() +"/sepas/available");
-    };
+        return this.$http.get(this.urlBase() + '/sepas/available');
+    }
 
     getPreferredSepas() {
-        return this.$http.get(this.urlBase() +"/sepas/favorites");
-    };
-
-    // addPreferredSepa(elementUri) {
-    //     return this.$http({
-    //         method: 'POST',
-    //         url: this.urlBase() + "/sepas/favorites",
-    //         data: $.param({uri: elementUri}),
-    //         headers: {'Content-Type': 'application/x-www-form-urlencoded'}
-    //     })
-    // }
-    //
-    // removePreferredSepa(elementUri) {
-    //     return this.$http({
-    //         method: 'DELETE',
-    //         url: this.urlBase() + "/sepas/favorites/" + encodeURIComponent(elementUri)
-    //     })
-    // }
+        return this.$http.get(this.urlBase() + '/sepas/favorites');
+    }
 
     getOwnSources(): Observable<any> {
-        return this.$http.get(this.urlBase() +"/sources/own");
-    };
+        return this.$http.get(this.urlBase() + '/sources/own');
+    }
 
     getAvailableSources() {
-        return this.$http.get(this.urlBase() +"/sources/available");
-    };
+        return this.$http.get(this.urlBase() + '/sources/available');
+    }
 
     getPreferredSources() {
-        return this.$http.get(this.urlBase() +"/sources/favorites");
-    };
-
-    // addPreferredSource(elementUri) {
-    //     return this.$http({
-    //         method: 'POST',
-    //         url: this.urlBase() + "/sources/favorites",
-    //         data: $.param({uri: elementUri}),
-    //         headers: {'Content-Type': 'application/x-www-form-urlencoded'}
-    //     })
-    // }
-    //
-    // removePreferredSource(elementUri) {
-    //     return this.$http({
-    //         method: 'DELETE',
-    //         url: this.urlBase() + "/sources/favorites/" + encodeURIComponent(elementUri)
-    //     })
-    // }
-
-    getOwnStreams(source){
-        return this.$http.get(this.urlBase() + "/sources/" + encodeURIComponent(source.uri) + "/streams");
-
-    };
+        return this.$http.get(this.urlBase() + '/sources/favorites');
+    }
+
+    getOwnStreams(source) {
+        return this.$http.get(this.urlBase() + '/sources/' + encodeURIComponent(source.uri) + '/streams');
+
+    }
 
     jsonld(elementUri) {
-        return this.$http.get(this.urlBase() +"/element/" + encodeURIComponent(elementUri) +"/jsonld");
+        return this.$http.get(this.urlBase() + '/element/' + encodeURIComponent(elementUri) + '/jsonld');
     }
 
     configured(): Observable<any> {
-        return this.$http.get(this.getServerUrl() + "/setup/configured", {
+        return this.$http.get(this.getServerUrl() + '/setup/configured', {
             headers: { ignoreLoadingBar: '' }
         });
     }
 
-    getConfiguration() {
-        return this.$http.get(this.getServerUrl() +"/setup/configuration");
-        //return this.$http.get(this.getServerUrl() +"/semantic-epa-backend/api/v2/setup/configured");
-    }
-
     updateConfiguration(config) {
-        return this.$http.put(this.getServerUrl() +"/setup/configuration", config);
-        //return this.$http.get(this.getServerUrl() +"/semantic-epa-backend/api/v2/setup/configured");
-    };
+        return this.$http.put(this.getServerUrl() + '/setup/configuration', config);
+        // return this.$http.get(this.getServerUrl() +"/semantic-epa-backend/api/v2/setup/configured");
+    }
 
     getOwnPipelines(): Observable<any> {
-        return this.$http.get(this.urlBase() +"/pipelines/own");
-        //return this.$http.get("/semantic-epa-backend/api/pipelines");
-    };
-
-    getSystemPipelines() {
-        return this.$http.get(this.urlBase() +"/pipelines/system");
-    };
+        return this.$http.get(this.urlBase() + '/pipelines/own');
+        // return this.$http.get("/semantic-epa-backend/api/pipelines");
+    }
 
     storePipeline(pipeline) {
-        return this.$http.post(this.urlBase() +"/pipelines", pipeline);
+        return this.$http.post(this.urlBase() + '/pipelines', pipeline);
     }
 
     updateStream(stream) {
-        return this.$http.post(this.urlBase() +"/streams/update", stream);
+        return this.$http.post(this.urlBase() + '/streams/update', stream);
     }
 
     getPipelineCategories() {
-        return this.$http.get(this.urlBase() +"/pipelinecategories");
-    };
+        return this.$http.get(this.urlBase() + '/pipelinecategories');
+    }
 
     storePipelineCategory(pipelineCategory) {
-        return this.$http.post(this.urlBase() +"/pipelinecategories", pipelineCategory);
-    };
+        return this.$http.post(this.urlBase() + '/pipelinecategories', pipelineCategory);
+    }
 
     startPipeline(pipelineId) {
-        return this.$http.get(this.urlBase() +"/pipelines/" +pipelineId +"/start");
+        return this.$http.get(this.urlBase() + '/pipelines/' + pipelineId + '/start');
     }
 
     stopPipeline(pipelineId) {
-        return this.$http.get(this.urlBase() +"/pipelines/" +pipelineId +"/stop");
+        return this.$http.get(this.urlBase() + '/pipelines/' + pipelineId + '/stop');
     }
 
     getPipelineById(pipelineId) {
-        return this.$http.get(this.urlBase() + "/pipelines/" + pipelineId);
+        return this.$http.get(this.urlBase() + '/pipelines/' + pipelineId);
     }
 
     getPipelineStatusById(pipelineId) {
-        return this.$http.get(this.urlBase() + "/pipelines/" + pipelineId +"/status");
-    }
-
-    updatePipeline(pipeline){
-        var pipelineId = pipeline._id;
-        return this.$http.put(this.urlBase() + "/pipelines/" + pipelineId, pipeline);
+        return this.$http.get(this.urlBase() + '/pipelines/' + pipelineId + '/status');
     }
 
     getNotifications() {
-        return this.$http.get(this.urlApiBase() +"/notifications");
+        return this.$http.get(this.urlApiBase() + '/notifications');
     }
 
     getUnreadNotificationsCount(): Observable<any> {
-        return this.$http.get(this.urlApiBase() +"/notifications/count");
+        return this.$http.get(this.urlApiBase() + '/notifications/count');
     }
 
     getUnreadNotifications() {
-        return this.$http.get(this.urlApiBase() +"/notifications/unread");
+        return this.$http.get(this.urlApiBase() + '/notifications/unread');
     }
 
     getSepaById(elementId) {
-        return this.$http.get(this.urlBase() +"/sepas/" + encodeURIComponent(elementId));
+        return this.$http.get(this.urlBase() + '/sepas/' + encodeURIComponent(elementId));
     }
 
-    getActionById(elementId) {
-        return this.$http.get(this.urlBase() +"/actions/" + encodeURIComponent(elementId));
-    };
-
     getOntologyProperties() {
-        return this.$http.get( this.getServerUrl() + "/ontology/properties");
-    };
+        return this.$http.get( this.getServerUrl() + '/ontology/properties');
+    }
 
     getOntologyPropertyDetails(propertyId) {
-        return this.$http.get(this.getServerUrl() + "/ontology/properties/" + encodeURIComponent(propertyId));
+        return this.$http.get(this.getServerUrl() + '/ontology/properties/' + encodeURIComponent(propertyId));
     }
 
     addOntologyProperty(propertyData) {
-        return this.$http.post(this.getServerUrl() + "/ontology/properties", propertyData);
+        return this.$http.post(this.getServerUrl() + '/ontology/properties', propertyData);
     }
 
     getOntologyConcepts() {
-        return this.$http.get(this.getServerUrl() + "/ontology/types");
-    };
+        return this.$http.get(this.getServerUrl() + '/ontology/types');
+    }
 
     getOntologyConceptDetails(conceptId) {
-        return this.$http.get(this.getServerUrl() + "/ontology/types/" + encodeURIComponent(conceptId));
+        return this.$http.get(this.getServerUrl() + '/ontology/types/' + encodeURIComponent(conceptId));
     }
 
     getOntologyNamespaces() {
-        return this.$http.get(this.getServerUrl() + "/ontology/namespaces");
+        return this.$http.get(this.getServerUrl() + '/ontology/namespaces');
     }
 
     addOntologyNamespace(namespace) {
-        return this.$http.post(this.getServerUrl() + "/ontology/namespaces", namespace);
+        return this.$http.post(this.getServerUrl() + '/ontology/namespaces', namespace);
     }
 
     addOntologyConcept(conceptData) {
-        return this.$http.post(this.getServerUrl() + "/ontology/types", conceptData);
-    }
-
-    addOntologyInstance(instanceData) {
-        return this.$http.post(this.getServerUrl() + "/ontology/instances", instanceData);
+        return this.$http.post(this.getServerUrl() + '/ontology/types', conceptData);
     }
 
     getOntologyInstanceDetails(instanceId) {
-        return this.$http.get(this.getServerUrl() + "/ontology/instances/" + encodeURIComponent(instanceId));
-    }
-
-    updateOntologyProperty(propertyId, propertyData) {
-        return this.$http.put(this.getServerUrl() + "/ontology/properties/" + encodeURIComponent(propertyId), propertyData);
+        return this.$http.get(this.getServerUrl() + '/ontology/instances/' + encodeURIComponent(instanceId));
     }
 
     updateOntologyConcept(conceptId, conceptData) {
-        return this.$http.put(this.getServerUrl() + "/ontology/types/" + encodeURIComponent(conceptId), conceptData);
+        return this.$http.put(this.getServerUrl() + '/ontology/types/' + encodeURIComponent(conceptId), conceptData);
     }
 
     updateOntologyInstance(instanceId, instanceData) {
-        return this.$http.put(this.getServerUrl() + "/ontology/instances/" + encodeURIComponent(instanceId), instanceData);
-    }
-
-    // deleteOntologyInstance(instanceId) {
-    //     return this.$http({
-    //         method: 'DELETE',
-    //         url: this.getServerUrl() + "/ontology/instances/" + encodeURIComponent(instanceId)
-    //     });
-    // }
-    //
-    // deleteOntologyProperty(propertyId) {
-    //     return this.$http({
-    //         method: 'DELETE',
-    //         url: this.getServerUrl() + "/ontology/properties/" + encodeURIComponent(propertyId)
-    //     });
-    // }
-    //
-    // deleteOntologyConcept(conceptId) {
-    //     return this.$http({
-    //         method: 'DELETE',
-    //         url: this.getServerUrl() + "/ontology/types/" + encodeURIComponent(conceptId)
-    //     });
-    // }
+        return this.$http.put(this.getServerUrl() + '/ontology/instances/' + encodeURIComponent(instanceId), instanceData);
+    }
 
     getAvailableContexts() {
-        return this.$http.get(this.getServerUrl()+ "/contexts");
-    };
-
-    // deleteContext(contextId) {
-    //     return this.$http({
-    //         method: 'DELETE',
-    //         url: this.getServerUrl() + "/contexts/" + encodeURIComponent(contextId)
-    //     });
-    // }
+        return this.$http.get(this.getServerUrl() + '/contexts');
+    }
 
     getDomainKnowledgeItems(query) {
-        return this.$http.post(this.getServerUrl() + "/autocomplete/domain", query);
-    };
+        return this.$http.post(this.getServerUrl() + '/autocomplete/domain', query);
+    }
 
 
     getSepasFromOntology() {
-        return this.$http.get(this.getServerUrl() + "/ontology/sepas")
+        return this.$http.get(this.getServerUrl() + '/ontology/sepas');
     }
 
     getSepaDetailsFromOntology(uri, keepIds) {
-        return this.$http.get(this.getServerUrl() + "/ontology/sepas/" + encodeURIComponent(uri) +"?keepIds=" +keepIds);
+        return this.$http.get(this.getServerUrl() + '/ontology/sepas/' + encodeURIComponent(uri) + '?keepIds=' + keepIds);
     }
 
     getSourcesFromOntology() {
-        return this.$http.get(this.getServerUrl() + "/ontology/sources")
+        return this.$http.get(this.getServerUrl() + '/ontology/sources');
     }
 
     getSourceDetailsFromOntology(uri, keepIds) {
-        return this.$http.get(this.getServerUrl() + "/ontology/sources/" + encodeURIComponent(uri) +"?keepIds=" +keepIds);
+        return this.$http.get(this.getServerUrl() + '/ontology/sources/' + encodeURIComponent(uri) + '?keepIds=' + keepIds);
     }
 
     getActionsFromOntology() {
-        return this.$http.get(this.getServerUrl() + "/ontology/actions")
+        return this.$http.get(this.getServerUrl() + '/ontology/actions');
     }
 
     getActionDetailsFromOntology(uri, keepIds) {
-        return this.$http.get(this.getServerUrl() + "/ontology/actions/" + encodeURIComponent(uri) +"?keepIds=" +keepIds);
+        return this.$http.get(this.getServerUrl() + '/ontology/actions/' + encodeURIComponent(uri) + '?keepIds=' + keepIds);
     }
 
     getAllUnits() {
-        return this.$http.get(this.getServerUrl() + "/units/instances");
+        return this.$http.get(this.getServerUrl() + '/units/instances');
     }
 
     getAllUnitTypes() {
-        return this.$http.get(this.getServerUrl() + "/units/types");
+        return this.$http.get(this.getServerUrl() + '/units/types');
     }
 
     getUnit(resource) {
-        return this.$http.get(this.getServerUrl() + "/units/instances/" + encodeURIComponent(resource));
+        return this.$http.get(this.getServerUrl() + '/units/instances/' + encodeURIComponent(resource));
     }
 
     getEpaCategories() {
-        return this.$http.get(this.getServerUrl() + "/categories/epa");
-    }
-
-    getEcCategories() {
-        return this.$http.get(this.getServerUrl() + "/categories/ec");
-    }
-
-    getEpCategories() {
-        return this.$http.get(this.getServerUrl() + "/categories/ep");
+        return this.$http.get(this.getServerUrl() + '/categories/epa');
     }
 
     getAdapterCategories() {
-        return this.$http.get(this.getServerUrl() + "/categories/adapter");
+        return this.$http.get(this.getServerUrl() + '/categories/adapter');
     }
 
     getAvailableApps(elementId) {
-        return this.$http.get(this.urlBase() +"/marketplace");
-    }
-
-    installApp(bundleInfo) {
-        return this.$http.post(this.urlBase() +"/marketplace/install", bundleInfo);
-    }
-
-    uninstallApp(bundleInfo) {
-        return this.$http.post(this.urlBase() +"/marketplace/uninstall", bundleInfo);
+        return this.$http.get(this.urlBase() + '/marketplace');
     }
 
     getTargetPods() {
-        return this.$http.get(this.urlBase() +"/marketplace/pods");
+        return this.$http.get(this.urlBase() + '/marketplace/pods');
     }
 
 
     getAuthc(): Observable<any> {
-        return this.$http.get(this.getServerUrl() + "/admin/authc");
-    }
-
-    loginSso(credentials, componentId, sessionId) {
-        return this.$http.post(this.getServerUrl() + "/admin/login/" +componentId +"?session=" +sessionId, credentials);
+        return this.$http.get(this.getServerUrl() + '/admin/authc');
     }
 
     logout() {
-        return this.$http.get(this.getServerUrl() + "/admin/logout");
+        return this.$http.get(this.getServerUrl() + '/admin/logout');
     }
 
     register(payload) {
-        return this.$http.post(this.getServerUrl() +"/admin/register", payload);
+        return this.$http.post(this.getServerUrl() + '/admin/register', payload);
     }
 
-    // deployStorm(payload) {
-    //     return this.$http({method: 'GET', responseType : 'arraybuffer', headers: {'Accept' : 'application/zip'}, url: this.urlBase() + '/deploy/storm'})
-    //
-    // }
-
     getApplicationLinks() {
-        return this.$http.get(this.getServerUrl() + "/applink");
-    };
-
-    // getRuntimeInfo(dataStream) {
-    //     return this.$http.post(this.urlBase() +"/pipeline-element/runtime", dataStream, {
-    //         ignoreLoadingBar: true
-    //     });
-    // }
-
-    getDocumentation(appId) {
-        return this.$http.get(this.getAssetUrl(appId) +"/documentation");
+        return this.$http.get(this.getServerUrl() + '/applink');
     }
 
-    // uploadFile(data) {
-    //     return this.$http.post(this.urlBase() + "/files", data, {headers: {'Content-Type': undefined },
-    //         transformRequest: angular.identity});
-    // }
-
     getFileMetadata() {
-        return this.$http.get(this.urlBase() + "/files");
+        return this.$http.get(this.urlApiBase() + '/files');
     }
 
     getCachedPipeline() {
-        return this.$http.get(this.urlApiBase() + "/pipeline-cache");
+        return this.$http.get(this.urlApiBase() + '/pipeline-cache');
     }
 
     updateCachedPipeline(rawPipelineModel: any) {
-        return this.$http.post(this.urlApiBase() + "/pipeline-cache", rawPipelineModel);
+        return this.$http.post(this.urlApiBase() + '/pipeline-cache', rawPipelineModel);
     }
 
     removePipelineFromCache() {
-        return this.$http.delete(this.urlApiBase() + "/pipeline-cache");
+        return this.$http.delete(this.urlApiBase() + '/pipeline-cache');
     }
 
     getVersionInfo() {
-        return this.$http.get(this.getServerUrl() + "/info/versions");
+        return this.$http.get(this.getServerUrl() + '/info/versions');
     }
 
     getSystemInfo() {
-        return this.$http.get(this.getServerUrl() + "/info/system");
+        return this.$http.get(this.getServerUrl() + '/info/system');
     }
 }

[incubator-streampipes] 12/12: [STREAMPIPES-427] Modify paths of StreamPipes connect resources

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

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

commit 8124c21924d633440ea9712c1b94d3800dc1500c
Author: Dominik Riemer <ri...@fzi.de>
AuthorDate: Fri Sep 24 15:25:56 2021 +0200

    [STREAMPIPES-427] Modify paths of StreamPipes connect resources
---
 .../master/management/SourcesManagement.java       |   6 +-
 .../master/management/SourcesManagementTest.java   |  10 +-
 .../rest/impl/connect/AbstractAdapterResource.java |   4 +-
 .../rest/impl/connect/AdapterResource.java         |  20 +--
 .../rest/impl/connect/AdapterTemplateResource.java |  18 +-
 .../rest/impl/connect/DescriptionResource.java     |   8 +-
 .../rest/impl/connect/GuessResource.java           |   2 +-
 .../impl/connect/RuntimeResolvableResource.java    |   2 +-
 .../rest/impl/connect/SourcesResource.java         |   9 +-
 .../rest/impl/connect/UnitResource.java            |   2 +-
 .../impl/connect/WorkerAdministrationResource.java |   2 +-
 ui/src/app/connect/services/connect.service.ts     |   2 +-
 .../connect/services/data-marketplace.service.ts   |  64 ++++----
 ui/src/app/connect/services/rest.service.ts        | 181 ++++++++++-----------
 14 files changed, 157 insertions(+), 173 deletions(-)

diff --git a/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/management/SourcesManagement.java b/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/management/SourcesManagement.java
index 37f3f4a..849ea95 100644
--- a/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/management/SourcesManagement.java
+++ b/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/management/SourcesManagement.java
@@ -77,7 +77,7 @@ public class SourcesManagement {
         WorkerRestClient.invokeSetAdapter(newUrl, decryptedAdapterDescription);
     }
 
-    public void detachAdapter(String streamId, String runningInstanceId, String username) throws AdapterException, NoServiceEndpointsAvailableException {
+    public void detachAdapter(String streamId, String runningInstanceId) throws AdapterException, NoServiceEndpointsAvailableException {
         AdapterSetDescription adapterDescription = (AdapterSetDescription) getAdapterDescriptionById(streamId);
 
         String newId = adapterDescription.getUri() + "/streams/" + runningInstanceId;
@@ -101,7 +101,7 @@ public class SourcesManagement {
 
     }
 
-    public String getAllAdaptersInstallDescription(String user) throws AdapterException {
+    public String getAllAdaptersInstallDescription() throws AdapterException {
 //        String host = getConnectHost();
 
         List<AdapterDescription> allAdapters = adapterStorage.getAllAdapters();
@@ -115,7 +115,7 @@ public class SourcesManagement {
                 uri = new URI(uriString);
             } catch (URISyntaxException e) {
                 logger.error("URI for the sources endpoint is not correct: " + uriString, e);
-                throw new AdapterException("Username " + user + " not allowed");
+                throw new AdapterException("Incorrect source URI: " +uriString);
             }
 
 
diff --git a/streampipes-connect-container-master/src/test/java/org/apache/streampipes/connect/container/master/management/SourcesManagementTest.java b/streampipes-connect-container-master/src/test/java/org/apache/streampipes/connect/container/master/management/SourcesManagementTest.java
index 587e68d..d4af051 100644
--- a/streampipes-connect-container-master/src/test/java/org/apache/streampipes/connect/container/master/management/SourcesManagementTest.java
+++ b/streampipes-connect-container-master/src/test/java/org/apache/streampipes/connect/container/master/management/SourcesManagementTest.java
@@ -78,7 +78,7 @@ public class SourcesManagementTest {
 
         org.powermock.api.mockito.PowerMockito.doThrow(new AdapterException()).when(WorkerRestClient.class, "stopSetAdapter", anyString(), any());
 
-        sourcesManagement.detachAdapter( ID, "id1", "user");
+        sourcesManagement.detachAdapter( ID, "id1");
     }
 
     @Ignore
@@ -89,7 +89,7 @@ public class SourcesManagementTest {
         SourcesManagement sourcesManagement = new SourcesManagement(adapterStorage);
         doNothing().when(WorkerRestClient.class, "stopSetAdapter", anyString(), any());
 
-        sourcesManagement.detachAdapter(ID, "id1", "user");
+        sourcesManagement.detachAdapter(ID, "id1");
 
         verify(adapterStorage, times(1)).getAllAdapters();
         verifyStatic(WorkerRestClient.class, times(1));
@@ -104,7 +104,7 @@ public class SourcesManagementTest {
         SourcesManagement sourcesManagement = new SourcesManagement(adapterStorage);
         org.powermock.api.mockito.PowerMockito.doThrow(new AdapterException()).when(WorkerRestClient.class, "stopSetAdapter", anyString(), any());
 
-        sourcesManagement.detachAdapter( ID, "id1", "user");
+        sourcesManagement.detachAdapter( ID, "id1");
     }
 
     @Ignore
@@ -117,7 +117,7 @@ public class SourcesManagementTest {
         SourcesManagement sourcesManagement = new SourcesManagement(adapterStorage);
         sourcesManagement.setConnectHost("host");
 
-        String result = sourcesManagement.getAllAdaptersInstallDescription("user@fzi.de");
+        String result = sourcesManagement.getAllAdaptersInstallDescription();
         assertEquals(getJsonString(), result);
 
     }
@@ -131,7 +131,7 @@ public class SourcesManagementTest {
         SourcesManagement sourcesManagement = new SourcesManagement(adapterStorage);
         sourcesManagement.setConnectHost("host");
 
-        sourcesManagement.getAllAdaptersInstallDescription(" ");
+        sourcesManagement.getAllAdaptersInstallDescription();
 
     }
 
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/AbstractAdapterResource.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/AbstractAdapterResource.java
index 06d6323..c9623a4 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/AbstractAdapterResource.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/AbstractAdapterResource.java
@@ -17,11 +17,11 @@
  */
 package org.apache.streampipes.rest.impl.connect;
 
-import org.apache.streampipes.rest.shared.impl.AbstractSharedRestInterface;
+import org.apache.streampipes.rest.core.base.impl.AbstractAuthGuardedRestResource;
 
 import java.util.function.Supplier;
 
-public class AbstractAdapterResource<T> extends AbstractSharedRestInterface {
+public class AbstractAdapterResource<T> extends AbstractAuthGuardedRestResource {
 
   protected T managementService;
 
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/AdapterResource.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/AdapterResource.java
index 4b4363c..aa1b9ce 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/AdapterResource.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/AdapterResource.java
@@ -34,11 +34,11 @@ import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 import java.util.List;
 
-@Path("/v2/connect/{username}/master/adapters")
+@Path("/v2/connect/master/adapters")
 public class AdapterResource extends AbstractAdapterResource<AdapterMasterManagement> {
 
-    private Logger LOG = LoggerFactory.getLogger(AdapterResource.class);
-    private WorkerUrlProvider workerUrlProvider;
+    private static final Logger LOG = LoggerFactory.getLogger(AdapterResource.class);
+    private final WorkerUrlProvider workerUrlProvider;
 
     public AdapterResource() {
         super(AdapterMasterManagement::new);
@@ -48,9 +48,8 @@ public class AdapterResource extends AbstractAdapterResource<AdapterMasterManage
     @POST
     @JacksonSerialized
     @Produces(MediaType.APPLICATION_JSON)
-    public Response addAdapter(AdapterDescription adapterDescription,
-                               @PathParam("username") String username) {
-
+    public Response addAdapter(AdapterDescription adapterDescription) {
+        String username = getAuthenticatedUsername();
         String adapterId;
         LOG.info("User: " + username + " starts adapter " + adapterDescription.getAdapterId());
 
@@ -86,8 +85,7 @@ public class AdapterResource extends AbstractAdapterResource<AdapterMasterManage
     @JacksonSerialized
     @Path("/{id}/stop")
     @Produces(MediaType.APPLICATION_JSON)
-    public Response stopAdapter(@PathParam("id") String adapterId,
-                                @PathParam("username") String username) {
+    public Response stopAdapter(@PathParam("id") String adapterId) {
         try {
             managementService.stopStreamAdapter(adapterId, getAdapterDescription(adapterId).getSelectedEndpointUrl());
             return ok(Notifications.success("Adapter started"));
@@ -101,8 +99,7 @@ public class AdapterResource extends AbstractAdapterResource<AdapterMasterManage
     @JacksonSerialized
     @Path("/{id}/start")
     @Produces(MediaType.APPLICATION_JSON)
-    public Response startAdapter(@PathParam("id") String adapterId,
-                                @PathParam("username") String username) {
+    public Response startAdapter(@PathParam("id") String adapterId) {
         try {
             String workerUrl =  workerUrlProvider.getWorkerBaseUrl(getAdapterDescription(adapterId).getAppId());
             managementService.startStreamAdapter(adapterId, workerUrl);
@@ -117,8 +114,7 @@ public class AdapterResource extends AbstractAdapterResource<AdapterMasterManage
     @JacksonSerialized
     @Path("/{id}")
     @Produces(MediaType.APPLICATION_JSON)
-    public Response deleteAdapter(@PathParam("id") String adapterId,
-                                  @PathParam("username") String username) {
+    public Response deleteAdapter(@PathParam("id") String adapterId) {
 
         try {
             managementService.deleteAdapter(adapterId);
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/AdapterTemplateResource.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/AdapterTemplateResource.java
index ea20e6e..aa57494 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/AdapterTemplateResource.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/AdapterTemplateResource.java
@@ -31,10 +31,10 @@ import javax.ws.rs.*;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
-@Path("/v2/connect/{username}/master/adapters/template")
+@Path("/v2/connect/master/adapters/template")
 public class AdapterTemplateResource extends AbstractAdapterResource<AdapterTemplateMasterManagement> {
 
-    private Logger logger = LoggerFactory.getLogger(AdapterTemplateResource.class);
+    private static final Logger LOG = LoggerFactory.getLogger(AdapterTemplateResource.class);
 
     public AdapterTemplateResource() {
         super(AdapterTemplateMasterManagement::new);
@@ -43,14 +43,14 @@ public class AdapterTemplateResource extends AbstractAdapterResource<AdapterTemp
     @POST
     @JacksonSerialized
     @Produces(MediaType.APPLICATION_JSON)
-    public Response addAdapterTemplate(AdapterDescription adapterDescription, @PathParam("username") String userName) {
+    public Response addAdapterTemplate(AdapterDescription adapterDescription) {
         try {
             String adapterTemplateId = managementService.addAdapterTemplate(adapterDescription);
-            logger.info("User: " + userName + " added adapter as adapter template");
+            LOG.info("User: " + getAuthenticatedUsername() + " added adapter as adapter template");
 
             return ok(Notifications.success(adapterTemplateId));
         } catch (AdapterException e) {
-            logger.error("Error while storing the adapter template", e);
+            LOG.error("Error while storing the adapter template", e);
             return ok(Notifications.error(e.getMessage()));
         }
     }
@@ -59,13 +59,13 @@ public class AdapterTemplateResource extends AbstractAdapterResource<AdapterTemp
     @JacksonSerialized
     @Path("/all")
     @Produces(MediaType.APPLICATION_JSON)
-    public Response getAllAdapterTemplates(@PathParam("username") String userName) {
+    public Response getAllAdapterTemplates() {
         try {
             AdapterDescriptionList result = managementService.getAllAdapterTemplates();
 
             return ok(result);
         } catch (AdapterException e) {
-            logger.error("Error while getting all adapter templates", e);
+            LOG.error("Error while getting all adapter templates", e);
             return ok(Notifications.error(e.getMessage()));
         }
 
@@ -75,13 +75,13 @@ public class AdapterTemplateResource extends AbstractAdapterResource<AdapterTemp
     @JacksonSerialized
     @Path("/{id}")
     @Produces(MediaType.APPLICATION_JSON)
-    public Response deleteAdapter(@PathParam("id") String id, @PathParam("username") String userName) {
+    public Response deleteAdapter(@PathParam("id") String id) {
 
         try {
             managementService.deleteAdapterTemplates(id);
             return ok(true);
         } catch (AdapterException e) {
-            logger.error("Error while deleting adapter with id " + id, e);
+            LOG.error("Error while deleting adapter with id " + id, e);
             return fail();
         }
     }
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/DescriptionResource.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/DescriptionResource.java
index d848cc3..9f9ab7e 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/DescriptionResource.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/DescriptionResource.java
@@ -38,7 +38,7 @@ import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 import java.util.Optional;
 
-@Path("/v2/connect/{username}/master/description")
+@Path("/v2/connect/master/description")
 public class DescriptionResource extends AbstractAdapterResource<DescriptionManagement> {
 
     private static final Logger LOG = LoggerFactory.getLogger(DescriptionResource.class);
@@ -82,7 +82,7 @@ public class DescriptionResource extends AbstractAdapterResource<DescriptionMana
     @GET
     @Path("/{id}/assets")
     @Produces("application/zip")
-    public Response getAdapterAssets(@PathParam("id") String id, @PathParam("username") String userName) {
+    public Response getAdapterAssets(@PathParam("id") String id) {
         try {
             String result = null;
 
@@ -119,7 +119,7 @@ public class DescriptionResource extends AbstractAdapterResource<DescriptionMana
     @GET
     @Path("/{id}/assets/icon")
     @Produces("image/png")
-    public Response getAdapterIconAsset(@PathParam("id") String id, @PathParam("username") String userName) {
+    public Response getAdapterIconAsset(@PathParam("id") String id) {
         try {
 
             byte[] result = null;
@@ -157,7 +157,7 @@ public class DescriptionResource extends AbstractAdapterResource<DescriptionMana
     @GET
     @Path("/{id}/assets/documentation")
     @Produces(MediaType.TEXT_PLAIN)
-    public Response getAdapterDocumentationAsset(@PathParam("id") String id, @PathParam("username") String userName) {
+    public Response getAdapterDocumentationAsset(@PathParam("id") String id) {
         try {
             String result = null;
 
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/GuessResource.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/GuessResource.java
index b5724cd..3d4bdd0 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/GuessResource.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/GuessResource.java
@@ -36,7 +36,7 @@ import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
 
-@Path("/v2/connect/{username}/master/guess")
+@Path("/v2/connect/master/guess")
 public class GuessResource extends AbstractAdapterResource<GuessManagement> {
 
   private static final Logger LOG = LoggerFactory.getLogger(GuessResource.class);
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/RuntimeResolvableResource.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/RuntimeResolvableResource.java
index eff352f..b8a6ab1 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/RuntimeResolvableResource.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/RuntimeResolvableResource.java
@@ -31,7 +31,7 @@ import javax.ws.rs.*;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
-@Path("/v2/connect/{username}/master/resolvable")
+@Path("/v2/connect/master/resolvable")
 public class RuntimeResolvableResource extends AbstractAdapterResource<WorkerAdministrationManagement> {
 
     private static final String SP_NS =  "https://streampipes.org/vocabulary/v1/";
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/SourcesResource.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/SourcesResource.java
index f9a4414..cfb611a 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/SourcesResource.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/SourcesResource.java
@@ -44,10 +44,10 @@ public class SourcesResource extends AbstractAdapterResource<SourcesManagement>
     @GET
     @Produces(MediaType.APPLICATION_JSON)
     @GsonWithIds
-    public Response getAllAdaptersInstallDescription(@PathParam("username") String username) {
+    public Response getAllAdaptersInstallDescription() {
 
         try {
-            String resultingJson = managementService.getAllAdaptersInstallDescription(username);
+            String resultingJson = managementService.getAllAdaptersInstallDescription();
             return ok(resultingJson);
         } catch (AdapterException e) {
             LOG.error("Error while getting all adapter descriptions", e);
@@ -91,15 +91,14 @@ public class SourcesResource extends AbstractAdapterResource<SourcesManagement>
     @Path("/{streamId}/{runningInstanceId}")
     @Produces(MediaType.APPLICATION_JSON)
     public Response detach(@PathParam("streamId") String elementId,
-                           @PathParam("runningInstanceId") String runningInstanceId,
-                           @PathParam("username") String username) {
+                           @PathParam("runningInstanceId") String runningInstanceId) {
         String responseMessage = "Instance of set id: " + elementId  + " with instance id: "+ runningInstanceId + " successfully started";
 
 //        String workerUrl = new Utils().getWorkerUrlById(elementId);
 //        String newUrl = Utils.addUserNameToApi(workerUrl, username);
 
         try {
-            managementService.detachAdapter(elementId, runningInstanceId, username);
+            managementService.detachAdapter(elementId, runningInstanceId);
         } catch (AdapterException | NoServiceEndpointsAvailableException e) {
             LOG.error("Could not set set id "+ elementId  + " with instance id: "+ runningInstanceId, e);
             return fail();
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/UnitResource.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/UnitResource.java
index 5a0433f..d89faa5 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/UnitResource.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/UnitResource.java
@@ -31,7 +31,7 @@ import javax.ws.rs.Produces;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
-@Path("/v2/connect/{username}/master/unit")
+@Path("/v2/connect/master/unit")
 public class UnitResource extends AbstractAdapterResource<UnitMasterManagement> {
 
     private static final Logger logger = LoggerFactory.getLogger(UnitResource.class);
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/WorkerAdministrationResource.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/WorkerAdministrationResource.java
index 866146f..c30fddf 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/WorkerAdministrationResource.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/WorkerAdministrationResource.java
@@ -35,7 +35,7 @@ import javax.ws.rs.core.Response;
 @Path("v2/connect/{username}/master/administration")
 public class WorkerAdministrationResource extends AbstractSharedRestInterface {
 
-    private Logger LOG = LoggerFactory.getLogger(WorkerAdministrationResource.class);
+    private static final Logger LOG = LoggerFactory.getLogger(WorkerAdministrationResource.class);
 
     private WorkerAdministrationManagement workerAdministrationManagement;
 
diff --git a/ui/src/app/connect/services/connect.service.ts b/ui/src/app/connect/services/connect.service.ts
index af8cc42..56bf82f 100644
--- a/ui/src/app/connect/services/connect.service.ts
+++ b/ui/src/app/connect/services/connect.service.ts
@@ -16,7 +16,7 @@
  *
  */
 
-import {Injectable} from '@angular/core';
+import { Injectable } from '@angular/core';
 import {
   AdapterDescription,
   GenericAdapterSetDescription,
diff --git a/ui/src/app/connect/services/data-marketplace.service.ts b/ui/src/app/connect/services/data-marketplace.service.ts
index 3e1298f..8df76ab 100644
--- a/ui/src/app/connect/services/data-marketplace.service.ts
+++ b/ui/src/app/connect/services/data-marketplace.service.ts
@@ -16,11 +16,11 @@
  *
  */
 
-import {Injectable} from '@angular/core';
-import {HttpClient} from '@angular/common/http';
-import {map} from 'rxjs/operators';
-import {AuthStatusService} from '../../services/auth-status.service';
-import {ConnectService} from './connect.service';
+import { Injectable } from '@angular/core';
+import { HttpClient } from '@angular/common/http';
+import { map } from 'rxjs/operators';
+import { AuthStatusService } from '../../services/auth-status.service';
+import { ConnectService } from './connect.service';
 import {
   AdapterDescription,
   AdapterDescriptionList,
@@ -34,13 +34,12 @@ import {
   SpDataStream,
   SpecificAdapterSetDescription,
   SpecificAdapterStreamDescription
-} from "../../core-model/gen/streampipes-model";
-import {Observable, zip} from "rxjs";
-import {PlatformServicesCommons} from "../../platform-services/apis/commons.service";
+} from '../../core-model/gen/streampipes-model';
+import { Observable, zip } from 'rxjs';
+import { PlatformServicesCommons } from '../../platform-services/apis/commons.service';
 
 @Injectable()
 export class DataMarketplaceService {
-  private host = '/streampipes-backend/api/v2/connect/';
 
   constructor(
       private http: HttpClient,
@@ -49,6 +48,9 @@ export class DataMarketplaceService {
       private platformServicesCommons: PlatformServicesCommons) {
   }
 
+  get connectPath() {
+    return this.platformServicesCommons.apiBasePath() + '/connect';
+  }
 
   getAdapterDescriptions(): Observable<AdapterDescriptionUnion[]> {
     return this.requestAdapterDescriptions('/master/description/adapters').pipe(map(response => {
@@ -67,12 +69,11 @@ export class DataMarketplaceService {
   requestAdapterDescriptions(path: string): Observable<AdapterDescriptionUnion[]> {
     return this.http
         .get(
-            this.host +
-            this.authStatusService.email +
+            this.connectPath +
             path
         )
         .pipe(map(response => {
-          let adapterDescriptionList: AdapterDescriptionList = AdapterDescriptionList.fromData(response as AdapterDescriptionList);
+          const adapterDescriptionList: AdapterDescriptionList = AdapterDescriptionList.fromData(response as AdapterDescriptionList);
           return adapterDescriptionList.list;
         }));
   }
@@ -80,29 +81,28 @@ export class DataMarketplaceService {
   stopAdapter(adapter: AdapterDescriptionUnion): Observable<Message> {
     return this.http.post(this.adapterMasterUrl
         + adapter.id
-        + "/stop", {})
+        + '/stop', {})
         .pipe(map(response => Message.fromData(response as any)));
   }
 
   startAdapter(adapter: AdapterDescriptionUnion): Observable<Message> {
     return this.http.post(this.adapterMasterUrl
         + adapter.id
-        + "/start", {})
-        .pipe(map(response => Message.fromData(response as any)));;
+        + '/start', {})
+        .pipe(map(response => Message.fromData(response as any)));
   }
 
   get adapterMasterUrl() {
-    return this.host
-        + this.authStatusService.email
-        + "/master/adapters/";
+    return this.connectPath
+        + '/master/adapters/';
   }
 
   deleteAdapter(adapter: AdapterDescription): Observable<Object> {
-    return this.deleteRequest(adapter, '/master/adapters/')
+    return this.deleteRequest(adapter, '/master/adapters/');
   }
 
   deleteAdapterTemplate(adapter: AdapterDescription): Observable<Object> {
-    return this.deleteRequest(adapter, '/master/adapters/template/')
+    return this.deleteRequest(adapter, '/master/adapters/template/');
   }
 
   getAdapterCategories(): Observable<Object> {
@@ -111,10 +111,9 @@ export class DataMarketplaceService {
         '/api/v2/categories/adapter');
   }
 
-  private deleteRequest(adapter: AdapterDescription, url: String) {
+  private deleteRequest(adapter: AdapterDescription, url: string) {
     return this.http.delete(
-        this.host +
-        this.authStatusService.email +
+        this.connectPath +
         url +
         adapter.id
     );
@@ -123,24 +122,23 @@ export class DataMarketplaceService {
   getProtocols(): Observable<AdapterDescriptionUnion[]> {
     return this.http
         .get(
-            this.host +
-            this.authStatusService.email +
+            this.connectPath +
             '/master/description/protocols'
         )
         .pipe(map(response => {
-          let adapterDescriptions: AdapterDescriptionUnion[] = [];
-          let protocols: ProtocolDescription[] = (ProtocolDescriptionList.fromData(response as ProtocolDescriptionList)).list;
+          const adapterDescriptions: AdapterDescriptionUnion[] = [];
+          const protocols: ProtocolDescription[] = (ProtocolDescriptionList.fromData(response as ProtocolDescriptionList)).list;
 
-          for (let protocol of protocols) {
+          for (const protocol of protocols) {
             let newAdapterDescription: AdapterDescriptionUnion;
             if (protocol.sourceType === 'SET') {
               newAdapterDescription = new GenericAdapterSetDescription();
-              newAdapterDescription["@class"] = "org.apache.streampipes.model.connect.adapter.GenericAdapterSetDescription";
+              newAdapterDescription['@class'] = 'org.apache.streampipes.model.connect.adapter.GenericAdapterSetDescription';
               newAdapterDescription.dataSet = new SpDataSet();
               newAdapterDescription.dataSet.eventSchema = new EventSchema();
             } else if (protocol.sourceType === 'STREAM') {
               newAdapterDescription = new GenericAdapterStreamDescription();
-              newAdapterDescription["@class"] = "org.apache.streampipes.model.connect.adapter.GenericAdapterStreamDescription";
+              newAdapterDescription['@class'] = 'org.apache.streampipes.model.connect.adapter.GenericAdapterStreamDescription';
               newAdapterDescription.dataStream = new SpDataStream();
               newAdapterDescription.dataStream.eventSchema = new EventSchema();
             }
@@ -185,11 +183,11 @@ export class DataMarketplaceService {
   // }
 
   getGenericAndSpecificAdapterDescriptions(): Observable<[AdapterDescriptionUnion[], AdapterDescriptionUnion[]]> {
-  return zip(this.getAdapterDescriptions(), this.getProtocols());
+    return zip(this.getAdapterDescriptions(), this.getProtocols());
   }
 
   cloneAdapterDescription(toClone: AdapterDescriptionUnion): AdapterDescriptionUnion {
-    var result: AdapterDescriptionUnion;
+    let result: AdapterDescriptionUnion;
 
     if (this.connectService.isGenericDescription(toClone)) {
       if (toClone instanceof GenericAdapterStreamDescription) {
@@ -209,7 +207,7 @@ export class DataMarketplaceService {
   }
 
   getAssetUrl(appId) {
-    return this.host + this.authStatusService.email + "/master/description/" + appId + "/assets"
+    return this.connectPath + '/master/description/' + appId + '/assets';
   }
 
   private get baseUrl() {
diff --git a/ui/src/app/connect/services/rest.service.ts b/ui/src/app/connect/services/rest.service.ts
index 48c4f04..dc54622 100644
--- a/ui/src/app/connect/services/rest.service.ts
+++ b/ui/src/app/connect/services/rest.service.ts
@@ -22,110 +22,101 @@ import { HttpClient } from '@angular/common/http';
 
 import { from, Observable } from 'rxjs';
 import { map } from 'rxjs/operators';
-
-
-import { AuthStatusService } from '../../services/auth-status.service';
 import { UnitDescription } from '../model/UnitDescription';
 import {
-    AdapterDescription,
-    FormatDescriptionList,
-    GuessSchema,
-    Message,
-    ProtocolDescriptionList,
-    SpDataStream
+  AdapterDescription,
+  FormatDescriptionList,
+  GuessSchema,
+  Message,
+  ProtocolDescriptionList,
+  SpDataStream
 } from '../../core-model/gen/streampipes-model';
 import { PlatformServicesCommons } from '../../platform-services/apis/commons.service';
 
 @Injectable()
 export class RestService {
-    private host = '/streampipes-backend/api/v2/connect/';
-
-    constructor(
-        private http: HttpClient,
-        private authStatusService: AuthStatusService,
-        private platformServicesCommons: PlatformServicesCommons) { }
-
-    addAdapter(adapter: AdapterDescription): Observable<Message> {
-        return this.addAdapterDescription(adapter, '/master/adapters');
-    }
-
-    addAdapterTemplate(adapter: AdapterDescription): Observable<Message> {
-        return this.addAdapterDescription(adapter, '/master/adapters/template');
-    }
-
-    addAdapterDescription(adapter: AdapterDescription, url: string): Observable<Message> {
-        adapter.userName = this.authStatusService.email;
-
-        const promise = new Promise<Message>((resolve, reject) => {
-            this.http
-                .post(
-                    this.host + this.authStatusService.email + url,
-                    adapter,
-                )
-                .pipe(map(response => {
-                    const statusMessage = response as Message;
-                    resolve(statusMessage);
-                }))
-                .subscribe();
-        });
-        return from(promise);
-    }
-
-
-    getGuessSchema(adapter: AdapterDescription): Observable<GuessSchema> {
-        return this.http
-            .post(this.host + this.authStatusService.email + '/master/guess/schema', adapter)
-            .pipe(map(response => {
-                return GuessSchema.fromData(response as GuessSchema);
+
+  constructor(
+      private http: HttpClient,
+      private platformServicesCommons: PlatformServicesCommons) {
+  }
+
+  get connectPath() {
+    return this.platformServicesCommons.apiBasePath() + '/connect';
+  }
+
+  addAdapter(adapter: AdapterDescription): Observable<Message> {
+    return this.addAdapterDescription(adapter, '/master/adapters');
+  }
+
+  addAdapterTemplate(adapter: AdapterDescription): Observable<Message> {
+    return this.addAdapterDescription(adapter, '/master/adapters/template');
+  }
+
+  addAdapterDescription(adapter: AdapterDescription, url: string): Observable<Message> {
+    const promise = new Promise<Message>((resolve, reject) => {
+      this.http
+          .post(
+              this.connectPath + url,
+              adapter,
+          )
+          .pipe(map(response => {
+            const statusMessage = response as Message;
+            resolve(statusMessage);
+          }))
+          .subscribe();
+    });
+    return from(promise);
+  }
+
+  getGuessSchema(adapter: AdapterDescription): Observable<GuessSchema> {
+    return this.http
+        .post(this.connectPath + '/master/guess/schema', adapter)
+        .pipe(map(response => {
+          return GuessSchema.fromData(response as GuessSchema);
         }));
 
-    }
-
-    getSourceDetails(sourceElementId): Observable<SpDataStream> {
-        return this.http
-            .get(this.platformServicesCommons.apiBasePath() + '/streams/' + encodeURIComponent(sourceElementId)).pipe(map(response => {
-                return SpDataStream.fromData(response as SpDataStream);
-            }));
-    }
-
-    getRuntimeInfo(sourceDescription): Observable<any> {
-        return this.http.post(this.platformServicesCommons.apiBasePath() + '/pipeline-element/runtime', sourceDescription, {
-            headers: { ignoreLoadingBar: '' }
-        });
-    }
-
-    makeUserDependentBaseUrl() {
-        return '/streampipes-backend/api/v2/users/' + this.authStatusService.email;
-    }
-
-
-    getFormats(): Observable<FormatDescriptionList> {
-        const self = this;
-        return this.http
-            .get(
-              this.host + this.authStatusService.email + '/master/description/formats'
-            )
-            .pipe(map(response => {
-                return FormatDescriptionList.fromData(response as FormatDescriptionList);
-            }));
-    }
-
-    getProtocols(): Observable<ProtocolDescriptionList> {
-        return this.http
-            .get(this.host + 'adapter/allProtocols')
-            .pipe(map(response => {
-                return response as ProtocolDescriptionList;
-            }));
-    }
-
-    getFittingUnits(unitDescription: UnitDescription): Observable<UnitDescription[]> {
-        return this.http
-            .post<UnitDescription[]>(this.host + this.authStatusService.email + '/master/unit', unitDescription)
-            .pipe(map(response => {
-                const descriptions = response as UnitDescription[];
-                return descriptions.filter(entry => entry.resource != unitDescription.resource);
-            }));
-    }
+  }
+
+  getSourceDetails(sourceElementId): Observable<SpDataStream> {
+    return this.http
+        .get(this.platformServicesCommons.apiBasePath() + '/streams/' + encodeURIComponent(sourceElementId)).pipe(map(response => {
+          return SpDataStream.fromData(response as SpDataStream);
+        }));
+  }
+
+  getRuntimeInfo(sourceDescription): Observable<any> {
+    return this.http.post(this.platformServicesCommons.apiBasePath() + '/pipeline-element/runtime', sourceDescription, {
+      headers: {ignoreLoadingBar: ''}
+    });
+  }
+
+  getFormats(): Observable<FormatDescriptionList> {
+    return this.http
+        .get(
+            this.connectPath + '/master/description/formats'
+        )
+        .pipe(map(response => {
+          return FormatDescriptionList.fromData(response as FormatDescriptionList);
+        }));
+  }
+
+  getProtocols(): Observable<ProtocolDescriptionList> {
+    return this.http
+        .get(this.connectPath + 'adapter/allProtocols')
+        .pipe(map(response => {
+          return response as ProtocolDescriptionList;
+        }));
+  }
+
+  getFittingUnits(unitDescription: UnitDescription): Observable<UnitDescription[]> {
+    return this.http
+        .post<UnitDescription[]>(this.connectPath + '/master/unit', unitDescription)
+        .pipe(map(response => {
+          const descriptions = response as UnitDescription[];
+          return descriptions.filter(entry => entry.resource !== unitDescription.resource);
+        }));
+  }
 
 
 }

[incubator-streampipes] 09/12: [STREAMPIPES-427] Modify paths of pipeline template resource

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

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

commit ad12673266ff96ccad94a60c9a251cfd31bf6647
Author: Dominik Riemer <ri...@fzi.de>
AuthorDate: Fri Sep 24 14:46:50 2021 +0200

    [STREAMPIPES-427] Modify paths of pipeline template resource
---
 .../org/apache/streampipes/rest/impl/PipelineTemplate.java    | 11 +++++------
 .../java/org/apache/streampipes/rest/impl/ResetResource.java  |  9 ++++-----
 2 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineTemplate.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineTemplate.java
index 8e7f6b8..9508d7d 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineTemplate.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineTemplate.java
@@ -25,7 +25,7 @@ import org.apache.streampipes.model.pipeline.PipelineOperationStatus;
 import org.apache.streampipes.model.template.PipelineTemplateDescription;
 import org.apache.streampipes.model.template.PipelineTemplateDescriptionContainer;
 import org.apache.streampipes.model.template.PipelineTemplateInvocation;
-import org.apache.streampipes.rest.core.base.impl.AbstractRestResource;
+import org.apache.streampipes.rest.core.base.impl.AbstractAuthGuardedRestResource;
 import org.apache.streampipes.rest.shared.util.SpMediaType;
 
 import javax.ws.rs.*;
@@ -34,8 +34,8 @@ import javax.ws.rs.core.Response;
 import java.util.ArrayList;
 import java.util.List;
 
-@Path("/v2/users/{username}/pipeline-templates")
-public class PipelineTemplate extends AbstractRestResource {
+@Path("/v2/pipeline-templates")
+public class PipelineTemplate extends AbstractAuthGuardedRestResource {
 
   @GET
   @Path("/streams")
@@ -98,11 +98,10 @@ public class PipelineTemplate extends AbstractRestResource {
 
   @POST
   @Produces(MediaType.APPLICATION_JSON)
-  public Response generatePipeline(@PathParam("username") String username,
-                                   PipelineTemplateInvocation pipelineTemplateInvocation) {
+  public Response generatePipeline(PipelineTemplateInvocation pipelineTemplateInvocation) {
 
     PipelineOperationStatus status = Operations
-            .handlePipelineTemplateInvocation(username, pipelineTemplateInvocation);
+            .handlePipelineTemplateInvocation(getAuthenticatedUsername(), pipelineTemplateInvocation);
 
     return ok(status);
 
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/ResetResource.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/ResetResource.java
index 4024c39..a37296c 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/ResetResource.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/ResetResource.java
@@ -19,9 +19,9 @@
 package org.apache.streampipes.rest.impl;
 
 import io.swagger.v3.oas.annotations.Operation;
-import org.apache.streampipes.rest.ResetManagement;
 import org.apache.streampipes.model.message.Notifications;
 import org.apache.streampipes.model.message.SuccessMessage;
+import org.apache.streampipes.rest.ResetManagement;
 import org.apache.streampipes.rest.core.base.impl.AbstractAuthGuardedRestResource;
 import org.apache.streampipes.rest.shared.annotation.JacksonSerialized;
 import org.slf4j.Logger;
@@ -29,12 +29,11 @@ import org.slf4j.LoggerFactory;
 
 import javax.ws.rs.POST;
 import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
-@Path("/v2/users/{username}/reset")
+@Path("/v2/reset")
 public class ResetResource extends AbstractAuthGuardedRestResource {
     private static final Logger logger = LoggerFactory.getLogger(ResetResource.class);
 
@@ -42,8 +41,8 @@ public class ResetResource extends AbstractAuthGuardedRestResource {
     @Produces(MediaType.APPLICATION_JSON)
     @JacksonSerialized
     @Operation(summary = "Resets StreamPipes instance")
-    public Response reset(@PathParam("username") String username) {
-        ResetManagement.reset(username);
+    public Response reset() {
+        ResetManagement.reset(getAuthenticatedUsername());
         SuccessMessage message = Notifications.success("Reset of system successfully performed");
         return ok(message);
     }