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 2020/06/10 15:37:06 UTC
[incubator-streampipes] branch STREAMPIPES-145 updated:
[STREAMPIPES-145] Refactor serialization layer in connect module
This is an automated email from the ASF dual-hosted git repository.
riemer pushed a commit to branch STREAMPIPES-145
in repository https://gitbox.apache.org/repos/asf/incubator-streampipes.git
The following commit(s) were added to refs/heads/STREAMPIPES-145 by this push:
new 77e2040 [STREAMPIPES-145] Refactor serialization layer in connect module
77e2040 is described below
commit 77e20407b98183ca489b35800ed74baefaa2c7be
Author: Dominik Riemer <ri...@fzi.de>
AuthorDate: Wed Jun 10 17:36:47 2020 +0200
[STREAMPIPES-145] Refactor serialization layer in connect module
---
.../master/management/GuessManagement.java | 24 +-
.../master/management/WorkerRestClient.java | 3 +-
.../container/master/rest/AdapterResource.java | 45 +-
.../master/rest/AdapterTemplateResource.java | 30 +-
.../container/master/rest/DescriptionResource.java | 27 +-
.../container/master/rest/GuessResource.java | 40 +-
.../container/master/rest/SourcesResource.java | 2 +-
.../master/rest/WorkerAdministrationResource.java | 2 +-
.../container/worker/rest/FileResource.java | 2 +-
.../container/worker/rest/GuessResource.java | 21 +-
.../container/worker/rest/WorkerResource.java | 63 +-
.../connect/rest/AbstractContainerResource.java | 9 +-
streampipes-model-client/pom.xml | 82 +--
.../client/messages/AppInstallationMessage.java | 63 --
.../model/connect/adapter/AdapterDescription.java | 11 +-
.../connect/adapter/AdapterDescriptionList.java | 2 +
.../adapter/GenericAdapterSetDescription.java | 2 +
.../adapter/GenericAdapterStreamDescription.java | 2 +
.../adapter/SpecificAdapterSetDescription.java | 2 +
.../adapter/SpecificAdapterStreamDescription.java | 2 +
.../connect/grounding/FormatDescriptionList.java | 2 +
.../connect/grounding/ProtocolDescription.java | 7 +-
.../connect/grounding/ProtocolDescriptionList.java | 2 +
.../model/connect/guess/GuessSchema.java | 2 +
.../rules/TransformationRuleDescription.java | 28 +-
.../value/TimestampTransformationRuleMode.java | 1 +
.../DataSetModificationMessage.java | 3 +-
.../streampipes/model/message}/ErrorMessage.java | 6 +-
.../apache/streampipes/model}/message/Message.java | 12 +-
.../streampipes/model}/message/Notification.java | 2 +-
.../model}/message/NotificationType.java | 2 +-
.../streampipes/model/message}/Notifications.java | 5 +-
.../PipelineModificationMessage.java | 4 +-
.../PipelineStatusMessage.java | 2 +-
.../PipelineStatusMessageType.java | 2 +-
.../model/message}/SetupStatusMessage.java | 4 +-
.../streampipes/model/message}/SuccessMessage.java | 6 +-
.../streampipes/model/pipeline/Pipeline.java | 5 +-
.../performance/pipeline/PipelineGenerator.java | 2 +-
.../manager/endpoint/EndpointItemParser.java | 6 +-
.../manager/execution/http/PipelineExecutor.java | 4 +-
.../execution/status/PipelineStatusManager.java | 2 +-
.../manager/matching/DataSetGroundingSelector.java | 2 +-
.../matching/PipelineVerificationHandler.java | 2 +-
.../monitoring/runtime/PipelineObserver.java | 4 +-
.../SepStoppedMonitoringPipelineBuilder.java | 2 +-
.../streampipes/manager/operations/Operations.java | 6 +-
.../setup/CacheInitializationInstallationStep.java | 4 +-
.../manager/setup/CouchDbInstallationStep.java | 4 +-
.../setup/EmpireInitializerInstallationStep.java | 4 +-
.../manager/setup/InstallationStep.java | 2 +-
.../streampipes/manager/setup/Installer.java | 4 +-
.../setup/PipelineElementInstallationStep.java | 4 +-
.../setup/UserRegistrationInstallationStep.java | 4 +-
.../manager/template/PipelineGenerator.java | 4 +-
.../template/PipelineTemplateGenerator.java | 2 +-
.../manager/verification/ElementVerifier.java | 10 +-
.../verification/messages/VerificationError.java | 2 +-
.../verification/messages/VerificationResult.java | 4 +-
.../verification/messages/VerificationWarning.java | 2 +-
.../verification/structure/AbstractVerifier.java | 2 +-
.../verification/structure/GeneralVerifier.java | 2 +-
.../rest/impl/AbstractRestInterface.java | 10 +-
.../streampipes/rest/impl/Authentication.java | 8 +-
.../apache/streampipes/rest/impl/Deployment.java | 4 +-
.../apache/streampipes/rest/impl/Notification.java | 2 +-
.../streampipes/rest/impl/OntologyContext.java | 2 +-
.../streampipes/rest/impl/OntologyKnowledge.java | 2 +-
.../rest/impl/OntologyPipelineElement.java | 2 +-
.../streampipes/rest/impl/PipelineCategory.java | 2 +-
.../rest/impl/PipelineElementImport.java | 8 +-
.../rest/impl/PipelineElementRuntimeInfo.java | 6 +-
.../rest/impl/PipelineWithUserResource.java | 8 +-
.../rest/impl/SemanticEventConsumer.java | 6 +-
.../rest/impl/SemanticEventProcessingAgent.java | 4 +-
.../rest/impl/SemanticEventProducer.java | 8 +-
.../org/apache/streampipes/rest/impl/Setup.java | 4 +-
.../org/apache/streampipes/rest/impl/User.java | 2 +-
.../streampipes/rest/impl/VirtualSensor.java | 2 +-
.../rest/impl/datalake/DataLakeResourceV3.java | 2 +-
.../impl/nouser/PipelineElementImportNoUser.java | 6 +-
.../rest/management/PipelineManagement.java | 4 +-
.../serializers/json/GsonSerializer.java | 2 +-
.../apache/streampipes/serializers/json/Utils.java | 2 +-
ui/src/app/NS/XS.service.ts | 24 +-
ui/src/app/connect/connect.service.ts | 12 +-
.../adapter-description.component.html | 27 +-
.../adapter-description.component.ts | 10 +-
.../adapter-upload-dialog.component.ts | 25 +-
.../data-marketplace.component.html | 2 +-
.../data-marketplace/data-marketplace.component.ts | 93 ++-
.../data-marketplace/data-marketplace.service.ts | 270 ++++---
ui/src/app/connect/data-marketplace/filter.pipe.ts | 4 +-
ui/src/app/connect/filter/timestamp.pipe.ts | 5 +-
.../connect/format-component/format.component.html | 4 +-
.../connect/format-component/format.component.ts | 8 +-
.../component/adapter-started-dialog.component.ts | 36 +-
.../component/dialog-adapter-started.html | 6 +-
.../connect/new-adapter/new-adapter.component.html | 12 +-
.../connect/new-adapter/new-adapter.component.ts | 87 +--
.../protocol-component/protocol.component.ts | 2 +-
ui/src/app/connect/rest.service.ts | 125 ++--
.../event-property-list.component.ts | 5 +-
.../event-property-primitive.component.ts | 41 +-
.../event-property-row.component.ts | 18 +-
.../event-property/event-property.component.html | 2 +-
.../event-property/event-property.component.ts | 63 +-
.../event-schema/event-schema.component.ts | 43 +-
.../schema-editor/model/EventPropertyPrimitive.ts | 9 +-
.../select-static-properties.component.html | 2 +-
.../select-static-properties.component.ts | 16 +-
.../static-alternatives.component.ts | 11 +-
.../static-collection.component.html | 4 +-
.../static-collection.component.ts | 2 +-
.../static-free-input.component.ts | 1 -
.../static-group/static-group.component.ts | 2 +-
.../static-one-of-input.component.ts | 8 +-
.../static-property.component.html | 4 +-
.../static-properties/static-property.component.ts | 2 +
.../static-text-input.component.ts | 1 -
ui/src/app/connect/transformation-rule.service.ts | 133 ++--
ui/src/app/core-model/gen/streampipes-model.ts | 778 +++++++++++++++++++--
.../pipeline-element-recommendation.service.ts | 15 +-
123 files changed, 1598 insertions(+), 1023 deletions(-)
diff --git a/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/management/GuessManagement.java b/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/management/GuessManagement.java
index ad5744a..886fb60 100644
--- a/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/management/GuessManagement.java
+++ b/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/management/GuessManagement.java
@@ -18,17 +18,17 @@
package org.apache.streampipes.connect.container.master.management;
+import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.http.client.fluent.Request;
import org.apache.http.entity.ContentType;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.apache.streampipes.connect.adapter.exception.AdapterException;
import org.apache.streampipes.connect.adapter.exception.ParseException;
-import org.apache.streampipes.model.ErrorMessageLd;
import org.apache.streampipes.model.connect.adapter.AdapterDescription;
import org.apache.streampipes.model.connect.guess.GuessSchema;
-import org.apache.streampipes.rest.shared.util.JsonLdUtils;
-import org.apache.streampipes.vocabulary.StreamPipes;
+import org.apache.streampipes.model.message.Message;
+import org.apache.streampipes.serializers.json.JacksonSerializer;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.io.IOException;
@@ -49,12 +49,10 @@ public class GuessManagement {
workerUrl = workerUrl + "api/v1/admin@streampipes.de/worker/guess/schema";
-
-
- String ad = JsonLdUtils.toJsonLD(adapterDescription);
+ ObjectMapper mapper = JacksonSerializer.getObjectMapper();
try {
-
+ String ad = mapper.writeValueAsString(adapterDescription);
LOG.info("Guess schema at: " + workerUrl);
String responseString = Request.Post(workerUrl)
.bodyString(ad, ContentType.APPLICATION_JSON)
@@ -62,14 +60,14 @@ public class GuessManagement {
.socketTimeout(100000)
.execute().returnContent().asString();
- GuessSchema guessSchema = JsonLdUtils.fromJsonLd(responseString, GuessSchema.class);
+ GuessSchema guessSchema = mapper.readValue(responseString, GuessSchema.class);
if (guessSchema.getEventSchema() != null) {
return guessSchema;
} else {
- ErrorMessageLd errorMessageLd = JsonLdUtils.fromJsonLd(responseString, ErrorMessageLd.class, StreamPipes.ERROR_MESSAGE);
- if (errorMessageLd.getNotifications() != null && errorMessageLd.getNotifications().get(0) != null) {
- throw new AdapterException(errorMessageLd.getNotifications().get(0).getTitle());
+ Message errorMessage = mapper.readValue(responseString, Message.class);
+ if (errorMessage.getNotifications() != null && errorMessage.getNotifications().get(0) != null) {
+ throw new AdapterException(errorMessage.getNotifications().get(0).getTitle());
} else {
throw new AdapterException("There was an error while guessing the schema in the worker with the URL: " + workerUrl + "\n" +
errorMessage);
diff --git a/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/management/WorkerRestClient.java b/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/management/WorkerRestClient.java
index b913e3a..9d6d4c1 100644
--- a/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/management/WorkerRestClient.java
+++ b/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/management/WorkerRestClient.java
@@ -24,6 +24,7 @@ import org.apache.http.entity.ContentType;
import org.apache.http.entity.mime.MultipartEntity;
import org.apache.http.entity.mime.content.InputStreamBody;
import org.apache.streampipes.model.connect.grounding.ProtocolDescription;
+import org.apache.streampipes.serializers.json.JacksonSerializer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.streampipes.connect.adapter.exception.AdapterException;
@@ -83,7 +84,7 @@ public class WorkerRestClient {
ad.setUri("https://streampipes.org/adapter/" + UUID.randomUUID());
}
- String adapterDescription = JsonLdUtils.toJsonLD(ad);
+ String adapterDescription = JacksonSerializer.getObjectMapper().writeValueAsString(ad);
String responseString = Request.Post(url)
.bodyString(adapterDescription, ContentType.APPLICATION_JSON)
diff --git a/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest/AdapterResource.java b/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest/AdapterResource.java
index 89be2f3..bbf18e4 100644
--- a/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest/AdapterResource.java
+++ b/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest/AdapterResource.java
@@ -18,31 +18,22 @@
package org.apache.streampipes.connect.container.master.rest;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.apache.streampipes.connect.adapter.exception.AdapterException;
import org.apache.streampipes.connect.container.master.management.AdapterMasterManagement;
import org.apache.streampipes.connect.container.master.management.Utils;
-import org.apache.streampipes.connect.management.AdapterDeserializer;
import org.apache.streampipes.connect.rest.AbstractContainerResource;
-import org.apache.streampipes.model.client.messages.Notifications;
import org.apache.streampipes.model.connect.adapter.AdapterDescription;
import org.apache.streampipes.model.connect.adapter.AdapterDescriptionList;
-import org.apache.streampipes.rest.shared.annotation.GsonWithIds;
-import org.apache.streampipes.rest.shared.annotation.JsonLdSerialized;
-import org.apache.streampipes.rest.shared.util.SpMediaType;
+import org.apache.streampipes.model.message.Notifications;
+import org.apache.streampipes.rest.shared.annotation.JacksonSerialized;
import org.apache.streampipes.storage.couchdb.impl.AdapterStorageImpl;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
-import java.util.List;
-
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
+import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
+import java.util.List;
@Path("/api/v1/{username}/master/adapters")
public class AdapterResource extends AbstractContainerResource {
@@ -57,22 +48,12 @@ public class AdapterResource extends AbstractContainerResource {
}
@POST
-// @JsonLdSerialized
@Path("/")
- @GsonWithIds
+ @JacksonSerialized
@Produces(MediaType.APPLICATION_JSON)
- public Response addAdapter(String s, @PathParam("username") String userName) {
+ public Response addAdapter(AdapterDescription adapterDescription, @PathParam("username") String userName) {
- AdapterDescription adapterDescription = null;
String adapterId;
-
- try {
- adapterDescription = AdapterDeserializer.getAdapterDescription(s);
- } catch (AdapterException e) {
- LOG.error("Could not deserialize AdapterDescription: " + s, e);
- e.printStackTrace();
- }
-
LOG.info("User: " + userName + " starts adapter " + adapterDescription.getAdapterId());
@@ -92,9 +73,9 @@ public class AdapterResource extends AbstractContainerResource {
}
@GET
- @JsonLdSerialized
+ @JacksonSerialized
@Path("/{id}")
- @Produces(SpMediaType.JSONLD)
+ @Produces(MediaType.APPLICATION_JSON)
public Response getAdapter(@PathParam("id") String id, @PathParam("username") String userName) {
try {
@@ -110,7 +91,7 @@ public class AdapterResource extends AbstractContainerResource {
@DELETE
- @JsonLdSerialized
+ @JacksonSerialized
@Path("/{id}")
@Produces(MediaType.APPLICATION_JSON)
public Response deleteAdapter(@PathParam("id") String id, @PathParam("username") String userName) {
@@ -130,9 +111,9 @@ public class AdapterResource extends AbstractContainerResource {
}
@GET
- @JsonLdSerialized
+ @JacksonSerialized
@Path("/")
- @Produces(SpMediaType.JSONLD)
+ @Produces(MediaType.APPLICATION_JSON)
public Response getAllAdapters(String id, @PathParam("username") String userName) {
try {
List<AdapterDescription> allAdapterDescription = adapterMasterManagement.getAllAdapters(new AdapterStorageImpl());
diff --git a/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest/AdapterTemplateResource.java b/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest/AdapterTemplateResource.java
index 49e5254..f51972b 100644
--- a/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest/AdapterTemplateResource.java
+++ b/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest/AdapterTemplateResource.java
@@ -18,25 +18,18 @@
package org.apache.streampipes.connect.container.master.rest;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.apache.streampipes.connect.adapter.exception.AdapterException;
-import org.apache.streampipes.connect.management.AdapterDeserializer;
import org.apache.streampipes.connect.container.master.management.AdapterTemplateMasterManagement;
+import org.apache.streampipes.connect.management.AdapterDeserializer;
import org.apache.streampipes.connect.rest.AbstractContainerResource;
-import org.apache.streampipes.model.client.messages.Notifications;
+import org.apache.streampipes.model.message.Notifications;
import org.apache.streampipes.model.connect.adapter.AdapterDescription;
import org.apache.streampipes.model.connect.adapter.AdapterDescriptionList;
-import org.apache.streampipes.rest.shared.annotation.GsonWithIds;
-import org.apache.streampipes.rest.shared.annotation.JsonLdSerialized;
-import org.apache.streampipes.rest.shared.util.SpMediaType;
-
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
+import org.apache.streampipes.rest.shared.annotation.JacksonSerialized;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
@@ -54,9 +47,8 @@ public class AdapterTemplateResource extends AbstractContainerResource {
}
@POST
-// @JsonLdSerialized
@Path("/")
- @GsonWithIds
+ @JacksonSerialized
@Produces(MediaType.APPLICATION_JSON)
public Response addAdapterTemplate(String s, @PathParam("username") String userName) {
@@ -83,9 +75,9 @@ public class AdapterTemplateResource extends AbstractContainerResource {
}
@GET
- @JsonLdSerialized
+ @JacksonSerialized
@Path("/all")
- @Produces(SpMediaType.JSONLD)
+ @Produces(MediaType.APPLICATION_JSON)
public Response getAllAdapterTemplates(String id, @PathParam("username") String userName) {
try {
AdapterDescriptionList result = adapterTemplateMasterManagement.getAllAdapterTemplates();
@@ -100,7 +92,7 @@ public class AdapterTemplateResource extends AbstractContainerResource {
@DELETE
- @JsonLdSerialized
+ @JacksonSerialized
@Path("/{id}")
@Produces(MediaType.APPLICATION_JSON)
public Response deleteAdapter(@PathParam("id") String id, @PathParam("username") String userName) {
diff --git a/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest/DescriptionResource.java b/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest/DescriptionResource.java
index 4b03e1f..44dc78f 100644
--- a/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest/DescriptionResource.java
+++ b/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest/DescriptionResource.java
@@ -18,18 +18,17 @@
package org.apache.streampipes.connect.container.master.rest;
import org.apache.streampipes.connect.adapter.exception.AdapterException;
-import org.apache.streampipes.model.connect.adapter.AdapterDescription;
-import org.apache.streampipes.model.connect.grounding.ProtocolDescription;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.streampipes.connect.container.master.management.Utils;
import org.apache.streampipes.connect.container.master.management.DescriptionManagement;
+import org.apache.streampipes.connect.container.master.management.Utils;
import org.apache.streampipes.connect.rest.AbstractContainerResource;
+import org.apache.streampipes.model.connect.adapter.AdapterDescription;
import org.apache.streampipes.model.connect.adapter.AdapterDescriptionList;
import org.apache.streampipes.model.connect.grounding.FormatDescriptionList;
+import org.apache.streampipes.model.connect.grounding.ProtocolDescription;
import org.apache.streampipes.model.connect.grounding.ProtocolDescriptionList;
-import org.apache.streampipes.rest.shared.annotation.JsonLdSerialized;
-import org.apache.streampipes.rest.shared.util.SpMediaType;
+import org.apache.streampipes.rest.shared.annotation.JacksonSerialized;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
@@ -55,9 +54,9 @@ public class DescriptionResource extends AbstractContainerResource {
}
@GET
- @JsonLdSerialized
+ @JacksonSerialized
@Path("/formats")
- @Produces(SpMediaType.JSONLD)
+ @Produces(MediaType.APPLICATION_JSON)
public Response getFormats() {
FormatDescriptionList result = descriptionManagement.getFormats();
@@ -65,9 +64,9 @@ public class DescriptionResource extends AbstractContainerResource {
}
@GET
- @JsonLdSerialized
+ @JacksonSerialized
@Path("/protocols")
- @Produces(SpMediaType.JSONLD)
+ @Produces(MediaType.APPLICATION_JSON)
public Response getProtocols() {
ProtocolDescriptionList result = descriptionManagement.getProtocols();
@@ -75,9 +74,9 @@ public class DescriptionResource extends AbstractContainerResource {
}
@GET
- @JsonLdSerialized
+ @JacksonSerialized
@Path("/adapters")
- @Produces(SpMediaType.JSONLD)
+ @Produces(MediaType.APPLICATION_JSON)
public Response getAdapters() {
AdapterDescriptionList result = descriptionManagement.getAdapters();
@@ -158,7 +157,7 @@ public class DescriptionResource extends AbstractContainerResource {
return ok(result);
}
} catch (AdapterException e) {
- logger.error("Not found adapter with id " + id, e);
+ logger.error("Not found adapter with id " + id);
return fail();
}
}
diff --git a/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest/GuessResource.java b/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest/GuessResource.java
index bb4be28..da2eeed 100644
--- a/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest/GuessResource.java
+++ b/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest/GuessResource.java
@@ -18,24 +18,18 @@
package org.apache.streampipes.connect.container.master.rest;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
import org.apache.streampipes.connect.adapter.exception.ParseException;
-import org.apache.streampipes.connect.management.AdapterDeserializer;
import org.apache.streampipes.connect.container.master.management.GuessManagement;
import org.apache.streampipes.connect.rest.AbstractContainerResource;
-import org.apache.streampipes.model.client.messages.Notifications;
+import org.apache.streampipes.model.message.Notifications;
import org.apache.streampipes.model.connect.adapter.AdapterDescription;
import org.apache.streampipes.model.connect.guess.GuessSchema;
-import org.apache.streampipes.rest.shared.annotation.JsonLdSerialized;
-import org.apache.streampipes.rest.shared.util.SpMediaType;
-
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
+import org.apache.streampipes.rest.shared.annotation.JacksonSerialized;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.ws.rs.*;
+import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
@@ -55,28 +49,29 @@ public class GuessResource extends AbstractContainerResource {
}
@POST
- @JsonLdSerialized
+ @JacksonSerialized
@Path("/schema")
- @Produces(SpMediaType.JSONLD)
- public Response guessSchema(String s, @PathParam("username") String userName) {
+ @Produces(MediaType.APPLICATION_JSON)
+ public Response guessSchema(AdapterDescription adapterDescription, @PathParam("username") String userName) {
try {
- AdapterDescription adapterDescription = AdapterDeserializer.getAdapterDescription(s);
+ //AdapterDescription adapterDescription = AdapterDeserializer.getAdapterDescription(s);
GuessSchema result = guessManagement.guessSchema(adapterDescription);
return ok(result);
} catch (ParseException e) {
logger.error("Error while parsing events: ", e);
- return ok(Notifications.error(e.getMessage()));
+ return error(Notifications.error(e.getMessage()));
} catch (Exception e) {
- logger.error("Error while guess schema for AdapterDescription: " + s, e);
- return ok(Notifications.error(e.getMessage()));
+ logger.error("Error while guess schema for AdapterDescription: ", e);
+ return error(Notifications.error(e.getMessage()));
}
}
@GET
- @Produces(SpMediaType.JSONLD)
+ @JacksonSerialized
+ @Produces(MediaType.APPLICATION_JSON)
@Path("/format")
public Response guessFormat() {
//TODO
@@ -85,7 +80,8 @@ public class GuessResource extends AbstractContainerResource {
@GET
- @Produces(SpMediaType.JSONLD)
+ @JacksonSerialized
+ @Produces(MediaType.APPLICATION_JSON)
@Path("/formatdescription")
public Response guessFormatDescription() {
//TODO
diff --git a/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest/SourcesResource.java b/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest/SourcesResource.java
index ab5ef88..20bce3c 100644
--- a/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest/SourcesResource.java
+++ b/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest/SourcesResource.java
@@ -25,7 +25,7 @@ import org.apache.streampipes.connect.config.ConnectContainerConfig;
import org.apache.streampipes.connect.container.master.management.SourcesManagement;
import org.apache.streampipes.connect.rest.AbstractContainerResource;
import org.apache.streampipes.model.SpDataSet;
-import org.apache.streampipes.model.client.messages.Notifications;
+import org.apache.streampipes.model.message.Notifications;
import org.apache.streampipes.model.graph.DataSourceDescription;
import org.apache.streampipes.rest.shared.annotation.GsonWithIds;
import org.apache.streampipes.rest.shared.annotation.JsonLdSerialized;
diff --git a/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest/WorkerAdministrationResource.java b/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest/WorkerAdministrationResource.java
index 7e785b4..68d2108 100644
--- a/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest/WorkerAdministrationResource.java
+++ b/streampipes-connect-container-master/src/main/java/org/apache/streampipes/connect/container/master/rest/WorkerAdministrationResource.java
@@ -22,7 +22,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.streampipes.connect.container.master.management.WorkerAdministrationManagement;
import org.apache.streampipes.connect.rest.AbstractContainerResource;
-import org.apache.streampipes.model.client.messages.Notifications;
+import org.apache.streampipes.model.message.Notifications;
import org.apache.streampipes.model.connect.worker.ConnectWorkerContainer;
import org.apache.streampipes.rest.shared.annotation.GsonWithIds;
import org.apache.streampipes.rest.shared.util.JsonLdUtils;
diff --git a/streampipes-connect-container-worker/src/main/java/org/apache/streampipes/connect/container/worker/rest/FileResource.java b/streampipes-connect-container-worker/src/main/java/org/apache/streampipes/connect/container/worker/rest/FileResource.java
index 62a30cc..4c63db7 100644
--- a/streampipes-connect-container-worker/src/main/java/org/apache/streampipes/connect/container/worker/rest/FileResource.java
+++ b/streampipes-connect-container-worker/src/main/java/org/apache/streampipes/connect/container/worker/rest/FileResource.java
@@ -24,7 +24,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.streampipes.connect.container.worker.management.FileManagement;
import org.apache.streampipes.connect.rest.AbstractContainerResource;
-import org.apache.streampipes.model.client.messages.Notifications;
+import org.apache.streampipes.model.message.Notifications;
import java.io.File;
import java.io.IOException;
diff --git a/streampipes-connect-container-worker/src/main/java/org/apache/streampipes/connect/container/worker/rest/GuessResource.java b/streampipes-connect-container-worker/src/main/java/org/apache/streampipes/connect/container/worker/rest/GuessResource.java
index 9d5dc78..c88b162 100644
--- a/streampipes-connect-container-worker/src/main/java/org/apache/streampipes/connect/container/worker/rest/GuessResource.java
+++ b/streampipes-connect-container-worker/src/main/java/org/apache/streampipes/connect/container/worker/rest/GuessResource.java
@@ -18,22 +18,21 @@
package org.apache.streampipes.connect.container.worker.rest;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.apache.streampipes.connect.adapter.exception.ParseException;
-import org.apache.streampipes.connect.management.AdapterDeserializer;
import org.apache.streampipes.connect.container.worker.management.GuessManagement;
import org.apache.streampipes.connect.rest.AbstractContainerResource;
-import org.apache.streampipes.model.client.messages.Notifications;
+import org.apache.streampipes.model.message.Notifications;
import org.apache.streampipes.model.connect.adapter.AdapterDescription;
import org.apache.streampipes.model.connect.guess.GuessSchema;
-import org.apache.streampipes.rest.shared.annotation.JsonLdSerialized;
-import org.apache.streampipes.rest.shared.util.SpMediaType;
+import org.apache.streampipes.rest.shared.annotation.JacksonSerialized;
+import org.slf4j.Logger;
+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;
@@ -53,13 +52,13 @@ public class GuessResource extends AbstractContainerResource {
}
@POST
- @JsonLdSerialized
+ @JacksonSerialized
@Path("/schema")
- @Produces(SpMediaType.JSONLD)
- public Response guessSchema(String s, @PathParam("username") String userName) {
+ @Produces(MediaType.APPLICATION_JSON)
+ public Response guessSchema(AdapterDescription adapterDescription, @PathParam("username") String userName) {
try {
- AdapterDescription adapterDescription = AdapterDeserializer.getAdapterDescription(s);
+ //AdapterDescription adapterDescription = AdapterDeserializer.getAdapterDescription(s);
GuessSchema result = guessManagement.guessSchema(adapterDescription);
return ok(result);
@@ -67,7 +66,7 @@ public class GuessResource extends AbstractContainerResource {
logger.error("Error while parsing events: ", e);
return ok(Notifications.error(e.getMessage()));
} catch (Exception e) {
- logger.error("Error while guess schema for AdapterDescription: " + s, e);
+ logger.error("Error while guess schema for AdapterDescription: " + adapterDescription.getAdapterId(), e);
return ok(Notifications.error(e.getMessage()));
}
diff --git a/streampipes-connect-container-worker/src/main/java/org/apache/streampipes/connect/container/worker/rest/WorkerResource.java b/streampipes-connect-container-worker/src/main/java/org/apache/streampipes/connect/container/worker/rest/WorkerResource.java
index 9d368a5..b9dcdba 100644
--- a/streampipes-connect-container-worker/src/main/java/org/apache/streampipes/connect/container/worker/rest/WorkerResource.java
+++ b/streampipes-connect-container-worker/src/main/java/org/apache/streampipes/connect/container/worker/rest/WorkerResource.java
@@ -18,18 +18,20 @@
package org.apache.streampipes.connect.container.worker.rest;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.apache.streampipes.connect.adapter.exception.AdapterException;
-import org.apache.streampipes.connect.management.AdapterDeserializer;
import org.apache.streampipes.connect.container.worker.management.AdapterWorkerManagement;
import org.apache.streampipes.connect.rest.AbstractContainerResource;
-import org.apache.streampipes.model.client.messages.Notifications;
import org.apache.streampipes.model.connect.adapter.AdapterSetDescription;
import org.apache.streampipes.model.connect.adapter.AdapterStreamDescription;
-import org.apache.streampipes.rest.shared.annotation.JsonLdSerialized;
+import org.apache.streampipes.model.message.Notifications;
+import org.apache.streampipes.rest.shared.annotation.JacksonSerialized;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
-import javax.ws.rs.*;
+import javax.ws.rs.Consumes;
+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;
@@ -49,18 +51,13 @@ public class WorkerResource extends AbstractContainerResource {
}
@POST
- @JsonLdSerialized
+ @JacksonSerialized
@Path("/stream/invoke")
-// @Consumes(SpMediaType.JSONLD)
+ @Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- public Response invokeStreamAdapter(String adapterDescription) {
-
- AdapterStreamDescription adapterStreamDescription = null;
+ public Response invokeStreamAdapter(AdapterStreamDescription adapterStreamDescription) {
try {
- adapterStreamDescription = (AdapterStreamDescription)
- AdapterDeserializer.getAdapterDescription(adapterDescription);
-
adapterManagement.invokeStreamAdapter(adapterStreamDescription);
} catch (AdapterException e) {
logger.error("Error while starting adapter with id " + adapterStreamDescription.getUri(), e);
@@ -73,18 +70,13 @@ public class WorkerResource extends AbstractContainerResource {
}
@POST
- @JsonLdSerialized
+ @JacksonSerialized
@Path("/stream/stop")
-// @Consumes(SpMediaType.JSONLD)
+ @Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- public Response stopStreamAdapter(String adapterDescription) {
-
- AdapterStreamDescription adapterStreamDescription = null;
+ public Response stopStreamAdapter(AdapterStreamDescription adapterStreamDescription) {
try {
- adapterStreamDescription = (AdapterStreamDescription)
- AdapterDeserializer.getAdapterDescription(adapterDescription);
-
adapterManagement.stopStreamAdapter(adapterStreamDescription);
} catch (AdapterException e) {
logger.error("Error while stopping adapter with id " + adapterStreamDescription.getUri(), e);
@@ -98,18 +90,13 @@ public class WorkerResource extends AbstractContainerResource {
}
@POST
- @JsonLdSerialized
+ @JacksonSerialized
@Path("/set/invoke")
-// @Consumes(SpMediaType.JSONLD)
+ @Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- public Response invokeSetAdapter(String adapterDescription) {
-
- AdapterSetDescription adapterSetDescription = null;
+ public Response invokeSetAdapter(AdapterSetDescription adapterSetDescription) {
try {
- adapterSetDescription = (AdapterSetDescription)
- AdapterDeserializer.getAdapterDescription(adapterDescription);
-
adapterManagement.invokeSetAdapter(adapterSetDescription);
} catch (AdapterException e) {
logger.error("Error while starting adapter with id " + adapterSetDescription.getUri(), e);
@@ -123,18 +110,13 @@ public class WorkerResource extends AbstractContainerResource {
}
@POST
- @JsonLdSerialized
+ @JacksonSerialized
@Path("/set/stop")
-// @Consumes(SpMediaType.JSONLD)
+ @Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
- public Response stopSetAdapter(String adapterDescription){
-
- AdapterSetDescription adapterSetDescription = null;
+ public Response stopSetAdapter(AdapterSetDescription adapterSetDescription){
try {
- adapterSetDescription = (AdapterSetDescription)
- AdapterDeserializer.getAdapterDescription(adapterDescription);
-
adapterManagement.stopSetAdapter(adapterSetDescription);
} catch (AdapterException e) {
logger.error("Error while stopping adapter with id " + adapterSetDescription.getUri(), e);
@@ -146,9 +128,4 @@ public class WorkerResource extends AbstractContainerResource {
logger.info(responseMessage);
return ok(Notifications.success(responseMessage));
}
-
- public void setAdapterManagement(AdapterWorkerManagement adapterManagement) {
- this.adapterManagement = adapterManagement;
- }
-
}
diff --git a/streampipes-connect-container/src/main/java/org/apache/streampipes/connect/rest/AbstractContainerResource.java b/streampipes-connect-container/src/main/java/org/apache/streampipes/connect/rest/AbstractContainerResource.java
index 275b8a3..6ed7d23 100644
--- a/streampipes-connect-container/src/main/java/org/apache/streampipes/connect/rest/AbstractContainerResource.java
+++ b/streampipes-connect-container/src/main/java/org/apache/streampipes/connect/rest/AbstractContainerResource.java
@@ -18,7 +18,7 @@
package org.apache.streampipes.connect.rest;
-import org.apache.streampipes.model.shared.message.Message;
+import org.apache.streampipes.model.message.Message;
import javax.ws.rs.core.Response;
@@ -37,6 +37,13 @@ public abstract class AbstractContainerResource {
.build();
}
+ protected <T> Response error(T entity) {
+ return Response
+ .status(500)
+ .entity(entity)
+ .build();
+ }
+
protected Response statusMessage(Message message) {
return ok(message);
diff --git a/streampipes-model-client/pom.xml b/streampipes-model-client/pom.xml
index 95fdcc1..915e6a3 100644
--- a/streampipes-model-client/pom.xml
+++ b/streampipes-model-client/pom.xml
@@ -46,45 +46,45 @@
</dependency>
</dependencies>
-<!-- <build>-->
-<!-- <plugins>-->
-<!-- <plugin>-->
-<!-- <groupId>cz.habarta.typescript-generator</groupId>-->
-<!-- <artifactId>typescript-generator-maven-plugin</artifactId>-->
-<!-- <version>2.23.603</version>-->
-<!-- <executions>-->
-<!-- <execution>-->
-<!-- <id>generate</id>-->
-<!-- <goals>-->
-<!-- <goal>generate</goal>-->
-<!-- </goals>-->
-<!-- <phase>process-classes</phase>-->
-<!-- </execution>-->
-<!-- </executions>-->
-<!-- <configuration>-->
-<!-- <jsonLibrary>jackson2</jsonLibrary>-->
-<!-- <classesWithAnnotations>-->
-<!-- <annotation>org.apache.streampipes.model.shared.annotation.TsModel</annotation>-->
-<!-- </classesWithAnnotations>-->
-<!-- <excludePropertyAnnotations>-->
-<!-- <annotation>org.apache.streampipes.model.shared.annotation.TsIgnore</annotation>-->
-<!-- </excludePropertyAnnotations>-->
-<!-- <excludeClasses>-->
-<!-- <class>io.fogsy.empire.core.empire.SupportsRdfId</class>-->
-<!-- <class>java.io.Serializable</class>-->
-<!-- </excludeClasses>-->
-<!-- <outputKind>module</outputKind>-->
-<!-- <outputFileType>implementationFile</outputFileType>-->
-<!-- <outputKind>module</outputKind>-->
-<!-- <disableTaggedUnions>false</disableTaggedUnions>-->
-<!-- <mapClasses>asClasses</mapClasses>-->
-<!-- <sortDeclarations>true</sortDeclarations>-->
-<!-- <tsNoCheck>true</tsNoCheck>-->
-<!-- <extensions>-->
-<!-- <extension>cz.habarta.typescript.generator.ext.JsonDeserializationExtension</extension>-->
-<!-- </extensions>-->
-<!-- </configuration>-->
-<!-- </plugin>-->
-<!-- </plugins>-->
-<!-- </build>-->
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>cz.habarta.typescript-generator</groupId>
+ <artifactId>typescript-generator-maven-plugin</artifactId>
+ <version>2.23.603</version>
+ <executions>
+ <execution>
+ <id>generate</id>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ <phase>process-classes</phase>
+ </execution>
+ </executions>
+ <configuration>
+ <jsonLibrary>jackson2</jsonLibrary>
+ <classesWithAnnotations>
+ <annotation>org.apache.streampipes.model.shared.annotation.TsModel</annotation>
+ </classesWithAnnotations>
+ <excludePropertyAnnotations>
+ <annotation>org.apache.streampipes.model.shared.annotation.TsIgnore</annotation>
+ </excludePropertyAnnotations>
+ <excludeClasses>
+ <class>io.fogsy.empire.core.empire.SupportsRdfId</class>
+ <class>java.io.Serializable</class>
+ </excludeClasses>
+ <outputKind>module</outputKind>
+ <outputFileType>implementationFile</outputFileType>
+ <outputKind>module</outputKind>
+ <disableTaggedUnions>false</disableTaggedUnions>
+ <mapClasses>asClasses</mapClasses>
+ <sortDeclarations>true</sortDeclarations>
+ <tsNoCheck>true</tsNoCheck>
+ <extensions>
+ <extension>cz.habarta.typescript.generator.ext.JsonDeserializationExtension</extension>
+ </extensions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
\ No newline at end of file
diff --git a/streampipes-model-client/src/main/java/org/apache/streampipes/model/client/messages/AppInstallationMessage.java b/streampipes-model-client/src/main/java/org/apache/streampipes/model/client/messages/AppInstallationMessage.java
deleted file mode 100644
index 8064938..0000000
--- a/streampipes-model-client/src/main/java/org/apache/streampipes/model/client/messages/AppInstallationMessage.java
+++ /dev/null
@@ -1,63 +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.model.client.messages;
-
-import org.apache.streampipes.model.shared.message.Message;
-
-import java.util.List;
-
-public class AppInstallationMessage {
-
- private boolean success;
- private String errorMessage;
-
- List<Message> importMessages;
-
- public AppInstallationMessage(boolean success, List<Message> importMessages) {
- super();
- this.success = success;
- this.importMessages = importMessages;
- }
-
- public AppInstallationMessage(boolean success, String errorMessage) {
- this.success = success;
- this.errorMessage = errorMessage;
- }
- public boolean isSuccess() {
- return success;
- }
- public void setSuccess(boolean success) {
- this.success = success;
- }
- public List<Message> getImportMessages() {
- return importMessages;
- }
- public void setImportMessages(List<Message> importMessages) {
- this.importMessages = importMessages;
- }
-
- public String getErrorMessage() {
- return errorMessage;
- }
-
- public void setErrorMessage(String errorMessage) {
- this.errorMessage = errorMessage;
- }
-
-}
diff --git a/streampipes-model/src/main/java/org/apache/streampipes/model/connect/adapter/AdapterDescription.java b/streampipes-model/src/main/java/org/apache/streampipes/model/connect/adapter/AdapterDescription.java
index d6805c4..be693ce 100644
--- a/streampipes-model/src/main/java/org/apache/streampipes/model/connect/adapter/AdapterDescription.java
+++ b/streampipes-model/src/main/java/org/apache/streampipes/model/connect/adapter/AdapterDescription.java
@@ -18,6 +18,7 @@
package org.apache.streampipes.model.connect.adapter;
+import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.google.gson.annotations.SerializedName;
import io.fogsy.empire.annotations.Namespaces;
@@ -32,6 +33,7 @@ import org.apache.streampipes.model.grounding.EventGrounding;
import org.apache.streampipes.model.grounding.KafkaTransportProtocol;
import org.apache.streampipes.model.grounding.SimpleTopicDefinition;
import org.apache.streampipes.model.grounding.TransportProtocol;
+import org.apache.streampipes.model.shared.annotation.TsModel;
import org.apache.streampipes.model.staticproperty.StaticProperty;
import org.apache.streampipes.model.util.Cloner;
import org.apache.streampipes.vocabulary.StreamPipes;
@@ -47,14 +49,19 @@ import java.util.List;
@RdfsClass("sp:AdapterDescription")
@Entity
@JsonSubTypes({
- @JsonSubTypes.Type(AdapterSetDescription.class),
- @JsonSubTypes.Type(AdapterStreamDescription.class)
+ @JsonSubTypes.Type(GenericAdapterSetDescription.class),
+ @JsonSubTypes.Type(GenericAdapterStreamDescription.class),
+ @JsonSubTypes.Type(SpecificAdapterStreamDescription.class),
+ @JsonSubTypes.Type(SpecificAdapterSetDescription.class)
})
+@TsModel
public abstract class AdapterDescription extends NamedStreamPipesEntity {
@RdfProperty("sp:couchDBId")
+ @JsonProperty("couchDBId")
private @SerializedName("_id") String id;
+ @JsonProperty("_rev")
private @SerializedName("_rev") String rev;
@RdfProperty("sp:adapterId")
diff --git a/streampipes-model/src/main/java/org/apache/streampipes/model/connect/adapter/AdapterDescriptionList.java b/streampipes-model/src/main/java/org/apache/streampipes/model/connect/adapter/AdapterDescriptionList.java
index 4e97007..bed7d4b 100644
--- a/streampipes-model/src/main/java/org/apache/streampipes/model/connect/adapter/AdapterDescriptionList.java
+++ b/streampipes-model/src/main/java/org/apache/streampipes/model/connect/adapter/AdapterDescriptionList.java
@@ -22,6 +22,7 @@ import io.fogsy.empire.annotations.Namespaces;
import io.fogsy.empire.annotations.RdfProperty;
import io.fogsy.empire.annotations.RdfsClass;
import org.apache.streampipes.model.base.NamedStreamPipesEntity;
+import org.apache.streampipes.model.shared.annotation.TsModel;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
@@ -33,6 +34,7 @@ import java.util.List;
@Namespaces({"sp", "https://streampipes.org/vocabulary/v1/"})
@RdfsClass("sp:AdapterDescriptionList")
@Entity
+@TsModel
public class AdapterDescriptionList extends NamedStreamPipesEntity {
@OneToMany(fetch = FetchType.EAGER,
cascade = {CascadeType.ALL})
diff --git a/streampipes-model/src/main/java/org/apache/streampipes/model/connect/adapter/GenericAdapterSetDescription.java b/streampipes-model/src/main/java/org/apache/streampipes/model/connect/adapter/GenericAdapterSetDescription.java
index f794ea9..dd13b47 100644
--- a/streampipes-model/src/main/java/org/apache/streampipes/model/connect/adapter/GenericAdapterSetDescription.java
+++ b/streampipes-model/src/main/java/org/apache/streampipes/model/connect/adapter/GenericAdapterSetDescription.java
@@ -25,6 +25,7 @@ import org.apache.streampipes.model.connect.grounding.FormatDescription;
import org.apache.streampipes.model.connect.grounding.ProtocolDescription;
import org.apache.streampipes.model.connect.grounding.ProtocolSetDescription;
import org.apache.streampipes.model.schema.EventSchema;
+import org.apache.streampipes.model.shared.annotation.TsModel;
import org.apache.streampipes.vocabulary.StreamPipes;
import javax.persistence.Entity;
@@ -32,6 +33,7 @@ import javax.persistence.Entity;
@Namespaces({"sp", "https://streampipes.org/vocabulary/v1/"})
@RdfsClass(StreamPipes.GENERIC_ADAPTER_SET_DESCRIPTION)
@Entity
+@TsModel
public class GenericAdapterSetDescription extends AdapterSetDescription implements GenericAdapterDescription {
public static final String ID = "http://streampipes.org/genericadaptersetdescription";
diff --git a/streampipes-model/src/main/java/org/apache/streampipes/model/connect/adapter/GenericAdapterStreamDescription.java b/streampipes-model/src/main/java/org/apache/streampipes/model/connect/adapter/GenericAdapterStreamDescription.java
index e4e27d0..bef7a09 100644
--- a/streampipes-model/src/main/java/org/apache/streampipes/model/connect/adapter/GenericAdapterStreamDescription.java
+++ b/streampipes-model/src/main/java/org/apache/streampipes/model/connect/adapter/GenericAdapterStreamDescription.java
@@ -25,6 +25,7 @@ import org.apache.streampipes.model.connect.grounding.FormatDescription;
import org.apache.streampipes.model.connect.grounding.ProtocolDescription;
import org.apache.streampipes.model.connect.grounding.ProtocolStreamDescription;
import org.apache.streampipes.model.schema.EventSchema;
+import org.apache.streampipes.model.shared.annotation.TsModel;
import org.apache.streampipes.vocabulary.StreamPipes;
import javax.persistence.Entity;
@@ -32,6 +33,7 @@ import javax.persistence.Entity;
@Namespaces({"sp", "https://streampipes.org/vocabulary/v1/"})
@RdfsClass(StreamPipes.GENERIC_ADAPTER_STREAM_DESCRIPTION)
@Entity
+@TsModel
public class GenericAdapterStreamDescription extends AdapterStreamDescription implements GenericAdapterDescription{
public static final String ID = "http://streampipes.org/genericadapterstreamdescription";
diff --git a/streampipes-model/src/main/java/org/apache/streampipes/model/connect/adapter/SpecificAdapterSetDescription.java b/streampipes-model/src/main/java/org/apache/streampipes/model/connect/adapter/SpecificAdapterSetDescription.java
index f541f1d..8f15123 100644
--- a/streampipes-model/src/main/java/org/apache/streampipes/model/connect/adapter/SpecificAdapterSetDescription.java
+++ b/streampipes-model/src/main/java/org/apache/streampipes/model/connect/adapter/SpecificAdapterSetDescription.java
@@ -20,12 +20,14 @@ package org.apache.streampipes.model.connect.adapter;
import io.fogsy.empire.annotations.Namespaces;
import io.fogsy.empire.annotations.RdfsClass;
+import org.apache.streampipes.model.shared.annotation.TsModel;
import javax.persistence.Entity;
@Namespaces({"sp", "https://streampipes.org/vocabulary/v1/"})
@RdfsClass("sp:SpecificAdapterSetDescription")
@Entity
+@TsModel
public class SpecificAdapterSetDescription extends AdapterSetDescription {
public SpecificAdapterSetDescription() {
diff --git a/streampipes-model/src/main/java/org/apache/streampipes/model/connect/adapter/SpecificAdapterStreamDescription.java b/streampipes-model/src/main/java/org/apache/streampipes/model/connect/adapter/SpecificAdapterStreamDescription.java
index 2ec226e..2abc1af 100644
--- a/streampipes-model/src/main/java/org/apache/streampipes/model/connect/adapter/SpecificAdapterStreamDescription.java
+++ b/streampipes-model/src/main/java/org/apache/streampipes/model/connect/adapter/SpecificAdapterStreamDescription.java
@@ -20,12 +20,14 @@ package org.apache.streampipes.model.connect.adapter;
import io.fogsy.empire.annotations.Namespaces;
import io.fogsy.empire.annotations.RdfsClass;
+import org.apache.streampipes.model.shared.annotation.TsModel;
import javax.persistence.Entity;
@Namespaces({"sp", "https://streampipes.org/vocabulary/v1/"})
@RdfsClass("sp:SpecificAdapterStreamDescription")
@Entity
+@TsModel
public class SpecificAdapterStreamDescription extends AdapterStreamDescription {
public SpecificAdapterStreamDescription() {
diff --git a/streampipes-model/src/main/java/org/apache/streampipes/model/connect/grounding/FormatDescriptionList.java b/streampipes-model/src/main/java/org/apache/streampipes/model/connect/grounding/FormatDescriptionList.java
index 59d048e..703254b 100644
--- a/streampipes-model/src/main/java/org/apache/streampipes/model/connect/grounding/FormatDescriptionList.java
+++ b/streampipes-model/src/main/java/org/apache/streampipes/model/connect/grounding/FormatDescriptionList.java
@@ -22,6 +22,7 @@ import io.fogsy.empire.annotations.Namespaces;
import io.fogsy.empire.annotations.RdfProperty;
import io.fogsy.empire.annotations.RdfsClass;
import org.apache.streampipes.model.base.NamedStreamPipesEntity;
+import org.apache.streampipes.model.shared.annotation.TsModel;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
@@ -33,6 +34,7 @@ import java.util.List;
@Namespaces({"sp", "https://streampipes.org/vocabulary/v1/"})
@RdfsClass("sp:FormatDescriptionList")
@Entity
+@TsModel
public class FormatDescriptionList extends NamedStreamPipesEntity {
diff --git a/streampipes-model/src/main/java/org/apache/streampipes/model/connect/grounding/ProtocolDescription.java b/streampipes-model/src/main/java/org/apache/streampipes/model/connect/grounding/ProtocolDescription.java
index fa32a7d..870acad 100644
--- a/streampipes-model/src/main/java/org/apache/streampipes/model/connect/grounding/ProtocolDescription.java
+++ b/streampipes-model/src/main/java/org/apache/streampipes/model/connect/grounding/ProtocolDescription.java
@@ -22,21 +22,22 @@ import io.fogsy.empire.annotations.Namespaces;
import io.fogsy.empire.annotations.RdfProperty;
import io.fogsy.empire.annotations.RdfsClass;
import org.apache.streampipes.model.base.NamedStreamPipesEntity;
+import org.apache.streampipes.model.shared.annotation.TsModel;
import org.apache.streampipes.model.staticproperty.StaticProperty;
import org.apache.streampipes.model.util.Cloner;
import org.apache.streampipes.vocabulary.StreamPipes;
-import java.util.ArrayList;
-import java.util.List;
-
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
+import java.util.ArrayList;
+import java.util.List;
@Namespaces({"sp", "https://streampipes.org/vocabulary/v1/"})
@RdfsClass("sp:ProtocolDescription")
@Entity
+@TsModel
public class ProtocolDescription extends NamedStreamPipesEntity {
diff --git a/streampipes-model/src/main/java/org/apache/streampipes/model/connect/grounding/ProtocolDescriptionList.java b/streampipes-model/src/main/java/org/apache/streampipes/model/connect/grounding/ProtocolDescriptionList.java
index f0190d6..d801f74 100644
--- a/streampipes-model/src/main/java/org/apache/streampipes/model/connect/grounding/ProtocolDescriptionList.java
+++ b/streampipes-model/src/main/java/org/apache/streampipes/model/connect/grounding/ProtocolDescriptionList.java
@@ -23,6 +23,7 @@ import io.fogsy.empire.annotations.Namespaces;
import io.fogsy.empire.annotations.RdfProperty;
import io.fogsy.empire.annotations.RdfsClass;
import org.apache.streampipes.model.base.NamedStreamPipesEntity;
+import org.apache.streampipes.model.shared.annotation.TsModel;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
@@ -34,6 +35,7 @@ import java.util.List;
@Namespaces({"sp", "https://streampipes.org/vocabulary/v1/"})
@RdfsClass("sp:ProtocolDescriptionList")
@Entity
+@TsModel
public class ProtocolDescriptionList extends NamedStreamPipesEntity {
@OneToMany(fetch = FetchType.EAGER,
diff --git a/streampipes-model/src/main/java/org/apache/streampipes/model/connect/guess/GuessSchema.java b/streampipes-model/src/main/java/org/apache/streampipes/model/connect/guess/GuessSchema.java
index 5e3bc2b..ccb2866 100644
--- a/streampipes-model/src/main/java/org/apache/streampipes/model/connect/guess/GuessSchema.java
+++ b/streampipes-model/src/main/java/org/apache/streampipes/model/connect/guess/GuessSchema.java
@@ -23,6 +23,7 @@ import io.fogsy.empire.annotations.RdfProperty;
import io.fogsy.empire.annotations.RdfsClass;
import org.apache.streampipes.model.base.UnnamedStreamPipesEntity;
import org.apache.streampipes.model.schema.EventSchema;
+import org.apache.streampipes.model.shared.annotation.TsModel;
import org.apache.streampipes.vocabulary.StreamPipes;
import javax.persistence.CascadeType;
@@ -35,6 +36,7 @@ import java.util.List;
@Namespaces({"sp", "https://streampipes.org/vocabulary/v1/"})
@RdfsClass(StreamPipes.GUESS_SCHEMA)
@Entity
+@TsModel
public class GuessSchema extends UnnamedStreamPipesEntity {
@RdfProperty("sp:hasEventSchema")
diff --git a/streampipes-model/src/main/java/org/apache/streampipes/model/connect/rules/TransformationRuleDescription.java b/streampipes-model/src/main/java/org/apache/streampipes/model/connect/rules/TransformationRuleDescription.java
index e7df785..e99b32e 100644
--- a/streampipes-model/src/main/java/org/apache/streampipes/model/connect/rules/TransformationRuleDescription.java
+++ b/streampipes-model/src/main/java/org/apache/streampipes/model/connect/rules/TransformationRuleDescription.java
@@ -22,9 +22,17 @@ import com.fasterxml.jackson.annotation.JsonSubTypes;
import io.fogsy.empire.annotations.Namespaces;
import io.fogsy.empire.annotations.RdfsClass;
import org.apache.streampipes.model.base.UnnamedStreamPipesEntity;
-import org.apache.streampipes.model.connect.rules.schema.SchemaTransformationRuleDescription;
-import org.apache.streampipes.model.connect.rules.stream.StreamTransformationRuleDescription;
-import org.apache.streampipes.model.connect.rules.value.ValueTransformationRuleDescription;
+import org.apache.streampipes.model.connect.rules.schema.CreateNestedRuleDescription;
+import org.apache.streampipes.model.connect.rules.schema.DeleteRuleDescription;
+import org.apache.streampipes.model.connect.rules.schema.MoveRuleDescription;
+import org.apache.streampipes.model.connect.rules.schema.RenameRuleDescription;
+import org.apache.streampipes.model.connect.rules.stream.EventRateTransformationRuleDescription;
+import org.apache.streampipes.model.connect.rules.stream.RemoveDuplicatesTransformationRuleDescription;
+import org.apache.streampipes.model.connect.rules.value.AddTimestampRuleDescription;
+import org.apache.streampipes.model.connect.rules.value.AddValueTransformationRuleDescription;
+import org.apache.streampipes.model.connect.rules.value.TimestampTranfsformationRuleDescription;
+import org.apache.streampipes.model.connect.rules.value.UnitTransformRuleDescription;
+import org.apache.streampipes.model.shared.annotation.TsModel;
import org.apache.streampipes.vocabulary.StreamPipes;
import javax.persistence.Entity;
@@ -32,10 +40,18 @@ import javax.persistence.Entity;
@Namespaces({StreamPipes.NS_PREFIX, StreamPipes.NS})
@RdfsClass(StreamPipes.TRANSFORM_RULE_DESCRIPTION)
@Entity
+@TsModel
@JsonSubTypes({
- @JsonSubTypes.Type(ValueTransformationRuleDescription.class),
- @JsonSubTypes.Type(StreamTransformationRuleDescription.class),
- @JsonSubTypes.Type(SchemaTransformationRuleDescription.class),
+ @JsonSubTypes.Type(AddTimestampRuleDescription.class),
+ @JsonSubTypes.Type(AddValueTransformationRuleDescription.class),
+ @JsonSubTypes.Type(TimestampTranfsformationRuleDescription.class),
+ @JsonSubTypes.Type(UnitTransformRuleDescription.class),
+ @JsonSubTypes.Type(EventRateTransformationRuleDescription.class),
+ @JsonSubTypes.Type(RemoveDuplicatesTransformationRuleDescription.class),
+ @JsonSubTypes.Type(CreateNestedRuleDescription.class),
+ @JsonSubTypes.Type(DeleteRuleDescription.class),
+ @JsonSubTypes.Type(RenameRuleDescription.class),
+ @JsonSubTypes.Type(MoveRuleDescription.class),
})
public abstract class TransformationRuleDescription extends UnnamedStreamPipesEntity {
diff --git a/streampipes-model/src/main/java/org/apache/streampipes/model/connect/rules/value/TimestampTransformationRuleMode.java b/streampipes-model/src/main/java/org/apache/streampipes/model/connect/rules/value/TimestampTransformationRuleMode.java
index 30497cb..2afd46b 100644
--- a/streampipes-model/src/main/java/org/apache/streampipes/model/connect/rules/value/TimestampTransformationRuleMode.java
+++ b/streampipes-model/src/main/java/org/apache/streampipes/model/connect/rules/value/TimestampTransformationRuleMode.java
@@ -18,6 +18,7 @@
package org.apache.streampipes.model.connect.rules.value;
+
public class TimestampTransformationRuleMode {
public static final String FORMAT_STRING = "formatString";
diff --git a/streampipes-model/src/main/java/org/apache/streampipes/model/pipeline/DataSetModificationMessage.java b/streampipes-model/src/main/java/org/apache/streampipes/model/message/DataSetModificationMessage.java
similarity index 93%
rename from streampipes-model/src/main/java/org/apache/streampipes/model/pipeline/DataSetModificationMessage.java
rename to streampipes-model/src/main/java/org/apache/streampipes/model/message/DataSetModificationMessage.java
index 2eb362b..a15180f 100644
--- a/streampipes-model/src/main/java/org/apache/streampipes/model/pipeline/DataSetModificationMessage.java
+++ b/streampipes-model/src/main/java/org/apache/streampipes/model/message/DataSetModificationMessage.java
@@ -15,9 +15,8 @@
* limitations under the License.
*
*/
-package org.apache.streampipes.model.pipeline;
+package org.apache.streampipes.model.message;
-import org.apache.streampipes.model.shared.message.Message;
import org.apache.streampipes.model.grounding.EventGrounding;
public class DataSetModificationMessage extends Message {
diff --git a/streampipes-model-client/src/main/java/org/apache/streampipes/model/client/messages/ErrorMessage.java b/streampipes-model/src/main/java/org/apache/streampipes/model/message/ErrorMessage.java
similarity index 87%
rename from streampipes-model-client/src/main/java/org/apache/streampipes/model/client/messages/ErrorMessage.java
rename to streampipes-model/src/main/java/org/apache/streampipes/model/message/ErrorMessage.java
index 17be66d..4faf560 100644
--- a/streampipes-model-client/src/main/java/org/apache/streampipes/model/client/messages/ErrorMessage.java
+++ b/streampipes-model/src/main/java/org/apache/streampipes/model/message/ErrorMessage.java
@@ -16,13 +16,13 @@
*
*/
-package org.apache.streampipes.model.client.messages;
+package org.apache.streampipes.model.message;
-import org.apache.streampipes.model.shared.message.Message;
-import org.apache.streampipes.model.shared.message.Notification;
+import org.apache.streampipes.model.shared.annotation.TsModel;
import java.util.List;
+@TsModel
public class ErrorMessage extends Message {
public ErrorMessage(Notification...notifications) {
diff --git a/streampipes-model-shared/src/main/java/org/apache/streampipes/model/shared/message/Message.java b/streampipes-model/src/main/java/org/apache/streampipes/model/message/Message.java
similarity index 84%
rename from streampipes-model-shared/src/main/java/org/apache/streampipes/model/shared/message/Message.java
rename to streampipes-model/src/main/java/org/apache/streampipes/model/message/Message.java
index d7058b2..0a5ae50 100644
--- a/streampipes-model-shared/src/main/java/org/apache/streampipes/model/shared/message/Message.java
+++ b/streampipes-model/src/main/java/org/apache/streampipes/model/message/Message.java
@@ -16,12 +16,22 @@
*
*/
-package org.apache.streampipes.model.shared.message;
+package org.apache.streampipes.model.message;
+
+import com.fasterxml.jackson.annotation.JsonSubTypes;
+import org.apache.streampipes.model.shared.annotation.TsModel;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
+@TsModel
+@JsonSubTypes({
+ @JsonSubTypes.Type(DataSetModificationMessage.class),
+ @JsonSubTypes.Type(ErrorMessage.class),
+ @JsonSubTypes.Type(SuccessMessage.class),
+ @JsonSubTypes.Type(PipelineModificationMessage.class),
+})
public abstract class Message {
private boolean success;
diff --git a/streampipes-model-shared/src/main/java/org/apache/streampipes/model/shared/message/Notification.java b/streampipes-model/src/main/java/org/apache/streampipes/model/message/Notification.java
similarity index 97%
rename from streampipes-model-shared/src/main/java/org/apache/streampipes/model/shared/message/Notification.java
rename to streampipes-model/src/main/java/org/apache/streampipes/model/message/Notification.java
index ac37f9e..cea965f 100644
--- a/streampipes-model-shared/src/main/java/org/apache/streampipes/model/shared/message/Notification.java
+++ b/streampipes-model/src/main/java/org/apache/streampipes/model/message/Notification.java
@@ -16,7 +16,7 @@
*
*/
-package org.apache.streampipes.model.shared.message;
+package org.apache.streampipes.model.message;
public class Notification {
diff --git a/streampipes-model-shared/src/main/java/org/apache/streampipes/model/shared/message/NotificationType.java b/streampipes-model/src/main/java/org/apache/streampipes/model/message/NotificationType.java
similarity index 98%
rename from streampipes-model-shared/src/main/java/org/apache/streampipes/model/shared/message/NotificationType.java
rename to streampipes-model/src/main/java/org/apache/streampipes/model/message/NotificationType.java
index 896ba48..e8720c4 100644
--- a/streampipes-model-shared/src/main/java/org/apache/streampipes/model/shared/message/NotificationType.java
+++ b/streampipes-model/src/main/java/org/apache/streampipes/model/message/NotificationType.java
@@ -16,7 +16,7 @@
*
*/
-package org.apache.streampipes.model.shared.message;
+package org.apache.streampipes.model.message;
public enum NotificationType {
STORAGE_SUCCESS("Success", "Entity successfully stored"),
diff --git a/streampipes-model-client/src/main/java/org/apache/streampipes/model/client/messages/Notifications.java b/streampipes-model/src/main/java/org/apache/streampipes/model/message/Notifications.java
similarity index 91%
rename from streampipes-model-client/src/main/java/org/apache/streampipes/model/client/messages/Notifications.java
rename to streampipes-model/src/main/java/org/apache/streampipes/model/message/Notifications.java
index f87ffb0..66dbe16 100644
--- a/streampipes-model-client/src/main/java/org/apache/streampipes/model/client/messages/Notifications.java
+++ b/streampipes-model/src/main/java/org/apache/streampipes/model/message/Notifications.java
@@ -16,10 +16,7 @@
*
*/
-package org.apache.streampipes.model.client.messages;
-
-import org.apache.streampipes.model.shared.message.Notification;
-import org.apache.streampipes.model.shared.message.NotificationType;
+package org.apache.streampipes.model.message;
public class Notifications {
diff --git a/streampipes-model/src/main/java/org/apache/streampipes/model/pipeline/PipelineModificationMessage.java b/streampipes-model/src/main/java/org/apache/streampipes/model/message/PipelineModificationMessage.java
similarity index 94%
rename from streampipes-model/src/main/java/org/apache/streampipes/model/pipeline/PipelineModificationMessage.java
rename to streampipes-model/src/main/java/org/apache/streampipes/model/message/PipelineModificationMessage.java
index 4989993..cd26edb 100644
--- a/streampipes-model/src/main/java/org/apache/streampipes/model/pipeline/PipelineModificationMessage.java
+++ b/streampipes-model/src/main/java/org/apache/streampipes/model/message/PipelineModificationMessage.java
@@ -16,9 +16,9 @@
*
*/
-package org.apache.streampipes.model.pipeline;
+package org.apache.streampipes.model.message;
-import org.apache.streampipes.model.shared.message.Message;
+import org.apache.streampipes.model.pipeline.PipelineModification;
import org.apache.streampipes.model.shared.annotation.TsModel;
import java.util.ArrayList;
diff --git a/streampipes-model/src/main/java/org/apache/streampipes/model/pipeline/PipelineStatusMessage.java b/streampipes-model/src/main/java/org/apache/streampipes/model/message/PipelineStatusMessage.java
similarity index 97%
rename from streampipes-model/src/main/java/org/apache/streampipes/model/pipeline/PipelineStatusMessage.java
rename to streampipes-model/src/main/java/org/apache/streampipes/model/message/PipelineStatusMessage.java
index f09b3c9..b41405c 100644
--- a/streampipes-model/src/main/java/org/apache/streampipes/model/pipeline/PipelineStatusMessage.java
+++ b/streampipes-model/src/main/java/org/apache/streampipes/model/message/PipelineStatusMessage.java
@@ -16,7 +16,7 @@
*
*/
-package org.apache.streampipes.model.pipeline;
+package org.apache.streampipes.model.message;
public class PipelineStatusMessage {
diff --git a/streampipes-model/src/main/java/org/apache/streampipes/model/pipeline/PipelineStatusMessageType.java b/streampipes-model/src/main/java/org/apache/streampipes/model/message/PipelineStatusMessageType.java
similarity index 97%
rename from streampipes-model/src/main/java/org/apache/streampipes/model/pipeline/PipelineStatusMessageType.java
rename to streampipes-model/src/main/java/org/apache/streampipes/model/message/PipelineStatusMessageType.java
index da1a406..e8bfb56 100644
--- a/streampipes-model/src/main/java/org/apache/streampipes/model/pipeline/PipelineStatusMessageType.java
+++ b/streampipes-model/src/main/java/org/apache/streampipes/model/message/PipelineStatusMessageType.java
@@ -16,7 +16,7 @@
*
*/
-package org.apache.streampipes.model.pipeline;
+package org.apache.streampipes.model.message;
public enum PipelineStatusMessageType {
diff --git a/streampipes-model-client/src/main/java/org/apache/streampipes/model/client/messages/SetupStatusMessage.java b/streampipes-model/src/main/java/org/apache/streampipes/model/message/SetupStatusMessage.java
similarity index 95%
rename from streampipes-model-client/src/main/java/org/apache/streampipes/model/client/messages/SetupStatusMessage.java
rename to streampipes-model/src/main/java/org/apache/streampipes/model/message/SetupStatusMessage.java
index 40e86fa..3ee46a2 100644
--- a/streampipes-model-client/src/main/java/org/apache/streampipes/model/client/messages/SetupStatusMessage.java
+++ b/streampipes-model/src/main/java/org/apache/streampipes/model/message/SetupStatusMessage.java
@@ -15,9 +15,7 @@
* limitations under the License.
*
*/
-package org.apache.streampipes.model.client.messages;
-
-import org.apache.streampipes.model.shared.message.Message;
+package org.apache.streampipes.model.message;
import java.util.List;
diff --git a/streampipes-model-client/src/main/java/org/apache/streampipes/model/client/messages/SuccessMessage.java b/streampipes-model/src/main/java/org/apache/streampipes/model/message/SuccessMessage.java
similarity index 87%
rename from streampipes-model-client/src/main/java/org/apache/streampipes/model/client/messages/SuccessMessage.java
rename to streampipes-model/src/main/java/org/apache/streampipes/model/message/SuccessMessage.java
index cad938c..1f54188 100644
--- a/streampipes-model-client/src/main/java/org/apache/streampipes/model/client/messages/SuccessMessage.java
+++ b/streampipes-model/src/main/java/org/apache/streampipes/model/message/SuccessMessage.java
@@ -16,13 +16,13 @@
*
*/
-package org.apache.streampipes.model.client.messages;
+package org.apache.streampipes.model.message;
-import org.apache.streampipes.model.shared.message.Message;
-import org.apache.streampipes.model.shared.message.Notification;
+import org.apache.streampipes.model.shared.annotation.TsModel;
import java.util.List;
+@TsModel
public class SuccessMessage extends Message {
public SuccessMessage() {
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 1ecbaad..5de1173 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
@@ -47,8 +47,11 @@ public class Pipeline extends ElementComposition {
private List<String> pipelineCategories;
+ @JsonProperty("_id")
private @SerializedName("_id")
String pipelineId;
+
+ @JsonProperty("_rev")
private @SerializedName("_rev")
String rev;
@@ -98,7 +101,6 @@ public class Pipeline extends ElementComposition {
this.createdByUser = createdByUser;
}
- @JsonProperty("_id")
public String getPipelineId() {
return pipelineId;
}
@@ -107,7 +109,6 @@ public class Pipeline extends ElementComposition {
this.pipelineId = pipelineId;
}
- @JsonProperty("_rev")
public String getRev() {
return rev;
}
diff --git a/streampipes-performance-tests/src/main/java/org/apache/streampipes/performance/pipeline/PipelineGenerator.java b/streampipes-performance-tests/src/main/java/org/apache/streampipes/performance/pipeline/PipelineGenerator.java
index 596cf18..979a245 100644
--- a/streampipes-performance-tests/src/main/java/org/apache/streampipes/performance/pipeline/PipelineGenerator.java
+++ b/streampipes-performance-tests/src/main/java/org/apache/streampipes/performance/pipeline/PipelineGenerator.java
@@ -24,7 +24,7 @@ import org.apache.streampipes.manager.matching.PipelineVerificationHandler;
import org.apache.streampipes.model.SpDataStream;
import org.apache.streampipes.model.client.exception.InvalidConnectionException;
import org.apache.streampipes.model.pipeline.Pipeline;
-import org.apache.streampipes.model.pipeline.PipelineModificationMessage;
+import org.apache.streampipes.model.message.PipelineModificationMessage;
import org.apache.streampipes.model.graph.DataProcessorDescription;
import org.apache.streampipes.model.graph.DataProcessorInvocation;
import org.apache.streampipes.model.graph.DataSinkDescription;
diff --git a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/endpoint/EndpointItemParser.java b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/endpoint/EndpointItemParser.java
index e92b271..51befc5 100644
--- a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/endpoint/EndpointItemParser.java
+++ b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/endpoint/EndpointItemParser.java
@@ -18,9 +18,9 @@
package org.apache.streampipes.manager.endpoint;
import org.apache.streampipes.manager.operations.Operations;
-import org.apache.streampipes.model.shared.message.Message;
-import org.apache.streampipes.model.shared.message.NotificationType;
-import org.apache.streampipes.model.client.messages.Notifications;
+import org.apache.streampipes.model.message.Message;
+import org.apache.streampipes.model.message.NotificationType;
+import org.apache.streampipes.model.message.Notifications;
import java.io.IOException;
import java.net.URI;
diff --git a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/execution/http/PipelineExecutor.java b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/execution/http/PipelineExecutor.java
index 60a3e07..ce16327 100644
--- a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/execution/http/PipelineExecutor.java
+++ b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/execution/http/PipelineExecutor.java
@@ -26,8 +26,8 @@ import org.apache.streampipes.model.SpDataSet;
import org.apache.streampipes.model.base.InvocableStreamPipesEntity;
import org.apache.streampipes.model.pipeline.Pipeline;
import org.apache.streampipes.model.pipeline.PipelineOperationStatus;
-import org.apache.streampipes.model.pipeline.PipelineStatusMessage;
-import org.apache.streampipes.model.pipeline.PipelineStatusMessageType;
+import org.apache.streampipes.model.message.PipelineStatusMessage;
+import org.apache.streampipes.model.message.PipelineStatusMessageType;
import org.apache.streampipes.model.graph.DataProcessorInvocation;
import org.apache.streampipes.model.graph.DataSinkInvocation;
import org.apache.streampipes.model.staticproperty.SecretStaticProperty;
diff --git a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/execution/status/PipelineStatusManager.java b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/execution/status/PipelineStatusManager.java
index f5b012b..69f065a 100644
--- a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/execution/status/PipelineStatusManager.java
+++ b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/execution/status/PipelineStatusManager.java
@@ -23,7 +23,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import org.apache.streampipes.model.pipeline.PipelineStatusMessage;
+import org.apache.streampipes.model.message.PipelineStatusMessage;
public class PipelineStatusManager {
diff --git a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/matching/DataSetGroundingSelector.java b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/matching/DataSetGroundingSelector.java
index ea40eeb..c4567ff 100644
--- a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/matching/DataSetGroundingSelector.java
+++ b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/matching/DataSetGroundingSelector.java
@@ -21,7 +21,7 @@ import org.apache.commons.lang.RandomStringUtils;
import org.apache.streampipes.config.backend.BackendConfig;
import org.apache.streampipes.manager.util.TopicGenerator;
import org.apache.streampipes.model.SpDataSet;
-import org.apache.streampipes.model.pipeline.DataSetModificationMessage;
+import org.apache.streampipes.model.message.DataSetModificationMessage;
import org.apache.streampipes.model.grounding.EventGrounding;
import org.apache.streampipes.model.grounding.KafkaTransportProtocol;
import org.apache.streampipes.model.grounding.TransportFormat;
diff --git a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/matching/PipelineVerificationHandler.java b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/matching/PipelineVerificationHandler.java
index 94dcbb7..acc5976 100644
--- a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/matching/PipelineVerificationHandler.java
+++ b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/matching/PipelineVerificationHandler.java
@@ -34,7 +34,7 @@ import org.apache.streampipes.model.client.connection.Connection;
import org.apache.streampipes.model.client.exception.InvalidConnectionException;
import org.apache.streampipes.model.pipeline.Pipeline;
import org.apache.streampipes.model.pipeline.PipelineModification;
-import org.apache.streampipes.model.pipeline.PipelineModificationMessage;
+import org.apache.streampipes.model.message.PipelineModificationMessage;
import org.apache.streampipes.model.constants.PropertySelectorConstants;
import org.apache.streampipes.model.graph.DataProcessorInvocation;
import org.apache.streampipes.model.output.CustomOutputStrategy;
diff --git a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/monitoring/runtime/PipelineObserver.java b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/monitoring/runtime/PipelineObserver.java
index 16c8708..59e4639 100644
--- a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/monitoring/runtime/PipelineObserver.java
+++ b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/monitoring/runtime/PipelineObserver.java
@@ -19,8 +19,8 @@
package org.apache.streampipes.manager.monitoring.runtime;
import org.apache.streampipes.manager.execution.status.PipelineStatusManager;
-import org.apache.streampipes.model.pipeline.PipelineStatusMessage;
-import org.apache.streampipes.model.pipeline.PipelineStatusMessageType;
+import org.apache.streampipes.model.message.PipelineStatusMessage;
+import org.apache.streampipes.model.message.PipelineStatusMessageType;
public class PipelineObserver {
diff --git a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/monitoring/runtime/SepStoppedMonitoringPipelineBuilder.java b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/monitoring/runtime/SepStoppedMonitoringPipelineBuilder.java
index 27de528..6612104 100644
--- a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/monitoring/runtime/SepStoppedMonitoringPipelineBuilder.java
+++ b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/monitoring/runtime/SepStoppedMonitoringPipelineBuilder.java
@@ -28,7 +28,7 @@ import org.apache.streampipes.model.SpDataSet;
import org.apache.streampipes.model.SpDataStream;
import org.apache.streampipes.model.base.NamedStreamPipesEntity;
import org.apache.streampipes.model.pipeline.Pipeline;
-import org.apache.streampipes.model.pipeline.PipelineModificationMessage;
+import org.apache.streampipes.model.message.PipelineModificationMessage;
import org.apache.streampipes.model.graph.DataProcessorDescription;
import org.apache.streampipes.model.graph.DataProcessorInvocation;
import org.apache.streampipes.model.graph.DataSinkDescription;
diff --git a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/operations/Operations.java b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/operations/Operations.java
index 7db8712..c647878 100644
--- a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/operations/Operations.java
+++ b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/operations/Operations.java
@@ -38,11 +38,11 @@ import org.apache.streampipes.model.SpDataSet;
import org.apache.streampipes.model.SpDataStream;
import org.apache.streampipes.model.client.endpoint.RdfEndpoint;
import org.apache.streampipes.model.client.endpoint.RdfEndpointItem;
-import org.apache.streampipes.model.shared.message.Message;
-import org.apache.streampipes.model.pipeline.DataSetModificationMessage;
+import org.apache.streampipes.model.message.Message;
+import org.apache.streampipes.model.message.DataSetModificationMessage;
import org.apache.streampipes.model.pipeline.Pipeline;
import org.apache.streampipes.model.pipeline.PipelineElementRecommendationMessage;
-import org.apache.streampipes.model.pipeline.PipelineModificationMessage;
+import org.apache.streampipes.model.message.PipelineModificationMessage;
import org.apache.streampipes.model.pipeline.PipelineOperationStatus;
import org.apache.streampipes.model.runtime.ContainerProvidedOptionsParameterRequest;
import org.apache.streampipes.model.staticproperty.Option;
diff --git a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/setup/CacheInitializationInstallationStep.java b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/setup/CacheInitializationInstallationStep.java
index f54022d..19f8b65 100644
--- a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/setup/CacheInitializationInstallationStep.java
+++ b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/setup/CacheInitializationInstallationStep.java
@@ -17,8 +17,8 @@
*/
package org.apache.streampipes.manager.setup;
-import org.apache.streampipes.model.shared.message.Message;
-import org.apache.streampipes.model.client.messages.Notifications;
+import org.apache.streampipes.model.message.Message;
+import org.apache.streampipes.model.message.Notifications;
import org.apache.streampipes.storage.api.IPipelineElementDescriptionStorageCache;
import org.apache.streampipes.storage.management.StorageDispatcher;
diff --git a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/setup/CouchDbInstallationStep.java b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/setup/CouchDbInstallationStep.java
index c6dc9d5..cc300e9 100644
--- a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/setup/CouchDbInstallationStep.java
+++ b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/setup/CouchDbInstallationStep.java
@@ -19,8 +19,8 @@
package org.apache.streampipes.manager.setup;
import org.apache.streampipes.model.client.endpoint.RdfEndpoint;
-import org.apache.streampipes.model.shared.message.Message;
-import org.apache.streampipes.model.client.messages.Notifications;
+import org.apache.streampipes.model.message.Message;
+import org.apache.streampipes.model.message.Notifications;
import org.apache.streampipes.storage.couchdb.impl.RdfEndpointStorageImpl;
import org.apache.streampipes.storage.couchdb.utils.Utils;
import org.lightcouch.DesignDocument;
diff --git a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/setup/EmpireInitializerInstallationStep.java b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/setup/EmpireInitializerInstallationStep.java
index 577a20e..08260a8 100644
--- a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/setup/EmpireInitializerInstallationStep.java
+++ b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/setup/EmpireInitializerInstallationStep.java
@@ -17,8 +17,8 @@
*/
package org.apache.streampipes.manager.setup;
-import org.apache.streampipes.model.shared.message.Message;
-import org.apache.streampipes.model.client.messages.Notifications;
+import org.apache.streampipes.model.message.Message;
+import org.apache.streampipes.model.message.Notifications;
import org.apache.streampipes.storage.management.StorageDispatcher;
import java.util.Collections;
diff --git a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/setup/InstallationStep.java b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/setup/InstallationStep.java
index 5e6b694..3f22826 100644
--- a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/setup/InstallationStep.java
+++ b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/setup/InstallationStep.java
@@ -18,7 +18,7 @@
package org.apache.streampipes.manager.setup;
-import org.apache.streampipes.model.shared.message.Message;
+import org.apache.streampipes.model.message.Message;
import java.util.List;
diff --git a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/setup/Installer.java b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/setup/Installer.java
index 95b2aa0..504bcfd 100644
--- a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/setup/Installer.java
+++ b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/setup/Installer.java
@@ -19,8 +19,8 @@
package org.apache.streampipes.manager.setup;
import org.apache.streampipes.config.backend.BackendConfig;
-import org.apache.streampipes.model.shared.message.Message;
-import org.apache.streampipes.model.client.messages.SetupStatusMessage;
+import org.apache.streampipes.model.message.Message;
+import org.apache.streampipes.model.message.SetupStatusMessage;
import org.apache.streampipes.model.client.setup.InitialSettings;
import java.util.ArrayList;
diff --git a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/setup/PipelineElementInstallationStep.java b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/setup/PipelineElementInstallationStep.java
index fb554e0..d00a66c 100644
--- a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/setup/PipelineElementInstallationStep.java
+++ b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/setup/PipelineElementInstallationStep.java
@@ -21,8 +21,8 @@ import org.apache.streampipes.manager.endpoint.EndpointItemParser;
import org.apache.streampipes.manager.operations.Operations;
import org.apache.streampipes.model.client.endpoint.RdfEndpoint;
import org.apache.streampipes.model.client.endpoint.RdfEndpointItem;
-import org.apache.streampipes.model.shared.message.Message;
-import org.apache.streampipes.model.client.messages.Notifications;
+import org.apache.streampipes.model.message.Message;
+import org.apache.streampipes.model.message.Notifications;
import java.util.ArrayList;
import java.util.Collections;
diff --git a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/setup/UserRegistrationInstallationStep.java b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/setup/UserRegistrationInstallationStep.java
index 4c50a3a..85f85b6 100644
--- a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/setup/UserRegistrationInstallationStep.java
+++ b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/setup/UserRegistrationInstallationStep.java
@@ -18,8 +18,8 @@
package org.apache.streampipes.manager.setup;
-import org.apache.streampipes.model.shared.message.Message;
-import org.apache.streampipes.model.client.messages.Notifications;
+import org.apache.streampipes.model.message.Message;
+import org.apache.streampipes.model.message.Notifications;
import org.apache.streampipes.model.client.user.Role;
import org.apache.streampipes.model.client.user.User;
import org.apache.streampipes.storage.management.StorageDispatcher;
diff --git a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/template/PipelineGenerator.java b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/template/PipelineGenerator.java
index 4e0e4fc..fcd92b4 100644
--- a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/template/PipelineGenerator.java
+++ b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/template/PipelineGenerator.java
@@ -24,9 +24,9 @@ import org.apache.streampipes.model.SpDataSet;
import org.apache.streampipes.model.SpDataStream;
import org.apache.streampipes.model.base.InvocableStreamPipesEntity;
import org.apache.streampipes.model.client.exception.InvalidConnectionException;
-import org.apache.streampipes.model.pipeline.DataSetModificationMessage;
+import org.apache.streampipes.model.message.DataSetModificationMessage;
import org.apache.streampipes.model.pipeline.Pipeline;
-import org.apache.streampipes.model.pipeline.PipelineModificationMessage;
+import org.apache.streampipes.model.message.PipelineModificationMessage;
import org.apache.streampipes.model.graph.DataProcessorInvocation;
import org.apache.streampipes.model.graph.DataSinkInvocation;
import org.apache.streampipes.model.template.BoundPipelineElement;
diff --git a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/template/PipelineTemplateGenerator.java b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/template/PipelineTemplateGenerator.java
index 205dd51..547f03c 100644
--- a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/template/PipelineTemplateGenerator.java
+++ b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/template/PipelineTemplateGenerator.java
@@ -26,7 +26,7 @@ import org.apache.streampipes.manager.template.instances.*;
import org.apache.streampipes.model.SpDataSet;
import org.apache.streampipes.model.SpDataStream;
import org.apache.streampipes.model.base.InvocableStreamPipesEntity;
-import org.apache.streampipes.model.pipeline.DataSetModificationMessage;
+import org.apache.streampipes.model.message.DataSetModificationMessage;
import org.apache.streampipes.model.graph.DataProcessorDescription;
import org.apache.streampipes.model.graph.DataProcessorInvocation;
import org.apache.streampipes.model.graph.DataSinkDescription;
diff --git a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/verification/ElementVerifier.java b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/verification/ElementVerifier.java
index b26d24b..c760f0c 100644
--- a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/verification/ElementVerifier.java
+++ b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/verification/ElementVerifier.java
@@ -29,11 +29,11 @@ import org.apache.streampipes.manager.verification.messages.VerificationResult;
import org.apache.streampipes.manager.verification.structure.GeneralVerifier;
import org.apache.streampipes.manager.verification.structure.Verifier;
import org.apache.streampipes.model.base.NamedStreamPipesEntity;
-import org.apache.streampipes.model.client.messages.ErrorMessage;
-import org.apache.streampipes.model.shared.message.Message;
-import org.apache.streampipes.model.shared.message.Notification;
-import org.apache.streampipes.model.shared.message.NotificationType;
-import org.apache.streampipes.model.client.messages.SuccessMessage;
+import org.apache.streampipes.model.message.ErrorMessage;
+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.SuccessMessage;
import org.apache.streampipes.serializers.jsonld.JsonLdTransformer;
import org.apache.streampipes.storage.api.IPipelineElementDescriptionStorageCache;
import org.apache.streampipes.storage.management.StorageManager;
diff --git a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/verification/messages/VerificationError.java b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/verification/messages/VerificationError.java
index 1f1a2ce..5fbaf4b 100644
--- a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/verification/messages/VerificationError.java
+++ b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/verification/messages/VerificationError.java
@@ -18,7 +18,7 @@
package org.apache.streampipes.manager.verification.messages;
-import org.apache.streampipes.model.shared.message.NotificationType;
+import org.apache.streampipes.model.message.NotificationType;
public class VerificationError extends VerificationResult{
diff --git a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/verification/messages/VerificationResult.java b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/verification/messages/VerificationResult.java
index 844bb15..6923acd 100644
--- a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/verification/messages/VerificationResult.java
+++ b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/verification/messages/VerificationResult.java
@@ -18,8 +18,8 @@
package org.apache.streampipes.manager.verification.messages;
-import org.apache.streampipes.model.shared.message.Notification;
-import org.apache.streampipes.model.shared.message.NotificationType;
+import org.apache.streampipes.model.message.Notification;
+import org.apache.streampipes.model.message.NotificationType;
public abstract class VerificationResult {
diff --git a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/verification/messages/VerificationWarning.java b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/verification/messages/VerificationWarning.java
index 7472803..95d9ccd 100644
--- a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/verification/messages/VerificationWarning.java
+++ b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/verification/messages/VerificationWarning.java
@@ -18,7 +18,7 @@
package org.apache.streampipes.manager.verification.messages;
-import org.apache.streampipes.model.shared.message.NotificationType;
+import org.apache.streampipes.model.message.NotificationType;
public class VerificationWarning extends VerificationResult {
diff --git a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/verification/structure/AbstractVerifier.java b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/verification/structure/AbstractVerifier.java
index 3732b8b..99d821d 100644
--- a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/verification/structure/AbstractVerifier.java
+++ b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/verification/structure/AbstractVerifier.java
@@ -24,7 +24,7 @@ import java.util.List;
import org.apache.streampipes.manager.verification.messages.VerificationError;
import org.apache.streampipes.manager.verification.messages.VerificationResult;
import org.apache.streampipes.manager.verification.messages.VerificationWarning;
-import org.apache.streampipes.model.shared.message.NotificationType;
+import org.apache.streampipes.model.message.NotificationType;
public abstract class AbstractVerifier implements Verifier {
diff --git a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/verification/structure/GeneralVerifier.java b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/verification/structure/GeneralVerifier.java
index e4f9aea..e2a6472 100644
--- a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/verification/structure/GeneralVerifier.java
+++ b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/verification/structure/GeneralVerifier.java
@@ -21,7 +21,7 @@ package org.apache.streampipes.manager.verification.structure;
import java.util.List;
import org.apache.streampipes.manager.verification.messages.VerificationResult;
-import org.apache.streampipes.model.shared.message.NotificationType;
+import org.apache.streampipes.model.message.NotificationType;
import org.apache.streampipes.model.base.NamedStreamPipesEntity;
public class GeneralVerifier<T extends NamedStreamPipesEntity> extends AbstractVerifier {
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/AbstractRestInterface.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/AbstractRestInterface.java
index 37c7057..3463064 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/AbstractRestInterface.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/AbstractRestInterface.java
@@ -33,11 +33,11 @@ import org.apache.streampipes.manager.endpoint.HttpJsonParser;
import org.apache.streampipes.manager.storage.UserManagementService;
import org.apache.streampipes.manager.storage.UserService;
import org.apache.streampipes.model.base.NamedStreamPipesEntity;
-import org.apache.streampipes.model.client.messages.ErrorMessage;
-import org.apache.streampipes.model.shared.message.Message;
-import org.apache.streampipes.model.shared.message.Notification;
-import org.apache.streampipes.model.shared.message.NotificationType;
-import org.apache.streampipes.model.client.messages.SuccessMessage;
+import org.apache.streampipes.model.message.ErrorMessage;
+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.SuccessMessage;
import org.apache.streampipes.serializers.json.GsonSerializer;
import org.apache.streampipes.serializers.jsonld.JsonLdTransformer;
import org.apache.streampipes.storage.api.IDataLakeStorage;
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 60789ad..ff8ce1b 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
@@ -24,10 +24,10 @@ import org.apache.shiro.authc.UsernamePasswordToken;
import org.apache.shiro.subject.Subject;
import org.apache.streampipes.config.backend.BackendConfig;
import org.apache.streampipes.manager.storage.UserManagementService;
-import org.apache.streampipes.model.client.messages.ErrorMessage;
-import org.apache.streampipes.model.shared.message.NotificationType;
-import org.apache.streampipes.model.client.messages.Notifications;
-import org.apache.streampipes.model.client.messages.SuccessMessage;
+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.model.client.user.RegistrationData;
import org.apache.streampipes.model.client.user.Role;
import org.apache.streampipes.model.client.user.ShiroAuthenticationRequest;
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 b32a2e9..3d9e968 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
@@ -28,8 +28,8 @@ import org.apache.streampipes.manager.operations.Operations;
import org.apache.streampipes.model.base.NamedStreamPipesEntity;
import org.apache.streampipes.model.client.deployment.DeploymentConfiguration;
import org.apache.streampipes.model.client.deployment.ElementType;
-import org.apache.streampipes.model.shared.message.Message;
-import org.apache.streampipes.model.client.messages.Notifications;
+import org.apache.streampipes.model.message.Message;
+import org.apache.streampipes.model.message.Notifications;
import org.apache.streampipes.model.graph.DataSinkDescription;
import org.apache.streampipes.model.graph.DataSourceDescription;
import org.apache.streampipes.model.graph.DataProcessorDescription;
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 3031db8..3b116ab 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
@@ -18,7 +18,7 @@
package org.apache.streampipes.rest.impl;
-import org.apache.streampipes.model.client.messages.Notifications;
+import org.apache.streampipes.model.message.Notifications;
import org.apache.streampipes.rest.api.INotification;
import org.apache.streampipes.rest.shared.annotation.GsonWithIds;
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/OntologyContext.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/OntologyContext.java
index a751c84..31150c5 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/OntologyContext.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/OntologyContext.java
@@ -20,7 +20,7 @@ package org.apache.streampipes.rest.impl;
import org.glassfish.jersey.media.multipart.FormDataParam;
import org.apache.streampipes.storage.management.StorageManager;
-import org.apache.streampipes.model.client.messages.Notifications;
+import org.apache.streampipes.model.message.Notifications;
import org.apache.streampipes.model.client.ontology.Context;
import org.apache.streampipes.rest.api.IOntologyContext;
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/OntologyKnowledge.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/OntologyKnowledge.java
index 7c06f83..922b185 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/OntologyKnowledge.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/OntologyKnowledge.java
@@ -32,7 +32,7 @@ import org.eclipse.rdf4j.query.MalformedQueryException;
import org.eclipse.rdf4j.query.QueryEvaluationException;
import org.eclipse.rdf4j.repository.RepositoryException;
-import org.apache.streampipes.model.client.messages.Notifications;
+import org.apache.streampipes.model.message.Notifications;
import org.apache.streampipes.model.client.ontology.Concept;
import org.apache.streampipes.model.client.ontology.Instance;
import org.apache.streampipes.model.client.ontology.Namespace;
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 0f14a6f..9439fdb 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
@@ -21,7 +21,7 @@ package org.apache.streampipes.rest.impl;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.google.gson.JsonPrimitive;
-import org.apache.streampipes.model.client.messages.Notifications;
+import org.apache.streampipes.model.message.Notifications;
import org.apache.streampipes.model.graph.DataProcessorDescription;
import org.apache.streampipes.model.graph.DataSinkDescription;
import org.apache.streampipes.model.graph.DataSourceDescription;
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 6cde7c1..66070e2 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
@@ -18,7 +18,7 @@
package org.apache.streampipes.rest.impl;
-import org.apache.streampipes.model.client.messages.Notifications;
+import org.apache.streampipes.model.message.Notifications;
import org.apache.streampipes.storage.api.IPipelineCategoryStorage;
import javax.ws.rs.DELETE;
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 5cf3160..6d88613 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
@@ -27,10 +27,10 @@ import org.apache.streampipes.manager.assets.AssetManager;
import org.apache.streampipes.manager.endpoint.EndpointItemParser;
import org.apache.streampipes.manager.operations.Operations;
import org.apache.streampipes.manager.storage.UserService;
-import org.apache.streampipes.model.shared.message.Message;
-import org.apache.streampipes.model.shared.message.Notification;
-import org.apache.streampipes.model.shared.message.NotificationType;
-import org.apache.streampipes.model.client.messages.Notifications;
+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.storage.api.IPipelineElementDescriptionStorage;
import org.apache.streampipes.storage.api.IPipelineElementDescriptionStorageCache;
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 00fef7f..98c12ce 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
@@ -20,9 +20,11 @@ package org.apache.streampipes.rest.impl;
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.client.messages.Notifications;
+import org.apache.streampipes.model.message.Notifications;
import org.apache.streampipes.rest.api.IPipelineElementRuntimeInfo;
+import org.apache.streampipes.rest.shared.annotation.JacksonSerialized;
+import javax.ws.rs.Consumes;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
@@ -35,7 +37,9 @@ public class PipelineElementRuntimeInfo extends AbstractRestInterface implements
@Override
@POST
+ @JacksonSerialized
@Produces(MediaType.APPLICATION_JSON)
+ @Consumes(MediaType.APPLICATION_JSON)
public Response getRuntimeInfo(SpDataStream spDataStream) {
// TODO currently only supported for data streams. For data sets, a dummy pipeline needs to be generated to get runtime values.
try {
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineWithUserResource.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineWithUserResource.java
index 995c0e2..5f7399a 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineWithUserResource.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/PipelineWithUserResource.java
@@ -24,10 +24,10 @@ import org.apache.streampipes.manager.execution.status.PipelineStatusManager;
import org.apache.streampipes.manager.operations.Operations;
import org.apache.streampipes.model.SpDataSet;
import org.apache.streampipes.model.client.exception.InvalidConnectionException;
-import org.apache.streampipes.model.shared.message.Notification;
-import org.apache.streampipes.model.shared.message.NotificationType;
-import org.apache.streampipes.model.client.messages.Notifications;
-import org.apache.streampipes.model.client.messages.SuccessMessage;
+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.model.message.SuccessMessage;
import org.apache.streampipes.model.pipeline.Pipeline;
import org.apache.streampipes.model.pipeline.PipelineOperationStatus;
import org.apache.streampipes.rest.api.IPipeline;
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 4a5df92..e877903 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
@@ -19,9 +19,9 @@
package org.apache.streampipes.rest.impl;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
-import org.apache.streampipes.model.shared.message.Notification;
-import org.apache.streampipes.model.shared.message.NotificationType;
-import org.apache.streampipes.model.client.messages.Notifications;
+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.model.graph.DataSinkDescription;
import org.apache.streampipes.model.graph.DataSinkInvocation;
import org.apache.streampipes.rest.api.IPipelineElement;
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 950dc7d..a7231f3 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
@@ -19,8 +19,8 @@
package org.apache.streampipes.rest.impl;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
-import org.apache.streampipes.model.shared.message.NotificationType;
-import org.apache.streampipes.model.client.messages.Notifications;
+import org.apache.streampipes.model.message.NotificationType;
+import org.apache.streampipes.model.message.Notifications;
import org.apache.streampipes.model.graph.DataProcessorDescription;
import org.apache.streampipes.model.graph.DataProcessorInvocation;
import org.apache.streampipes.rest.api.IPipelineElement;
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 afa6d64..d42648d 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
@@ -19,9 +19,9 @@
package org.apache.streampipes.rest.impl;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
-import org.apache.streampipes.model.shared.message.Notification;
-import org.apache.streampipes.model.shared.message.NotificationType;
-import org.apache.streampipes.model.client.messages.Notifications;
+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.model.graph.DataSourceDescription;
import org.apache.streampipes.rest.api.IPipelineElement;
import org.apache.streampipes.rest.shared.annotation.GsonWithIds;
@@ -150,7 +150,7 @@ public class SemanticEventProducer extends AbstractRestInterface implements IPip
@Path("/{elementUri}")
@GET
@Produces(MediaType.APPLICATION_JSON)
- @GsonWithIds
+ @JacksonSerialized
@Override
public Response getElement(@PathParam("username") String username, @PathParam("elementUri") String elementUri) {
// TODO Access rights
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 fb76ee7..a5a5a8d 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
@@ -21,8 +21,8 @@ package org.apache.streampipes.rest.impl;
import com.google.gson.JsonObject;
import org.apache.streampipes.config.backend.BackendConfig;
import org.apache.streampipes.manager.setup.Installer;
-import org.apache.streampipes.model.client.messages.Notifications;
-import org.apache.streampipes.model.client.messages.SetupStatusMessage;
+import org.apache.streampipes.model.message.Notifications;
+import org.apache.streampipes.model.message.SetupStatusMessage;
import org.apache.streampipes.model.client.setup.InitialSettings;
import org.apache.streampipes.rest.api.ISetup;
import org.apache.streampipes.rest.notifications.NotificationListener;
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 31df9ed..f303fcc 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
@@ -18,7 +18,7 @@
package org.apache.streampipes.rest.impl;
-import org.apache.streampipes.model.client.messages.Notifications;
+import org.apache.streampipes.model.message.Notifications;
import org.apache.streampipes.rest.api.IUser;
import javax.ws.rs.Consumes;
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 b3fec56..1005890 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
@@ -18,7 +18,7 @@
package org.apache.streampipes.rest.impl;
-import org.apache.streampipes.model.shared.message.NotificationType;
+import org.apache.streampipes.model.message.NotificationType;
import org.apache.streampipes.serializers.json.Utils;
import org.apache.streampipes.rest.api.IVirtualSensor;
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/datalake/DataLakeResourceV3.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/datalake/DataLakeResourceV3.java
index ed5a765..a09bae3 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/datalake/DataLakeResourceV3.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/datalake/DataLakeResourceV3.java
@@ -18,7 +18,7 @@
package org.apache.streampipes.rest.impl.datalake;
-import org.apache.streampipes.model.shared.message.Notification;
+import org.apache.streampipes.model.message.Notification;
import org.apache.streampipes.model.datalake.DataLakeMeasure;
import org.apache.streampipes.rest.impl.AbstractRestInterface;
import org.apache.streampipes.rest.impl.datalake.model.DataResult;
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 6aa39f5..644c8d9 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
@@ -22,9 +22,9 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.streampipes.manager.endpoint.EndpointItemParser;
import org.apache.streampipes.manager.storage.UserService;
-import org.apache.streampipes.model.shared.message.Message;
-import org.apache.streampipes.model.shared.message.Notification;
-import org.apache.streampipes.model.shared.message.NotificationType;
+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.AbstractRestInterface;
import org.apache.streampipes.storage.api.IPipelineElementDescriptionStorageCache;
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 6bd2085..446953f 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
@@ -19,8 +19,8 @@
package org.apache.streampipes.rest.management;
import org.apache.streampipes.manager.operations.Operations;
-import org.apache.streampipes.model.shared.message.Notification;
-import org.apache.streampipes.model.shared.message.NotificationType;
+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.AbstractRestInterface;
diff --git a/streampipes-serializers/src/main/java/org/apache/streampipes/serializers/json/GsonSerializer.java b/streampipes-serializers/src/main/java/org/apache/streampipes/serializers/json/GsonSerializer.java
index 2b4636d..f01725b 100644
--- a/streampipes-serializers/src/main/java/org/apache/streampipes/serializers/json/GsonSerializer.java
+++ b/streampipes-serializers/src/main/java/org/apache/streampipes/serializers/json/GsonSerializer.java
@@ -23,7 +23,7 @@ import com.google.gson.FieldAttributes;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import org.apache.streampipes.model.*;
-import org.apache.streampipes.model.shared.message.Message;
+import org.apache.streampipes.model.message.Message;
import org.apache.streampipes.model.connect.adapter.*;
import org.apache.streampipes.model.connect.rules.schema.CreateNestedRuleDescription;
import org.apache.streampipes.model.connect.rules.schema.DeleteRuleDescription;
diff --git a/streampipes-serializers/src/main/java/org/apache/streampipes/serializers/json/Utils.java b/streampipes-serializers/src/main/java/org/apache/streampipes/serializers/json/Utils.java
index 6303303..de43ac0 100644
--- a/streampipes-serializers/src/main/java/org/apache/streampipes/serializers/json/Utils.java
+++ b/streampipes-serializers/src/main/java/org/apache/streampipes/serializers/json/Utils.java
@@ -20,7 +20,7 @@ package org.apache.streampipes.serializers.json;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
-import org.apache.streampipes.model.shared.message.Message;
+import org.apache.streampipes.model.message.Message;
import org.apache.streampipes.model.client.ontology.Range;
diff --git a/ui/src/app/NS/XS.service.ts b/ui/src/app/NS/XS.service.ts
index 68255af..e5bbd1e 100644
--- a/ui/src/app/NS/XS.service.ts
+++ b/ui/src/app/NS/XS.service.ts
@@ -19,14 +19,20 @@
import {Injectable} from '@angular/core';
@Injectable()
-export class xsService{
-
- XS_STRING: string = "xs:string";
- XS_INTEGER: string = "xs:integer";
- XS_DOUBLE: string = "xs:double";
- XS_BOOLEAN: string = "xs:boolean";
- XS_NUMBER: string = "https://www.w3.org/2001/XMLSchema#number";
- XS_STRING1: string = "https://www.w3.org/2001/XMLSchema#string";
- SO_URL: string = "https://schema.org/URL";
+export class xsService {
+
+ XS_STRING: string = "xs:string";
+ XS_INTEGER: string = "http://www.w3.org/2001/XMLSchema#integer";
+ XS_DOUBLE: string = "http://www.w3.org/2001/XMLSchema#:double";
+ XS_BOOLEAN: string = "http://www.w3.org/2001/XMLSchema#boolean";
+ XS_NUMBER: string = "http://www.w3.org/2001/XMLSchema#number";
+ XS_STRING1: string = "http://www.w3.org/2001/XMLSchema#string";
+ SO_URL: string = "https://schema.org/URL";
+
+ isNumber(datatype: string): boolean {
+ return datatype === this.XS_DOUBLE ||
+ datatype === this.XS_INTEGER ||
+ datatype === this.XS_NUMBER;
+ }
}
\ No newline at end of file
diff --git a/ui/src/app/connect/connect.service.ts b/ui/src/app/connect/connect.service.ts
index 74d3a80..87aba2d 100644
--- a/ui/src/app/connect/connect.service.ts
+++ b/ui/src/app/connect/connect.service.ts
@@ -17,11 +17,13 @@
*/
import {Injectable} from '@angular/core';
-import {AdapterDescription} from './model/connect/AdapterDescription';
-import {GenericAdapterSetDescription} from './model/connect/GenericAdapterSetDescription';
-import {GenericAdapterStreamDescription} from './model/connect/GenericAdapterStreamDescription';
-import {SpecificAdapterStreamDescription} from './model/connect/SpecificAdapterStreamDescription';
-import {SpecificAdapterSetDescription} from './model/connect/SpecificAdapterSetDescription';
+import {
+ AdapterDescription,
+ GenericAdapterSetDescription,
+ GenericAdapterStreamDescription,
+ SpecificAdapterSetDescription,
+ SpecificAdapterStreamDescription
+} from "../core-model/gen/streampipes-model";
@Injectable()
export class ConnectService {
diff --git a/ui/src/app/connect/data-marketplace/adapter-description/adapter-description.component.html b/ui/src/app/connect/data-marketplace/adapter-description/adapter-description.component.html
index f7fa368..4280abf 100644
--- a/ui/src/app/connect/data-marketplace/adapter-description/adapter-description.component.html
+++ b/ui/src/app/connect/data-marketplace/adapter-description/adapter-description.component.html
@@ -31,45 +31,38 @@
<img *ngIf="getIconUrl() && !adapter.icon" [src]="getIconUrl()" class="iconImg"/>
<img *ngIf="adapter.icon" [src]="adapter.icon" style="min-height: 50px;" class="iconImg"/>
</div>
- <h3>{{adapter.label}}</h3>
+ <h3>{{adapter.name}}</h3>
</div>
<div fxLayout="row">
<div fxFlex="70" class="description" fxLayoutAlign="start start">
<p [innerHTML]="adapter.description"></p>
</div>
<div fxFlex="30" fxLayout="row" fxLayoutAlign="end end" *ngIf="isRunningAdapter" class="delete">
- <button id="{{ 'create-template-' + adapter.label.split(' ').join('_') }}" matTooltip="Create Adapter Template" color="secondary" class="edit" mat-fab (click)="createTemplate(adapter)">
+ <button id="{{ 'create-template-' + adapter.name.split(' ').join('_') }}" matTooltip="Create Adapter Template" color="secondary" class="edit" mat-fab (click)="createTemplate(adapter)">
<i class="material-icons">
content_copy
</i>
</button>
- <button id="{{ 'delete-' + adapterLabel }}" matTooltip="Delete Adapter" color="primary" mat-fab (click)="deleteAdapter(adapter)" [disabled]="deleteInProgress(adapter.couchDbId)">
- <i class="material-icons" *ngIf="!deleteInProgress(adapter.couchDbId)">
+ <button id="{{ 'delete-' + adapterLabel }}" matTooltip="Delete Adapter" color="primary" mat-fab (click)="deleteAdapter(adapter)" [disabled]="deleteInProgress(adapter.couchDBId)">
+ <i class="material-icons" *ngIf="!deleteInProgress(adapter.couchDBId)">
delete
</i>
- <mat-spinner *ngIf="deleteInProgress(adapter.couchDbId)" [diameter]="20" fxLayoutAlign="center"></mat-spinner>
+ <mat-spinner *ngIf="deleteInProgress(adapter.couchDBId)" [diameter]="20" fxLayoutAlign="center"></mat-spinner>
</button>
</div>
- <div fxFlex="30" fxLayout="row" fxLayoutAlign="end end" *ngIf="adapter.isTemplate" class="delete">
+ <div fxFlex="30" fxLayout="row" fxLayoutAlign="end end" *ngIf="$any(adapter).isTemplate" class="delete">
<button id="{{ 'share-template-' + adapterLabel }}" matTooltip="Share Adapter Template" color="secondary" mat-fab (click)="shareAdapterTemplate(adapter); $event.stopPropagation()">
- <i class="material-icons" *ngIf="!deleteInProgress(adapter.couchDbId)">
+ <i class="material-icons" *ngIf="!deleteInProgress(adapter.couchDBId)">
share
</i>
</button>
- <button id="{{ 'delete-template-' + adapterLabel }}" matTooltip="Delete Adapter Template" color="primary" mat-fab (click)="deleteAdapterTemplate(adapter); $event.stopPropagation()" [disabled]="deleteInProgress(adapter.couchDbId)">
- <i class="material-icons" *ngIf="!deleteInProgress(adapter.couchDbId)">
+ <button id="{{ 'delete-template-' + adapterLabel }}" matTooltip="Delete Adapter Template" color="primary" mat-fab (click)="deleteAdapterTemplate(adapter); $event.stopPropagation()" [disabled]="deleteInProgress(adapter.couchDBId)">
+ <i class="material-icons" *ngIf="!deleteInProgress(adapter.couchDBId)">
delete
</i>
- <mat-spinner *ngIf="deleteInProgress(adapter.couchDbId)" [diameter]="20" fxLayoutAlign="center"></mat-spinner>
+ <mat-spinner *ngIf="deleteInProgress(adapter.couchDBId)" [diameter]="20" fxLayoutAlign="center"></mat-spinner>
</button>
</div>
- <!--<div fxFlex="30" *ngIf="!adapter.couchDbId" fxLayout="row" fxLayoutAlign="end end">-->
- <!--<button color="primary" mat-fab>-->
- <!--<i class="material-icons">-->
- <!--add-->
- <!--</i>-->
- <!--</button>-->
- <!--</div>-->
</div>
</div>
\ No newline at end of file
diff --git a/ui/src/app/connect/data-marketplace/adapter-description/adapter-description.component.ts b/ui/src/app/connect/data-marketplace/adapter-description/adapter-description.component.ts
index cb415a0..9faed90 100644
--- a/ui/src/app/connect/data-marketplace/adapter-description/adapter-description.component.ts
+++ b/ui/src/app/connect/data-marketplace/adapter-description/adapter-description.component.ts
@@ -17,11 +17,11 @@
*/
import {Component, EventEmitter, Input, Output} from '@angular/core';
-import {AdapterDescription} from '../../model/connect/AdapterDescription';
import {ConnectService} from '../../connect.service';
import {DataMarketplaceService} from "../data-marketplace.service";
import {AdapterExportDialog} from '../adapter-export/adapter-export-dialog.component';
import {MatDialog} from '@angular/material/dialog';
+import {AdapterDescription} from "../../../core-model/gen/streampipes-model";
@Component({
selector: 'sp-adapter-description',
@@ -52,8 +52,8 @@ export class AdapterDescriptionComponent {
ngOnInit() {
this.isDataSetDescription = this.connectService.isDataSetDescription(this.adapter);
this.isDataStreamDescription = this.connectService.isDataStreamDescription(this.adapter);
- this.isRunningAdapter = (this.adapter.couchDbId != undefined && !this.adapter.isTemplate);
- this.adapterLabel = this.adapter.label.split(' ').join('_');
+ this.isRunningAdapter = (this.adapter.couchDBId != undefined && !(this.adapter as any).isTemplate);
+ this.adapterLabel = this.adapter.name.split(' ').join('_');
this.className = this.getClassName();
}
@@ -67,7 +67,7 @@ export class AdapterDescriptionComponent {
deleteAdapter(adapter: AdapterDescription): void {
this.deleting = true;
- this.adapterToDelete = adapter.couchDbId;
+ this.adapterToDelete = adapter.couchDBId;
this.dataMarketplaceService.deleteAdapter(adapter).subscribe(res => {
this.adapterToDelete = undefined;
this.updateAdapterEmitter.emit();
@@ -93,7 +93,7 @@ export class AdapterDescriptionComponent {
deleteAdapterTemplate(adapter: AdapterDescription): void {
- this.adapterToDelete = adapter.couchDbId;
+ this.adapterToDelete = adapter.couchDBId;
this.dataMarketplaceService.deleteAdapterTemplate(adapter).subscribe(res => {
this.adapterToDelete = undefined;
this.updateAdapterEmitter.emit();
diff --git a/ui/src/app/connect/data-marketplace/adapter-upload/adapter-upload-dialog.component.ts b/ui/src/app/connect/data-marketplace/adapter-upload/adapter-upload-dialog.component.ts
index 77c6904..85e8755 100644
--- a/ui/src/app/connect/data-marketplace/adapter-upload/adapter-upload-dialog.component.ts
+++ b/ui/src/app/connect/data-marketplace/adapter-upload/adapter-upload-dialog.component.ts
@@ -19,9 +19,10 @@
import {Component, Inject} from '@angular/core';
import {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material/dialog';
import {RestService} from "../../rest.service";
-import {TsonLdSerializerService} from '../../../platform-services/tsonld-serializer.service';
-import {AdapterDescriptionList} from '../../model/connect/AdapterDescriptionList';
-import {AdapterDescription} from '../../model/connect/AdapterDescription';
+import {
+ AdapterDescription,
+ AdapterDescriptionList
+} from "../../../core-model/gen/streampipes-model";
@Component({
selector: 'sp-dialog-adapter-started-dialog',
@@ -36,7 +37,6 @@ export class AdapterUploadDialog {
constructor(
public dialogRef: MatDialogRef<AdapterUploadDialog>,
private restService: RestService,
- private tsonLdSerializerService: TsonLdSerializerService,
@Inject(MAT_DIALOG_DATA) public data: any) {
}
@@ -56,8 +56,8 @@ export class AdapterUploadDialog {
var jsonString: any = fileReader.result;
var json = JSON.parse(jsonString);
- if (jsonString.indexOf('AdapterDescriptionList') != -1) {
- let allTemplates: AdapterDescriptionList = this.tsonLdSerializerService.fromJsonLd(json, 'sp:AdapterDescriptionList');
+ if (jsonString["@class"].contains('AdapterDescriptionList') != -1) {
+ let allTemplates: AdapterDescriptionList = AdapterDescriptionList.fromData(json as AdapterDescriptionList);
let self = this;
allTemplates.list.forEach(function (adapterTemplate) {
@@ -68,16 +68,7 @@ export class AdapterUploadDialog {
} else {
let adapterTemplate: AdapterDescription;
-
- if (jsonString.indexOf('GenericAdapterSetDescription') != -1) {
- adapterTemplate = this.tsonLdSerializerService.fromJsonLd(json, 'sp:GenericAdapterSetDescription');
- } else if (jsonString.indexOf('SpecificAdapterSetDescription') != -1) {
- adapterTemplate = this.tsonLdSerializerService.fromJsonLd(json, 'sp:SpecificAdapterSetDescription');
- } else if (jsonString.indexOf('GenericAdapterStreamDescription') != -1) {
- adapterTemplate = this.tsonLdSerializerService.fromJsonLd(json, 'sp:GenericAdapterStreamDescription');
- } else if (jsonString.indexOf('SpecificAdapterStreamDescription') != -1) {
- adapterTemplate = this.tsonLdSerializerService.fromJsonLd(json, 'sp:SpecificAdapterStreamDescription');
- }
+ adapterTemplate = AdapterDescription.fromDataUnion(json);
this.restService.addAdapterTemplate(adapterTemplate).subscribe(x => {
});
@@ -88,8 +79,6 @@ export class AdapterUploadDialog {
}
- storeAdapter
-
onCloseConfirm() {
this.dialogRef.close('Confirm');
}
diff --git a/ui/src/app/connect/data-marketplace/data-marketplace.component.html b/ui/src/app/connect/data-marketplace/data-marketplace.component.html
index e327fef..10a4484 100644
--- a/ui/src/app/connect/data-marketplace/data-marketplace.component.html
+++ b/ui/src/app/connect/data-marketplace/data-marketplace.component.html
@@ -87,7 +87,7 @@
<div *ngIf="selectedIndex === 0">
<div *ngIf="newAdapterFromDescription===undefined" fxLayout="row wrap" fxLayoutAlign="start stretch" class="adapter-description-container">
- <sp-adapter-description attr.id="{{adapterDescription.label.replace(' ', '_')}}" class="adapter-description"
+ <sp-adapter-description attr.id="{{adapterDescription.name.replace(' ', '_')}}" class="adapter-description"
fxFlex="33" (click)="selectAdapter(adapterDescription)" *ngFor="let adapterDescription of filteredAdapterDescriptions | filter:filterTerm"
[adapter]="adapterDescription" (updateAdapterEmitter)="updateDescriptionsAndRunningAdatpers()"></sp-adapter-description>
</div>
diff --git a/ui/src/app/connect/data-marketplace/data-marketplace.component.ts b/ui/src/app/connect/data-marketplace/data-marketplace.component.ts
index bd358cf..c3c46f3 100644
--- a/ui/src/app/connect/data-marketplace/data-marketplace.component.ts
+++ b/ui/src/app/connect/data-marketplace/data-marketplace.component.ts
@@ -18,14 +18,20 @@
import {Component, EventEmitter, OnInit, Output} from '@angular/core';
import {DataMarketplaceService} from './data-marketplace.service';
-import {AdapterDescription} from '../model/connect/AdapterDescription';
import {ShepherdService} from "../../services/tour/shepherd.service";
import {ConnectService} from '../connect.service';
import {FilterPipe} from './filter.pipe';
import {AdapterUploadDialog} from './adapter-upload/adapter-upload-dialog.component';
import {MatDialog} from '@angular/material/dialog';
-import {AdapterDescriptionList} from '../model/connect/AdapterDescriptionList';
-import {TsonLdSerializerService} from '../../platform-services/tsonld-serializer.service';
+import {
+ AdapterDescription,
+ AdapterDescriptionList,
+ AdapterDescriptionUnion,
+ AdapterSetDescription,
+ AdapterStreamDescription,
+ EventSchema, SpDataSet,
+ SpDataStream
+} from "../../core-model/gen/streampipes-model";
@Component({
selector: 'sp-data-marketplace',
@@ -33,12 +39,12 @@ import {TsonLdSerializerService} from '../../platform-services/tsonld-serializer
styleUrls: ['./data-marketplace.component.css']
})
export class DataMarketplaceComponent implements OnInit {
- adapterDescriptions: AdapterDescription[];
- newAdapterFromDescription: AdapterDescription;
- filteredAdapterDescriptions: AdapterDescription[];
- adapters: AdapterDescription[];
- filteredAdapters: AdapterDescription[];
- visibleAdapters: AdapterDescription[];
+ adapterDescriptions: AdapterDescriptionUnion[];
+ newAdapterFromDescription: AdapterDescriptionUnion;
+ filteredAdapterDescriptions: AdapterDescriptionUnion[];
+ adapters: AdapterDescriptionUnion[];
+ filteredAdapters: AdapterDescriptionUnion[];
+ visibleAdapters: AdapterDescriptionUnion[];
@Output()
selectAdapterEmitter: EventEmitter<AdapterDescription> = new EventEmitter<AdapterDescription>();
@@ -55,9 +61,7 @@ export class DataMarketplaceComponent implements OnInit {
constructor(private dataMarketplaceService: DataMarketplaceService,
private ShepherdService: ShepherdService,
private connectService: ConnectService,
- public dialog: MatDialog,
- private tsonLdSerializerService: TsonLdSerializerService,
- ) {
+ public dialog: MatDialog) {
}
ngOnInit() {
@@ -82,22 +86,23 @@ export class DataMarketplaceComponent implements OnInit {
this.adapterDescriptions = [];
this.dataMarketplaceService
- .getGenericAndSpecifigAdapterDescriptions()
- .subscribe(res => {
- res.subscribe(adapterDescriptions => {
- this.adapterDescriptions = this.adapterDescriptions.concat(adapterDescriptions);
- this.adapterDescriptions.sort((a, b) => a.label.localeCompare(b.label));
- this.filteredAdapterDescriptions = this.adapterDescriptions;
- });
+ .getGenericAndSpecificAdapterDescriptions()
+ .subscribe((allAdapters) => {
+ this.adapterDescriptions = this.adapterDescriptions.concat(allAdapters[0]);
+ this.adapterDescriptions = this.adapterDescriptions.concat(allAdapters[1]);
+ this.adapterDescriptions
+ .sort((a, b) => a.name.localeCompare(b.name));
+ this.filteredAdapterDescriptions = this.adapterDescriptions;
});
this.dataMarketplaceService.getAdapterTemplates().subscribe(adapterTemplates => {
adapterTemplates.forEach(function (adapterTemplate) {
- adapterTemplate.isTemplate = true;
+ (adapterTemplate as any).isTemplate = true;
});
this.adapterDescriptions = this.adapterDescriptions.concat(adapterTemplates);
- this.adapterDescriptions.sort((a, b) => a.label.localeCompare(b.label));
+ this.adapterDescriptions
+ .sort((a, b) => a.name.localeCompare(b.name));
this.filteredAdapterDescriptions = this.adapterDescriptions;
});
}
@@ -125,17 +130,31 @@ export class DataMarketplaceComponent implements OnInit {
this.ShepherdService.startAdapterTour3();
}
- selectAdapter(adapterDescription: AdapterDescription) {
+ selectAdapter(adapterDescription: AdapterDescriptionUnion) {
this.newAdapterFromDescription = this.dataMarketplaceService.cloneAdapterDescription(adapterDescription);
- this.newAdapterFromDescription.templateTitle = this.newAdapterFromDescription.label;
- this.newAdapterFromDescription.label = "";
+ (this.newAdapterFromDescription as any).templateTitle = this.newAdapterFromDescription.name;
+ this.newAdapterFromDescription.name = "";
this.newAdapterFromDescription.description = "";
+ if (this.newAdapterFromDescription instanceof AdapterStreamDescription) {
+ this.newAdapterFromDescription.dataStream = new SpDataStream();
+ this.newAdapterFromDescription.dataStream["@class"] = "org.apache.streampipes.model.SpDataStream";
+ this.newAdapterFromDescription.dataStream.eventSchema = new EventSchema();
+ this.newAdapterFromDescription.dataStream.eventSchema["@class"] = "org.apache.streampipes.model.schema.EventSchema";
+ }
+ if (this.newAdapterFromDescription instanceof AdapterSetDescription) {
+ this.newAdapterFromDescription.dataSet = new SpDataSet();
+ this.newAdapterFromDescription.dataSet["@class"] = "org.apache.streampipes.model.SpDataSet";
+ this.newAdapterFromDescription.dataSet.eventSchema = new EventSchema();
+ this.newAdapterFromDescription.dataSet.eventSchema["@class"] = "org.apache.streampipes.model.schema.EventSchema";
+ }
+ console.log("new adapter");
+ console.log(this.newAdapterFromDescription);
this.ShepherdService.trigger("select-adapter");
}
- templateFromRunningAdapter(adapter: AdapterDescription) {
+ templateFromRunningAdapter(adapter: AdapterDescriptionUnion) {
this.selectedIndexChange(0);
this.selectAdapter(adapter);
@@ -152,14 +171,15 @@ export class DataMarketplaceComponent implements OnInit {
downloadAllAdapterTemplates() {
var adapterTemplates: AdapterDescription[] = [];
this.adapterDescriptions.forEach(function (adapterTemplate) {
- if (adapterTemplate.isTemplate) {
+ if ((adapterTemplate as any).isTemplate) {
delete adapterTemplate['userName'];
adapterTemplates.push(adapterTemplate);
}
});
- let adapterDescriptionList: AdapterDescriptionList = new AdapterDescriptionList("http://streampipes.org/exportedList");
- adapterDescriptionList.list = adapterTemplates;
+ let adapterDescriptionList: AdapterDescriptionList = new AdapterDescriptionList();
+ adapterDescriptionList.elementId = "http://streampipes.org/exportedList";
+ adapterDescriptionList.list = adapterTemplates as AdapterDescriptionUnion[];
// this.tsonLdSerializerService.toJsonLd(this.data.adapter).subscribe(res => {
@@ -173,15 +193,12 @@ export class DataMarketplaceComponent implements OnInit {
// });
// this.adapterJsonLd = this.tsonLdSerializerService.toJsonLd(this.data.adapter);
- this.tsonLdSerializerService.toJsonLd(adapterDescriptionList).subscribe(res => {
- let data = "data:text/json;charset=utf-8," + encodeURIComponent(JSON.stringify(res, null, 2));
- let downloader = document.createElement('a');
+ let data = "data:text/json;charset=utf-8," +encodeURIComponent(JSON.stringify(adapterDescriptionList, null, 2));
+ let downloader = document.createElement('a');
- downloader.setAttribute('href', data);
- downloader.setAttribute('download', 'all-adapter-templates.json');
- downloader.click();
-
- });
+ downloader.setAttribute('href', data);
+ downloader.setAttribute('download', 'all-adapter-templates.json');
+ downloader.click();
}
uploadAdapterTemplates() {
@@ -209,7 +226,7 @@ export class DataMarketplaceComponent implements OnInit {
this.filteredAdapters = filteredAdapterTemplateCategories;
}
- filterAdapterCategory(currentElements: AdapterDescription[]): AdapterDescription[] {
+ filterAdapterCategory(currentElements: AdapterDescriptionUnion[]): AdapterDescriptionUnion[] {
if (this.selectedCategory == this.adapterCategories[0].type) {
return currentElements;
} else {
@@ -217,7 +234,7 @@ export class DataMarketplaceComponent implements OnInit {
}
}
- filterAdapterType(currentElements: AdapterDescription[]): AdapterDescription[] {
+ filterAdapterType(currentElements: AdapterDescriptionUnion[]): AdapterDescriptionUnion[] {
if (this.selectedType == this.adapterTypes[0]) {
return currentElements;
} else if (this.selectedType == this.adapterTypes[1]) {
diff --git a/ui/src/app/connect/data-marketplace/data-marketplace.service.ts b/ui/src/app/connect/data-marketplace/data-marketplace.service.ts
index 1b2211a..1b10e2c 100644
--- a/ui/src/app/connect/data-marketplace/data-marketplace.service.ts
+++ b/ui/src/app/connect/data-marketplace/data-marketplace.service.ts
@@ -18,71 +18,74 @@
import {Injectable} from '@angular/core';
import {HttpClient} from '@angular/common/http';
-import {Observable} from 'rxjs';
import {map} from 'rxjs/operators';
import {AuthStatusService} from '../../services/auth-status.service';
-import {AdapterDescriptionList} from '../model/connect/AdapterDescriptionList';
-import {AdapterDescription} from '../model/connect/AdapterDescription';
-import {GenericAdapterSetDescription} from '../model/connect/GenericAdapterSetDescription';
-import {SpecificAdapterSetDescription} from '../model/connect/SpecificAdapterSetDescription';
-import {GenericAdapterStreamDescription} from '../model/connect/GenericAdapterStreamDescription';
-import {SpecificAdapterStreamDescription} from '../model/connect/SpecificAdapterStreamDescription';
-import {ProtocolDescription} from '../model/connect/grounding/ProtocolDescription';
import {ConnectService} from '../connect.service';
-import {RestApi} from "../../services/rest-api.service";
-import {TsonLdSerializerService} from "../../platform-services/tsonld-serializer.service";
-import {AlternativesStaticProperty} from "../model/AlternativesStaticProperty";
-import {GroupStaticProperty} from "../model/GroupStaticProperty";
-import {StaticProperty} from "../model/StaticProperty";
-import {CollectionStaticProperty} from "../model/CollectionStaticProperty";
+import {
+ AdapterDescription,
+ AdapterDescriptionList,
+ AdapterDescriptionUnion,
+ EventSchema,
+ GenericAdapterSetDescription,
+ GenericAdapterStreamDescription,
+ ProtocolDescription,
+ ProtocolDescriptionList,
+ SpDataSet,
+ SpDataStream,
+ SpecificAdapterSetDescription,
+ SpecificAdapterStreamDescription
+} from "../../core-model/gen/streampipes-model";
+import {Observable, zip} from "rxjs";
@Injectable()
export class DataMarketplaceService {
private host = '/streampipes-connect/';
constructor(
- private http: HttpClient,
- private authStatusService: AuthStatusService,
- private connectService: ConnectService,
- private restApi: RestApi,
- private tsonLdSerializer: TsonLdSerializerService
- ) {}
+ private http: HttpClient,
+ private authStatusService: AuthStatusService,
+ private connectService: ConnectService) {
+ }
- getAdapterDescriptions(): Observable<AdapterDescription[]> {
- return this.requestAdapterDescriptions('/master/description/adapters');
+ getAdapterDescriptions(): Observable<AdapterDescriptionUnion[]> {
+ return this.requestAdapterDescriptions('/master/description/adapters').pipe(map(response => {
+ console.log(response);
+ return (response as any[]).map(resp => AdapterDescription.fromDataUnion(resp)).filter(ad => this.connectService.isSpecificDescription(ad));
+ }));
}
- getAdapters(): Observable<AdapterDescription[]> {
+ getAdapters(): Observable<AdapterDescriptionUnion[]> {
return this.requestAdapterDescriptions('/master/adapters');
}
- getAdapterTemplates(): Observable<AdapterDescription[]> {
+ getAdapterTemplates(): Observable<AdapterDescriptionUnion[]> {
return this.requestAdapterDescriptions('/master/adapters/template/all');
}
- requestAdapterDescriptions(path: string) : Observable<AdapterDescription[]> {
+ requestAdapterDescriptions(path: string): Observable<AdapterDescriptionUnion[]> {
return this.http
- .get(
- this.host +
- 'api/v1/' +
- this.authStatusService.email +
- path
- )
- .pipe(map(response => {
- if(response['@graph'] === undefined) return [];
- const res: AdapterDescriptionList = this.tsonLdSerializer.fromJsonLd(
- response,
- 'sp:AdapterDescriptionList'
- );
- res.list.forEach(adapterDescription => {
- adapterDescription.config.sort((a, b) => a.index - b.index);
- adapterDescription.config.forEach(sp => {
- this.sortStaticProperties(sp)
- });
- });
- return res.list;
- }));
+ .get(
+ this.host +
+ 'api/v1/' +
+ this.authStatusService.email +
+ path
+ )
+ .pipe(map(response => {
+ let adapterDescriptionList: AdapterDescriptionList = AdapterDescriptionList.fromData(response as AdapterDescriptionList);
+ return adapterDescriptionList.list;
+ // const res: AdapterDescriptionList = this.tsonLdSerializer.fromJsonLd(
+ // response,
+ // 'sp:AdapterDescriptionList'
+ // );
+ // res.list.forEach(adapterDescription => {
+ // adapterDescription.config.sort((a, b) => a.index - b.index);
+ // adapterDescription.config.forEach(sp => {
+ // this.sortStaticProperties(sp)
+ // });
+ // });
+ // return res.list;
+ }));
}
deleteAdapter(adapter: AdapterDescription): Observable<Object> {
@@ -90,7 +93,7 @@ export class DataMarketplaceService {
}
deleteAdapterTemplate(adapter: AdapterDescription): Observable<Object> {
- return this.deleteRequest(adapter, '/master/adapters/template/')
+ return this.deleteRequest(adapter, '/master/adapters/template/')
}
getAdapterCategories(): Observable<Object> {
@@ -103,114 +106,99 @@ export class DataMarketplaceService {
private deleteRequest(adapter: AdapterDescription, url: String) {
return this.http.delete(
- this.host +
+ this.host +
'api/v1/' +
this.authStatusService.email +
url +
- adapter.couchDbId
+ adapter.couchDBId
);
}
- getProtocols(): Observable<ProtocolDescription[]> {
+ getProtocols(): Observable<AdapterDescriptionUnion[]> {
return this.http
- .get(
- this.host +
- 'api/v1/' +
- this.authStatusService.email +
- '/master/description/protocols'
- )
- .pipe(map(response => {
- const res = this.tsonLdSerializer.fromJsonLd(
- response,
- 'sp:ProtocolDescriptionList'
- );
- res.list.forEach(protocolDescription => {
- protocolDescription.config.sort((a, b) => a.index - b.index);
- protocolDescription.config.forEach(sp => {
- this.sortStaticProperties(sp)
- });
- });
- return res.list;
- }));
- }
-
- sortStaticProperties(sp: StaticProperty) {
- if (sp instanceof AlternativesStaticProperty) {
- sp.alternatives.sort((a, b) => a.index - b.index);
- sp.alternatives.forEach(a => {
- if (a.staticProperty instanceof GroupStaticProperty) {
- a.staticProperty.staticProperties.sort((a, b) => a.index - b.index);
- } else if (a.staticProperty instanceof CollectionStaticProperty) {
- this.sortStaticProperties((<CollectionStaticProperty> a.staticProperty).staticPropertyTemplate)
- }
- })
- } else if (sp instanceof GroupStaticProperty) {
- sp.staticProperties.sort((a, b) => a.index - b.index);
- } else if (sp instanceof CollectionStaticProperty) {
- this.sortStaticProperties((<CollectionStaticProperty> sp).staticPropertyTemplate)
- }
+ .get(
+ this.host +
+ 'api/v1/' +
+ this.authStatusService.email +
+ '/master/description/protocols'
+ )
+ .pipe(map(response => {
+ let adapterDescriptions: AdapterDescriptionUnion[] = [];
+ let protocols: ProtocolDescription[] = (ProtocolDescriptionList.fromData(response as ProtocolDescriptionList)).list;
+
+ for (let protocol of protocols) {
+ let newAdapterDescription: AdapterDescriptionUnion;
+ if (protocol.sourceType === 'SET') {
+ newAdapterDescription = new GenericAdapterSetDescription();
+ newAdapterDescription.elementId = 'http://streampipes.org/genericadaptersetdescription'
+ newAdapterDescription.dataSet = new SpDataSet();
+ newAdapterDescription.dataSet.eventSchema = new EventSchema();
+ } else if (protocol.sourceType === 'STREAM') {
+ newAdapterDescription = new GenericAdapterStreamDescription();
+ newAdapterDescription.elementId = 'http://streampipes.org/genericadapterstreamdescription'
+ newAdapterDescription.dataStream = new SpDataStream();
+ newAdapterDescription.dataStream.eventSchema = new EventSchema();
+ }
+ newAdapterDescription.appId = protocol.appId;
+ newAdapterDescription.name = protocol.name;
+ newAdapterDescription.description = protocol.description;
+ newAdapterDescription.iconUrl = protocol.iconUrl;
+ newAdapterDescription.uri = newAdapterDescription.elementId;
+ newAdapterDescription.category = protocol.category;
+ newAdapterDescription.includedAssets = protocol.includedAssets;
+ newAdapterDescription.includesAssets = protocol.includesAssets;
+ newAdapterDescription.includedLocales = protocol.includedLocales;
+ newAdapterDescription.includesLocales = protocol.includesLocales;
+
+ if (
+ newAdapterDescription instanceof GenericAdapterSetDescription ||
+ newAdapterDescription instanceof GenericAdapterStreamDescription
+ ) {
+ newAdapterDescription.protocolDescription = protocol;
+ }
+ adapterDescriptions.push(newAdapterDescription);
+ }
+ return adapterDescriptions;
+ }));
}
- getGenericAndSpecifigAdapterDescriptions(): Observable<
- Observable<AdapterDescription[]>
- > {
- return this.getAdapterDescriptions().pipe(map(adapterDescriptions => {
- adapterDescriptions = adapterDescriptions.filter(
- this.connectService.isSpecificDescription
- );
-
- return this.getProtocols().pipe(map(protocols => {
- for (let protocol of protocols) {
- let newAdapterDescription: AdapterDescription;
- if (protocol.id.includes('sp:protocol/set') || protocol.sourceType === 'SET') {
- newAdapterDescription = new GenericAdapterSetDescription(
- 'http://streampipes.org/genericadaptersetdescription'
- );
- } else if (protocol.id.includes('sp:protocol/stream') || protocol.sourceType === 'STREAM') {
- newAdapterDescription = new GenericAdapterStreamDescription(
- 'http://streampipes.org/genericadapterstreamdescription'
- );
- }
- newAdapterDescription.appId = protocol.appId;
- newAdapterDescription.label = protocol.label;
- newAdapterDescription.description = protocol.description;
- newAdapterDescription.iconUrl = protocol.iconUrl;
- newAdapterDescription.uri = newAdapterDescription.id;
- newAdapterDescription.category = protocol.category;
- newAdapterDescription.includedAssets = protocol.includedAssets;
- newAdapterDescription.includesAssets = protocol.includesAssets;
- newAdapterDescription.includedLocales = protocol.includedLocales;
- newAdapterDescription.includesLocales = protocol.includesLocales;
-
- if (
- newAdapterDescription instanceof GenericAdapterSetDescription ||
- newAdapterDescription instanceof GenericAdapterStreamDescription
- ) {
- newAdapterDescription.protocol = protocol;
- }
- adapterDescriptions.push(newAdapterDescription);
- }
- return adapterDescriptions;
- }));
- }));
+ // sortStaticProperties(sp: StaticProperty) {
+ // if (sp instanceof AlternativesStaticProperty) {
+ // sp.alternatives.sort((a, b) => a.index - b.index);
+ // sp.alternatives.forEach(a => {
+ // if (a.staticProperty instanceof GroupStaticProperty) {
+ // a.staticProperty.staticProperties.sort((a, b) => a.index - b.index);
+ // } else if (a.staticProperty instanceof CollectionStaticProperty) {
+ // this.sortStaticProperties((<CollectionStaticProperty> a.staticProperty).staticPropertyTemplate)
+ // }
+ // })
+ // } else if (sp instanceof GroupStaticProperty) {
+ // sp.staticProperties.sort((a, b) => a.index - b.index);
+ // } else if (sp instanceof CollectionStaticProperty) {
+ // this.sortStaticProperties((<CollectionStaticProperty> sp).staticPropertyTemplate)
+ // }
+ // }
+
+ getGenericAndSpecificAdapterDescriptions(): Observable<[AdapterDescriptionUnion[], AdapterDescriptionUnion[]]> {
+ return zip(this.getAdapterDescriptions(), this.getProtocols());
}
- cloneAdapterDescription(toClone: AdapterDescription): AdapterDescription {
- var result: AdapterDescription;
+ cloneAdapterDescription(toClone: AdapterDescriptionUnion): AdapterDescriptionUnion {
+ var result: AdapterDescriptionUnion;
- if (this.connectService.isGenericDescription(toClone)) {
- if (this.connectService.isDataStreamDescription(toClone)) {
- result = Object.assign(new GenericAdapterStreamDescription(toClone.id), toClone);
- } else {
- result = Object.assign(new GenericAdapterSetDescription(toClone.id), toClone);
- }
- } else {
- if (this.connectService.isDataStreamDescription(toClone)) {
- result = Object.assign(new SpecificAdapterStreamDescription(toClone.id), toClone);
- } else {
- result = Object.assign(new SpecificAdapterSetDescription(toClone.id), toClone);
- }
+ if (this.connectService.isGenericDescription(toClone)) {
+ if (toClone instanceof GenericAdapterStreamDescription) {
+ result = GenericAdapterStreamDescription.fromData(toClone, new GenericAdapterStreamDescription());
+ } else if (toClone instanceof GenericAdapterSetDescription) {
+ result = GenericAdapterSetDescription.fromData(toClone, new GenericAdapterSetDescription());
}
+ } else {
+ if (toClone instanceof SpecificAdapterStreamDescription) {
+ result = SpecificAdapterStreamDescription.fromData(toClone, new SpecificAdapterStreamDescription());
+ } else if (toClone instanceof SpecificAdapterSetDescription) {
+ result = SpecificAdapterSetDescription.fromData(toClone, new SpecificAdapterSetDescription());
+ }
+ }
return result;
}
diff --git a/ui/src/app/connect/data-marketplace/filter.pipe.ts b/ui/src/app/connect/data-marketplace/filter.pipe.ts
index b7e1a0f..8f67b70 100644
--- a/ui/src/app/connect/data-marketplace/filter.pipe.ts
+++ b/ui/src/app/connect/data-marketplace/filter.pipe.ts
@@ -30,8 +30,8 @@ export class FilterPipe implements PipeTransform {
//check if search filterTerm is undefined
if(filterTerm == undefined || !adapterDescription) return adapterDescription;
return adapterDescription.filter(function(adapterDescription){
- adapterDescription.label.replace(' ', '_');
- if (adapterDescription.label.toLowerCase().includes(filterTerm.toLowerCase()) || adapterDescription.description.toLowerCase().includes(filterTerm.toLowerCase())) {
+ adapterDescription.name.replace(' ', '_');
+ if (adapterDescription.name.toLowerCase().includes(filterTerm.toLowerCase()) || adapterDescription.description.toLowerCase().includes(filterTerm.toLowerCase())) {
return true
}
else {
diff --git a/ui/src/app/connect/filter/timestamp.pipe.ts b/ui/src/app/connect/filter/timestamp.pipe.ts
index 2ad1be5..4ad2342 100644
--- a/ui/src/app/connect/filter/timestamp.pipe.ts
+++ b/ui/src/app/connect/filter/timestamp.pipe.ts
@@ -18,15 +18,16 @@
import {Pipe, PipeTransform} from '@angular/core';
import {EventProperty} from '../schema-editor/model/EventProperty';
+import {EventPropertyUnion} from "../../core-model/gen/streampipes-model";
@Pipe({
name: 'timestampFilter',
pure: false
})
export class TimestampPipe implements PipeTransform {
- transform(items: EventProperty[], filter: Object): any {
+ transform(items: EventPropertyUnion[], filter: Object): any {
return items.filter(item => {
- if ("http://schema.org/DateTime" == item.domainProperty) {
+ if (item.domainProperties.some(dp => dp === "http://schema.org/DateTime")) {
return true;
} else {
return false;
diff --git a/ui/src/app/connect/format-component/format.component.html b/ui/src/app/connect/format-component/format.component.html
index c3547f5..ba288af 100644
--- a/ui/src/app/connect/format-component/format.component.html
+++ b/ui/src/app/connect/format-component/format.component.html
@@ -16,6 +16,6 @@
~
-->
-<div id="{{format.label.split(' ').join('_').toLowerCase()}}" *ngIf="!format.edit || !hasConfig" class="format-box" (click)="formatEditable()" [ngClass]="{selectedItem: isSelected()}" fxFlex="100" fxLayout="column">
- <div class="format-label"> {{format.label}} </div>
+<div id="{{format.name.split(' ').join('_').toLowerCase()}}" *ngIf="!$any(format).edit || !hasConfig" class="format-box" (click)="formatEditable()" [ngClass]="{selectedItem: isSelected()}" fxFlex="100" fxLayout="column">
+ <div class="format-label"> {{format.name}} </div>
</div>
\ No newline at end of file
diff --git a/ui/src/app/connect/format-component/format.component.ts b/ui/src/app/connect/format-component/format.component.ts
index 5e50569..858bbf2 100644
--- a/ui/src/app/connect/format-component/format.component.ts
+++ b/ui/src/app/connect/format-component/format.component.ts
@@ -17,8 +17,8 @@
*/
import {Component, EventEmitter, Input, Output} from '@angular/core';
-import {FormatDescription} from '../model/connect/grounding/FormatDescription';
import {ShepherdService} from '../../services/tour/shepherd.service';
+import {FormatDescription} from "../../core-model/gen/streampipes-model";
@Component({
selector: 'app-format',
@@ -47,12 +47,12 @@ export class FormatComponent {
this.selectedFormat = this.format;
this.selectedFormatEmitter.emit(this.selectedFormat);
- this.ShepherdService.trigger("select-" + this.selectedFormat.label.toLocaleLowerCase());
+ this.ShepherdService.trigger("select-" + this.selectedFormat.name.toLocaleLowerCase());
}
validateText(textValid) {
- if (textValid && this.format.edit) {
+ if (textValid && (this.format as any).edit) {
this.validateEmitter.emit(true);
this.selectedFormat = this.format;
this.selectedFormatEmitter.emit(this.selectedFormat);
@@ -65,7 +65,7 @@ export class FormatComponent {
if (!this.selectedFormat || !this.format) {
return false;
} else {
- return this.selectedFormat.label === this.format.label;
+ return this.selectedFormat.name === this.format.name;
}
}
ngOnInit() {}
diff --git a/ui/src/app/connect/new-adapter/component/adapter-started-dialog.component.ts b/ui/src/app/connect/new-adapter/component/adapter-started-dialog.component.ts
index c1aa20a..9fd4a3c 100644
--- a/ui/src/app/connect/new-adapter/component/adapter-started-dialog.component.ts
+++ b/ui/src/app/connect/new-adapter/component/adapter-started-dialog.component.ts
@@ -20,12 +20,16 @@ import {Component, Inject} from '@angular/core';
import {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material/dialog';
import {ShepherdService} from '../../../services/tour/shepherd.service';
import {RestService} from "../../rest.service";
-import {StatusMessage} from "../../model/message/StatusMessage";
-import {GenericAdapterSetDescription} from '../../model/connect/GenericAdapterSetDescription';
-import {SpecificAdapterSetDescription} from '../../model/connect/SpecificAdapterSetDescription';
import {PipelineTemplateService} from '../../../platform-services/apis/pipeline-template.service';
-import {FreeTextStaticProperty} from '../../model/FreeTextStaticProperty';
-import {MappingPropertyUnary} from '../../model/MappingPropertyUnary';
+import {
+ EventPropertyUnion,
+ FreeTextStaticProperty,
+ GenericAdapterSetDescription,
+ MappingPropertyUnary,
+ Message,
+ SpDataStream,
+ SpecificAdapterSetDescription
+} from "../../../core-model/gen/streampipes-model";
@Component({
selector: 'sp-dialog-adapter-started-dialog',
@@ -35,12 +39,12 @@ import {MappingPropertyUnary} from '../../model/MappingPropertyUnary';
export class AdapterStartedDialog {
adapterInstalled: boolean = false;
- private adapterStatus: StatusMessage;
- private streamDescription: any;
+ public adapterStatus: Message;
+ public streamDescription: SpDataStream;
private pollingActive: boolean = false;
- private runtimeData: any;
- private isSetAdapter: boolean = false;
- private isTemplate: boolean = false;
+ public runtimeData: any;
+ public isSetAdapter: boolean = false;
+ public isTemplate: boolean = false;
private saveInDataLake: boolean;
@@ -59,7 +63,7 @@ export class AdapterStartedDialog {
if (this.data.storeAsTemplate) {
this.restService.addAdapterTemplate(this.data.adapter).subscribe(x => {
- this.adapterStatus = x;
+ this.adapterStatus = x as Message;
this.isTemplate = true;
this.adapterInstalled = true;
});
@@ -101,13 +105,9 @@ export class AdapterStartedDialog {
res.pipelineTemplateId = templateName;
res.name = this.data.adapter.label;
-
this.pipelineTemplateService.createPipelineTemplateInvocation(res);
-
});
}
-
-
}
});
@@ -128,9 +128,9 @@ export class AdapterStartedDialog {
});
}
- isPropertyType(property, type) {
- return property.properties.domainProperties !== undefined && property.properties.domainProperties.length === 1 &&
- property.properties.domainProperties[0] === type;
+ isPropertyType(property: EventPropertyUnion, type) {
+ return property.domainProperties !== undefined && property.domainProperties.length === 1 &&
+ property.domainProperties[0] === type;
}
isImage(property) {
diff --git a/ui/src/app/connect/new-adapter/component/dialog-adapter-started.html b/ui/src/app/connect/new-adapter/component/dialog-adapter-started.html
index c42fc08..9c1bced 100644
--- a/ui/src/app/connect/new-adapter/component/dialog-adapter-started.html
+++ b/ui/src/app/connect/new-adapter/component/dialog-adapter-started.html
@@ -78,10 +78,10 @@
</thead>
<tbody id="preview-data-rows-id">
<tr *ngFor="let property of streamDescription.eventSchema.eventProperties">
- <td>{{property.properties.runtimeName}}</td>
+ <td>{{property.runtimeName}}</td>
<td *ngIf="isImage(property)"> <img src="data:image/png;base64,{{runtimeData[property.properties.runtimeName]}}" style="max-width: 150px;" /> </td>
- <td *ngIf="isTimestamp(property)">{{runtimeData[property.properties.runtimeName] | date:'yyyy-MM-dd HH:mm:ss '}}</td>
- <td *ngIf="hasNoDomainProperty(property)">{{runtimeData[property.properties.runtimeName]}}</td>
+ <td *ngIf="isTimestamp(property)">{{runtimeData[property.runtimeName] | date:'yyyy-MM-dd HH:mm:ss '}}</td>
+ <td *ngIf="hasNoDomainProperty(property)">{{runtimeData[property.runtimeName]}}</td>
</tr>
</tbody>
</table>
diff --git a/ui/src/app/connect/new-adapter/new-adapter.component.html b/ui/src/app/connect/new-adapter/new-adapter.component.html
index 955467b..b6e692b 100644
--- a/ui/src/app/connect/new-adapter/new-adapter.component.html
+++ b/ui/src/app/connect/new-adapter/new-adapter.component.html
@@ -57,7 +57,7 @@
[staticProperties]="adapter.config" [adapterId]="adapter.appId"
(updateEmitter)="triggerUpdate($event)" [completedStaticProperty]="completedStaticProperty">
</app-static-property>
- <app-protocol (validateEmitter)="validateProtocol($event)" [protocol]="adapter.protocol"
+ <app-protocol (validateEmitter)="validateProtocol($event)" [protocol]="adapter.protocolDescription"
*ngIf="isGenericAdapter"></app-protocol>
</div>
</div>
@@ -84,18 +84,18 @@
</div>
<div class="sp-blue-border padding">
<app-format-form fxFlex="100" (selectedFormatEmitter)="formatSelected($event)"
- [(selectedFormat)]="adapter.format" [allFormats]="allFormats"></app-format-form>
+ [(selectedFormat)]="adapter.formatDescription" [allFormats]="allFormats"></app-format-form>
</div>
<div class="assemblyOptions sp-blue-bg">
<h4>Configure format</h4>
</div>
<div class="sp-blue-border padding">
- <div fxFlex="100" *ngIf="adapter.format">
+ <div fxFlex="100" *ngIf="adapter.formatDescription">
<app-select-static-properties (validateEmitter)="validateFormat($event)"
- [staticProperties]="adapter.format.config" class="fullWidth">
+ [staticProperties]="adapter.formatDescription.config" class="fullWidth">
</app-select-static-properties>
- <h5 *ngIf="adapter.format.config.length === 0" style="text-align:center;">(no further
+ <h5 *ngIf="adapter.formatDescription.config.length === 0" style="text-align:center;">(no further
configuration needed)</h5>
</div>
</div>
@@ -142,7 +142,7 @@
<div fxLayoutAlign="center" fxLayout="column" fxFlex="100">
<mat-form-field>
<input matInput id="input-AdapterName" placeholder="Adapter Name"
- formControlName="startAdapterFormCtrl" [(ngModel)]="adapter.label">
+ formControlName="startAdapterFormCtrl" [(ngModel)]="adapter.name">
</mat-form-field>
<mat-form-field>
<input matInput id="input-AdapterDescription" [ngModelOptions]="{standalone: true}"
diff --git a/ui/src/app/connect/new-adapter/new-adapter.component.ts b/ui/src/app/connect/new-adapter/new-adapter.component.ts
index d174d9e..af451a6 100644
--- a/ui/src/app/connect/new-adapter/new-adapter.component.ts
+++ b/ui/src/app/connect/new-adapter/new-adapter.component.ts
@@ -17,31 +17,33 @@
*/
///<reference path="../model/connect/AdapterDescription.ts"/>
-import { Component, EventEmitter, Input, OnInit, Output, PipeTransform, ViewChild } from '@angular/core';
-import { FormBuilder, FormGroup, Validators } from '@angular/forms';
-import { MatDialog } from '@angular/material/dialog';
-import { MatStepper } from '@angular/material/stepper';
-import { ShepherdService } from '../../services/tour/shepherd.service';
-import { Logger } from '../../shared/logger/default-log.service';
-import { ConnectService } from '../connect.service';
-import { TimestampPipe } from '../filter/timestamp.pipe';
-import { AdapterDescription } from '../model/connect/AdapterDescription';
-import { GenericAdapterSetDescription } from '../model/connect/GenericAdapterSetDescription';
-import { GenericAdapterStreamDescription } from '../model/connect/GenericAdapterStreamDescription';
-import { FormatDescription } from '../model/connect/grounding/FormatDescription';
-import { EventRateTransformationRuleDescription } from '../model/connect/rules/EventRateTransformationRuleDescription';
-import { RemoveDuplicatesRuleDescription } from '../model/connect/rules/RemoveDuplicatesRuleDescription';
-import { TransformationRuleDescription } from '../model/connect/rules/TransformationRuleDescription';
-import { SpecificAdapterSetDescription } from '../model/connect/SpecificAdapterSetDescription';
-import { SpecificAdapterStreamDescription } from '../model/connect/SpecificAdapterStreamDescription';
-import { ConfigurationInfo } from '../model/message/ConfigurationInfo';
-import { RestService } from '../rest.service';
-import { EventSchemaComponent } from '../schema-editor/event-schema/event-schema.component';
-import { EventProperty } from '../schema-editor/model/EventProperty';
-import { EventSchema } from '../schema-editor/model/EventSchema';
-import { TransformationRuleService } from '../transformation-rule.service';
-import { AdapterStartedDialog } from './component/adapter-started-dialog.component';
-import { IconService } from './icon.service';
+import {Component, EventEmitter, Input, OnInit, Output, ViewChild} from '@angular/core';
+import {FormBuilder, FormGroup, Validators} from '@angular/forms';
+import {MatDialog} from '@angular/material/dialog';
+import {MatStepper} from '@angular/material/stepper';
+import {ShepherdService} from '../../services/tour/shepherd.service';
+import {Logger} from '../../shared/logger/default-log.service';
+import {ConnectService} from '../connect.service';
+import {TimestampPipe} from '../filter/timestamp.pipe';
+import {ConfigurationInfo} from '../model/message/ConfigurationInfo';
+import {RestService} from '../rest.service';
+import {TransformationRuleService} from '../transformation-rule.service';
+import {AdapterStartedDialog} from './component/adapter-started-dialog.component';
+import {IconService} from './icon.service';
+import {
+ AdapterDescription,
+ EventProperty,
+ EventRateTransformationRuleDescription,
+ EventSchema,
+ FormatDescription,
+ GenericAdapterSetDescription,
+ GenericAdapterStreamDescription,
+ RemoveDuplicatesTransformationRuleDescription,
+ SpecificAdapterSetDescription,
+ SpecificAdapterStreamDescription,
+ TransformationRuleDescriptionUnion
+} from "../../core-model/gen/streampipes-model";
+import {EventSchemaComponent} from "../schema-editor/event-schema/event-schema.component";
@Component({
selector: 'sp-new-adapter',
@@ -50,8 +52,6 @@ import { IconService } from './icon.service';
})
export class NewAdapterComponent implements OnInit {
-
-
constructor(
private logger: Logger,
private restService: RestService,
@@ -142,13 +142,13 @@ export class NewAdapterComponent implements OnInit {
this.formatConfigurationValid = false;
if (this.adapter instanceof GenericAdapterSetDescription) {
- if ((this.adapter as GenericAdapterSetDescription).format != undefined) {
+ if ((this.adapter as GenericAdapterSetDescription).formatDescription != undefined) {
this.formatConfigurationValid = true;
}
}
if (this.adapter instanceof GenericAdapterStreamDescription) {
- if ((this.adapter as GenericAdapterStreamDescription).format != undefined) {
+ if ((this.adapter as GenericAdapterStreamDescription).formatDescription != undefined) {
this.formatConfigurationValid = true;
}
}
@@ -177,8 +177,6 @@ export class NewAdapterComponent implements OnInit {
this.fromTemplate = true;
this.isEditable = false;
this.oldEventSchema = this.eventSchema;
-
-
}
}
@@ -188,10 +186,15 @@ export class NewAdapterComponent implements OnInit {
public triggerDialog(storeAsTemplate: boolean) {
if (this.removeDuplicates) {
- this.adapter.rules.push(new RemoveDuplicatesRuleDescription(this.removeDuplicatesTime));
+ let removeDuplicates: RemoveDuplicatesTransformationRuleDescription = new RemoveDuplicatesTransformationRuleDescription();
+ removeDuplicates.filterTimeWindow = (this.removeDuplicatesTime) as any;
+ this.adapter.rules.push(removeDuplicates);
}
if (this.eventRateReduction) {
- this.adapter.rules.push(new EventRateTransformationRuleDescription(this.eventRateTime, this.eventRateMode));
+ let eventRate: EventRateTransformationRuleDescription = new EventRateTransformationRuleDescription();
+ eventRate.aggregationTimeWindow = this.eventRateMode as any;
+ eventRate.aggregationType = this.eventRateMode;
+ this.adapter.rules.push(eventRate);
}
const dialogRef = this.dialog.open(AdapterStartedDialog, {
@@ -272,6 +275,7 @@ export class NewAdapterComponent implements OnInit {
guessEventSchema() {
const eventSchema: EventSchema = this.getEventSchema(this.adapter);
+ console.log(eventSchema);
if (eventSchema.eventProperties.length === 0) {
this.eventSchemaComponent.guessSchema();
} else {
@@ -283,21 +287,22 @@ export class NewAdapterComponent implements OnInit {
let eventSchema: EventSchema;
if (adapter instanceof GenericAdapterSetDescription) {
- eventSchema = (adapter as GenericAdapterSetDescription).dataSet.eventSchema;
+ eventSchema = (adapter as GenericAdapterSetDescription).dataSet.eventSchema || new EventSchema();
} else if (adapter instanceof SpecificAdapterSetDescription) {
- eventSchema = (adapter as SpecificAdapterSetDescription).dataSet.eventSchema;
+ eventSchema = (adapter as SpecificAdapterSetDescription).dataSet.eventSchema || new EventSchema();
} else if (adapter instanceof GenericAdapterStreamDescription) {
- eventSchema = (adapter as GenericAdapterStreamDescription).dataStream.eventSchema;
+ eventSchema = (adapter as GenericAdapterStreamDescription).dataStream.eventSchema || new EventSchema();
} else if (adapter instanceof SpecificAdapterStreamDescription) {
- eventSchema = (adapter as SpecificAdapterStreamDescription).dataStream.eventSchema;
+ eventSchema = (adapter as SpecificAdapterStreamDescription).dataStream.eventSchema || new EventSchema();
} else {
- return new EventSchema();
+ eventSchema = new EventSchema();
}
if (eventSchema && eventSchema.eventProperties && eventSchema.eventProperties.length > 0) {
return eventSchema;
} else {
- return new EventSchema();
+ eventSchema.eventProperties = [];
+ return eventSchema;
}
}
@@ -319,7 +324,7 @@ export class NewAdapterComponent implements OnInit {
this.transformationRuleService.setOldEventSchema(this.oldEventSchema);
this.transformationRuleService.setNewEventSchema(this.eventSchema);
- const transformationRules: TransformationRuleDescription[] = this.transformationRuleService.getTransformationRuleDescriptions();
+ const transformationRules: TransformationRuleDescriptionUnion[] = this.transformationRuleService.getTransformationRuleDescriptions();
this.adapter.rules = transformationRules;
}
@@ -328,7 +333,7 @@ export class NewAdapterComponent implements OnInit {
this.adapter instanceof GenericAdapterSetDescription ||
this.adapter instanceof GenericAdapterStreamDescription
) {
- this.adapter.format = selectedFormat;
+ this.adapter.formatDescription = selectedFormat;
if (selectedFormat.config.length === 0) {
this.validateFormat(true);
}
diff --git a/ui/src/app/connect/protocol-component/protocol.component.ts b/ui/src/app/connect/protocol-component/protocol.component.ts
index 2a01756..5270243 100644
--- a/ui/src/app/connect/protocol-component/protocol.component.ts
+++ b/ui/src/app/connect/protocol-component/protocol.component.ts
@@ -53,6 +53,6 @@ export class ProtocolComponent {
}
}
ngOnInit() {
-
+ console.log(this.protocol);
}
}
\ No newline at end of file
diff --git a/ui/src/app/connect/rest.service.ts b/ui/src/app/connect/rest.service.ts
index 32d7214..08cf1ce 100644
--- a/ui/src/app/connect/rest.service.ts
+++ b/ui/src/app/connect/rest.service.ts
@@ -24,17 +24,18 @@ import {from, Observable} from 'rxjs';
import {map} from 'rxjs/operators';
-import {ProtocolDescriptionList} from './model/connect/grounding/ProtocolDescriptionList';
-import {AdapterDescription} from './model/connect/AdapterDescription';
-import {FormatDescriptionList} from './model/connect/grounding/FormatDescriptionList';
-import {EventProperty} from './schema-editor/model/EventProperty';
-import {EventPropertyNested} from './schema-editor/model/EventPropertyNested';
-import {GuessSchema} from './schema-editor/model/GuessSchema';
import {AuthStatusService} from '../services/auth-status.service';
-import {StatusMessage} from "./model/message/StatusMessage";
import {UnitDescription} from './model/UnitDescription';
-import {TsonLdSerializerService} from '../platform-services/tsonld-serializer.service';
-import {RuntimeOptionsResponse} from "../core-model/gen/streampipes-model";
+import {
+ AdapterDescription, DataSourceDescription,
+ ErrorMessage,
+ FormatDescriptionList,
+ GuessSchema,
+ Message,
+ ProtocolDescriptionList,
+ RuntimeOptionsResponse
+} from "../core-model/gen/streampipes-model";
+import {StatusMessage} from "./model/message/StatusMessage";
@Injectable()
export class RestService {
@@ -42,105 +43,65 @@ export class RestService {
constructor(
private http: HttpClient,
- private authStatusService: AuthStatusService,
- private tsonLdSerializerService: TsonLdSerializerService,
- ) { }
+ private authStatusService: AuthStatusService) { }
- addAdapter(adapter: AdapterDescription): Observable<StatusMessage> {
+ addAdapter(adapter: AdapterDescription): Observable<Message> {
return this.addAdapterDescription(adapter, '/master/adapters');
}
- addAdapterTemplate(adapter: AdapterDescription): Observable<StatusMessage> {
+ addAdapterTemplate(adapter: AdapterDescription): Observable<Message> {
return this.addAdapterDescription(adapter, '/master/adapters/template');
}
fetchRemoteOptions(resolvableOptionsParameterRequest: any, adapterId: string): Observable<RuntimeOptionsResponse> {
let promise = new Promise<RuntimeOptionsResponse>((resolve, reject) => {
- this.tsonLdSerializerService.toJsonLd(resolvableOptionsParameterRequest).subscribe(serialized => {
- const httpOptions = {
- headers: new HttpHeaders({
- 'Content-Type': 'application/ld+json',
- }),
- };
this.http.post("/streampipes-connect/api/v1/"
+ this.authStatusService.email
+ "/master/resolvable/"
+ encodeURIComponent(adapterId)
- + "/configurations", serialized, httpOptions).pipe(map(response => {
- const r = this.tsonLdSerializerService.fromJsonLd(response, 'sp:RuntimeOptionsResponse');
- resolve(r);
+ + "/configurations", resolvableOptionsParameterRequest)
+ .pipe(map(response => {
+ let resp = response as RuntimeOptionsResponse;
+ resolve(resp);
})).subscribe();
- });
});
return from(promise);
}
- addAdapterDescription(adapter: AdapterDescription, url: String): Observable<StatusMessage> {
+ addAdapterDescription(adapter: AdapterDescription, url: String): Observable<Message> {
adapter.userName = this.authStatusService.email;
- var self = this;
-
- let promise = new Promise<StatusMessage>(function (resolve, reject) {
- self.tsonLdSerializerService.toJsonLd(adapter).subscribe(res => {
- const httpOptions = {
- headers: new HttpHeaders({
- 'Content-Type': 'application/ld+json',
- }),
- };
- self.http
- .post(
- '/streampipes-connect/api/v1/' + self.authStatusService.email + url,
- res,
- httpOptions
- )
- .pipe(map(response => {
- var statusMessage = response as StatusMessage;
- resolve(statusMessage);
- }))
- .subscribe();
- });
+ let promise = new Promise<Message>((resolve, reject) => {
+ this.http
+ .post(
+ '/streampipes-connect/api/v1/' + this.authStatusService.email + url,
+ adapter,
+ )
+ .pipe(map(response => {
+ var statusMessage = response as Message;
+ resolve(statusMessage);
+ }))
+ .subscribe();
});
return from(promise);
}
getGuessSchema(adapter: AdapterDescription): Observable<GuessSchema> {
- let promise = new Promise<GuessSchema>((resolve, reject) => {
- this.tsonLdSerializerService.toJsonLd(adapter).subscribe(res => {
- return this.http
- .post('/streampipes-connect/api/v1/' + this.authStatusService.email + '/master/guess/schema', res)
- .pipe(map(response => {
- if (JSON.stringify(response).includes('sp:GuessSchema')) {
- const r = this.tsonLdSerializerService.fromJsonLd(response, 'sp:GuessSchema');
- r.eventSchema.eventProperties.sort((a, b) => a.index - b.index);
- this.removeHeaderKeys(r.eventSchema.eventProperties);
- resolve(r);
- } else {
- const r = this.tsonLdSerializerService.fromJsonLd(response, 'sp:ErrorMessage');
- reject(r);
- }
-
- }))
- .subscribe();
- });
- });
- return from(promise);
- }
-
- removeHeaderKeys(eventProperties: EventProperty[]) {
- // remove header key form schema
- for (let ep of eventProperties) {
- if (ep instanceof EventPropertyNested) {
- this.removeHeaderKeys((<EventPropertyNested>ep).eventProperties);
- }
- }
+ return this.http
+ .post('/streampipes-connect/api/v1/' + this.authStatusService.email + '/master/guess/schema', adapter)
+ .pipe(map(response => {
+ return GuessSchema.fromData(response as GuessSchema);
+ }))
}
- getSourceDetails(sourceElementId): Observable<any> {
+ getSourceDetails(sourceElementId): Observable<DataSourceDescription> {
return this.http
- .get(this.makeUserDependentBaseUrl() + "/sources/" + encodeURIComponent(sourceElementId));
+ .get(this.makeUserDependentBaseUrl() + "/sources/" + encodeURIComponent(sourceElementId)).pipe(map(response => {
+ return DataSourceDescription.fromData(response as DataSourceDescription);
+ }));
}
getRuntimeInfo(sourceDescription): Observable<any> {
@@ -159,21 +120,15 @@ export class RestService {
'/streampipes-connect/api/v1/riemer@fzi.de/master/description/formats'
)
.pipe(map(response => {
- const res = self.tsonLdSerializerService.fromJsonLd(response, 'sp:FormatDescriptionList');
- return res;
+ return FormatDescriptionList.fromData(response as FormatDescriptionList);
}));
}
getProtocols(): Observable<ProtocolDescriptionList> {
- var self = this;
return this.http
.get(this.host + 'api/v2/adapter/allProtocols')
.pipe(map(response => {
- const res = this.tsonLdSerializerService.fromJsonLd(
- response,
- 'sp:ProtocolDescriptionList'
- );
- return res;
+ return response as ProtocolDescriptionList;
}));
}
diff --git a/ui/src/app/connect/schema-editor/event-property-list/event-property-list.component.ts b/ui/src/app/connect/schema-editor/event-property-list/event-property-list.component.ts
index 8447224..c55ee48 100644
--- a/ui/src/app/connect/schema-editor/event-property-list/event-property-list.component.ts
+++ b/ui/src/app/connect/schema-editor/event-property-list/event-property-list.component.ts
@@ -17,9 +17,8 @@
*/
import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
-import {EventPropertyList} from '../model/EventPropertyList';
-import {EventProperty} from '../model/EventProperty';
import {DataTypesService} from '../data-type.service';
+import {EventProperty, EventPropertyList} from "../../../core-model/gen/streampipes-model";
@Component({
@@ -32,7 +31,7 @@ export class EventPropertyListComponent implements OnInit {
constructor(private dataTypeService: DataTypesService) { }
- @Input() property: EventPropertyList;
+ @Input() property: any;
@Input() index: number;
runtimeDataTypes;
diff --git a/ui/src/app/connect/schema-editor/event-property-primitive/event-property-primitive.component.ts b/ui/src/app/connect/schema-editor/event-property-primitive/event-property-primitive.component.ts
index c73bb50..02a5b6a 100644
--- a/ui/src/app/connect/schema-editor/event-property-primitive/event-property-primitive.component.ts
+++ b/ui/src/app/connect/schema-editor/event-property-primitive/event-property-primitive.component.ts
@@ -17,9 +17,7 @@
*/
import {Component, DoCheck, EventEmitter, Input, OnInit, Output} from '@angular/core';
-import {EventProperty} from '../model/EventProperty';
import {Observable, Subscription} from 'rxjs';
-import {EventPropertyPrimitive} from '../model/EventPropertyPrimitive';
import {FormBuilder, FormControl, FormGroup} from '@angular/forms';
import {DataTypesService} from '../data-type.service';
import {DomainPropertyProbabilityList} from '../model/DomainPropertyProbabilityList';
@@ -28,6 +26,7 @@ import {RestService} from '../../rest.service';
import {UnitDescription} from '../../model/UnitDescription';
import {UnitProviderService} from '../unit-provider.service';
import {map, startWith} from 'rxjs/operators';
+import {EventProperty, EventPropertyPrimitive} from "../../../core-model/gen/streampipes-model";
@Component({
selector: 'app-event-property-primitive',
@@ -36,7 +35,7 @@ import {map, startWith} from 'rxjs/operators';
})
export class EventPropertyPrimitiveComponent implements OnInit, DoCheck {
- @Input() property: EventPropertyPrimitive;
+ @Input() property: any;
@Input() index: number;
@Input() domainPropertyGuess: DomainPropertyProbabilityList;
@@ -90,20 +89,20 @@ export class EventPropertyPrimitiveComponent implements OnInit, DoCheck {
ngOnInit() {
// this.property.propertyNumber = this.index;
- if (this.property.measurementUnitTmp !== undefined) {
- this.property.oldMeasurementUnit = this.property.oldMeasurementUnit;
+ if ((this.property as any).measurementUnitTmp !== undefined) {
+ (this.property as any).oldMeasurementUnit = (this.property as any).oldMeasurementUnit;
// TODO: use if backend deserialize URI correct
- this.property.measurementUnitTmp = this.property.measurementUnitTmp;
- this.hadMesarumentUnit = this.property.hadMeasarumentUnit;
- this.transformUnitEnable = this.property.hadMeasarumentUnit;
- const unit = this.allUnits.find(unitTmp => unitTmp.resource === this.property.oldMeasurementUnit);
+ (this.property as any).measurementUnitTmp = (this.property as any).measurementUnitTmp;
+ this.hadMesarumentUnit = (this.property as any).hadMeasarumentUnit;
+ this.transformUnitEnable = (this.property as any).hadMeasarumentUnit;
+ const unit = this.allUnits.find(unitTmp => unitTmp.resource === (this.property as any).oldMeasurementUnit);
this.oldMeasurementUnitDipsplay = unit.label;
this.stateCtrl.setValue(unit.label);
this.restService.getFittingUnits(unit).subscribe(result => {
this.possibleUnitTransformations = result;
// this.selectUnit = this.possibleUnitTransformations[0];
- this.selectUnit = this.allUnits.find(unitTmp => unitTmp.resource === this.property.measurementUnitTmp);
+ this.selectUnit = this.allUnits.find(unitTmp => unitTmp.resource === (this.property as any).measurementUnitTmp);
this.transformUnitEnable = true
this.changeTargetUnit(this.selectUnit);
});
@@ -111,7 +110,7 @@ export class EventPropertyPrimitiveComponent implements OnInit, DoCheck {
// this.newUnitStateCtrl.setValue(newUnit);
// this.selectUnit = newUnit;
}
- this.property.timestampTransformationMultiplier = 1000;
+ (this.property as any).timestampTransformationMultiplier = 1000;
}
@@ -120,7 +119,7 @@ export class EventPropertyPrimitiveComponent implements OnInit, DoCheck {
}
ngDoCheck() {
- this.property.propertyNumber = this.index;
+ (this.property as any).propertyNumber = this.index;
}
private transformUnit() {
@@ -128,11 +127,11 @@ export class EventPropertyPrimitiveComponent implements OnInit, DoCheck {
this.transformUnitEnable = false;
// TODO: use if backend deserialize URI correct
// this.property.measurementUnit = this.property.oldMeasurementUnit;
- this.property.measurementUnitTmp = this.property.oldMeasurementUnit;
- this.property.hadMeasarumentUnit = false;
+ (this.property as any).measurementUnitTmp = (this.property as any).oldMeasurementUnit;
+ (this.property as any).hadMeasarumentUnit = false;
} else {
const unit = this.allUnits.find(unitTmp => unitTmp.label === this.stateCtrl.value);
- this.property.hadMeasarumentUnit = true;
+ (this.property as any).hadMeasarumentUnit = true;
if (!unit) {
return;
}
@@ -151,13 +150,13 @@ export class EventPropertyPrimitiveComponent implements OnInit, DoCheck {
const units: UnitDescription[] = this.allUnits.filter(unit => unit.label.toLowerCase().indexOf(filterValue) === 0);
const unit: UnitDescription = this.allUnits.filter(unit => unit.label.toLocaleLowerCase() === filterValue)[0];
if (unit !== undefined) {
- this.property.oldMeasurementUnit = unit.resource;
- this.property.measurementUnitTmp = unit.resource;
+ (this.property as any).oldMeasurementUnit = unit.resource;
+ (this.property as any).measurementUnitTmp = unit.resource;
// TODO: use if backend deserialize URI correct
// this.property.measurementUnit = units.resource;
} else {
- this.property.oldMeasurementUnit = undefined;
- this.property.measurementUnitTmp = undefined;
+ (this.property as any).oldMeasurementUnit = undefined;
+ (this.property as any).measurementUnitTmp = undefined;
// TODO: use if backend deserialize URI correct
// this.property.measurementUnit = undefined;
}
@@ -167,12 +166,12 @@ export class EventPropertyPrimitiveComponent implements OnInit, DoCheck {
changeTargetUnit(unit: UnitDescription) {
// TODO: use if backend deserialize URI correct
// this.property.measurementUnit = unit.resource;
- this.property.measurementUnitTmp = unit.resource;
+ (this.property as any).measurementUnitTmp = unit.resource;
this.newUnitStateCtrl.setValue(unit);
}
staticValueAddedByUser() {
- if (this.property.id.startsWith('http://eventProperty.de/staticValue/')) {
+ if (this.property.elementId.startsWith('http://eventProperty.de/staticValue/')) {
return true;
} else {
return false;
diff --git a/ui/src/app/connect/schema-editor/event-property-row/event-property-row.component.ts b/ui/src/app/connect/schema-editor/event-property-row/event-property-row.component.ts
index 655b5d2..a57f9d8 100644
--- a/ui/src/app/connect/schema-editor/event-property-row/event-property-row.component.ts
+++ b/ui/src/app/connect/schema-editor/event-property-row/event-property-row.component.ts
@@ -17,16 +17,16 @@
*/
import {Component, EventEmitter, Input, OnChanges, Output, SimpleChanges} from "@angular/core";
-import {EventProperty} from "../model/EventProperty";
-import {EventPropertyPrimitive} from "../model/EventPropertyPrimitive";
-import {EventPropertyNested} from "../model/EventPropertyNested";
-import {EventPropertyList} from "../model/EventPropertyList";
-import {EventSchema} from "../model/EventSchema";
import {UUID} from "angular2-uuid";
-import {EventPropertyComponent} from "../event-property/event-property.component";
import {DomainPropertyProbabilityList} from "../model/DomainPropertyProbabilityList";
import {TreeNode} from "angular-tree-component";
import {MatDialog} from "@angular/material/dialog";
+import {
+ EventProperty, EventPropertyList, EventPropertyNested,
+ EventPropertyPrimitive, EventPropertyUnion,
+ EventSchema
+} from "../../../core-model/gen/streampipes-model";
+import {EventPropertyComponent} from "../event-property/event-property.component";
@Component({
selector: 'event-property-row',
@@ -183,9 +183,11 @@ export class EventPropertyRowComponent implements OnChanges {
public addNestedProperty(eventProperty: EventPropertyNested): void {
const uuid: string = UUID.UUID();
if (!eventProperty.eventProperties) {
- eventProperty.eventProperties = new Array<EventProperty>();
+ eventProperty.eventProperties = new Array<EventPropertyUnion>();
}
- eventProperty.eventProperties.push(new EventPropertyNested(uuid, undefined));
+ let property: EventPropertyNested = new EventPropertyNested();
+ property.elementId = uuid;
+ eventProperty.eventProperties.push(property);
this.refreshTreeEmitter.emit();
}
diff --git a/ui/src/app/connect/schema-editor/event-property/event-property.component.html b/ui/src/app/connect/schema-editor/event-property/event-property.component.html
index a80c6f0..40a7138 100644
--- a/ui/src/app/connect/schema-editor/event-property/event-property.component.html
+++ b/ui/src/app/connect/schema-editor/event-property/event-property.component.html
@@ -36,7 +36,7 @@
<div class="form-group">
<mat-form-field class="doubleWidth">
<input matInput placeholder="Domain Property" class="dmainProperty" name="domainproperty" id="domainproperty"
- [(ngModel)]="cachedProperty.domainProperty">
+ [(ngModel)]="cachedProperty.domainProperties[0]">
</mat-form-field>
<div *ngIf="!isNested">
<mat-checkbox name="timestampCheckbox"
diff --git a/ui/src/app/connect/schema-editor/event-property/event-property.component.ts b/ui/src/app/connect/schema-editor/event-property/event-property.component.ts
index 85aefdb..cf27909 100644
--- a/ui/src/app/connect/schema-editor/event-property/event-property.component.ts
+++ b/ui/src/app/connect/schema-editor/event-property/event-property.component.ts
@@ -18,14 +18,16 @@
import {Component, EventEmitter, Inject, OnInit, Output} from '@angular/core';
import {FormBuilder, FormGroup, Validators} from '@angular/forms';
-import {EventProperty} from '../model/EventProperty';
import {DomainPropertyProbabilityList} from '../model/DomainPropertyProbabilityList';
import {DomainPropertyProbability} from '../model/DomainPropertyProbability';
import {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material/dialog';
-import {EventPropertyPrimitive} from '../model/EventPropertyPrimitive';
import {DataTypesService} from '../data-type.service';
-import {EventPropertyNested} from '../model/EventPropertyNested';
-import {EventPropertyList} from '../model/EventPropertyList';
+import {
+ EventProperty, EventPropertyList,
+ EventPropertyNested,
+ EventPropertyPrimitive, EventPropertyUnion
+} from "../../../core-model/gen/streampipes-model";
+import {EventPropertyRowComponent} from "../event-property-row/event-property-row.component";
@Component({
@@ -37,9 +39,9 @@ export class EventPropertyComponent implements OnInit {
soTimestamp = "http://schema.org/DateTime";
- cachedProperty: EventProperty;
+ cachedProperty: EventPropertyUnion;
- property: EventProperty;
+ property: EventPropertyUnion;
domainProbability: DomainPropertyProbabilityList;
isNested: boolean;
isTimestampProperty: boolean = false;
@@ -47,7 +49,7 @@ export class EventPropertyComponent implements OnInit {
private propertyForm: FormGroup;
// protected dataTypes = dataTypes;
- @Output() propertyChange = new EventEmitter<EventProperty>();
+ @Output() propertyChange = new EventEmitter<EventPropertyUnion>();
domainPropertyGuess: any;
private runtimeDataTypes;
@@ -55,16 +57,23 @@ export class EventPropertyComponent implements OnInit {
private dialogRef: MatDialogRef<EventPropertyComponent>,
private formBuilder: FormBuilder,
private dataTypeService: DataTypesService) {
- this.property = data.property;
- this.cachedProperty = this.property.copy();
- this.domainProbability = data.domainProbability;
+ }
+
+ copyEp(ep: EventPropertyUnion) {
+ if (ep instanceof EventPropertyPrimitive) {
+ return EventPropertyPrimitive.fromData(ep as EventPropertyPrimitive, new EventPropertyPrimitive());
+ } else if (ep instanceof EventPropertyNested) {
+ return EventPropertyNested.fromData(ep as EventPropertyNested, new EventPropertyNested());
+ } else {
+ return EventPropertyList.fromData(ep as EventPropertyList, new EventPropertyList());
+ }
}
private createForm() {
this.propertyForm = this.formBuilder.group({
- label: [this.property.getLabel(), Validators.required],
- runtimeName: [this.property.getRuntimeName(), Validators.required],
- description: [this.property.getDescription(), Validators.required],
+ label: [this.property.label, Validators.required],
+ runtimeName: [this.property.runtimeName, Validators.required],
+ description: [this.property.description, Validators.required],
domainProperty: ['', Validators.required],
dataType: ['', Validators.required]
});
@@ -83,17 +92,19 @@ export class EventPropertyComponent implements OnInit {
}
staticValueAddedByUser() {
- if (this.property.id.startsWith('http://eventProperty.de/staticValue/')) {
+ if (this.property.elementId.startsWith('http://eventProperty.de/staticValue/')) {
return true;
} else {
return false;
}
-
}
ngOnInit(): void {
+ this.property = this.data.property;
+ this.cachedProperty = this.copyEp(this.cachedProperty);
+ this.domainProbability = this.data.domainProbability;
this.runtimeDataTypes = this.dataTypeService.getDataTypes();
- this.isTimestampProperty = this.cachedProperty.domainProperty === this.soTimestamp;
+ this.isTimestampProperty = this.cachedProperty.domainProperties.some(dp => dp === this.soTimestamp);
this.isNested = this.isEventPropertyNested(this.property);
this.createForm();
@@ -104,7 +115,7 @@ export class EventPropertyComponent implements OnInit {
const tmpBestDomainProperty = this.getDomainPropertyWithHighestConfidence(this.domainPropertyGuess.list);
if (tmpBestDomainProperty != null) {
- this.property.domainProperty = tmpBestDomainProperty.domainProperty;
+ this.property.domainProperties = [tmpBestDomainProperty.domainProperty];
}
}
@@ -123,16 +134,16 @@ export class EventPropertyComponent implements OnInit {
addTimestampDomainProperty() {
if (!this.isTimestampProperty) {
this.isTimestampProperty = true;
- this.cachedProperty.domainProperty = this.soTimestamp;
+ this.cachedProperty.domainProperties = [this.soTimestamp];
} else {
- this.isTimestampProperty = this.cachedProperty.domainProperty === this.soTimestamp;
+ this.isTimestampProperty = this.cachedProperty.domainProperties.some(dp => dp === this.soTimestamp);
}
}
save(): void {
this.property.label = this.cachedProperty.label;
this.property.description = this.cachedProperty.description;
- this.property.domainProperty = this.cachedProperty.domainProperty;
+ this.property.domainProperties = this.cachedProperty.domainProperties;
this.property.runtimeName = this.cachedProperty.runtimeName;
@@ -145,13 +156,13 @@ export class EventPropertyComponent implements OnInit {
this.property.runtimeType = (this.cachedProperty as EventPropertyPrimitive).runtimeType;
this.property.measurementUnit = (this.cachedProperty as EventPropertyPrimitive).measurementUnit;
- this.property.measurementUnitTmp = (this.cachedProperty as EventPropertyPrimitive).measurementUnitTmp;
- this.property.oldMeasurementUnit = (this.cachedProperty as EventPropertyPrimitive).oldMeasurementUnit;
- this.property.hadMeasarumentUnit = (this.cachedProperty as EventPropertyPrimitive).hadMeasarumentUnit;;
+ (this.property as any).measurementUnitTmp = (this.cachedProperty as any).measurementUnitTmp;
+ (this.property as any).oldMeasurementUnit = (this.cachedProperty as any).oldMeasurementUnit;
+ (this.property as any).hadMeasarumentUnit = (this.cachedProperty as any).hadMeasarumentUnit;;
- this.property.timestampTransformationMode = (this.cachedProperty as EventPropertyPrimitive).timestampTransformationMode;
- this.property.timestampTransformationFormatString = (this.cachedProperty as EventPropertyPrimitive).timestampTransformationFormatString;
- this.property.timestampTransformationMultiplier = (this.cachedProperty as EventPropertyPrimitive).timestampTransformationMultiplier;
+ (this.property as any).timestampTransformationMode = (this.cachedProperty as any).timestampTransformationMode;
+ (this.property as any).timestampTransformationFormatString = (this.cachedProperty as any).timestampTransformationFormatString;
+ (this.property as any).timestampTransformationMultiplier = (this.cachedProperty as any).timestampTransformationMultiplier;
}
this.dialogRef.close({ data: this.property});
diff --git a/ui/src/app/connect/schema-editor/event-schema/event-schema.component.ts b/ui/src/app/connect/schema-editor/event-schema/event-schema.component.ts
index 4cbf81f..8510d2b 100644
--- a/ui/src/app/connect/schema-editor/event-schema/event-schema.component.ts
+++ b/ui/src/app/connect/schema-editor/event-schema/event-schema.component.ts
@@ -18,16 +18,14 @@
import {Component, EventEmitter, Input, OnChanges, Output, SimpleChanges, ViewChild} from '@angular/core';
import {RestService} from '../../rest.service';
-import {EventSchema} from '../model/EventSchema';
-import {AdapterDescription} from '../../model/connect/AdapterDescription';
-import {GuessSchema} from '../model/GuessSchema';
-import {NotificationLd} from '../../model/message/NotificationLd';
-import {EventProperty} from '../model/EventProperty';
-import {EventPropertyNested} from '../model/EventPropertyNested';
-import {EventPropertyPrimitive} from '../model/EventPropertyPrimitive';
import {ITreeOptions, TreeComponent} from 'angular-tree-component';
import {UUID} from 'angular2-uuid';
import {DataTypesService} from '../data-type.service';
+import {
+ AdapterDescription, EventProperty, EventPropertyNested, EventPropertyPrimitive,
+ EventSchema,
+ GuessSchema, Notification
+} from "../../../core-model/gen/streampipes-model";
@Component({
selector: 'app-event-schema',
@@ -56,7 +54,7 @@ export class EventSchemaComponent implements OnChanges {
isError = false;
isPreviewEnabled = false;
showErrorMessage = false;
- errorMessages: NotificationLd[];
+ errorMessages: Notification[];
nodes: EventProperty[] = new Array<EventProperty>();
options: ITreeOptions = {
childrenField: 'eventProperties',
@@ -86,7 +84,7 @@ export class EventSchemaComponent implements OnChanges {
this.eventSchemaChange.emit(this.eventSchema);
this.schemaGuess = guessSchema;
- this.oldEventSchema = this.eventSchema.copy();
+ this.oldEventSchema = EventSchema.fromData(this.eventSchema, new EventSchema());
this.oldEventSchemaChange.emit(this.oldEventSchema);
this.refreshTree();
@@ -111,10 +109,13 @@ export class EventSchemaComponent implements OnChanges {
public addNestedProperty(eventProperty?: EventPropertyNested): void {
const uuid: string = UUID.UUID();
- if (eventProperty === undefined) {
- this.eventSchema.eventProperties.push(new EventPropertyNested(uuid, undefined));
+ let nested: EventPropertyNested = new EventPropertyNested();
+ nested.elementId = uuid;
+ nested.eventProperties = [];
+ if (!eventProperty) {
+ this.eventSchema.eventProperties.push(nested);
} else {
- eventProperty.eventProperties.push(new EventPropertyNested(uuid, undefined));
+ eventProperty.eventProperties.push(nested);
}
this.refreshTree();
}
@@ -135,22 +136,24 @@ export class EventSchemaComponent implements OnChanges {
}
public addStaticValueProperty(): void {
- const eventProperty = new EventPropertyPrimitive('staticValue/' + UUID.UUID(), undefined);
+ const eventProperty = new EventPropertyPrimitive();
+ eventProperty.elementId = 'staticValue/' + UUID.UUID(), undefined;
- eventProperty.setRuntimeName('key_0');
- eventProperty.setRuntimeType(this.dataTypesService.getStringTypeUrl());
+ eventProperty.runtimeName = 'key_0';
+ eventProperty.runtimeType = this.dataTypesService.getStringTypeUrl();
this.eventSchema.eventProperties.push(eventProperty);
this.refreshTree();
}
public addTimestampProperty(): void {
- const eventProperty = new EventPropertyPrimitive('timestamp/' + UUID.UUID(), undefined);
+ const eventProperty = new EventPropertyPrimitive();
+ eventProperty.elementId = 'timestamp/' + UUID.UUID();
- eventProperty.setRuntimeName('timestamp');
- eventProperty.setLabel('Timestamp');
- eventProperty.setDomainProperty('http://schema.org/DateTime');
- eventProperty.setRuntimeType(this.dataTypesService.getNumberTypeUrl());
+ eventProperty.runtimeName = 'timestamp';
+ eventProperty.label = 'Timestamp';
+ eventProperty.domainProperties = ['http://schema.org/DateTime'];
+ eventProperty.runtimeType = this.dataTypesService.getNumberTypeUrl();
this.eventSchema.eventProperties.push(eventProperty);
this.refreshTree();
diff --git a/ui/src/app/connect/schema-editor/model/EventPropertyPrimitive.ts b/ui/src/app/connect/schema-editor/model/EventPropertyPrimitive.ts
index 8472028..70217e6 100644
--- a/ui/src/app/connect/schema-editor/model/EventPropertyPrimitive.ts
+++ b/ui/src/app/connect/schema-editor/model/EventPropertyPrimitive.ts
@@ -84,14 +84,7 @@ export class EventPropertyPrimitive extends EventProperty {
this.runtimeType = runtimeType;
}
- isTimestampProperty() {
- if (this.domainProperty === "http://schema.org/DateTime") {
- this.runtimeType = "http://www.w3.org/2001/XMLSchema#float";
- return true;
- } else {
- return false;
- }
- }
+
diff --git a/ui/src/app/connect/select-static-properties-component/select-static-properties.component.html b/ui/src/app/connect/select-static-properties-component/select-static-properties.component.html
index 33d5044..e874390 100644
--- a/ui/src/app/connect/select-static-properties-component/select-static-properties.component.html
+++ b/ui/src/app/connect/select-static-properties-component/select-static-properties.component.html
@@ -17,6 +17,6 @@
-->
<div id="select-static-properties" *ngFor="let staticProperty of staticProperties" class="blockElement fullWidth">
- <app-static-property [adapterId]="adapterId" [staticProperties]="staticProperties" [eventSchema]="eventSchema" [staticProperty]="staticProperty" (validateEmitter)="validateText()" (updateEmitter)="triggerUpdate($event)" [completedStaticProperty]="completedStaticProperty" class="test fullWidth">
+ <app-static-property [adapterId]="adapterId" [staticProperties]="staticProperties" [eventSchemas]="eventSchema" [staticProperty]="staticProperty" (validateEmitter)="validateText()" (updateEmitter)="triggerUpdate($event)" [completedStaticProperty]="completedStaticProperty" class="test fullWidth">
</app-static-property>
</div>
\ No newline at end of file
diff --git a/ui/src/app/connect/select-static-properties-component/select-static-properties.component.ts b/ui/src/app/connect/select-static-properties-component/select-static-properties.component.ts
index c062440..d0a7b54 100644
--- a/ui/src/app/connect/select-static-properties-component/select-static-properties.component.ts
+++ b/ui/src/app/connect/select-static-properties-component/select-static-properties.component.ts
@@ -16,18 +16,17 @@
*
*/
-import {Component, EventEmitter, Input, Output} from '@angular/core';
+import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
-import {StaticProperty} from '../model/StaticProperty';
-import {EventSchema} from '../schema-editor/model/EventSchema';
import {ConfigurationInfo} from "../model/message/ConfigurationInfo";
+import {EventSchema, StaticProperty} from "../../core-model/gen/streampipes-model";
@Component({
selector: 'app-select-static-properties',
templateUrl: './select-static-properties.component.html',
styleUrls: ['./select-static-properties.component.css'],
})
-export class SelectStaticPropertiesComponent {
+export class SelectStaticPropertiesComponent implements OnInit{
@Input()
@@ -35,14 +34,23 @@ export class SelectStaticPropertiesComponent {
@Input()
staticProperties: StaticProperty[];
+
@Input()
eventSchema: EventSchema;
+
@Output()
validateEmitter = new EventEmitter();
+
@Output()
emitter: EventEmitter<any> = new EventEmitter<any>();
completedStaticProperty: ConfigurationInfo;
+ eventSchemas: EventSchema[];
+
+ ngOnInit() {
+ console.log(this.staticProperties);
+ this.eventSchemas = [this.eventSchema];
+ }
validateText() {
if (this.staticProperties.every(this.allValid)) {
diff --git a/ui/src/app/connect/static-properties/static-alternatives/static-alternatives.component.ts b/ui/src/app/connect/static-properties/static-alternatives/static-alternatives.component.ts
index df60b36..1dff374 100644
--- a/ui/src/app/connect/static-properties/static-alternatives/static-alternatives.component.ts
+++ b/ui/src/app/connect/static-properties/static-alternatives/static-alternatives.component.ts
@@ -20,7 +20,10 @@ import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
import {EventSchema} from '../../schema-editor/model/EventSchema';
import {GroupStaticProperty} from '../../model/GroupStaticProperty';
import {AbstractStaticPropertyRenderer} from "../base/abstract-static-property";
-import {StaticPropertyAlternatives} from "../../../core-model/gen/streampipes-model";
+import {
+ StaticPropertyAlternatives,
+ StaticPropertyGroup
+} from "../../../core-model/gen/streampipes-model";
@Component({
selector: 'app-static-alternatives',
@@ -56,8 +59,8 @@ export class StaticAlternativesComponent
if (alternative !== undefined) {
if (alternative.staticProperty !== undefined) {
var childsAreValid = true;
- (<GroupStaticProperty> alternative.staticProperty).staticProperties.forEach(property => {
- if (!property.isValid) {
+ (<StaticPropertyGroup> alternative.staticProperty).staticProperties.forEach(property => {
+ if (!(property as any).isValid) {
childsAreValid = false
}
});
@@ -72,7 +75,7 @@ export class StaticAlternativesComponent
radioSelectionChange(event) {
this.staticProperty.alternatives.forEach(alternative => {
- if (alternative.id == event.value.id) {
+ if (alternative.elementId == event.value.id) {
alternative.selected = true;
} else {
alternative.selected = false;
diff --git a/ui/src/app/connect/static-properties/static-collection/static-collection.component.html b/ui/src/app/connect/static-properties/static-collection/static-collection.component.html
index 44c3609..4c2f9ed 100644
--- a/ui/src/app/connect/static-properties/static-collection/static-collection.component.html
+++ b/ui/src/app/connect/static-properties/static-collection/static-collection.component.html
@@ -27,7 +27,7 @@
<div fxLayout="row" fxLayoutAlign="space-between center" *ngFor="let property of staticProperty.members; let i = index">
<div fxFlex="grow">
<app-static-property [adapterId]="adapterId"
- [eventSchema]="eventSchema"
+ [eventSchemas]="eventSchemas"
[staticProperty]="property"
(validateEmitter)="valueChange($event)">
</app-static-property>
@@ -44,7 +44,7 @@
<div fxFlex="grow" style="pointer-events: none; opacity: 0.4;">
<app-static-property
[adapterId]="adapterId"
- [eventSchema]="eventSchema"
+ [eventSchemas]="eventSchemas"
[staticProperty]="staticProperty.staticPropertyTemplate"
(validateEmitter)="valueChange($event)">
</app-static-property>
diff --git a/ui/src/app/connect/static-properties/static-collection/static-collection.component.ts b/ui/src/app/connect/static-properties/static-collection/static-collection.component.ts
index d87db50..f3e33d0 100644
--- a/ui/src/app/connect/static-properties/static-collection/static-collection.component.ts
+++ b/ui/src/app/connect/static-properties/static-collection/static-collection.component.ts
@@ -44,7 +44,7 @@ export class StaticCollectionComponent
valueChange(inputValue) {
if ((<CollectionStaticProperty> this.staticProperty).members !== undefined) {
- let property = (<CollectionStaticProperty> this.staticProperty).members.find(member => member.isValid == false);
+ let property = (<CollectionStaticProperty> this.staticProperty).members.find(member => (member as any).isValid == false);
property === undefined ? this.hasInput = true : this.hasInput = false;
} else {
this.hasInput = false;
diff --git a/ui/src/app/connect/static-properties/static-free-input/static-free-input.component.ts b/ui/src/app/connect/static-properties/static-free-input/static-free-input.component.ts
index d9acdcc..6c3025d 100644
--- a/ui/src/app/connect/static-properties/static-free-input/static-free-input.component.ts
+++ b/ui/src/app/connect/static-properties/static-free-input/static-free-input.component.ts
@@ -17,7 +17,6 @@
*/
import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
-import {StaticProperty} from '../../model/StaticProperty';
import {FormControl, FormGroup, Validators} from '@angular/forms';
import {StaticPropertyUtilService} from '../static-property-util.service';
import {ConfigurationInfo} from "../../model/message/ConfigurationInfo";
diff --git a/ui/src/app/connect/static-properties/static-group/static-group.component.ts b/ui/src/app/connect/static-properties/static-group/static-group.component.ts
index 433546c..030edb6 100644
--- a/ui/src/app/connect/static-properties/static-group/static-group.component.ts
+++ b/ui/src/app/connect/static-properties/static-group/static-group.component.ts
@@ -35,7 +35,7 @@ export class StaticGroupComponent
private hasInput: Boolean;
valueChange(inputValue) {
- let property = this.staticProperty.staticProperties.find(property => property.isValid == false);
+ let property = this.staticProperty.staticProperties.find(property => (property as any).isValid == false);
if (property == undefined) {
this.hasInput = true;
} else {
diff --git a/ui/src/app/connect/static-properties/static-one-of-input/static-one-of-input.component.ts b/ui/src/app/connect/static-properties/static-one-of-input/static-one-of-input.component.ts
index 9f9649a..793adff 100644
--- a/ui/src/app/connect/static-properties/static-one-of-input/static-one-of-input.component.ts
+++ b/ui/src/app/connect/static-properties/static-one-of-input/static-one-of-input.component.ts
@@ -40,10 +40,10 @@ export class StaticOneOfInputComponent extends AbstractStaticPropertyRenderer<On
if (this.noneSelected()) {
if (this.staticProperty.options.length > 0) {
this.staticProperty.options[0].selected = true;
- this.selectedOption = this.staticProperty.options[0].id;
+ this.selectedOption = this.staticProperty.options[0].elementId;
}
} else {
- this.selectedOption = this.staticProperty.options.find(option => option.selected).id;
+ this.selectedOption = this.staticProperty.options.find(option => option.selected).elementId;
}
this.inputEmitter.emit(true);
}
@@ -53,11 +53,11 @@ export class StaticOneOfInputComponent extends AbstractStaticPropertyRenderer<On
}
select(id) {
- this.selectedOption = this.staticProperty.options.find(option => option.id === id).id;
+ this.selectedOption = this.staticProperty.options.find(option => option.elementId === id).elementId;
for (let option of this.staticProperty.options) {
option.selected = false;
}
- this.staticProperty.options.find(option => option.id === id).selected = true;
+ this.staticProperty.options.find(option => option.elementId === id).selected = true;
this.inputEmitter.emit(true)
}
}
diff --git a/ui/src/app/connect/static-properties/static-property.component.html b/ui/src/app/connect/static-properties/static-property.component.html
index 036eb91..b069b61 100644
--- a/ui/src/app/connect/static-properties/static-property.component.html
+++ b/ui/src/app/connect/static-properties/static-property.component.html
@@ -21,11 +21,11 @@
(inputEmitter)="valueChange($event)" [staticProperty]="staticProperty">
</app-static-url-input>
-<app-static-number-input *ngIf="isFreeTextStaticProperty(staticProperty) && staticPropertyUtil.asFreeTextStaticProperty(staticProperty).requiredDomainProperty == xsService.XS_NUMBER"
+<app-static-number-input *ngIf="isFreeTextStaticProperty(staticProperty) && xsService.isNumber(staticPropertyUtil.asFreeTextStaticProperty(staticProperty).requiredDomainProperty)"
(updateEmitter)="emitUpdate($event)" (inputEmitter)="valueChange($event)" [staticProperty]="staticProperty">
</app-static-number-input>
-<app-static-text-input *ngIf="isFreeTextStaticProperty(staticProperty) && staticPropertyUtil.asFreeTextStaticProperty (staticProperty).requiredDomainProperty == xsService.XS_STRING1"
+<app-static-text-input *ngIf="isFreeTextStaticProperty(staticProperty) && staticPropertyUtil.asFreeTextStaticProperty (staticProperty).requiredDomainProperty === xsService.XS_STRING1"
(updateEmitter)="emitUpdate($event)" (inputEmitter)="valueChange($event)" [staticProperty]="staticProperty">
</app-static-text-input>
diff --git a/ui/src/app/connect/static-properties/static-property.component.ts b/ui/src/app/connect/static-properties/static-property.component.ts
index 73331a2..05bbc93 100644
--- a/ui/src/app/connect/static-properties/static-property.component.ts
+++ b/ui/src/app/connect/static-properties/static-property.component.ts
@@ -73,6 +73,8 @@ export class StaticPropertyComponent implements OnInit {
}
ngOnInit() {
+ console.log(this.staticProperty);
+ console.log(this.staticPropertyUtil.asFreeTextStaticProperty(this.staticProperty));
// this.mappingFormControl.valueChanges
// .subscribe(res => {
// this.emitter.emit(res);
diff --git a/ui/src/app/connect/static-properties/static-text-input/static-text-input.component.ts b/ui/src/app/connect/static-properties/static-text-input/static-text-input.component.ts
index 2c39025..dfc167d 100644
--- a/ui/src/app/connect/static-properties/static-text-input/static-text-input.component.ts
+++ b/ui/src/app/connect/static-properties/static-text-input/static-text-input.component.ts
@@ -17,7 +17,6 @@
*/
import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
-import {StaticProperty} from '../../model/StaticProperty';
import {FormControl, FormGroup, Validators} from '@angular/forms';
import {ValidateString} from '../../select-protocol-component/input.validator';
import {StaticPropertyUtilService} from '../static-property-util.service';
diff --git a/ui/src/app/connect/transformation-rule.service.ts b/ui/src/app/connect/transformation-rule.service.ts
index 7e432de..0c300fb 100644
--- a/ui/src/app/connect/transformation-rule.service.ts
+++ b/ui/src/app/connect/transformation-rule.service.ts
@@ -17,21 +17,23 @@
*/
import {Injectable} from '@angular/core';
-import {EventSchema} from './schema-editor/model/EventSchema';
-import {TransformationRuleDescription} from './model/connect/rules/TransformationRuleDescription';
import {Logger} from '../shared/logger/default-log.service';
-import {RenameRuleDescription} from './model/connect/rules/RenameRuleDescription';
-import {EventProperty} from './schema-editor/model/EventProperty';
-import {EventPropertyPrimitive} from './schema-editor/model/EventPropertyPrimitive';
-import {EventPropertyNested} from './schema-editor/model/EventPropertyNested';
-import {AddNestedRuleDescription} from './model/connect/rules/AddNestedRuleDescription';
-import {MoveRuleDescription} from './model/connect/rules/MoveRuleDesctiption';
-import {DeleteRuleDescription} from './model/connect/rules/DeleteRuleDescription';
-import {UnitTransformRuleDescription} from './model/connect/rules/UnitTransformRuleDescription';
-import {AddTimestampRuleDescription} from './model/connect/rules/AddTimestampRuleDescription';
-import {AddValueTransformationRuleDescription} from './model/connect/rules/AddValueTransformationRuleDescription';
-import {TimestampTransformationRuleMode} from './model/connect/rules/TimestampTransformationRuleMode';
-import {TimestampTransformationRuleDescription} from './model/connect/rules/TimestampTransformationRuleDescription';
+import {
+ AddTimestampRuleDescription,
+ AddValueTransformationRuleDescription, CreateNestedRuleDescription,
+ DeleteRuleDescription,
+ EventProperty,
+ EventPropertyNested,
+ EventPropertyPrimitive,
+ EventPropertyUnion,
+ EventSchema,
+ MoveRuleDescription,
+ RenameRuleDescription,
+ TimestampTranfsformationRuleDescription,
+ TransformationRuleDescription, TransformationRuleDescriptionUnion,
+ UnitTransformRuleDescription
+} from "../core-model/gen/streampipes-model";
+import {TimestampTransformationRuleMode} from "./model/connect/rules/TimestampTransformationRuleMode";
@Injectable()
export class TransformationRuleService {
@@ -49,8 +51,8 @@ export class TransformationRuleService {
this.newEventSchema = newEventSchema;
}
- public getTransformationRuleDescriptions(): TransformationRuleDescription[] {
- var transformationRuleDescription: TransformationRuleDescription[] = [];
+ public getTransformationRuleDescriptions(): TransformationRuleDescriptionUnion[] {
+ var transformationRuleDescription: TransformationRuleDescriptionUnion[] = [];
if (this.oldEventSchema == null || this.newEventSchema == null) {
this.logger.error("Old and new schema must be defined")
@@ -61,13 +63,18 @@ export class TransformationRuleService {
// add to old event schema for the case users moved the property to a nested property
this.oldEventSchema.eventProperties.push(addedTimestampProperties);
- transformationRuleDescription.push(new AddTimestampRuleDescription(addedTimestampProperties.getRuntimeName()));
+ let timestampRuleDescription: AddTimestampRuleDescription = new AddTimestampRuleDescription();
+ timestampRuleDescription.runtimeKey = addedTimestampProperties.runtimeName;
+ transformationRuleDescription.push(timestampRuleDescription);
}
let staticValueProperties = this.getStaticValueProperties(this.newEventSchema.eventProperties);
for (let ep of staticValueProperties) {
this.oldEventSchema.eventProperties.push(ep);
- transformationRuleDescription.push(new AddValueTransformationRuleDescription(ep.getRuntimeName(), (<EventPropertyPrimitive> ep).staticValue))
+ let rule: AddValueTransformationRuleDescription = new AddValueTransformationRuleDescription();
+ rule.runtimeKey = ep.runtimeName;
+ rule.staticValue = (ep as any).staticValue;
+ transformationRuleDescription.push(rule)
}
// Rename
@@ -113,8 +120,8 @@ export class TransformationRuleService {
result = result.concat(tmpResults);
}
- const keyOld: string = this.getCompleteRuntimeNameKey(oldEventSchema.eventProperties, eventProperty.id);
- const keyNew: string = this.getCompleteRuntimeNameKey(newEventSchema.eventProperties, eventProperty.id);
+ const keyOld: string = this.getCompleteRuntimeNameKey(oldEventSchema.eventProperties, eventProperty.elementId);
+ const keyNew: string = this.getCompleteRuntimeNameKey(newEventSchema.eventProperties, eventProperty.elementId);
// get prefix
@@ -132,7 +139,10 @@ export class TransformationRuleService {
} else {
keyOfOldValue = keyOldPrefix + "." + keyNew.substr(keyNew.lastIndexOf(".") + 1, keyNew.length);
}
- result.push(new MoveRuleDescription(keyOfOldValue, keyNewPrefix));
+ let rule: MoveRuleDescription = new MoveRuleDescription();
+ rule.oldRuntimeKey = keyOfOldValue;
+ rule.newRuntimeKey = keyNewPrefix;
+ result.push(rule);
}
}
@@ -143,18 +153,20 @@ export class TransformationRuleService {
public getCreateNestedRules(newEventProperties: EventProperty[],
oldEventSchema: EventSchema,
- newEventSchema: EventSchema): AddNestedRuleDescription[] {
+ newEventSchema: EventSchema): CreateNestedRuleDescription[] {
var allNewIds: string[] = this.getAllIds(newEventSchema.eventProperties);
var allOldIds: string[] = this.getAllIds(oldEventSchema.eventProperties);
- const result: AddNestedRuleDescription[] = [];
+ const result: CreateNestedRuleDescription[] = [];
for (let id of allNewIds) {
if (allOldIds.indexOf(id) === -1) {
const key = this.getCompleteRuntimeNameKey(newEventSchema.eventProperties, id);
- result.push(new AddNestedRuleDescription(key));
+ let rule: CreateNestedRuleDescription = new CreateNestedRuleDescription();
+ rule.runtimeKey = key;
+ result.push(rule);
}
}
@@ -169,10 +181,13 @@ export class TransformationRuleService {
var result: RenameRuleDescription[] = [];
for (let eventProperty of newEventProperties) {
- const keyOld = this.getCompleteRuntimeNameKey(oldEventSchema.eventProperties, eventProperty.id);
- const keyNew = this.getCompleteRuntimeNameKey(newEventSchema.eventProperties, eventProperty.id);
+ const keyOld = this.getCompleteRuntimeNameKey(oldEventSchema.eventProperties, eventProperty.elementId);
+ const keyNew = this.getCompleteRuntimeNameKey(newEventSchema.eventProperties, eventProperty.elementId);
- result.push(new RenameRuleDescription(keyOld, keyNew));
+ let renameRule: RenameRuleDescription = new RenameRuleDescription();
+ renameRule.oldRuntimeKey = keyOld;
+ renameRule.newRuntimeKey = keyNew;
+ result.push(renameRule);
if (eventProperty instanceof EventPropertyNested) {
const tmpResults: RenameRuleDescription[] = this.getRenameRules((<EventPropertyNested> eventProperty).eventProperties, oldEventSchema, newEventSchema);
@@ -225,7 +240,9 @@ export class TransformationRuleService {
var resultRules: DeleteRuleDescription[] = [];
for (let key of resultKeys) {
- resultRules.push(new DeleteRuleDescription(key));
+ let rule: DeleteRuleDescription = new DeleteRuleDescription();
+ rule.runtimeKey = key;
+ resultRules.push(rule);
}
return resultRules;
@@ -240,13 +257,16 @@ export class TransformationRuleService {
if (eventProperty instanceof EventPropertyPrimitive) {
const eventPropertyPrimitive = eventProperty as EventPropertyPrimitive;
- const keyNew = this.getCompleteRuntimeNameKey(newEventSchema.eventProperties, eventPropertyPrimitive.id);
+ const keyNew = this.getCompleteRuntimeNameKey(newEventSchema.eventProperties, eventPropertyPrimitive.elementId);
+ //let unitTransformation: UnitTransformRuleDescription = new UnitTransformRuleDescription();
+ //unitTransformation.fromUnitRessourceURL = eventPropertyPrimitive.
+ let rule: UnitTransformRuleDescription = new UnitTransformRuleDescription();
+ rule.runtimeKey = keyNew;
+ rule.fromUnitRessourceURL = (eventPropertyPrimitive as any).oldMeasurementUnit;
+ rule.toUnitRessourceURL = (eventPropertyPrimitive as any).measurementUnitTmp
- result.push(new UnitTransformRuleDescription(keyNew,
- // TODO: use if backend deserialize URI correct
- // eventPropertyPrimitive.oldMeasurementUnit, eventPropertyPrimitive.measurementUnit));
- eventPropertyPrimitive.oldMeasurementUnit, eventPropertyPrimitive.measurementUnitTmp));
+ result.push(rule);
} else if (eventProperty instanceof EventPropertyNested) {
const tmpResults: UnitTransformRuleDescription[] =
@@ -276,13 +296,13 @@ export class TransformationRuleService {
for (let eventProperty of eventProperties) {
- if (eventProperty.id === id) {
- return eventProperty.getRuntimeName();
+ if (eventProperty.elementId === id) {
+ return eventProperty.runtimeName;
} else {
if (eventProperty instanceof EventPropertyNested) {
var methodResult = this.getCompleteRuntimeNameKey((<EventPropertyNested> eventProperty).eventProperties, id);
if (methodResult != null) {
- result = eventProperty.getRuntimeName() + "." + methodResult;
+ result = eventProperty.runtimeName + "." + methodResult;
}
}
}
@@ -313,7 +333,7 @@ export class TransformationRuleService {
var result: string[] = [];
for (let eventProperty of eventProperties) {
- result.push(eventProperty.id);
+ result.push(eventProperty.elementId);
if (eventProperty instanceof EventPropertyNested) {
result = result.concat(this.getAllIds((<EventPropertyNested> eventProperty).eventProperties));
@@ -327,7 +347,7 @@ export class TransformationRuleService {
for (let eventProperty of eventProperties) {
- if (eventProperty.id === id) {
+ if (eventProperty.elementId === id) {
return eventProperty;
} else {
if (eventProperty instanceof EventPropertyNested) {
@@ -338,10 +358,10 @@ export class TransformationRuleService {
return result;
}
- private getTimestampProperty(eventProperties: EventProperty[]): EventProperty {
+ private getTimestampProperty(eventProperties: EventPropertyUnion[]): EventPropertyUnion {
for (let eventProperty of eventProperties) {
- if (eventProperty.id.startsWith('http://eventProperty.de/timestamp/')) {
+ if (eventProperty.elementId.startsWith('http://eventProperty.de/timestamp/')) {
return eventProperty;
}
@@ -357,11 +377,11 @@ export class TransformationRuleService {
return null;
}
- private getStaticValueProperties(eventProperties: EventProperty[]): EventProperty[] {
+ private getStaticValueProperties(eventProperties: EventPropertyUnion[]): EventPropertyUnion[] {
var result = [];
for (let eventProperty of eventProperties) {
- if (eventProperty.id.startsWith('http://eventProperty.de/staticValue/')) {
+ if (eventProperty.elementId.startsWith('http://eventProperty.de/staticValue/')) {
return [eventProperty];
}
@@ -378,24 +398,25 @@ export class TransformationRuleService {
public getTimestampTransformRules(newEventProperties: EventProperty[],
oldEventSchema: EventSchema,
- newEventSchema: EventSchema): TimestampTransformationRuleDescription[] {
- var result: TimestampTransformationRuleDescription[] = [];
+ newEventSchema: EventSchema): TimestampTranfsformationRuleDescription[] {
+ var result: TimestampTranfsformationRuleDescription[] = [];
for (let eventProperty of newEventProperties) {
if (eventProperty instanceof EventPropertyPrimitive) {
const eventPropertyPrimitive = eventProperty as EventPropertyPrimitive;
- const keyNew = this.getCompleteRuntimeNameKey(newEventSchema.eventProperties, eventPropertyPrimitive.id);
-
- if (eventProperty.isTimestampProperty()) {
- result.push(new TimestampTransformationRuleDescription(
- keyNew,
- eventProperty.timestampTransformationMode,
- eventProperty.timestampTransformationFormatString,
- eventProperty.timestampTransformationMultiplier));
+ const keyNew = this.getCompleteRuntimeNameKey(newEventSchema.eventProperties, eventPropertyPrimitive.elementId);
+
+ if (this.isTimestampProperty(eventPropertyPrimitive)) {
+ let rule: TimestampTranfsformationRuleDescription = new TimestampTranfsformationRuleDescription();
+ rule.runtimeKey = keyNew;
+ rule.mode = (eventProperty as any).timestampTransformationMode;
+ rule.formatString = (eventProperty as any).timestampTransformationFormatString;
+ rule.multiplier = (eventProperty as any).timestampTransformationMultiplier;
+ result.push(rule);
}
} else if (eventProperty instanceof EventPropertyNested) {
- const tmpResults: TimestampTransformationRuleDescription[] =
+ const tmpResults: TimestampTranfsformationRuleDescription[] =
this.getTimestampTransformRules((<EventPropertyNested> eventProperty).eventProperties, oldEventSchema, newEventSchema);
result = result.concat(tmpResults);
}
@@ -403,7 +424,7 @@ export class TransformationRuleService {
}
- var filteredResult: TimestampTransformationRuleDescription[] = [];
+ var filteredResult: TimestampTranfsformationRuleDescription[] = [];
for (let res of result) {
// TODO: better solution to check if the mode is valid
if (res.mode === TimestampTransformationRuleMode.FORMAT_STRING
@@ -417,4 +438,8 @@ export class TransformationRuleService {
}
+
+ isTimestampProperty(property: EventPropertyPrimitive) {
+ return property.domainProperties.some(dp => dp === "http://schema.org/DateTime");
+ }
}
diff --git a/ui/src/app/core-model/gen/streampipes-model.ts b/ui/src/app/core-model/gen/streampipes-model.ts
index 4feb04c..252605e 100644
--- a/ui/src/app/core-model/gen/streampipes-model.ts
+++ b/ui/src/app/core-model/gen/streampipes-model.ts
@@ -1,28 +1,10 @@
-/*
- * 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.
- *
- */
-
/* tslint:disable */
/* eslint-disable */
// @ts-nocheck
-// Generated using typescript-generator version 2.23.603 on 2020-06-08 22:33:51.
+// Generated using typescript-generator version 2.23.603 on 2020-06-10 11:14:31.
export class AbstractStreamPipesEntity {
- "@class": "org.apache.streampipes.model.base.NamedStreamPipesEntity" | "org.apache.streampipes.model.graph.DataSourceDescription" | "org.apache.streampipes.model.SpDataStream" | "org.apache.streampipes.model.SpDataSet" | "org.apache.streampipes.model.base.InvocableStreamPipesEntity" | "org.apache.streampipes.model.graph.DataProcessorInvocation" | "org.apache.streampipes.model.graph.DataSinkInvocation" | "org.apache.streampipes.model.base.UnnamedStreamPipesEntity" | "org.apache.stream [...]
+ "@class": "org.apache.streampipes.model.base.NamedStreamPipesEntity" | "org.apache.streampipes.model.connect.adapter.AdapterDescription" | "org.apache.streampipes.model.connect.adapter.AdapterSetDescription" | "org.apache.streampipes.model.connect.adapter.GenericAdapterSetDescription" | "org.apache.streampipes.model.connect.adapter.SpecificAdapterSetDescription" | "org.apache.streampipes.model.connect.adapter.AdapterStreamDescription" | "org.apache.streampipes.model.connect.adapter.G [...]
static fromData(data: AbstractStreamPipesEntity, target?: AbstractStreamPipesEntity): AbstractStreamPipesEntity {
if (!data) {
@@ -35,7 +17,7 @@ export class AbstractStreamPipesEntity {
}
export class UnnamedStreamPipesEntity extends AbstractStreamPipesEntity {
- "@class": "org.apache.streampipes.model.base.UnnamedStreamPipesEntity" | "org.apache.streampipes.model.runtime.RuntimeOptionsRequest" | "org.apache.streampipes.model.runtime.RuntimeOptionsResponse" | "org.apache.streampipes.model.staticproperty.StaticProperty" | "org.apache.streampipes.model.staticproperty.CodeInputStaticProperty" | "org.apache.streampipes.model.staticproperty.CollectionStaticProperty" | "org.apache.streampipes.model.staticproperty.ColorPickerStaticProperty" | "org.a [...]
+ "@class": "org.apache.streampipes.model.base.UnnamedStreamPipesEntity" | "org.apache.streampipes.model.connect.guess.GuessSchema" | "org.apache.streampipes.model.connect.rules.TransformationRuleDescription" | "org.apache.streampipes.model.connect.rules.value.ValueTransformationRuleDescription" | "org.apache.streampipes.model.connect.rules.value.AddTimestampRuleDescription" | "org.apache.streampipes.model.connect.rules.value.AddValueTransformationRuleDescription" | "org.apache.streamp [...]
elementId: string;
static fromData(data: UnnamedStreamPipesEntity, target?: UnnamedStreamPipesEntity): UnnamedStreamPipesEntity {
@@ -118,6 +100,171 @@ export class Accuracy extends EventPropertyQualityDefinition {
}
}
+export class NamedStreamPipesEntity extends AbstractStreamPipesEntity {
+ "@class": "org.apache.streampipes.model.base.NamedStreamPipesEntity" | "org.apache.streampipes.model.connect.adapter.AdapterDescription" | "org.apache.streampipes.model.connect.adapter.AdapterSetDescription" | "org.apache.streampipes.model.connect.adapter.GenericAdapterSetDescription" | "org.apache.streampipes.model.connect.adapter.SpecificAdapterSetDescription" | "org.apache.streampipes.model.connect.adapter.AdapterStreamDescription" | "org.apache.streampipes.model.connect.adapter.G [...]
+ appId: string;
+ applicationLinks: ApplicationLink[];
+ connectedTo: string[];
+ description: string;
+ dom: string;
+ elementId: string;
+ iconUrl: string;
+ includedAssets: string[];
+ includedLocales: string[];
+ includesAssets: boolean;
+ includesLocales: boolean;
+ name: string;
+ uri: string;
+
+ static fromData(data: NamedStreamPipesEntity, target?: NamedStreamPipesEntity): NamedStreamPipesEntity {
+ if (!data) {
+ return data;
+ }
+ const instance = target || new NamedStreamPipesEntity();
+ super.fromData(data, instance);
+ instance.name = data.name;
+ instance.description = data.description;
+ instance.iconUrl = data.iconUrl;
+ instance.elementId = data.elementId;
+ instance.appId = data.appId;
+ instance.includesAssets = data.includesAssets;
+ instance.includesLocales = data.includesLocales;
+ instance.includedAssets = __getCopyArrayFn(__identity<string>())(data.includedAssets);
+ instance.includedLocales = __getCopyArrayFn(__identity<string>())(data.includedLocales);
+ instance.applicationLinks = __getCopyArrayFn(ApplicationLink.fromData)(data.applicationLinks);
+ instance.connectedTo = __getCopyArrayFn(__identity<string>())(data.connectedTo);
+ instance.dom = data.dom;
+ instance.uri = data.uri;
+ return instance;
+ }
+}
+
+export class AdapterDescription extends NamedStreamPipesEntity {
+ "@class": "org.apache.streampipes.model.connect.adapter.AdapterDescription" | "org.apache.streampipes.model.connect.adapter.AdapterSetDescription" | "org.apache.streampipes.model.connect.adapter.GenericAdapterSetDescription" | "org.apache.streampipes.model.connect.adapter.SpecificAdapterSetDescription" | "org.apache.streampipes.model.connect.adapter.AdapterStreamDescription" | "org.apache.streampipes.model.connect.adapter.GenericAdapterStreamDescription" | "org.apache.streampipes.mod [...]
+ _rev: string;
+ adapterId: string;
+ adapterType: string;
+ category: string[];
+ config: StaticPropertyUnion[];
+ couchDBId: string;
+ eventGrounding: EventGrounding;
+ icon: string;
+ rules: TransformationRuleDescriptionUnion[];
+ schemaRules: any[];
+ streamRules: any[];
+ userName: string;
+ valueRules: any[];
+
+ static fromData(data: AdapterDescription, target?: AdapterDescription): AdapterDescription {
+ if (!data) {
+ return data;
+ }
+ const instance = target || new AdapterDescription();
+ super.fromData(data, instance);
+ instance.adapterId = data.adapterId;
+ instance.userName = data.userName;
+ instance.eventGrounding = EventGrounding.fromData(data.eventGrounding);
+ instance.adapterType = data.adapterType;
+ instance.icon = data.icon;
+ instance.config = __getCopyArrayFn(StaticProperty.fromDataUnion)(data.config);
+ instance.rules = __getCopyArrayFn(TransformationRuleDescription.fromDataUnion)(data.rules);
+ instance.category = __getCopyArrayFn(__identity<string>())(data.category);
+ instance.streamRules = __getCopyArrayFn(__identity<any>())(data.streamRules);
+ instance.valueRules = __getCopyArrayFn(__identity<any>())(data.valueRules);
+ instance.schemaRules = __getCopyArrayFn(__identity<any>())(data.schemaRules);
+ instance.couchDBId = data.couchDBId;
+ instance._rev = data._rev;
+ return instance;
+ }
+
+ static fromDataUnion(data: AdapterDescriptionUnion): AdapterDescriptionUnion {
+ if (!data) {
+ return data;
+ }
+ switch (data["@class"]) {
+ case "org.apache.streampipes.model.connect.adapter.GenericAdapterSetDescription":
+ return GenericAdapterSetDescription.fromData(data);
+ case "org.apache.streampipes.model.connect.adapter.GenericAdapterStreamDescription":
+ return GenericAdapterStreamDescription.fromData(data);
+ case "org.apache.streampipes.model.connect.adapter.SpecificAdapterStreamDescription":
+ return SpecificAdapterStreamDescription.fromData(data);
+ case "org.apache.streampipes.model.connect.adapter.SpecificAdapterSetDescription":
+ return SpecificAdapterSetDescription.fromData(data);
+ }
+ }
+}
+
+export class AdapterDescriptionList extends NamedStreamPipesEntity {
+ "@class": "org.apache.streampipes.model.connect.adapter.AdapterDescriptionList";
+ list: AdapterDescriptionUnion[];
+
+ static fromData(data: AdapterDescriptionList, target?: AdapterDescriptionList): AdapterDescriptionList {
+ if (!data) {
+ return data;
+ }
+ const instance = target || new AdapterDescriptionList();
+ super.fromData(data, instance);
+ instance.list = __getCopyArrayFn(AdapterDescription.fromDataUnion)(data.list);
+ return instance;
+ }
+}
+
+export class AdapterSetDescription extends AdapterDescription {
+ "@class": "org.apache.streampipes.model.connect.adapter.AdapterSetDescription" | "org.apache.streampipes.model.connect.adapter.GenericAdapterSetDescription" | "org.apache.streampipes.model.connect.adapter.SpecificAdapterSetDescription";
+ dataSet: SpDataSet;
+ stopPipeline: boolean;
+
+ static fromData(data: AdapterSetDescription, target?: AdapterSetDescription): AdapterSetDescription {
+ if (!data) {
+ return data;
+ }
+ const instance = target || new AdapterSetDescription();
+ super.fromData(data, instance);
+ instance.dataSet = SpDataSet.fromData(data.dataSet);
+ instance.stopPipeline = data.stopPipeline;
+ return instance;
+ }
+
+ static fromDataUnion(data: AdapterSetDescriptionUnion): AdapterSetDescriptionUnion {
+ if (!data) {
+ return data;
+ }
+ switch (data["@class"]) {
+ case "org.apache.streampipes.model.connect.adapter.GenericAdapterSetDescription":
+ return GenericAdapterSetDescription.fromData(data);
+ case "org.apache.streampipes.model.connect.adapter.SpecificAdapterSetDescription":
+ return SpecificAdapterSetDescription.fromData(data);
+ }
+ }
+}
+
+export class AdapterStreamDescription extends AdapterDescription {
+ "@class": "org.apache.streampipes.model.connect.adapter.AdapterStreamDescription" | "org.apache.streampipes.model.connect.adapter.GenericAdapterStreamDescription" | "org.apache.streampipes.model.connect.adapter.SpecificAdapterStreamDescription";
+ dataStream: SpDataStreamUnion;
+
+ static fromData(data: AdapterStreamDescription, target?: AdapterStreamDescription): AdapterStreamDescription {
+ if (!data) {
+ return data;
+ }
+ const instance = target || new AdapterStreamDescription();
+ super.fromData(data, instance);
+ instance.dataStream = SpDataStream.fromDataUnion(data.dataStream);
+ return instance;
+ }
+
+ static fromDataUnion(data: AdapterStreamDescriptionUnion): AdapterStreamDescriptionUnion {
+ if (!data) {
+ return data;
+ }
+ switch (data["@class"]) {
+ case "org.apache.streampipes.model.connect.adapter.SpecificAdapterStreamDescription":
+ return SpecificAdapterStreamDescription.fromData(data);
+ case "org.apache.streampipes.model.connect.adapter.SpecificAdapterStreamDescription":
+ return SpecificAdapterStreamDescription.fromData(data);
+ }
+ }
+}
+
export class AdapterType {
code: string;
description: string;
@@ -135,6 +282,108 @@ export class AdapterType {
}
}
+export class TransformationRuleDescription extends UnnamedStreamPipesEntity {
+ "@class": "org.apache.streampipes.model.connect.rules.TransformationRuleDescription" | "org.apache.streampipes.model.connect.rules.value.ValueTransformationRuleDescription" | "org.apache.streampipes.model.connect.rules.value.AddTimestampRuleDescription" | "org.apache.streampipes.model.connect.rules.value.AddValueTransformationRuleDescription" | "org.apache.streampipes.model.connect.rules.value.TimestampTranfsformationRuleDescription" | "org.apache.streampipes.model.connect.rules.valu [...]
+
+ static fromData(data: TransformationRuleDescription, target?: TransformationRuleDescription): TransformationRuleDescription {
+ if (!data) {
+ return data;
+ }
+ const instance = target || new TransformationRuleDescription();
+ super.fromData(data, instance);
+ return instance;
+ }
+
+ static fromDataUnion(data: TransformationRuleDescriptionUnion): TransformationRuleDescriptionUnion {
+ if (!data) {
+ return data;
+ }
+ switch (data["@class"]) {
+ case "org.apache.streampipes.model.connect.rules.value.AddTimestampRuleDescription":
+ return AddTimestampRuleDescription.fromData(data);
+ case "org.apache.streampipes.model.connect.rules.value.AddValueTransformationRuleDescription":
+ return AddValueTransformationRuleDescription.fromData(data);
+ case "org.apache.streampipes.model.connect.rules.value.TimestampTranfsformationRuleDescription":
+ return TimestampTranfsformationRuleDescription.fromData(data);
+ case "org.apache.streampipes.model.connect.rules.value.UnitTransformRuleDescription":
+ return UnitTransformRuleDescription.fromData(data);
+ case "org.apache.streampipes.model.connect.rules.stream.EventRateTransformationRuleDescription":
+ return EventRateTransformationRuleDescription.fromData(data);
+ case "org.apache.streampipes.model.connect.rules.stream.RemoveDuplicatesTransformationRuleDescription":
+ return RemoveDuplicatesTransformationRuleDescription.fromData(data);
+ case "org.apache.streampipes.model.connect.rules.schema.CreateNestedRuleDescription":
+ return CreateNestedRuleDescription.fromData(data);
+ case "org.apache.streampipes.model.connect.rules.schema.DeleteRuleDescription":
+ return DeleteRuleDescription.fromData(data);
+ case "org.apache.streampipes.model.connect.rules.schema.RenameRuleDescription":
+ return RenameRuleDescription.fromData(data);
+ case "org.apache.streampipes.model.connect.rules.schema.MoveRuleDescription":
+ return MoveRuleDescription.fromData(data);
+ }
+ }
+}
+
+export class ValueTransformationRuleDescription extends TransformationRuleDescription {
+ "@class": "org.apache.streampipes.model.connect.rules.value.ValueTransformationRuleDescription" | "org.apache.streampipes.model.connect.rules.value.AddTimestampRuleDescription" | "org.apache.streampipes.model.connect.rules.value.AddValueTransformationRuleDescription" | "org.apache.streampipes.model.connect.rules.value.TimestampTranfsformationRuleDescription" | "org.apache.streampipes.model.connect.rules.value.UnitTransformRuleDescription";
+
+ static fromData(data: ValueTransformationRuleDescription, target?: ValueTransformationRuleDescription): ValueTransformationRuleDescription {
+ if (!data) {
+ return data;
+ }
+ const instance = target || new ValueTransformationRuleDescription();
+ super.fromData(data, instance);
+ return instance;
+ }
+
+ static fromDataUnion(data: ValueTransformationRuleDescriptionUnion): ValueTransformationRuleDescriptionUnion {
+ if (!data) {
+ return data;
+ }
+ switch (data["@class"]) {
+ case "org.apache.streampipes.model.connect.rules.value.AddTimestampRuleDescription":
+ return AddTimestampRuleDescription.fromData(data);
+ case "org.apache.streampipes.model.connect.rules.value.AddValueTransformationRuleDescription":
+ return AddValueTransformationRuleDescription.fromData(data);
+ case "org.apache.streampipes.model.connect.rules.value.TimestampTranfsformationRuleDescription":
+ return TimestampTranfsformationRuleDescription.fromData(data);
+ case "org.apache.streampipes.model.connect.rules.value.UnitTransformRuleDescription":
+ return UnitTransformRuleDescription.fromData(data);
+ }
+ }
+}
+
+export class AddTimestampRuleDescription extends ValueTransformationRuleDescription {
+ "@class": "org.apache.streampipes.model.connect.rules.value.AddTimestampRuleDescription";
+ runtimeKey: string;
+
+ static fromData(data: AddTimestampRuleDescription, target?: AddTimestampRuleDescription): AddTimestampRuleDescription {
+ if (!data) {
+ return data;
+ }
+ const instance = target || new AddTimestampRuleDescription();
+ super.fromData(data, instance);
+ instance.runtimeKey = data.runtimeKey;
+ return instance;
+ }
+}
+
+export class AddValueTransformationRuleDescription extends ValueTransformationRuleDescription {
+ "@class": "org.apache.streampipes.model.connect.rules.value.AddValueTransformationRuleDescription";
+ runtimeKey: string;
+ staticValue: string;
+
+ static fromData(data: AddValueTransformationRuleDescription, target?: AddValueTransformationRuleDescription): AddValueTransformationRuleDescription {
+ if (!data) {
+ return data;
+ }
+ const instance = target || new AddValueTransformationRuleDescription();
+ super.fromData(data, instance);
+ instance.runtimeKey = data.runtimeKey;
+ instance.staticValue = data.staticValue;
+ return instance;
+ }
+}
+
export class StaticProperty extends UnnamedStreamPipesEntity {
"@class": "org.apache.streampipes.model.staticproperty.StaticProperty" | "org.apache.streampipes.model.staticproperty.CodeInputStaticProperty" | "org.apache.streampipes.model.staticproperty.CollectionStaticProperty" | "org.apache.streampipes.model.staticproperty.ColorPickerStaticProperty" | "org.apache.streampipes.model.staticproperty.DomainStaticProperty" | "org.apache.streampipes.model.staticproperty.FileStaticProperty" | "org.apache.streampipes.model.staticproperty.FreeTextStaticP [...]
description: string;
@@ -378,6 +627,50 @@ export class ColorPickerStaticProperty extends StaticProperty {
}
}
+export class SchemaTransformationRuleDescription extends TransformationRuleDescription {
+ "@class": "org.apache.streampipes.model.connect.rules.schema.SchemaTransformationRuleDescription" | "org.apache.streampipes.model.connect.rules.schema.CreateNestedRuleDescription" | "org.apache.streampipes.model.connect.rules.schema.DeleteRuleDescription" | "org.apache.streampipes.model.connect.rules.schema.RenameRuleDescription" | "org.apache.streampipes.model.connect.rules.schema.MoveRuleDescription";
+
+ static fromData(data: SchemaTransformationRuleDescription, target?: SchemaTransformationRuleDescription): SchemaTransformationRuleDescription {
+ if (!data) {
+ return data;
+ }
+ const instance = target || new SchemaTransformationRuleDescription();
+ super.fromData(data, instance);
+ return instance;
+ }
+
+ static fromDataUnion(data: SchemaTransformationRuleDescriptionUnion): SchemaTransformationRuleDescriptionUnion {
+ if (!data) {
+ return data;
+ }
+ switch (data["@class"]) {
+ case "org.apache.streampipes.model.connect.rules.schema.CreateNestedRuleDescription":
+ return CreateNestedRuleDescription.fromData(data);
+ case "org.apache.streampipes.model.connect.rules.schema.DeleteRuleDescription":
+ return DeleteRuleDescription.fromData(data);
+ case "org.apache.streampipes.model.connect.rules.schema.RenameRuleDescription":
+ return RenameRuleDescription.fromData(data);
+ case "org.apache.streampipes.model.connect.rules.schema.MoveRuleDescription":
+ return MoveRuleDescription.fromData(data);
+ }
+ }
+}
+
+export class CreateNestedRuleDescription extends SchemaTransformationRuleDescription {
+ "@class": "org.apache.streampipes.model.connect.rules.schema.CreateNestedRuleDescription";
+ runtimeKey: string;
+
+ static fromData(data: CreateNestedRuleDescription, target?: CreateNestedRuleDescription): CreateNestedRuleDescription {
+ if (!data) {
+ return data;
+ }
+ const instance = target || new CreateNestedRuleDescription();
+ super.fromData(data, instance);
+ instance.runtimeKey = data.runtimeKey;
+ return instance;
+ }
+}
+
export class CustomOutputStrategy extends OutputStrategy {
"@class": "org.apache.streampipes.model.output.CustomOutputStrategy";
availablePropertyKeys: string[];
@@ -412,45 +705,6 @@ export class CustomTransformOutputStrategy extends OutputStrategy {
}
}
-export class NamedStreamPipesEntity extends AbstractStreamPipesEntity {
- "@class": "org.apache.streampipes.model.base.NamedStreamPipesEntity" | "org.apache.streampipes.model.graph.DataSourceDescription" | "org.apache.streampipes.model.SpDataStream" | "org.apache.streampipes.model.SpDataSet" | "org.apache.streampipes.model.base.InvocableStreamPipesEntity" | "org.apache.streampipes.model.graph.DataProcessorInvocation" | "org.apache.streampipes.model.graph.DataSinkInvocation";
- appId: string;
- applicationLinks: ApplicationLink[];
- connectedTo: string[];
- description: string;
- dom: string;
- elementId: string;
- iconUrl: string;
- includedAssets: string[];
- includedLocales: string[];
- includesAssets: boolean;
- includesLocales: boolean;
- name: string;
- uri: string;
-
- static fromData(data: NamedStreamPipesEntity, target?: NamedStreamPipesEntity): NamedStreamPipesEntity {
- if (!data) {
- return data;
- }
- const instance = target || new NamedStreamPipesEntity();
- super.fromData(data, instance);
- instance.name = data.name;
- instance.description = data.description;
- instance.iconUrl = data.iconUrl;
- instance.elementId = data.elementId;
- instance.appId = data.appId;
- instance.includesAssets = data.includesAssets;
- instance.includesLocales = data.includesLocales;
- instance.includedAssets = __getCopyArrayFn(__identity<string>())(data.includedAssets);
- instance.includedLocales = __getCopyArrayFn(__identity<string>())(data.includedLocales);
- instance.applicationLinks = __getCopyArrayFn(ApplicationLink.fromData)(data.applicationLinks);
- instance.connectedTo = __getCopyArrayFn(__identity<string>())(data.connectedTo);
- instance.dom = data.dom;
- instance.uri = data.uri;
- return instance;
- }
-}
-
export class InvocableStreamPipesEntity extends NamedStreamPipesEntity {
"@class": "org.apache.streampipes.model.base.InvocableStreamPipesEntity" | "org.apache.streampipes.model.graph.DataProcessorInvocation" | "org.apache.streampipes.model.graph.DataSinkInvocation";
belongsTo: string;
@@ -522,6 +776,39 @@ export class DataProcessorType {
}
}
+export class Message {
+ elementName: string;
+ notifications: Notification[];
+ success: boolean;
+
+ static fromData(data: Message, target?: Message): Message {
+ if (!data) {
+ return data;
+ }
+ const instance = target || new Message();
+ instance.success = data.success;
+ instance.elementName = data.elementName;
+ instance.notifications = __getCopyArrayFn(Notification.fromData)(data.notifications);
+ return instance;
+ }
+}
+
+export class DataSetModificationMessage extends Message {
+ eventGrounding: EventGrounding;
+ invocationId: string;
+
+ static fromData(data: DataSetModificationMessage, target?: DataSetModificationMessage): DataSetModificationMessage {
+ if (!data) {
+ return data;
+ }
+ const instance = target || new DataSetModificationMessage();
+ super.fromData(data, instance);
+ instance.eventGrounding = EventGrounding.fromData(data.eventGrounding);
+ instance.invocationId = data.invocationId;
+ return instance;
+ }
+}
+
export class DataSinkInvocation extends InvocableStreamPipesEntity {
"@class": "org.apache.streampipes.model.graph.DataSinkInvocation";
category: string[];
@@ -571,6 +858,55 @@ export class DataSourceDescription extends NamedStreamPipesEntity {
}
}
+export class DeleteRuleDescription extends SchemaTransformationRuleDescription {
+ "@class": "org.apache.streampipes.model.connect.rules.schema.DeleteRuleDescription";
+ runtimeKey: string;
+
+ static fromData(data: DeleteRuleDescription, target?: DeleteRuleDescription): DeleteRuleDescription {
+ if (!data) {
+ return data;
+ }
+ const instance = target || new DeleteRuleDescription();
+ super.fromData(data, instance);
+ instance.runtimeKey = data.runtimeKey;
+ return instance;
+ }
+}
+
+export class DomainPropertyProbability extends UnnamedStreamPipesEntity {
+ "@class": "org.apache.streampipes.model.connect.guess.DomainPropertyProbability";
+ domainProperty: string;
+ probability: string;
+
+ static fromData(data: DomainPropertyProbability, target?: DomainPropertyProbability): DomainPropertyProbability {
+ if (!data) {
+ return data;
+ }
+ const instance = target || new DomainPropertyProbability();
+ super.fromData(data, instance);
+ instance.domainProperty = data.domainProperty;
+ instance.probability = data.probability;
+ return instance;
+ }
+}
+
+export class DomainPropertyProbabilityList extends UnnamedStreamPipesEntity {
+ "@class": "org.apache.streampipes.model.connect.guess.DomainPropertyProbabilityList";
+ list: DomainPropertyProbability[];
+ runtimeName: string;
+
+ static fromData(data: DomainPropertyProbabilityList, target?: DomainPropertyProbabilityList): DomainPropertyProbabilityList {
+ if (!data) {
+ return data;
+ }
+ const instance = target || new DomainPropertyProbabilityList();
+ super.fromData(data, instance);
+ instance.runtimeName = data.runtimeName;
+ instance.list = __getCopyArrayFn(DomainPropertyProbability.fromData)(data.list);
+ return instance;
+ }
+}
+
export class DomainStaticProperty extends StaticProperty {
"@class": "org.apache.streampipes.model.staticproperty.DomainStaticProperty";
requiredClass: string;
@@ -674,6 +1010,18 @@ export class Enumeration extends ValueSpecification {
}
}
+export class ErrorMessage extends Message {
+
+ static fromData(data: ErrorMessage, target?: ErrorMessage): ErrorMessage {
+ if (!data) {
+ return data;
+ }
+ const instance = target || new ErrorMessage();
+ super.fromData(data, instance);
+ return instance;
+ }
+}
+
export class EventGrounding extends UnnamedStreamPipesEntity {
"@class": "org.apache.streampipes.model.grounding.EventGrounding";
transportFormats: TransportFormat[];
@@ -806,6 +1154,48 @@ export class EventPropertyQualityRequirement extends UnnamedStreamPipesEntity {
}
}
+export class StreamTransformationRuleDescription extends TransformationRuleDescription {
+ "@class": "org.apache.streampipes.model.connect.rules.stream.StreamTransformationRuleDescription" | "org.apache.streampipes.model.connect.rules.stream.EventRateTransformationRuleDescription" | "org.apache.streampipes.model.connect.rules.stream.RemoveDuplicatesTransformationRuleDescription";
+
+ static fromData(data: StreamTransformationRuleDescription, target?: StreamTransformationRuleDescription): StreamTransformationRuleDescription {
+ if (!data) {
+ return data;
+ }
+ const instance = target || new StreamTransformationRuleDescription();
+ super.fromData(data, instance);
+ return instance;
+ }
+
+ static fromDataUnion(data: StreamTransformationRuleDescriptionUnion): StreamTransformationRuleDescriptionUnion {
+ if (!data) {
+ return data;
+ }
+ switch (data["@class"]) {
+ case "org.apache.streampipes.model.connect.rules.stream.EventRateTransformationRuleDescription":
+ return EventRateTransformationRuleDescription.fromData(data);
+ case "org.apache.streampipes.model.connect.rules.stream.RemoveDuplicatesTransformationRuleDescription":
+ return RemoveDuplicatesTransformationRuleDescription.fromData(data);
+ }
+ }
+}
+
+export class EventRateTransformationRuleDescription extends StreamTransformationRuleDescription {
+ "@class": "org.apache.streampipes.model.connect.rules.stream.EventRateTransformationRuleDescription";
+ aggregationTimeWindow: number;
+ aggregationType: string;
+
+ static fromData(data: EventRateTransformationRuleDescription, target?: EventRateTransformationRuleDescription): EventRateTransformationRuleDescription {
+ if (!data) {
+ return data;
+ }
+ const instance = target || new EventRateTransformationRuleDescription();
+ super.fromData(data, instance);
+ instance.aggregationTimeWindow = data.aggregationTimeWindow;
+ instance.aggregationType = data.aggregationType;
+ return instance;
+ }
+}
+
export class EventSchema extends UnnamedStreamPipesEntity {
"@class": "org.apache.streampipes.model.schema.EventSchema";
eventProperties: EventPropertyUnion[];
@@ -895,6 +1285,36 @@ export class FixedOutputStrategy extends OutputStrategy {
}
}
+export class FormatDescription extends NamedStreamPipesEntity {
+ "@class": "org.apache.streampipes.model.connect.grounding.FormatDescription";
+ config: StaticPropertyUnion[];
+
+ static fromData(data: FormatDescription, target?: FormatDescription): FormatDescription {
+ if (!data) {
+ return data;
+ }
+ const instance = target || new FormatDescription();
+ super.fromData(data, instance);
+ instance.config = __getCopyArrayFn(StaticProperty.fromDataUnion)(data.config);
+ return instance;
+ }
+}
+
+export class FormatDescriptionList extends NamedStreamPipesEntity {
+ "@class": "org.apache.streampipes.model.connect.grounding.FormatDescriptionList";
+ list: FormatDescription[];
+
+ static fromData(data: FormatDescriptionList, target?: FormatDescriptionList): FormatDescriptionList {
+ if (!data) {
+ return data;
+ }
+ const instance = target || new FormatDescriptionList();
+ super.fromData(data, instance);
+ instance.list = __getCopyArrayFn(FormatDescription.fromData)(data.list);
+ return instance;
+ }
+}
+
export class FreeTextStaticProperty extends StaticProperty {
"@class": "org.apache.streampipes.model.staticproperty.FreeTextStaticProperty";
htmlAllowed: boolean;
@@ -939,6 +1359,68 @@ export class Frequency extends EventStreamQualityDefinition {
}
}
+export interface GenericAdapterDescription {
+ eventSchema: EventSchema;
+ formatDescription: FormatDescription;
+ protocolDescription: ProtocolDescription;
+ rules: TransformationRuleDescriptionUnion[];
+}
+
+export class GenericAdapterSetDescription extends AdapterSetDescription implements GenericAdapterDescription {
+ "@class": "org.apache.streampipes.model.connect.adapter.GenericAdapterSetDescription";
+ eventSchema: EventSchema;
+ formatDescription: FormatDescription;
+ protocolDescription: ProtocolDescription;
+
+ static fromData(data: GenericAdapterSetDescription, target?: GenericAdapterSetDescription): GenericAdapterSetDescription {
+ if (!data) {
+ return data;
+ }
+ const instance = target || new GenericAdapterSetDescription();
+ super.fromData(data, instance);
+ instance.eventSchema = EventSchema.fromData(data.eventSchema);
+ instance.formatDescription = FormatDescription.fromData(data.formatDescription);
+ instance.protocolDescription = ProtocolDescription.fromData(data.protocolDescription);
+ return instance;
+ }
+}
+
+export class GenericAdapterStreamDescription extends AdapterStreamDescription implements GenericAdapterDescription {
+ "@class": "org.apache.streampipes.model.connect.adapter.GenericAdapterStreamDescription";
+ eventSchema: EventSchema;
+ formatDescription: FormatDescription;
+ protocolDescription: ProtocolDescription;
+
+ static fromData(data: GenericAdapterStreamDescription, target?: GenericAdapterStreamDescription): GenericAdapterStreamDescription {
+ if (!data) {
+ return data;
+ }
+ const instance = target || new GenericAdapterStreamDescription();
+ super.fromData(data, instance);
+ instance.eventSchema = EventSchema.fromData(data.eventSchema);
+ instance.formatDescription = FormatDescription.fromData(data.formatDescription);
+ instance.protocolDescription = ProtocolDescription.fromData(data.protocolDescription);
+ return instance;
+ }
+}
+
+export class GuessSchema extends UnnamedStreamPipesEntity {
+ "@class": "org.apache.streampipes.model.connect.guess.GuessSchema";
+ eventSchema: EventSchema;
+ propertyProbabilityList: DomainPropertyProbabilityList[];
+
+ static fromData(data: GuessSchema, target?: GuessSchema): GuessSchema {
+ if (!data) {
+ return data;
+ }
+ const instance = target || new GuessSchema();
+ super.fromData(data, instance);
+ instance.eventSchema = EventSchema.fromData(data.eventSchema);
+ instance.propertyProbabilityList = __getCopyArrayFn(DomainPropertyProbabilityList.fromData)(data.propertyProbabilityList);
+ return instance;
+ }
+}
+
export class TransportProtocol extends UnnamedStreamPipesEntity {
"@class": "org.apache.streampipes.model.grounding.TransportProtocol" | "org.apache.streampipes.model.grounding.JmsTransportProtocol" | "org.apache.streampipes.model.grounding.KafkaTransportProtocol" | "org.apache.streampipes.model.grounding.MqttTransportProtocol";
brokerHostname: string;
@@ -1188,19 +1670,19 @@ export class MeasurementRange extends EventPropertyQualityDefinition {
}
}
-export class Message {
- elementName: string;
- notifications: Notification[];
- success: boolean;
+export class MoveRuleDescription extends SchemaTransformationRuleDescription {
+ "@class": "org.apache.streampipes.model.connect.rules.schema.MoveRuleDescription";
+ newRuntimeKey: string;
+ oldRuntimeKey: string;
- static fromData(data: Message, target?: Message): Message {
+ static fromData(data: MoveRuleDescription, target?: MoveRuleDescription): MoveRuleDescription {
if (!data) {
return data;
}
- const instance = target || new Message();
- instance.success = data.success;
- instance.elementName = data.elementName;
- instance.notifications = __getCopyArrayFn(Notification.fromData)(data.notifications);
+ const instance = target || new MoveRuleDescription();
+ super.fromData(data, instance);
+ instance.oldRuntimeKey = data.oldRuntimeKey;
+ instance.newRuntimeKey = data.newRuntimeKey;
return instance;
}
}
@@ -1433,6 +1915,40 @@ export class PropertyValueSpecification extends UnnamedStreamPipesEntity {
}
}
+export class ProtocolDescription extends NamedStreamPipesEntity {
+ "@class": "org.apache.streampipes.model.connect.grounding.ProtocolDescription";
+ category: string[];
+ config: StaticPropertyUnion[];
+ sourceType: string;
+
+ static fromData(data: ProtocolDescription, target?: ProtocolDescription): ProtocolDescription {
+ if (!data) {
+ return data;
+ }
+ const instance = target || new ProtocolDescription();
+ super.fromData(data, instance);
+ instance.sourceType = data.sourceType;
+ instance.config = __getCopyArrayFn(StaticProperty.fromDataUnion)(data.config);
+ instance.category = __getCopyArrayFn(__identity<string>())(data.category);
+ return instance;
+ }
+}
+
+export class ProtocolDescriptionList extends NamedStreamPipesEntity {
+ "@class": "org.apache.streampipes.model.connect.grounding.ProtocolDescriptionList";
+ list: ProtocolDescription[];
+
+ static fromData(data: ProtocolDescriptionList, target?: ProtocolDescriptionList): ProtocolDescriptionList {
+ if (!data) {
+ return data;
+ }
+ const instance = target || new ProtocolDescriptionList();
+ super.fromData(data, instance);
+ instance.list = __getCopyArrayFn(ProtocolDescription.fromData)(data.list);
+ return instance;
+ }
+}
+
export class QuantitativeValue extends ValueSpecification {
"@class": "org.apache.streampipes.model.schema.QuantitativeValue";
maxValue: number;
@@ -1452,6 +1968,38 @@ export class QuantitativeValue extends ValueSpecification {
}
}
+export class RemoveDuplicatesTransformationRuleDescription extends StreamTransformationRuleDescription {
+ "@class": "org.apache.streampipes.model.connect.rules.stream.RemoveDuplicatesTransformationRuleDescription";
+ filterTimeWindow: string;
+
+ static fromData(data: RemoveDuplicatesTransformationRuleDescription, target?: RemoveDuplicatesTransformationRuleDescription): RemoveDuplicatesTransformationRuleDescription {
+ if (!data) {
+ return data;
+ }
+ const instance = target || new RemoveDuplicatesTransformationRuleDescription();
+ super.fromData(data, instance);
+ instance.filterTimeWindow = data.filterTimeWindow;
+ return instance;
+ }
+}
+
+export class RenameRuleDescription extends SchemaTransformationRuleDescription {
+ "@class": "org.apache.streampipes.model.connect.rules.schema.RenameRuleDescription";
+ newRuntimeKey: string;
+ oldRuntimeKey: string;
+
+ static fromData(data: RenameRuleDescription, target?: RenameRuleDescription): RenameRuleDescription {
+ if (!data) {
+ return data;
+ }
+ const instance = target || new RenameRuleDescription();
+ super.fromData(data, instance);
+ instance.oldRuntimeKey = data.oldRuntimeKey;
+ instance.newRuntimeKey = data.newRuntimeKey;
+ return instance;
+ }
+}
+
export class Resolution extends EventPropertyQualityDefinition {
"@class": "org.apache.streampipes.model.quality.Resolution";
quantityValue: number;
@@ -1654,6 +2202,32 @@ export class SpDataSet extends SpDataStream {
}
}
+export class SpecificAdapterSetDescription extends AdapterSetDescription {
+ "@class": "org.apache.streampipes.model.connect.adapter.SpecificAdapterSetDescription";
+
+ static fromData(data: SpecificAdapterSetDescription, target?: SpecificAdapterSetDescription): SpecificAdapterSetDescription {
+ if (!data) {
+ return data;
+ }
+ const instance = target || new SpecificAdapterSetDescription();
+ super.fromData(data, instance);
+ return instance;
+ }
+}
+
+export class SpecificAdapterStreamDescription extends AdapterStreamDescription {
+ "@class": "org.apache.streampipes.model.connect.adapter.SpecificAdapterStreamDescription";
+
+ static fromData(data: SpecificAdapterStreamDescription, target?: SpecificAdapterStreamDescription): SpecificAdapterStreamDescription {
+ if (!data) {
+ return data;
+ }
+ const instance = target || new SpecificAdapterStreamDescription();
+ super.fromData(data, instance);
+ return instance;
+ }
+}
+
export class StaticPropertyAlternative extends StaticProperty {
"@class": "org.apache.streampipes.model.staticproperty.StaticPropertyAlternative";
selected: boolean;
@@ -1705,6 +2279,18 @@ export class StaticPropertyGroup extends StaticProperty {
}
}
+export class SuccessMessage extends Message {
+
+ static fromData(data: SuccessMessage, target?: SuccessMessage): SuccessMessage {
+ if (!data) {
+ return data;
+ }
+ const instance = target || new SuccessMessage();
+ super.fromData(data, instance);
+ return instance;
+ }
+}
+
export class SupportedProperty extends UnnamedStreamPipesEntity {
"@class": "org.apache.streampipes.model.staticproperty.SupportedProperty";
propertyId: string;
@@ -1724,6 +2310,27 @@ export class SupportedProperty extends UnnamedStreamPipesEntity {
}
}
+export class TimestampTranfsformationRuleDescription extends ValueTransformationRuleDescription {
+ "@class": "org.apache.streampipes.model.connect.rules.value.TimestampTranfsformationRuleDescription";
+ formatString: string;
+ mode: string;
+ multiplier: number;
+ runtimeKey: string;
+
+ static fromData(data: TimestampTranfsformationRuleDescription, target?: TimestampTranfsformationRuleDescription): TimestampTranfsformationRuleDescription {
+ if (!data) {
+ return data;
+ }
+ const instance = target || new TimestampTranfsformationRuleDescription();
+ super.fromData(data, instance);
+ instance.runtimeKey = data.runtimeKey;
+ instance.mode = data.mode;
+ instance.formatString = data.formatString;
+ instance.multiplier = data.multiplier;
+ return instance;
+ }
+}
+
export class TransformOperation extends UnnamedStreamPipesEntity {
"@class": "org.apache.streampipes.model.output.TransformOperation";
mappingPropertyInternalName: string;
@@ -1775,6 +2382,25 @@ export class TransportFormat extends UnnamedStreamPipesEntity {
}
}
+export class UnitTransformRuleDescription extends ValueTransformationRuleDescription {
+ "@class": "org.apache.streampipes.model.connect.rules.value.UnitTransformRuleDescription";
+ fromUnitRessourceURL: string;
+ runtimeKey: string;
+ toUnitRessourceURL: string;
+
+ static fromData(data: UnitTransformRuleDescription, target?: UnitTransformRuleDescription): UnitTransformRuleDescription {
+ if (!data) {
+ return data;
+ }
+ const instance = target || new UnitTransformRuleDescription();
+ super.fromData(data, instance);
+ instance.runtimeKey = data.runtimeKey;
+ instance.fromUnitRessourceURL = data.fromUnitRessourceURL;
+ instance.toUnitRessourceURL = data.toUnitRessourceURL;
+ return instance;
+ }
+}
+
export class UserDefinedOutputStrategy extends OutputStrategy {
"@class": "org.apache.streampipes.model.output.UserDefinedOutputStrategy";
eventProperties: EventPropertyUnion[];
@@ -1828,6 +2454,12 @@ export class WildcardTopicMapping extends UnnamedStreamPipesEntity {
}
}
+export type AdapterDescriptionUnion = GenericAdapterSetDescription | GenericAdapterStreamDescription | SpecificAdapterStreamDescription | SpecificAdapterSetDescription;
+
+export type AdapterSetDescriptionUnion = GenericAdapterSetDescription | SpecificAdapterSetDescription;
+
+export type AdapterStreamDescriptionUnion = SpecificAdapterStreamDescription;
+
export type EventPropertyQualityDefinitionUnion = Accuracy | MeasurementRange | Precision | Resolution;
export type EventPropertyUnion = EventPropertyList | EventPropertyNested | EventPropertyPrimitive;
@@ -1842,6 +2474,8 @@ export type OneOfStaticPropertyUnion = RuntimeResolvableOneOfStaticProperty;
export type OutputStrategyUnion = AppendOutputStrategy | CustomOutputStrategy | CustomTransformOutputStrategy | FixedOutputStrategy | KeepOutputStrategy | ListOutputStrategy | TransformOutputStrategy | UserDefinedOutputStrategy;
+export type SchemaTransformationRuleDescriptionUnion = CreateNestedRuleDescription | DeleteRuleDescription | RenameRuleDescription | MoveRuleDescription;
+
export type SelectionStaticPropertyUnion = AnyStaticProperty | OneOfStaticProperty;
export type SpDataStreamUnion = SpDataStream | SpDataSet;
@@ -1850,12 +2484,18 @@ export type StaticPropertyType = "AnyStaticProperty" | "CollectionStaticProperty
export type StaticPropertyUnion = AnyStaticProperty | CodeInputStaticProperty | CollectionStaticProperty | ColorPickerStaticProperty | DomainStaticProperty | FileStaticProperty | FreeTextStaticProperty | MappingPropertyUnary | MappingPropertyNary | MatchingStaticProperty | OneOfStaticProperty | RuntimeResolvableAnyStaticProperty | RuntimeResolvableOneOfStaticProperty | SecretStaticProperty | StaticPropertyAlternative | StaticPropertyAlternatives | StaticPropertyGroup;
+export type StreamTransformationRuleDescriptionUnion = EventRateTransformationRuleDescription | RemoveDuplicatesTransformationRuleDescription;
+
export type TopicDefinitionUnion = SimpleTopicDefinition | WildcardTopicDefinition;
+export type TransformationRuleDescriptionUnion = AddTimestampRuleDescription | AddValueTransformationRuleDescription | TimestampTranfsformationRuleDescription | UnitTransformRuleDescription | EventRateTransformationRuleDescription | RemoveDuplicatesTransformationRuleDescription | CreateNestedRuleDescription | DeleteRuleDescription | RenameRuleDescription | MoveRuleDescription;
+
export type TransportProtocolUnion = JmsTransportProtocol | KafkaTransportProtocol | MqttTransportProtocol;
export type ValueSpecificationUnion = QuantitativeValue | Enumeration;
+export type ValueTransformationRuleDescriptionUnion = AddTimestampRuleDescription | AddValueTransformationRuleDescription | TimestampTranfsformationRuleDescription | UnitTransformRuleDescription;
+
function __getCopyArrayFn<T>(itemCopyFn: (item: T) => T): (array: T[]) => T[] {
return (array: T[]) => __copyArray(array, itemCopyFn);
}
diff --git a/ui/src/app/editor-v2/services/pipeline-element-recommendation.service.ts b/ui/src/app/editor-v2/services/pipeline-element-recommendation.service.ts
index 44eb9d9..64344af 100644
--- a/ui/src/app/editor-v2/services/pipeline-element-recommendation.service.ts
+++ b/ui/src/app/editor-v2/services/pipeline-element-recommendation.service.ts
@@ -18,24 +18,23 @@
import * as angular from 'angular';
import {Injectable} from "@angular/core";
-import {RestApi} from "../../services/rest-api.service";
+import {EditorService} from "./editor.service";
@Injectable()
export class PipelineElementRecommendationService {
- constructor(private RestApi: RestApi) {
+ constructor(private EditorService: EditorService) {
}
getRecommendations(allElements, currentPipeline) {
return new Promise((resolve, reject) => {
- this.RestApi.recommendPipelineElement(currentPipeline)
- .then(msg => {
- let data = msg.data;
- if (data.success) {
+ this.EditorService.recommendPipelineElement(currentPipeline)
+ .subscribe(msg => {
+ if (msg.success) {
var result = {};
result["success"] = true;
- result['recommendations'] = this.populateRecommendedList(allElements, data.recommendedElements);
- result['possibleElements'] = this.collectPossibleElements(allElements, data.possibleElements);
+ result['recommendations'] = this.populateRecommendedList(allElements, msg.recommendedElements);
+ result['possibleElements'] = this.collectPossibleElements(allElements, msg.possibleElements);
resolve(result);
} else {
// TODO improve