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 2026/03/11 13:45:19 UTC
(streampipes) branch remove-supported-grounding created (now 476ef2cc12)
This is an automated email from the ASF dual-hosted git repository.
riemer pushed a change to branch remove-supported-grounding
in repository https://gitbox.apache.org/repos/asf/streampipes.git
at 476ef2cc12 feat: Remove supported grounding, provide messaging settings from env
This branch includes the following new commits:
new 476ef2cc12 feat: Remove supported grounding, provide messaging settings from env
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(streampipes) 01/01: feat: Remove supported grounding, provide messaging settings from env
Posted by ri...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
riemer pushed a commit to branch remove-supported-grounding
in repository https://gitbox.apache.org/repos/asf/streampipes.git
commit 476ef2cc123d3b59ceaa6d9fa6041adb1b38f649
Author: Dominik Riemer <do...@gmail.com>
AuthorDate: Wed Mar 11 14:41:19 2026 +0100
feat: Remove supported grounding, provide messaging settings from env
---
pom.xml | 1 -
.../apache/streampipes/client/api/IAdminApi.java | 3 -
.../apache/streampipes/client/api/AdminApi.java | 12 --
.../management/AdapterMasterManagement.java | 2 +-
.../export/utils/EventGroundingProcessor.java | 77 +-------
.../management/init/DeclarersSingleton.java | 27 +--
.../management/model/SpServiceDefinition.java | 4 -
.../extensions/all/iiot/AllExtensionsIIoTInit.java | 2 -
.../extensions/all/jvm/AllExtensionsInit.java | 2 -
.../siddhi/trend/TestTrendProcessor.java | 2 -
.../counter/TestBooleanCounterProcessor.java | 2 -
.../streampipes-sinks-brokers-jvm/pom.xml | 9 +-
.../sinks/brokers/jvm}/jms/ActiveMQPublisher.java | 38 ++--
.../sinks/brokers/jvm}/jms/ActiveMQUtils.java | 9 +-
.../sinks/brokers/jvm/jms/JmsPublisherSink.java | 7 +-
streampipes-messaging-jms/pom.xml | 54 ------
.../messaging/jms/ActiveMQConnectionProvider.java | 49 -----
.../messaging/jms/ActiveMQConsumer.java | 111 ------------
.../streampipes/messaging/jms/SpJmsProtocol.java | 37 ----
.../messaging/jms/SpJmsProtocolFactory.java | 42 -----
.../streampipes/messaging/SpProtocolManager.java | 4 -
.../model/base/ConsumableStreamPipesEntity.java | 15 --
.../model/base/InvocableStreamPipesEntity.java | 14 --
.../configuration/DefaultMessagingSettings.java | 71 --------
.../configuration/DefaultSpCoreConfiguration.java | 1 -
.../model/configuration/MessagingSettings.java | 187 -------------------
.../model/configuration/SpCoreConfiguration.java | 9 -
.../model/configuration/SpProtocol.java | 1 -
.../model/graph/DataProcessorDescription.java | 2 -
.../model/graph/DataProcessorInvocation.java | 3 -
.../model/graph/DataSinkDescription.java | 2 -
.../model/graph/DataSinkInvocation.java | 3 -
.../model/grounding/JmsTransportProtocol.java | 53 ------
.../model/grounding/KafkaTransportProtocol.java | 7 +
.../model/grounding/MqttTransportProtocol.java | 7 +
.../model/grounding/NatsTransportProtocol.java | 7 +
.../model/grounding/PulsarTransportProtocol.java | 7 +
.../model/grounding/TransportFormat.java | 54 ------
.../model/grounding/TransportProtocol.java | 3 +-
.../org/apache/streampipes/model/util/Cloner.java | 3 -
.../manager/matching/GroundingSelector.java | 46 -----
.../manager/matching/ProtocolSelector.java | 103 ++---------
.../manager/matching/v2/ElementVerification.java | 52 ------
.../manager/matching/v2/GroundingMatch.java | 53 ------
.../manager/matching/v2/ProtocolMatch.java | 44 -----
.../manager/matching/v2/StreamMatch.java | 16 +-
.../matching/v2/pipeline/ApplyGroundingStep.java | 58 ++----
.../manager/recommender/ElementRecommender.java | 1 -
.../streampipes/manager}/util/GroundingUtils.java | 95 ++++------
.../manager/matching/v2/TestGroundingMatch.java | 78 --------
.../manager/matching/v2/TestProtocolMatch.java | 55 ------
.../streampipes/manager/matching/v2/TestUtils.java | 34 ----
.../AbstractPipelineElementResource.java | 24 ---
.../impl/admin/MessagingConfigurationResource.java | 55 ------
streampipes-sdk-bundle/pom.xml | 5 -
.../builder/AbstractProcessingElementBuilder.java | 37 ----
.../apache/streampipes/sdk/helpers/Protocols.java | 14 --
.../sdk/helpers/SupportedProtocols.java | 62 -------
streampipes-service-core-minimal/pom.xml | 4 -
streampipes-service-core/pom.xml | 5 -
.../service/core/StreamPipesCoreApplication.java | 41 ++---
.../test/generator/InvocationGraphGenerator.java | 2 -
.../distributed/runtime/DistributedRuntime.java | 9 -
.../configuration-sections.providers.ts | 10 --
.../broker-config/broker-config.component.html | 44 -----
.../broker-config/broker-config.component.ts | 60 -------
.../messaging-configuration.component.html | 200 ---------------------
.../messaging-configuration.component.scss | 70 --------
.../messaging-configuration.component.ts | 116 ------------
69 files changed, 170 insertions(+), 2166 deletions(-)
diff --git a/pom.xml b/pom.xml
index a86837b172..3ad42e83b3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -896,7 +896,6 @@
<module>streampipes-measurement-units</module>
<module>streampipes-messaging-kafka</module>
<module>streampipes-messaging</module>
- <module>streampipes-messaging-jms</module>
<module>streampipes-messaging-mqtt</module>
<module>streampipes-messaging-nats</module>
<module>streampipes-messaging-pulsar</module>
diff --git a/streampipes-client-api/src/main/java/org/apache/streampipes/client/api/IAdminApi.java b/streampipes-client-api/src/main/java/org/apache/streampipes/client/api/IAdminApi.java
index 11db107216..241a3b7c4b 100644
--- a/streampipes-client-api/src/main/java/org/apache/streampipes/client/api/IAdminApi.java
+++ b/streampipes-client-api/src/main/java/org/apache/streampipes/client/api/IAdminApi.java
@@ -18,7 +18,6 @@
package org.apache.streampipes.client.api;
-import org.apache.streampipes.model.configuration.MessagingSettings;
import org.apache.streampipes.model.extensions.configuration.SpServiceConfiguration;
import org.apache.streampipes.model.extensions.svcdiscovery.SpServiceRegistration;
import org.apache.streampipes.model.function.FunctionDefinition;
@@ -47,6 +46,4 @@ public interface IAdminApi {
void persistFunctionState(String functionId, Map<String, Object> state);
void registerMigrations(List<ModelMigratorConfig> migrationConfigs, String serviceId);
-
- MessagingSettings getMessagingSettings();
}
diff --git a/streampipes-client/src/main/java/org/apache/streampipes/client/api/AdminApi.java b/streampipes-client/src/main/java/org/apache/streampipes/client/api/AdminApi.java
index 54c84798be..fd200caee6 100644
--- a/streampipes-client/src/main/java/org/apache/streampipes/client/api/AdminApi.java
+++ b/streampipes-client/src/main/java/org/apache/streampipes/client/api/AdminApi.java
@@ -19,7 +19,6 @@ package org.apache.streampipes.client.api;
import org.apache.streampipes.client.model.StreamPipesClientConfig;
import org.apache.streampipes.client.util.StreamPipesApiPath;
-import org.apache.streampipes.model.configuration.MessagingSettings;
import org.apache.streampipes.model.extensions.configuration.SpServiceConfiguration;
import org.apache.streampipes.model.extensions.svcdiscovery.SpServiceRegistration;
import org.apache.streampipes.model.function.FunctionDefinition;
@@ -90,11 +89,6 @@ public class AdminApi extends AbstractClientApi implements IAdminApi {
post(getMigrationPath().addToPath(serviceId), migrationConfigs);
}
- @Override
- public MessagingSettings getMessagingSettings() {
- return getSingle(getMessagingSettingsPath(), MessagingSettings.class);
- }
-
private StreamPipesApiPath getExtensionsServiceRegistrationPath() {
return StreamPipesApiPath
.fromBaseApiPath()
@@ -107,12 +101,6 @@ public class AdminApi extends AbstractClientApi implements IAdminApi {
.addToPath("extensions-services-configurations");
}
- private StreamPipesApiPath getMessagingSettingsPath() {
- return StreamPipesApiPath
- .fromBaseApiPath()
- .addToPath("messaging");
- }
-
private StreamPipesApiPath getFunctionsPath() {
return StreamPipesApiPath
.fromBaseApiPath()
diff --git a/streampipes-connect-management/src/main/java/org/apache/streampipes/connect/management/management/AdapterMasterManagement.java b/streampipes-connect-management/src/main/java/org/apache/streampipes/connect/management/management/AdapterMasterManagement.java
index 925f2447ef..6853fb3548 100644
--- a/streampipes-connect-management/src/main/java/org/apache/streampipes/connect/management/management/AdapterMasterManagement.java
+++ b/streampipes-connect-management/src/main/java/org/apache/streampipes/connect/management/management/AdapterMasterManagement.java
@@ -20,7 +20,7 @@ package org.apache.streampipes.connect.management.management;
import org.apache.streampipes.commons.exceptions.NoServiceEndpointsAvailableException;
import org.apache.streampipes.commons.exceptions.connect.AdapterException;
import org.apache.streampipes.commons.prometheus.adapter.AdapterMetrics;
-import org.apache.streampipes.connect.management.util.GroundingUtils;
+import org.apache.streampipes.manager.util.GroundingUtils;
import org.apache.streampipes.loadbalance.LoadManager;
import org.apache.streampipes.loadbalance.pipeline.ExtensionsLogProvider;
import org.apache.streampipes.manager.execution.endpoint.ExtensionsServiceEndpointGenerator;
diff --git a/streampipes-data-export/src/main/java/org/apache/streampipes/export/utils/EventGroundingProcessor.java b/streampipes-data-export/src/main/java/org/apache/streampipes/export/utils/EventGroundingProcessor.java
index 83d508560a..f801cab4df 100644
--- a/streampipes-data-export/src/main/java/org/apache/streampipes/export/utils/EventGroundingProcessor.java
+++ b/streampipes-data-export/src/main/java/org/apache/streampipes/export/utils/EventGroundingProcessor.java
@@ -18,31 +18,19 @@
package org.apache.streampipes.export.utils;
-import org.apache.streampipes.commons.exceptions.SpRuntimeException;
-import org.apache.streampipes.model.configuration.MessagingSettings;
-import org.apache.streampipes.model.configuration.SpProtocol;
-import org.apache.streampipes.model.grounding.KafkaTransportProtocol;
-import org.apache.streampipes.model.grounding.MqttTransportProtocol;
-import org.apache.streampipes.model.grounding.NatsTransportProtocol;
-import org.apache.streampipes.model.grounding.PulsarTransportProtocol;
+import org.apache.streampipes.commons.environment.Environment;
+import org.apache.streampipes.commons.environment.Environments;
+import org.apache.streampipes.manager.util.GroundingUtils;
import org.apache.streampipes.model.grounding.TransportProtocol;
-import org.apache.streampipes.storage.management.StorageDispatcher;
public class EventGroundingProcessor {
- private final MessagingSettings messagingSettings;
- private final SpProtocol configuredProtocol;
+ private final Environment env;
+ private final String configuredProtocol;
public EventGroundingProcessor() {
- this.messagingSettings = StorageDispatcher
- .INSTANCE
- .getNoSqlStore()
- .getSpCoreConfigurationStorage()
- .get()
- .getMessagingSettings();
-
- this.configuredProtocol = messagingSettings
- .getPrioritizedProtocols().get(0);
+ this.env = Environments.getEnvironment();
+ this.configuredProtocol = env.getPrioritizedProtocol().getValueOrDefault();
}
public TransportProtocol applyOverride(TransportProtocol protocol) {
@@ -52,55 +40,6 @@ public class EventGroundingProcessor {
}
private TransportProtocol getConfiguredTransportProtocol() {
- return initializeProtocol(configuredProtocol);
- }
-
- private TransportProtocol initializeProtocol(SpProtocol configuredProtocol) {
- if (isProtocol(configuredProtocol, KafkaTransportProtocol.class)) {
- return makeKafkaProtocol();
- } else if (isProtocol(configuredProtocol, MqttTransportProtocol.class)) {
- return makeMqttProtocol();
- } else if (isProtocol(configuredProtocol, NatsTransportProtocol.class)) {
- return makeNatsProtocol();
- } else if (isProtocol(configuredProtocol, PulsarTransportProtocol.class)) {
- return makePulsarProtocol();
- } else {
- throw new SpRuntimeException("Not recognized protocol: " + configuredProtocol.getName());
- }
- }
-
- private boolean isProtocol(SpProtocol configuredProtocol,
- Class<?> actualProtocolClass) {
- return configuredProtocol.getProtocolClass().equals(actualProtocolClass.getCanonicalName());
- }
-
-
- private KafkaTransportProtocol makeKafkaProtocol() {
- var protocol = new KafkaTransportProtocol();
- protocol.setBrokerHostname(messagingSettings.getKafkaHost());
- protocol.setKafkaPort(messagingSettings.getKafkaPort());
- return protocol;
+ return GroundingUtils.makeProtocol(env, configuredProtocol, null);
}
-
- private MqttTransportProtocol makeMqttProtocol() {
- var protocol = new MqttTransportProtocol();
- protocol.setBrokerHostname(messagingSettings.getMqttHost());
- protocol.setPort(messagingSettings.getMqttPort());
- return protocol;
- }
-
- private NatsTransportProtocol makeNatsProtocol() {
- var protocol = new NatsTransportProtocol();
- protocol.setBrokerHostname(messagingSettings.getNatsHost());
- protocol.setPort(messagingSettings.getNatsPort());
- return protocol;
- }
-
- private PulsarTransportProtocol makePulsarProtocol() {
- var protocol = new PulsarTransportProtocol();
- protocol.setBrokerHostname(messagingSettings.getNatsHost());
- return protocol;
- }
-
-
}
diff --git a/streampipes-extensions-management/src/main/java/org/apache/streampipes/extensions/management/init/DeclarersSingleton.java b/streampipes-extensions-management/src/main/java/org/apache/streampipes/extensions/management/init/DeclarersSingleton.java
index 311e15ced7..93cc56631e 100644
--- a/streampipes-extensions-management/src/main/java/org/apache/streampipes/extensions/management/init/DeclarersSingleton.java
+++ b/streampipes-extensions-management/src/main/java/org/apache/streampipes/extensions/management/init/DeclarersSingleton.java
@@ -26,10 +26,7 @@ import org.apache.streampipes.extensions.api.pe.IStreamPipesDataStream;
import org.apache.streampipes.extensions.api.pe.IStreamPipesPipelineElement;
import org.apache.streampipes.extensions.api.pe.runtime.IStreamPipesRuntimeProvider;
import org.apache.streampipes.extensions.management.model.SpServiceDefinition;
-import org.apache.streampipes.messaging.SpProtocolDefinitionFactory;
import org.apache.streampipes.messaging.SpProtocolManager;
-import org.apache.streampipes.model.grounding.TransportProtocol;
-import org.apache.streampipes.model.util.Cloner;
import java.util.ArrayList;
import java.util.Collection;
@@ -37,7 +34,6 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
-import java.util.stream.Collectors;
public class DeclarersSingleton implements IDeclarersSingleton {
@@ -51,8 +47,6 @@ public class DeclarersSingleton implements IDeclarersSingleton {
private final Map<String, IStreamPipesDataSink> dataSinks;
private final Map<String, IStreamPipesDataStream> dataStreams;
private final Map<String, IStreamPipesFunctionDeclarer> functions;
-
- private final Map<String, TransportProtocol> supportedProtocols;
private final Map<String, StreamPipesAdapter> adapters;
private List<IStreamPipesRuntimeProvider> runtimeProviders;
@@ -69,7 +63,6 @@ public class DeclarersSingleton implements IDeclarersSingleton {
this.dataProcessors = new HashMap<>();
this.dataSinks = new HashMap<>();
this.dataStreams = new HashMap<>();
- this.supportedProtocols = new HashMap<>();
this.adapters = new HashMap<>();
this.functions = new HashMap<>();
this.runtimeProviders = new ArrayList<>();
@@ -91,10 +84,10 @@ public class DeclarersSingleton implements IDeclarersSingleton {
this.addDeclarers(serviceDef.getDeclarers());
this.serviceId = serviceDef.getServiceId();
this.serviceGroup = serviceDef.getServiceGroup();
- this.registerProtocols(serviceDef.getProtocolDefinitionFactories());
this.runtimeProviders = serviceDef.getRuntimeProviders();
serviceDef.getAdapters().forEach(a -> this.adapters.put(a.declareConfig().getAdapterDescription().getAppId(), a));
serviceDef.getFunctions().forEach(f -> this.functions.put(f.getFunctionConfig().getFunctionId().getId(), f));
+ serviceDef.getProtocolDefinitionFactories().forEach(SpProtocolManager.INSTANCE::register);
}
public void addDeclarers(List<IStreamPipesPipelineElement<?>> allPipelineElements) {
@@ -125,16 +118,6 @@ public class DeclarersSingleton implements IDeclarersSingleton {
return result;
}
- public void registerProtocol(SpProtocolDefinitionFactory<?> protocol) {
- SpProtocolManager.INSTANCE.register(protocol);
- this.supportedProtocols.put(protocol.getTransportProtocolClass(),
- protocol.getTransportProtocol());
- }
-
- public void registerProtocols(List<SpProtocolDefinitionFactory<?>> protocols) {
- protocols.forEach(this::registerProtocol);
- }
-
private void addDataProcessor(IStreamPipesDataProcessor dataProcessor) {
dataProcessors.put(dataProcessor.declareConfig().getDescription().getAppId(), dataProcessor);
}
@@ -160,14 +143,6 @@ public class DeclarersSingleton implements IDeclarersSingleton {
return dataSinks;
}
- public Collection<TransportProtocol> getSupportedProtocols() {
- return this.supportedProtocols
- .values()
- .stream()
- .map(p -> new Cloner().protocol(p))
- .collect(Collectors.toList());
- }
-
public int getPort() {
return this.port;
}
diff --git a/streampipes-extensions-management/src/main/java/org/apache/streampipes/extensions/management/model/SpServiceDefinition.java b/streampipes-extensions-management/src/main/java/org/apache/streampipes/extensions/management/model/SpServiceDefinition.java
index 42bd2dcc18..d343dd5721 100644
--- a/streampipes-extensions-management/src/main/java/org/apache/streampipes/extensions/management/model/SpServiceDefinition.java
+++ b/streampipes-extensions-management/src/main/java/org/apache/streampipes/extensions/management/model/SpServiceDefinition.java
@@ -141,10 +141,6 @@ public class SpServiceDefinition {
return protocolDefinitionFactories;
}
- public void setProtocolDefinitionFactories(List<SpProtocolDefinitionFactory<?>> protocolDefinitionFactories) {
- this.protocolDefinitionFactories = protocolDefinitionFactories;
- }
-
public List<ConfigItem> getKvConfigs() {
return kvConfigs;
}
diff --git a/streampipes-extensions/streampipes-extensions-all-iiot/src/main/java/org/apache/streampipes/extensions/all/iiot/AllExtensionsIIoTInit.java b/streampipes-extensions/streampipes-extensions-all-iiot/src/main/java/org/apache/streampipes/extensions/all/iiot/AllExtensionsIIoTInit.java
index b3a911b020..fb64c58b37 100644
--- a/streampipes-extensions/streampipes-extensions-all-iiot/src/main/java/org/apache/streampipes/extensions/all/iiot/AllExtensionsIIoTInit.java
+++ b/streampipes-extensions/streampipes-extensions-all-iiot/src/main/java/org/apache/streampipes/extensions/all/iiot/AllExtensionsIIoTInit.java
@@ -31,7 +31,6 @@ import org.apache.streampipes.extensions.connectors.rocketmq.RocketMqConnectorsM
import org.apache.streampipes.extensions.connectors.tubemq.TubeMQConnectorsModuleExport;
import org.apache.streampipes.extensions.management.model.SpServiceDefinition;
import org.apache.streampipes.extensions.management.model.SpServiceDefinitionBuilder;
-import org.apache.streampipes.messaging.jms.SpJmsProtocolFactory;
import org.apache.streampipes.messaging.kafka.SpKafkaProtocolFactory;
import org.apache.streampipes.messaging.mqtt.SpMqttProtocolFactory;
import org.apache.streampipes.messaging.nats.SpNatsProtocolFactory;
@@ -91,7 +90,6 @@ public class AllExtensionsIIoTInit extends StreamPipesExtensionsServiceBase {
.registerRuntimeProvider(new StandaloneStreamPipesRuntimeProvider())
.registerMessagingProtocols(
new SpKafkaProtocolFactory(),
- new SpJmsProtocolFactory(),
new SpMqttProtocolFactory(),
new SpNatsProtocolFactory(),
new SpPulsarProtocolFactory())
diff --git a/streampipes-extensions/streampipes-extensions-all-jvm/src/main/java/org/apache/streampipes/extensions/all/jvm/AllExtensionsInit.java b/streampipes-extensions/streampipes-extensions-all-jvm/src/main/java/org/apache/streampipes/extensions/all/jvm/AllExtensionsInit.java
index 8d82a69d14..e39dbdf0d8 100644
--- a/streampipes-extensions/streampipes-extensions-all-jvm/src/main/java/org/apache/streampipes/extensions/all/jvm/AllExtensionsInit.java
+++ b/streampipes-extensions/streampipes-extensions-all-jvm/src/main/java/org/apache/streampipes/extensions/all/jvm/AllExtensionsInit.java
@@ -32,7 +32,6 @@ import org.apache.streampipes.extensions.connectors.rocketmq.RocketMqConnectorsM
import org.apache.streampipes.extensions.connectors.tubemq.TubeMQConnectorsModuleExport;
import org.apache.streampipes.extensions.management.model.SpServiceDefinition;
import org.apache.streampipes.extensions.management.model.SpServiceDefinitionBuilder;
-import org.apache.streampipes.messaging.jms.SpJmsProtocolFactory;
import org.apache.streampipes.messaging.kafka.SpKafkaProtocolFactory;
import org.apache.streampipes.messaging.mqtt.SpMqttProtocolFactory;
import org.apache.streampipes.messaging.nats.SpNatsProtocolFactory;
@@ -99,7 +98,6 @@ public class AllExtensionsInit extends StreamPipesExtensionsServiceBase {
.registerRuntimeProvider(new StandaloneStreamPipesRuntimeProvider())
.registerMessagingProtocols(
new SpKafkaProtocolFactory(),
- new SpJmsProtocolFactory(),
new SpMqttProtocolFactory(),
new SpNatsProtocolFactory(),
new SpPulsarProtocolFactory())
diff --git a/streampipes-extensions/streampipes-processors-filters-siddhi/src/test/java/org/apache/streampipes/processors/siddhi/trend/TestTrendProcessor.java b/streampipes-extensions/streampipes-processors-filters-siddhi/src/test/java/org/apache/streampipes/processors/siddhi/trend/TestTrendProcessor.java
index 9b96316a35..5df5c855f1 100644
--- a/streampipes-extensions/streampipes-processors-filters-siddhi/src/test/java/org/apache/streampipes/processors/siddhi/trend/TestTrendProcessor.java
+++ b/streampipes-extensions/streampipes-processors-filters-siddhi/src/test/java/org/apache/streampipes/processors/siddhi/trend/TestTrendProcessor.java
@@ -28,7 +28,6 @@ import org.apache.streampipes.model.runtime.SourceInfo;
import org.apache.streampipes.sdk.helpers.Tuple2;
import org.apache.streampipes.test.generator.EventStreamGenerator;
import org.apache.streampipes.test.generator.InvocationGraphGenerator;
-import org.apache.streampipes.test.generator.grounding.EventGroundingGenerator;
import org.apache.streampipes.wrapper.params.generator.DataProcessorParameterGenerator;
import org.apache.streampipes.wrapper.siddhi.engine.callback.SiddhiDebugCallback;
@@ -93,7 +92,6 @@ public class TestTrendProcessor {
int expectedMatchCount) {
final Integer[] actualMatchCount = {0};
DataProcessorDescription originalGraph = new TrendProcessor().declareModel();
- originalGraph.setSupportedGrounding(EventGroundingGenerator.makeDummyGrounding());
DataProcessorInvocation graph =
InvocationGraphGenerator.makeEmptyInvocation(originalGraph);
diff --git a/streampipes-extensions/streampipes-processors-transformation-jvm/src/test/java/org/apache/streampipes/processors/transformation/jvm/processor/booloperator/counter/TestBooleanCounterProcessor.java b/streampipes-extensions/streampipes-processors-transformation-jvm/src/test/java/org/apache/streampipes/processors/transformation/jvm/processor/booloperator/counter/TestBooleanCounterProcessor.java
index a9fb7f39c8..4bca9b7036 100644
--- a/streampipes-extensions/streampipes-processors-transformation-jvm/src/test/java/org/apache/streampipes/processors/transformation/jvm/processor/booloperator/counter/TestBooleanCounterProcessor.java
+++ b/streampipes-extensions/streampipes-processors-transformation-jvm/src/test/java/org/apache/streampipes/processors/transformation/jvm/processor/booloperator/counter/TestBooleanCounterProcessor.java
@@ -31,7 +31,6 @@ import org.apache.streampipes.model.staticproperty.MappingPropertyUnary;
import org.apache.streampipes.model.staticproperty.OneOfStaticProperty;
import org.apache.streampipes.test.generator.EventStreamGenerator;
import org.apache.streampipes.test.generator.InvocationGraphGenerator;
-import org.apache.streampipes.test.generator.grounding.EventGroundingGenerator;
import org.apache.streampipes.wrapper.params.compat.ProcessorParams;
import org.junit.jupiter.params.ParameterizedTest;
@@ -84,7 +83,6 @@ public class TestBooleanCounterProcessor {
) {
BooleanCounterProcessor booleanCounter = new BooleanCounterProcessor();
DataProcessorDescription originalGraph = booleanCounter.declareConfig().getDescription();
- originalGraph.setSupportedGrounding(EventGroundingGenerator.makeDummyGrounding());
DataProcessorInvocation graph =
InvocationGraphGenerator.makeEmptyInvocation(originalGraph);
diff --git a/streampipes-extensions/streampipes-sinks-brokers-jvm/pom.xml b/streampipes-extensions/streampipes-sinks-brokers-jvm/pom.xml
index d671ab013c..16dfb0a22e 100644
--- a/streampipes-extensions/streampipes-sinks-brokers-jvm/pom.xml
+++ b/streampipes-extensions/streampipes-sinks-brokers-jvm/pom.xml
@@ -40,11 +40,6 @@
<artifactId>streampipes-extensions-management</artifactId>
<version>0.99.0-SNAPSHOT</version>
</dependency>
- <dependency>
- <groupId>org.apache.streampipes</groupId>
- <artifactId>streampipes-messaging-jms</artifactId>
- <version>0.99.0-SNAPSHOT</version>
- </dependency>
<dependency>
<groupId>org.apache.streampipes</groupId>
<artifactId>streampipes-wrapper-standalone</artifactId>
@@ -72,6 +67,10 @@
<groupId>org.java-websocket</groupId>
<artifactId>Java-WebSocket</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.apache.activemq</groupId>
+ <artifactId>activemq-client</artifactId>
+ </dependency>
<dependency>
<groupId>org.mockito</groupId>
diff --git a/streampipes-messaging-jms/src/main/java/org/apache/streampipes/messaging/jms/ActiveMQPublisher.java b/streampipes-extensions/streampipes-sinks-brokers-jvm/src/main/java/org/apache/streampipes/sinks/brokers/jvm/jms/ActiveMQPublisher.java
similarity index 75%
rename from streampipes-messaging-jms/src/main/java/org/apache/streampipes/messaging/jms/ActiveMQPublisher.java
rename to streampipes-extensions/streampipes-sinks-brokers-jvm/src/main/java/org/apache/streampipes/sinks/brokers/jvm/jms/ActiveMQPublisher.java
index 7760be77a4..4175c27c43 100644
--- a/streampipes-messaging-jms/src/main/java/org/apache/streampipes/messaging/jms/ActiveMQPublisher.java
+++ b/streampipes-extensions/streampipes-sinks-brokers-jvm/src/main/java/org/apache/streampipes/sinks/brokers/jvm/jms/ActiveMQPublisher.java
@@ -16,11 +16,10 @@
*
*/
-package org.apache.streampipes.messaging.jms;
+package org.apache.streampipes.sinks.brokers.jvm.jms;
import org.apache.streampipes.commons.exceptions.SpRuntimeException;
import org.apache.streampipes.messaging.EventProducer;
-import org.apache.streampipes.model.grounding.JmsTransportProtocol;
import org.apache.activemq.ActiveMQConnectionFactory;
import org.slf4j.Logger;
@@ -35,7 +34,7 @@ import jakarta.jms.MessageProducer;
import jakarta.jms.Session;
-public class ActiveMQPublisher extends ActiveMQConnectionProvider implements EventProducer {
+public class ActiveMQPublisher implements EventProducer {
private static final Logger LOG = LoggerFactory.getLogger(ActiveMQPublisher.class);
@@ -43,16 +42,24 @@ public class ActiveMQPublisher extends ActiveMQConnectionProvider implements Eve
private Session session;
private MessageProducer producer;
+ private final String host;
+ private final int port;
+ private final String topic;
+
private boolean connected = false;
- public ActiveMQPublisher(JmsTransportProtocol protocol) {
- super(protocol);
+ public ActiveMQPublisher(String host,
+ int port,
+ String topic) {
+ this.host = host;
+ this.port = port;
+ this.topic = topic;
}
@Override
public void connect() throws SpRuntimeException {
- String url = ActiveMQUtils.makeActiveMqUrl(protocol);
+ String url = ActiveMQUtils.makeActiveMqUrl(host, port);
ConnectionFactory connectionFactory = new ActiveMQConnectionFactory(url);
boolean co = false;
@@ -68,15 +75,13 @@ public class ActiveMQPublisher extends ActiveMQConnectionProvider implements Eve
try {
this.session = connection
.createSession(false, Session.AUTO_ACKNOWLEDGE);
- this.producer = session.createProducer(session.createTopic(protocol
- .getTopicDefinition()
- .getActualTopicName()));
+ this.producer = session.createProducer(session.createTopic(topic));
this.producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
this.connection.start();
this.connected = true;
} catch (JMSException e) {
throw new SpRuntimeException("could not connect to activemq broker. Broker: '"
- + protocol.getBrokerHostname() + "' Port: " + protocol.getPort());
+ + host + "' Port: " + port);
}
}
@@ -109,4 +114,17 @@ public class ActiveMQPublisher extends ActiveMQConnectionProvider implements Eve
return connected;
}
+ protected Connection startJmsConnection(String url) {
+ try {
+ ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(url);
+ connectionFactory.setAlwaysSyncSend(false);
+ Connection connect = connectionFactory.createConnection();
+
+ connect.start();
+ return connect;
+ } catch (JMSException e) {
+ throw new AssertionError("Failed to establish the JMS-Connection!", e);
+ }
+ }
+
}
diff --git a/streampipes-messaging-jms/src/main/java/org/apache/streampipes/messaging/jms/ActiveMQUtils.java b/streampipes-extensions/streampipes-sinks-brokers-jvm/src/main/java/org/apache/streampipes/sinks/brokers/jvm/jms/ActiveMQUtils.java
similarity index 77%
rename from streampipes-messaging-jms/src/main/java/org/apache/streampipes/messaging/jms/ActiveMQUtils.java
rename to streampipes-extensions/streampipes-sinks-brokers-jvm/src/main/java/org/apache/streampipes/sinks/brokers/jvm/jms/ActiveMQUtils.java
index 5bda0e642f..2e9c170ec7 100644
--- a/streampipes-messaging-jms/src/main/java/org/apache/streampipes/messaging/jms/ActiveMQUtils.java
+++ b/streampipes-extensions/streampipes-sinks-brokers-jvm/src/main/java/org/apache/streampipes/sinks/brokers/jvm/jms/ActiveMQUtils.java
@@ -15,16 +15,15 @@
* limitations under the License.
*
*/
-package org.apache.streampipes.messaging.jms;
-
-import org.apache.streampipes.model.grounding.JmsTransportProtocol;
+package org.apache.streampipes.sinks.brokers.jvm.jms;
public class ActiveMQUtils {
private static final String TCP_PROTOCOL = "tcp://";
private static final String COLON = ":";
- public static String makeActiveMqUrl(JmsTransportProtocol protocol) {
- return TCP_PROTOCOL + protocol.getBrokerHostname() + COLON + protocol.getPort();
+ public static String makeActiveMqUrl(String host,
+ int port) {
+ return TCP_PROTOCOL + host + COLON + port;
}
}
diff --git a/streampipes-extensions/streampipes-sinks-brokers-jvm/src/main/java/org/apache/streampipes/sinks/brokers/jvm/jms/JmsPublisherSink.java b/streampipes-extensions/streampipes-sinks-brokers-jvm/src/main/java/org/apache/streampipes/sinks/brokers/jvm/jms/JmsPublisherSink.java
index d2ebd79589..7e96dd5309 100644
--- a/streampipes-extensions/streampipes-sinks-brokers-jvm/src/main/java/org/apache/streampipes/sinks/brokers/jvm/jms/JmsPublisherSink.java
+++ b/streampipes-extensions/streampipes-sinks-brokers-jvm/src/main/java/org/apache/streampipes/sinks/brokers/jvm/jms/JmsPublisherSink.java
@@ -25,10 +25,8 @@ import org.apache.streampipes.extensions.api.pe.IStreamPipesDataSink;
import org.apache.streampipes.extensions.api.pe.config.IDataSinkConfiguration;
import org.apache.streampipes.extensions.api.pe.context.EventSinkRuntimeContext;
import org.apache.streampipes.extensions.api.pe.param.IDataSinkParameters;
-import org.apache.streampipes.messaging.jms.ActiveMQPublisher;
import org.apache.streampipes.model.DataSinkType;
import org.apache.streampipes.model.extensions.ExtensionAssetType;
-import org.apache.streampipes.model.grounding.JmsTransportProtocol;
import org.apache.streampipes.model.runtime.Event;
import org.apache.streampipes.sdk.builder.DataSinkBuilder;
import org.apache.streampipes.sdk.builder.StreamRequirementsBuilder;
@@ -80,10 +78,7 @@ public class JmsPublisherSink implements IStreamPipesDataSink {
Integer jmsPort = extractor.singleValueParameter(PORT_KEY, Integer.class);
String topic = extractor.singleValueParameter(TOPIC_KEY, String.class);
- JmsTransportProtocol jmsTransportProtocol =
- new JmsTransportProtocol(jmsHost, jmsPort, topic);
-
- this.publisher = new ActiveMQPublisher(jmsTransportProtocol);
+ this.publisher = new ActiveMQPublisher(jmsHost, jmsPort, topic);
this.publisher.connect();
if (!this.publisher.isConnected()) {
diff --git a/streampipes-messaging-jms/pom.xml b/streampipes-messaging-jms/pom.xml
deleted file mode 100644
index 413bff1b38..0000000000
--- a/streampipes-messaging-jms/pom.xml
+++ /dev/null
@@ -1,54 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You under the Apache License, Version 2.0
- ~ (the "License"); you may not use this file except in compliance with
- ~ the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- ~
- -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <parent>
- <groupId>org.apache.streampipes</groupId>
- <artifactId>streampipes-parent</artifactId>
- <version>0.99.0-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
-
- <artifactId>streampipes-messaging-jms</artifactId>
-
- <dependencies>
- <!-- StreamPipes dependencies -->
- <dependency>
- <groupId>org.apache.streampipes</groupId>
- <artifactId>streampipes-messaging</artifactId>
- <version>0.99.0-SNAPSHOT</version>
- </dependency>
-
- <!-- External dependencies -->
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>activemq-client</artifactId>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-checkstyle-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/streampipes-messaging-jms/src/main/java/org/apache/streampipes/messaging/jms/ActiveMQConnectionProvider.java b/streampipes-messaging-jms/src/main/java/org/apache/streampipes/messaging/jms/ActiveMQConnectionProvider.java
deleted file mode 100644
index ae6e9f9919..0000000000
--- a/streampipes-messaging-jms/src/main/java/org/apache/streampipes/messaging/jms/ActiveMQConnectionProvider.java
+++ /dev/null
@@ -1,49 +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.messaging.jms;
-
-import org.apache.streampipes.model.grounding.JmsTransportProtocol;
-
-import org.apache.activemq.ActiveMQConnectionFactory;
-
-import jakarta.jms.Connection;
-import jakarta.jms.JMSException;
-
-
-public abstract class ActiveMQConnectionProvider {
-
- protected JmsTransportProtocol protocol;
-
- public ActiveMQConnectionProvider(JmsTransportProtocol protocol) {
- this.protocol = protocol;
- }
-
- protected Connection startJmsConnection(String url) {
- try {
- ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(url);
- connectionFactory.setAlwaysSyncSend(false);
- Connection connect = connectionFactory.createConnection();
-
- connect.start();
- return connect;
- } catch (JMSException e) {
- throw new AssertionError("Failed to establish the JMS-Connection!", e);
- }
- }
-}
diff --git a/streampipes-messaging-jms/src/main/java/org/apache/streampipes/messaging/jms/ActiveMQConsumer.java b/streampipes-messaging-jms/src/main/java/org/apache/streampipes/messaging/jms/ActiveMQConsumer.java
deleted file mode 100644
index e83a635be8..0000000000
--- a/streampipes-messaging-jms/src/main/java/org/apache/streampipes/messaging/jms/ActiveMQConsumer.java
+++ /dev/null
@@ -1,111 +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.messaging.jms;
-
-import org.apache.streampipes.commons.exceptions.SpRuntimeException;
-import org.apache.streampipes.messaging.EventConsumer;
-import org.apache.streampipes.messaging.InternalEventProcessor;
-import org.apache.streampipes.model.grounding.JmsTransportProtocol;
-
-import org.apache.activemq.command.ActiveMQBytesMessage;
-import org.apache.activemq.util.ByteSequence;
-import org.slf4j.Logger;
-
-import jakarta.jms.BytesMessage;
-import jakarta.jms.JMSException;
-import jakarta.jms.MessageConsumer;
-import jakarta.jms.Session;
-
-import java.io.Serializable;
-
-public class ActiveMQConsumer extends ActiveMQConnectionProvider implements
- EventConsumer,
- AutoCloseable, Serializable {
-
- Logger logger = org.slf4j.LoggerFactory.getLogger(ActiveMQConsumer.class);
-
- private Session session;
- private MessageConsumer consumer;
- private InternalEventProcessor<byte[]> eventProcessor;
-
- private Boolean connected = false;
-
- public ActiveMQConsumer(JmsTransportProtocol protocol) {
- super(protocol);
- }
-
- private void initListener() {
- try {
- consumer.setMessageListener(message -> {
- if (message instanceof BytesMessage) {
- ByteSequence bs = ((ActiveMQBytesMessage) message).getContent();
- try {
- eventProcessor.onEvent(bs.getData());
- } catch (InterruptedException e) {
- Thread.currentThread().interrupt();
- logger.warn("Event processing was interrupted", e);
- }
- }
-
- });
- } catch (JMSException e) {
- e.printStackTrace();
- }
- }
-
- @Override
- public void connect(InternalEventProcessor<byte[]>
- eventProcessor) throws SpRuntimeException {
- String url = ActiveMQUtils.makeActiveMqUrl(protocol);
-
- try {
- this.eventProcessor = eventProcessor;
- session = startJmsConnection(url).createSession(false, Session.AUTO_ACKNOWLEDGE);
- consumer = session.createConsumer(session.createTopic(
- protocol.getTopicDefinition().getActualTopicName())
- );
- initListener();
- this.connected = true;
- } catch (JMSException e) {
- throw new SpRuntimeException("could not connect to activemq broker");
- }
- }
-
- @Override
- public void disconnect() throws SpRuntimeException {
- try {
- consumer.close();
- session.close();
- this.connected = false;
- } catch (JMSException e) {
- throw new SpRuntimeException("could not disconnect from activemq broker");
- }
-
- }
-
- @Override
- public boolean isConnected() {
- return connected;
- }
-
- @Override
- public void close() throws Exception {
- disconnect();
- }
-}
diff --git a/streampipes-messaging-jms/src/main/java/org/apache/streampipes/messaging/jms/SpJmsProtocol.java b/streampipes-messaging-jms/src/main/java/org/apache/streampipes/messaging/jms/SpJmsProtocol.java
deleted file mode 100644
index b8f7f5aba3..0000000000
--- a/streampipes-messaging-jms/src/main/java/org/apache/streampipes/messaging/jms/SpJmsProtocol.java
+++ /dev/null
@@ -1,37 +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.messaging.jms;
-
-import org.apache.streampipes.messaging.EventConsumer;
-import org.apache.streampipes.messaging.EventProducer;
-import org.apache.streampipes.messaging.SpProtocolDefinition;
-import org.apache.streampipes.model.grounding.JmsTransportProtocol;
-
-public class SpJmsProtocol implements SpProtocolDefinition<JmsTransportProtocol> {
-
-
- @Override
- public EventConsumer getConsumer(JmsTransportProtocol transportProtocol) {
- return new ActiveMQConsumer(transportProtocol);
- }
-
- @Override
- public EventProducer getProducer(JmsTransportProtocol transportProtocol) {
- return new ActiveMQPublisher(transportProtocol);
- }
-}
diff --git a/streampipes-messaging-jms/src/main/java/org/apache/streampipes/messaging/jms/SpJmsProtocolFactory.java b/streampipes-messaging-jms/src/main/java/org/apache/streampipes/messaging/jms/SpJmsProtocolFactory.java
deleted file mode 100644
index 64fceefbe3..0000000000
--- a/streampipes-messaging-jms/src/main/java/org/apache/streampipes/messaging/jms/SpJmsProtocolFactory.java
+++ /dev/null
@@ -1,42 +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.messaging.jms;
-
-import org.apache.streampipes.messaging.SpProtocolDefinition;
-import org.apache.streampipes.messaging.SpProtocolDefinitionFactory;
-import org.apache.streampipes.model.grounding.JmsTransportProtocol;
-import org.apache.streampipes.model.grounding.TransportProtocol;
-
-public class SpJmsProtocolFactory extends SpProtocolDefinitionFactory<JmsTransportProtocol> {
-
- @Override
- public TransportProtocol getTransportProtocol() {
- return new JmsTransportProtocol();
- }
-
- @Override
- public String getTransportProtocolClass() {
- return JmsTransportProtocol.class.getCanonicalName();
- }
-
- @Override
- public SpProtocolDefinition<JmsTransportProtocol> createInstance() {
- return new SpJmsProtocol();
- }
-}
-
diff --git a/streampipes-messaging/src/main/java/org/apache/streampipes/messaging/SpProtocolManager.java b/streampipes-messaging/src/main/java/org/apache/streampipes/messaging/SpProtocolManager.java
index 279c522eb9..e02296634d 100644
--- a/streampipes-messaging/src/main/java/org/apache/streampipes/messaging/SpProtocolManager.java
+++ b/streampipes-messaging/src/main/java/org/apache/streampipes/messaging/SpProtocolManager.java
@@ -38,10 +38,6 @@ public enum SpProtocolManager {
availableProtocols.add(protocolDefinition);
}
- public List<SpProtocolDefinitionFactory<? extends TransportProtocol>> getAvailableProtocols() {
- return availableProtocols;
- }
-
public <T extends TransportProtocol> Optional<SpProtocolDefinition<T>> findDefinition(T transportProtocol) {
return this.availableProtocols
.stream()
diff --git a/streampipes-model/src/main/java/org/apache/streampipes/model/base/ConsumableStreamPipesEntity.java b/streampipes-model/src/main/java/org/apache/streampipes/model/base/ConsumableStreamPipesEntity.java
index 3c763c15eb..bb1dfb403b 100644
--- a/streampipes-model/src/main/java/org/apache/streampipes/model/base/ConsumableStreamPipesEntity.java
+++ b/streampipes-model/src/main/java/org/apache/streampipes/model/base/ConsumableStreamPipesEntity.java
@@ -19,7 +19,6 @@
package org.apache.streampipes.model.base;
import org.apache.streampipes.model.SpDataStream;
-import org.apache.streampipes.model.grounding.EventGrounding;
import org.apache.streampipes.model.staticproperty.StaticProperty;
import org.apache.streampipes.model.util.Cloner;
@@ -34,8 +33,6 @@ public abstract class ConsumableStreamPipesEntity extends VersionedNamedStreamPi
protected List<StaticProperty> staticProperties;
- private EventGrounding supportedGrounding;
-
public ConsumableStreamPipesEntity() {
super();
this.spDataStreams = new ArrayList<>();
@@ -48,9 +45,6 @@ public abstract class ConsumableStreamPipesEntity extends VersionedNamedStreamPi
this.spDataStreams = new Cloner().streams(other.getSpDataStreams());
}
this.staticProperties = new Cloner().staticProperties(other.getStaticProperties());
- if (other.getSupportedGrounding() != null) {
- this.supportedGrounding = new EventGrounding(other.getSupportedGrounding());
- }
}
public List<SpDataStream> getSpDataStreams() {
@@ -68,13 +62,4 @@ public abstract class ConsumableStreamPipesEntity extends VersionedNamedStreamPi
public void setStaticProperties(List<StaticProperty> staticProperties) {
this.staticProperties = staticProperties;
}
-
- public EventGrounding getSupportedGrounding() {
- return supportedGrounding;
- }
-
- public void setSupportedGrounding(EventGrounding supportedGrounding) {
- this.supportedGrounding = supportedGrounding;
- }
-
}
diff --git a/streampipes-model/src/main/java/org/apache/streampipes/model/base/InvocableStreamPipesEntity.java b/streampipes-model/src/main/java/org/apache/streampipes/model/base/InvocableStreamPipesEntity.java
index c18335797b..80e34e40ab 100644
--- a/streampipes-model/src/main/java/org/apache/streampipes/model/base/InvocableStreamPipesEntity.java
+++ b/streampipes-model/src/main/java/org/apache/streampipes/model/base/InvocableStreamPipesEntity.java
@@ -22,7 +22,6 @@ import org.apache.streampipes.commons.constants.InstanceIdExtractor;
import org.apache.streampipes.model.SpDataStream;
import org.apache.streampipes.model.api.EndpointSelectable;
import org.apache.streampipes.model.extensions.svcdiscovery.SpServiceTagPrefix;
-import org.apache.streampipes.model.grounding.EventGrounding;
import org.apache.streampipes.model.staticproperty.StaticProperty;
import org.apache.streampipes.model.util.Cloner;
@@ -40,8 +39,6 @@ public abstract class InvocableStreamPipesEntity
private String belongsTo;
- private EventGrounding supportedGrounding;
-
private String correspondingPipeline;
private String correspondingUser;
@@ -76,9 +73,6 @@ public abstract class InvocableStreamPipesEntity
this.staticProperties = new Cloner().staticProperties(other.getStaticProperties());
}
this.dom = other.getDom();
- if (other.getSupportedGrounding() != null) {
- this.supportedGrounding = new EventGrounding(other.getSupportedGrounding());
- }
}
public List<SpDataStream> getInputStreams() {
@@ -105,14 +99,6 @@ public abstract class InvocableStreamPipesEntity
this.belongsTo = belongsTo;
}
- public EventGrounding getSupportedGrounding() {
- return supportedGrounding;
- }
-
- public void setSupportedGrounding(EventGrounding supportedGrounding) {
- this.supportedGrounding = supportedGrounding;
- }
-
@Override
public String getCorrespondingPipeline() {
return correspondingPipeline;
diff --git a/streampipes-model/src/main/java/org/apache/streampipes/model/configuration/DefaultMessagingSettings.java b/streampipes-model/src/main/java/org/apache/streampipes/model/configuration/DefaultMessagingSettings.java
deleted file mode 100644
index 6a8f1be2d9..0000000000
--- a/streampipes-model/src/main/java/org/apache/streampipes/model/configuration/DefaultMessagingSettings.java
+++ /dev/null
@@ -1,71 +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.configuration;
-
-import org.apache.streampipes.commons.environment.Environments;
-
-import java.util.Arrays;
-import java.util.List;
-
-public class DefaultMessagingSettings {
-
- public MessagingSettings make() {
- List<SpProtocol> protocolList;
- var env = Environments.getEnvironment();
- if (env.getPrioritizedProtocol().exists()) {
- protocolList = switch (env.getPrioritizedProtocol().getValueOrDefault().toLowerCase()) {
- case "mqtt" ->
- Arrays.asList(SpProtocol.MQTT, SpProtocol.KAFKA, SpProtocol.JMS, SpProtocol.NATS, SpProtocol.PULSAR);
- case "jms" ->
- Arrays.asList(SpProtocol.JMS, SpProtocol.KAFKA, SpProtocol.MQTT, SpProtocol.NATS, SpProtocol.PULSAR);
- case "nats" ->
- Arrays.asList(SpProtocol.NATS, SpProtocol.KAFKA, SpProtocol.MQTT, SpProtocol.JMS, SpProtocol.PULSAR);
- case "pulsar" ->
- Arrays.asList(SpProtocol.PULSAR, SpProtocol.KAFKA, SpProtocol.MQTT, SpProtocol.JMS, SpProtocol.NATS);
- default -> Arrays.asList(SpProtocol.KAFKA, SpProtocol.MQTT, SpProtocol.JMS, SpProtocol.NATS, SpProtocol.PULSAR);
- };
- } else {
- protocolList =
- Arrays.asList(SpProtocol.KAFKA, SpProtocol.MQTT, SpProtocol.JMS, SpProtocol.NATS, SpProtocol.PULSAR);
- }
-
- var defaultSettings = new MessagingSettings(
- 1638400,
- 5000012,
- 20,
- 2,
- protocolList);
-
- defaultSettings.setJmsHost("activemq");
- defaultSettings.setJmsPort(61616);
-
- defaultSettings.setMqttHost(env.getMqttHost().getValueOrDefault());
- defaultSettings.setMqttPort(env.getMqttPort().getValueOrDefault());
-
- defaultSettings.setNatsHost(env.getNatsHost().getValueOrDefault());
- defaultSettings.setNatsPort(env.getNatsPort().getValueOrDefault());
-
- defaultSettings.setKafkaHost(env.getKafkaHost().getValueOrDefault());
- defaultSettings.setKafkaPort(env.getKafkaPort().getValueOrDefault());
-
- defaultSettings.setPulsarUrl(env.getPulsarUrl().getValueOrDefault());
-
- return defaultSettings;
- }
-}
diff --git a/streampipes-model/src/main/java/org/apache/streampipes/model/configuration/DefaultSpCoreConfiguration.java b/streampipes-model/src/main/java/org/apache/streampipes/model/configuration/DefaultSpCoreConfiguration.java
index 6522d7358c..d5237fa1e0 100644
--- a/streampipes-model/src/main/java/org/apache/streampipes/model/configuration/DefaultSpCoreConfiguration.java
+++ b/streampipes-model/src/main/java/org/apache/streampipes/model/configuration/DefaultSpCoreConfiguration.java
@@ -30,7 +30,6 @@ public class DefaultSpCoreConfiguration {
var coreCfg = new SpCoreConfiguration();
coreCfg.setGeneralConfig(new DefaultGeneralConfig().make());
- coreCfg.setMessagingSettings(new DefaultMessagingSettings().make());
coreCfg.setEmailConfig(EmailConfig.fromDefaults());
coreCfg.setEmailTemplateConfig(new DefaultEmailTemplateConfiguration().getDefaultTemplates());
coreCfg.setFilesDir(makeFileLocation());
diff --git a/streampipes-model/src/main/java/org/apache/streampipes/model/configuration/MessagingSettings.java b/streampipes-model/src/main/java/org/apache/streampipes/model/configuration/MessagingSettings.java
deleted file mode 100644
index 1ad96d72ff..0000000000
--- a/streampipes-model/src/main/java/org/apache/streampipes/model/configuration/MessagingSettings.java
+++ /dev/null
@@ -1,187 +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.configuration;
-
-import org.apache.streampipes.model.shared.annotation.TsModel;
-
-import java.util.ArrayList;
-import java.util.List;
-
-@TsModel
-public class MessagingSettings {
-
- private Integer batchSize;
- private Integer messageMaxBytes;
- private Integer lingerMs;
- private Integer acks;
-
- private List<SpProtocol> prioritizedProtocols;
-
- private String jmsHost;
- private int jmsPort;
-
- private String mqttHost;
- private int mqttPort;
-
- private String natsHost;
- private int natsPort;
-
- private String kafkaHost;
- private int kafkaPort;
-
- private String pulsarUrl;
-
- private List<String> supportedProtocols;
-
- public MessagingSettings(Integer batchSize,
- Integer messageMaxBytes,
- Integer lingerMs,
- Integer acks,
- List<SpProtocol> prioritizedProtocols) {
- this.batchSize = batchSize;
- this.messageMaxBytes = messageMaxBytes;
- this.lingerMs = lingerMs;
- this.acks = acks;
- this.prioritizedProtocols = prioritizedProtocols;
- this.supportedProtocols = new ArrayList<>();
- }
-
- public MessagingSettings() {
-
- }
-
- public Integer getBatchSize() {
- return batchSize;
- }
-
- public void setBatchSize(Integer batchSize) {
- this.batchSize = batchSize;
- }
-
- public Integer getMessageMaxBytes() {
- return messageMaxBytes;
- }
-
- public void setMessageMaxBytes(Integer messageMaxBytes) {
- this.messageMaxBytes = messageMaxBytes;
- }
-
- public Integer getLingerMs() {
- return lingerMs;
- }
-
- public void setLingerMs(Integer lingerMs) {
- this.lingerMs = lingerMs;
- }
-
- public Integer getAcks() {
- return acks;
- }
-
- public void setAcks(Integer acks) {
- this.acks = acks;
- }
-
- public List<SpProtocol> getPrioritizedProtocols() {
- return prioritizedProtocols;
- }
-
- public void setPrioritizedProtocols(List<SpProtocol> prioritizedProtocols) {
- this.prioritizedProtocols = prioritizedProtocols;
- }
-
- public String getJmsHost() {
- return jmsHost;
- }
-
- public void setJmsHost(String jmsHost) {
- this.jmsHost = jmsHost;
- }
-
- public int getJmsPort() {
- return jmsPort;
- }
-
- public void setJmsPort(int jmsPort) {
- this.jmsPort = jmsPort;
- }
-
- public String getMqttHost() {
- return mqttHost;
- }
-
- public void setMqttHost(String mqttHost) {
- this.mqttHost = mqttHost;
- }
-
- public int getMqttPort() {
- return mqttPort;
- }
-
- public void setMqttPort(int mqttPort) {
- this.mqttPort = mqttPort;
- }
-
- public String getNatsHost() {
- return natsHost;
- }
-
- public void setNatsHost(String natsHost) {
- this.natsHost = natsHost;
- }
-
- public int getNatsPort() {
- return natsPort;
- }
-
- public void setNatsPort(int natsPort) {
- this.natsPort = natsPort;
- }
-
- public String getKafkaHost() {
- return kafkaHost;
- }
-
- public void setKafkaHost(String kafkaHost) {
- this.kafkaHost = kafkaHost;
- }
-
- public int getKafkaPort() {
- return kafkaPort;
- }
-
- public void setKafkaPort(int kafkaPort) {
- this.kafkaPort = kafkaPort;
- }
-
- public String getPulsarUrl() {
- return pulsarUrl;
- }
-
- public void setPulsarUrl(String pulsarUrl) {
- this.pulsarUrl = pulsarUrl;
- }
-
- public List<String> getSupportedProtocols() {
- return supportedProtocols;
- }
-
- public void setSupportedProtocols(List<String> supportedProtocols) {
- this.supportedProtocols = supportedProtocols;
- }
-}
diff --git a/streampipes-model/src/main/java/org/apache/streampipes/model/configuration/SpCoreConfiguration.java b/streampipes-model/src/main/java/org/apache/streampipes/model/configuration/SpCoreConfiguration.java
index 88c8a56e1e..4d3bc3a5e1 100644
--- a/streampipes-model/src/main/java/org/apache/streampipes/model/configuration/SpCoreConfiguration.java
+++ b/streampipes-model/src/main/java/org/apache/streampipes/model/configuration/SpCoreConfiguration.java
@@ -29,7 +29,6 @@ public class SpCoreConfiguration {
protected @SerializedName("_rev") String rev;
private @SerializedName("_id") String id = ID;
- private MessagingSettings messagingSettings;
private LocalAuthConfig localAuthConfig;
private EmailConfig emailConfig;
private EmailTemplateConfig emailTemplateConfig;
@@ -64,14 +63,6 @@ public class SpCoreConfiguration {
this.id = id;
}
- public MessagingSettings getMessagingSettings() {
- return messagingSettings;
- }
-
- public void setMessagingSettings(MessagingSettings messagingSettings) {
- this.messagingSettings = messagingSettings;
- }
-
public LocalAuthConfig getLocalAuthConfig() {
return localAuthConfig;
}
diff --git a/streampipes-model/src/main/java/org/apache/streampipes/model/configuration/SpProtocol.java b/streampipes-model/src/main/java/org/apache/streampipes/model/configuration/SpProtocol.java
index 657ae968db..607465f118 100644
--- a/streampipes-model/src/main/java/org/apache/streampipes/model/configuration/SpProtocol.java
+++ b/streampipes-model/src/main/java/org/apache/streampipes/model/configuration/SpProtocol.java
@@ -20,7 +20,6 @@ package org.apache.streampipes.model.configuration;
public enum SpProtocol {
KAFKA("Kafka", "org.apache.streampipes.model.grounding.KafkaTransportProtocol"),
- JMS("JMS", "org.apache.streampipes.model.grounding.JmsTransportProtocol"),
MQTT("MQTT", "org.apache.streampipes.model.grounding.MqttTransportProtocol"),
NATS("NATS", "org.apache.streampipes.model.grounding.NatsTransportProtocol"),
PULSAR("PULSAR", "org.apache.streampipes.model.grounding.PulsarTransportProtocol");
diff --git a/streampipes-model/src/main/java/org/apache/streampipes/model/graph/DataProcessorDescription.java b/streampipes-model/src/main/java/org/apache/streampipes/model/graph/DataProcessorDescription.java
index 9de8809bf8..5136e06ca5 100644
--- a/streampipes-model/src/main/java/org/apache/streampipes/model/graph/DataProcessorDescription.java
+++ b/streampipes-model/src/main/java/org/apache/streampipes/model/graph/DataProcessorDescription.java
@@ -27,8 +27,6 @@ import java.util.List;
public class DataProcessorDescription extends ConsumableStreamPipesEntity {
- private static final long serialVersionUID = 3995767921861518597L;
-
private List<OutputStrategy> outputStrategies;
private List<String> category;
diff --git a/streampipes-model/src/main/java/org/apache/streampipes/model/graph/DataProcessorInvocation.java b/streampipes-model/src/main/java/org/apache/streampipes/model/graph/DataProcessorInvocation.java
index 4414f2b749..5607187a4a 100644
--- a/streampipes-model/src/main/java/org/apache/streampipes/model/graph/DataProcessorInvocation.java
+++ b/streampipes-model/src/main/java/org/apache/streampipes/model/graph/DataProcessorInvocation.java
@@ -31,8 +31,6 @@ import java.util.List;
public class DataProcessorInvocation extends InvocableStreamPipesEntity implements Serializable {
- private static final long serialVersionUID = 865870355944824186L;
-
private SpDataStream outputStream;
private List<OutputStrategy> outputStrategies;
@@ -44,7 +42,6 @@ public class DataProcessorInvocation extends InvocableStreamPipesEntity implemen
this.setName(other.getName());
this.setDescription(other.getDescription());
this.setInputStreams(other.getSpDataStreams());
- this.setSupportedGrounding(other.getSupportedGrounding());
this.setStaticProperties(other.getStaticProperties());
this.setOutputStrategies(other.getOutputStrategies());
this.setBelongsTo(other.getElementId());
diff --git a/streampipes-model/src/main/java/org/apache/streampipes/model/graph/DataSinkDescription.java b/streampipes-model/src/main/java/org/apache/streampipes/model/graph/DataSinkDescription.java
index d491d62d20..41c220157b 100644
--- a/streampipes-model/src/main/java/org/apache/streampipes/model/graph/DataSinkDescription.java
+++ b/streampipes-model/src/main/java/org/apache/streampipes/model/graph/DataSinkDescription.java
@@ -26,8 +26,6 @@ import java.util.List;
public class DataSinkDescription extends ConsumableStreamPipesEntity {
- private static final long serialVersionUID = -6553066396392585731L;
-
private List<String> category;
public DataSinkDescription(DataSinkDescription other) {
diff --git a/streampipes-model/src/main/java/org/apache/streampipes/model/graph/DataSinkInvocation.java b/streampipes-model/src/main/java/org/apache/streampipes/model/graph/DataSinkInvocation.java
index bc95f269c9..21247b9673 100644
--- a/streampipes-model/src/main/java/org/apache/streampipes/model/graph/DataSinkInvocation.java
+++ b/streampipes-model/src/main/java/org/apache/streampipes/model/graph/DataSinkInvocation.java
@@ -27,8 +27,6 @@ import java.util.List;
public class DataSinkInvocation extends InvocableStreamPipesEntity {
- private static final long serialVersionUID = -2345635798917416757L;
-
private List<String> category;
public DataSinkInvocation(DataSinkInvocation sec) {
@@ -42,7 +40,6 @@ public class DataSinkInvocation extends InvocableStreamPipesEntity {
this.setName(other.getName());
this.setDescription(other.getDescription());
this.setInputStreams(other.getSpDataStreams());
- this.setSupportedGrounding(other.getSupportedGrounding());
this.setStaticProperties(other.getStaticProperties());
this.setBelongsTo(other.getElementId());
this.category = other.getCategory();
diff --git a/streampipes-model/src/main/java/org/apache/streampipes/model/grounding/JmsTransportProtocol.java b/streampipes-model/src/main/java/org/apache/streampipes/model/grounding/JmsTransportProtocol.java
deleted file mode 100644
index 35f50275b0..0000000000
--- a/streampipes-model/src/main/java/org/apache/streampipes/model/grounding/JmsTransportProtocol.java
+++ /dev/null
@@ -1,53 +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.grounding;
-
-public class JmsTransportProtocol extends TransportProtocol {
-
- private static final long serialVersionUID = -5650426611208789835L;
-
- private int port;
-
- public JmsTransportProtocol(String uri, int port, String topicName) {
- super(uri, new SimpleTopicDefinition(topicName));
- this.port = port;
- }
-
- public JmsTransportProtocol(JmsTransportProtocol other) {
- super(other);
- this.port = other.getPort();
- }
-
- public JmsTransportProtocol() {
- super();
- }
-
- public int getPort() {
- return port;
- }
-
- public void setPort(int port) {
- this.port = port;
- }
-
- @Override
- public String toString() {
- return getBrokerHostname() + ":" + getPort();
- }
-}
diff --git a/streampipes-model/src/main/java/org/apache/streampipes/model/grounding/KafkaTransportProtocol.java b/streampipes-model/src/main/java/org/apache/streampipes/model/grounding/KafkaTransportProtocol.java
index 8af85bdd56..fc13853075 100644
--- a/streampipes-model/src/main/java/org/apache/streampipes/model/grounding/KafkaTransportProtocol.java
+++ b/streampipes-model/src/main/java/org/apache/streampipes/model/grounding/KafkaTransportProtocol.java
@@ -20,6 +20,8 @@ package org.apache.streampipes.model.grounding;
public class KafkaTransportProtocol extends TransportProtocol {
+ public static final String BROKER_ID = "kafka";
+
private int kafkaPort;
private Integer lingerMs;
@@ -62,6 +64,11 @@ public class KafkaTransportProtocol extends TransportProtocol {
super();
}
+ @Override
+ public String protocolId() {
+ return BROKER_ID;
+ }
+
public int getKafkaPort() {
return kafkaPort;
}
diff --git a/streampipes-model/src/main/java/org/apache/streampipes/model/grounding/MqttTransportProtocol.java b/streampipes-model/src/main/java/org/apache/streampipes/model/grounding/MqttTransportProtocol.java
index 8bd09cb396..01a18d4957 100644
--- a/streampipes-model/src/main/java/org/apache/streampipes/model/grounding/MqttTransportProtocol.java
+++ b/streampipes-model/src/main/java/org/apache/streampipes/model/grounding/MqttTransportProtocol.java
@@ -20,6 +20,8 @@ package org.apache.streampipes.model.grounding;
public class MqttTransportProtocol extends TransportProtocol {
+ public static final String BROKER_ID = "mqtt";
+
private int port;
public MqttTransportProtocol(String hostname, int port, String topicName) {
@@ -36,6 +38,11 @@ public class MqttTransportProtocol extends TransportProtocol {
super();
}
+ @Override
+ public String protocolId() {
+ return BROKER_ID;
+ }
+
public int getPort() {
return port;
}
diff --git a/streampipes-model/src/main/java/org/apache/streampipes/model/grounding/NatsTransportProtocol.java b/streampipes-model/src/main/java/org/apache/streampipes/model/grounding/NatsTransportProtocol.java
index 4b450b5f44..527f18b787 100644
--- a/streampipes-model/src/main/java/org/apache/streampipes/model/grounding/NatsTransportProtocol.java
+++ b/streampipes-model/src/main/java/org/apache/streampipes/model/grounding/NatsTransportProtocol.java
@@ -20,6 +20,8 @@ package org.apache.streampipes.model.grounding;
public class NatsTransportProtocol extends TransportProtocol {
+ public static final String BROKER_ID = "nats";
+
private int port;
public NatsTransportProtocol(String hostname,
@@ -38,6 +40,11 @@ public class NatsTransportProtocol extends TransportProtocol {
super();
}
+ @Override
+ public String protocolId() {
+ return BROKER_ID;
+ }
+
public int getPort() {
return port;
}
diff --git a/streampipes-model/src/main/java/org/apache/streampipes/model/grounding/PulsarTransportProtocol.java b/streampipes-model/src/main/java/org/apache/streampipes/model/grounding/PulsarTransportProtocol.java
index 9c38f54e45..bc7b5a225a 100644
--- a/streampipes-model/src/main/java/org/apache/streampipes/model/grounding/PulsarTransportProtocol.java
+++ b/streampipes-model/src/main/java/org/apache/streampipes/model/grounding/PulsarTransportProtocol.java
@@ -20,11 +20,18 @@ package org.apache.streampipes.model.grounding;
public class PulsarTransportProtocol extends TransportProtocol {
+ public static final String BROKER_ID = "pulsar";
+
public PulsarTransportProtocol(String brokerUrl,
TopicDefinition topicDefinition) {
super(brokerUrl, topicDefinition);
}
+ @Override
+ public String protocolId() {
+ return BROKER_ID;
+ }
+
public PulsarTransportProtocol(PulsarTransportProtocol other) {
super(other);
}
diff --git a/streampipes-model/src/main/java/org/apache/streampipes/model/grounding/TransportFormat.java b/streampipes-model/src/main/java/org/apache/streampipes/model/grounding/TransportFormat.java
deleted file mode 100644
index a585787f10..0000000000
--- a/streampipes-model/src/main/java/org/apache/streampipes/model/grounding/TransportFormat.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.streampipes.model.grounding;
-
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.List;
-
-public class TransportFormat {
-
- private static final long serialVersionUID = -525073244975968386L;
-
- private List<URI> rdfType;
-
- public TransportFormat() {
- super();
- this.rdfType = new ArrayList<>();
- }
-
- public TransportFormat(String transportFormatType) {
- super();
- this.rdfType = new ArrayList<>();
- this.rdfType.add(URI.create(transportFormatType));
- }
-
- public TransportFormat(TransportFormat other) {
- this.rdfType = other.getRdfType();
- }
-
- public List<URI> getRdfType() {
- return rdfType;
- }
-
- public void setRdfType(List<URI> rdfType) {
- this.rdfType = rdfType;
- }
-
-}
diff --git a/streampipes-model/src/main/java/org/apache/streampipes/model/grounding/TransportProtocol.java b/streampipes-model/src/main/java/org/apache/streampipes/model/grounding/TransportProtocol.java
index a3a5afe428..a5f31ce332 100644
--- a/streampipes-model/src/main/java/org/apache/streampipes/model/grounding/TransportProtocol.java
+++ b/streampipes-model/src/main/java/org/apache/streampipes/model/grounding/TransportProtocol.java
@@ -25,7 +25,6 @@ import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
@JsonSubTypes({
- @JsonSubTypes.Type(JmsTransportProtocol.class),
@JsonSubTypes.Type(KafkaTransportProtocol.class),
@JsonSubTypes.Type(MqttTransportProtocol.class),
@JsonSubTypes.Type(NatsTransportProtocol.class),
@@ -84,4 +83,6 @@ public abstract class TransportProtocol {
public void setElementId(String elementId) {
this.elementId = elementId;
}
+
+ public abstract String protocolId();
}
diff --git a/streampipes-model/src/main/java/org/apache/streampipes/model/util/Cloner.java b/streampipes-model/src/main/java/org/apache/streampipes/model/util/Cloner.java
index bce767d46c..d8a3fba931 100644
--- a/streampipes-model/src/main/java/org/apache/streampipes/model/util/Cloner.java
+++ b/streampipes-model/src/main/java/org/apache/streampipes/model/util/Cloner.java
@@ -23,7 +23,6 @@ import org.apache.streampipes.model.base.NamedStreamPipesEntity;
import org.apache.streampipes.model.connect.adapter.AdapterDescription;
import org.apache.streampipes.model.graph.DataProcessorDescription;
import org.apache.streampipes.model.graph.DataSinkDescription;
-import org.apache.streampipes.model.grounding.JmsTransportProtocol;
import org.apache.streampipes.model.grounding.KafkaTransportProtocol;
import org.apache.streampipes.model.grounding.MqttTransportProtocol;
import org.apache.streampipes.model.grounding.NatsTransportProtocol;
@@ -155,8 +154,6 @@ public class Cloner {
public TransportProtocol protocol(TransportProtocol protocol) {
if (protocol instanceof KafkaTransportProtocol) {
return new KafkaTransportProtocol((KafkaTransportProtocol) protocol);
- } else if (protocol instanceof JmsTransportProtocol) {
- return new JmsTransportProtocol((JmsTransportProtocol) protocol);
} else if (protocol instanceof MqttTransportProtocol) {
return new MqttTransportProtocol((MqttTransportProtocol) protocol);
} else if (protocol instanceof NatsTransportProtocol) {
diff --git a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/matching/GroundingSelector.java b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/matching/GroundingSelector.java
deleted file mode 100644
index 92c73cd797..0000000000
--- a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/matching/GroundingSelector.java
+++ /dev/null
@@ -1,46 +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.manager.matching;
-
-import org.apache.streampipes.model.base.InvocableStreamPipesEntity;
-import org.apache.streampipes.model.base.NamedStreamPipesEntity;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-
-public abstract class GroundingSelector {
-
- protected NamedStreamPipesEntity source;
- protected Set<InvocableStreamPipesEntity> targets;
-
- public GroundingSelector(NamedStreamPipesEntity source,
- Set<InvocableStreamPipesEntity> targets) {
- this.source = source;
- this.targets = targets;
- }
-
- protected List<InvocableStreamPipesEntity> buildInvocables() {
- List<InvocableStreamPipesEntity> elements = new ArrayList<>();
- elements.add((InvocableStreamPipesEntity) source);
- elements.addAll(targets);
-
- return elements;
- }
-}
diff --git a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/matching/ProtocolSelector.java b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/matching/ProtocolSelector.java
index e1eeb4f58f..c06eda3203 100644
--- a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/matching/ProtocolSelector.java
+++ b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/matching/ProtocolSelector.java
@@ -18,116 +18,43 @@
package org.apache.streampipes.manager.matching;
+import org.apache.streampipes.commons.environment.Environment;
+import org.apache.streampipes.commons.environment.Environments;
+import org.apache.streampipes.manager.util.GroundingUtils;
import org.apache.streampipes.manager.util.TopicGenerator;
import org.apache.streampipes.model.SpDataStream;
import org.apache.streampipes.model.base.InvocableStreamPipesEntity;
import org.apache.streampipes.model.base.NamedStreamPipesEntity;
-import org.apache.streampipes.model.configuration.MessagingSettings;
-import org.apache.streampipes.model.configuration.SpProtocol;
-import org.apache.streampipes.model.grounding.JmsTransportProtocol;
-import org.apache.streampipes.model.grounding.KafkaTransportProtocol;
-import org.apache.streampipes.model.grounding.MqttTransportProtocol;
-import org.apache.streampipes.model.grounding.NatsTransportProtocol;
-import org.apache.streampipes.model.grounding.PulsarTransportProtocol;
-import org.apache.streampipes.model.grounding.SimpleTopicDefinition;
import org.apache.streampipes.model.grounding.TransportProtocol;
-import org.apache.streampipes.storage.management.StorageDispatcher;
-import java.util.List;
import java.util.Set;
-public class ProtocolSelector extends GroundingSelector {
+public class ProtocolSelector {
+ private final Environment env;
private final String outputTopic;
- private final List<SpProtocol> prioritizedProtocols;
-
- private final MessagingSettings messagingSettings;
+ private final String prioritizedProtocol;
+ protected NamedStreamPipesEntity source;
+ protected Set<InvocableStreamPipesEntity> targets;
public ProtocolSelector(NamedStreamPipesEntity source, Set<InvocableStreamPipesEntity> targets) {
- super(source, targets);
+ this.env = Environments.getEnvironment();
+ this.source = source;
+ this.targets = targets;
this.outputTopic = TopicGenerator.generateRandomTopic();
- this.messagingSettings = StorageDispatcher
- .INSTANCE
- .getNoSqlStore()
- .getSpCoreConfigurationStorage()
- .get()
- .getMessagingSettings();
- this.prioritizedProtocols =
- messagingSettings.getPrioritizedProtocols();
+
+ this.prioritizedProtocol = env.getPrioritizedProtocol().getValueOrDefault();
}
public TransportProtocol getPreferredProtocol() {
+ var env = Environments.getEnvironment();
if (source instanceof SpDataStream) {
return ((SpDataStream) source)
.getEventGrounding()
.getTransportProtocol();
} else {
- for (SpProtocol prioritizedProtocol : prioritizedProtocols) {
- if (prioritizedProtocol.getProtocolClass().equals(KafkaTransportProtocol.class.getCanonicalName())
- && supportsProtocol(KafkaTransportProtocol.class)) {
- return kafkaTopic();
- } else if (prioritizedProtocol.getProtocolClass().equals(JmsTransportProtocol.class.getCanonicalName())
- && supportsProtocol(JmsTransportProtocol.class)) {
- return jmsTopic();
- } else if (prioritizedProtocol.getProtocolClass().equals(MqttTransportProtocol.class.getCanonicalName())
- && supportsProtocol(MqttTransportProtocol.class)) {
- return mqttTopic();
- } else if (prioritizedProtocol.getProtocolClass().equals(NatsTransportProtocol.class.getCanonicalName())
- && supportsProtocol(NatsTransportProtocol.class)) {
- return natsTopic();
- } else if (prioritizedProtocol.getProtocolClass().equals(PulsarTransportProtocol.class.getCanonicalName())
- && supportsProtocol(PulsarTransportProtocol.class)) {
- return new PulsarTransportProtocol(messagingSettings.getPulsarUrl(),
- new SimpleTopicDefinition(outputTopic));
- }
- }
+ return GroundingUtils.makeProtocol(env, prioritizedProtocol, outputTopic);
}
- return kafkaTopic();
- }
-
- private TransportProtocol mqttTopic() {
- return new MqttTransportProtocol(
- messagingSettings.getMqttHost(),
- messagingSettings.getMqttPort(),
- outputTopic
- );
- }
-
- private TransportProtocol jmsTopic() {
- return new JmsTransportProtocol(
- messagingSettings.getJmsHost(),
- messagingSettings.getJmsPort(),
- outputTopic
- );
- }
-
- private TransportProtocol natsTopic() {
- return new NatsTransportProtocol(
- messagingSettings.getNatsHost(),
- messagingSettings.getNatsPort(),
- outputTopic
- );
- }
-
- private TransportProtocol kafkaTopic() {
- return new KafkaTransportProtocol(
- messagingSettings.getKafkaHost(),
- messagingSettings.getKafkaPort(),
- outputTopic
- );
- }
-
-
- public <T extends TransportProtocol> boolean supportsProtocol(Class<T> protocol) {
- List<InvocableStreamPipesEntity> elements = buildInvocables();
-
- return elements
- .stream()
- .allMatch(e -> e
- .getSupportedGrounding()
- .getTransportProtocols()
- .stream()
- .anyMatch(protocol::isInstance));
}
}
diff --git a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/matching/v2/ElementVerification.java b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/matching/v2/ElementVerification.java
deleted file mode 100644
index 35244f3a4d..0000000000
--- a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/matching/v2/ElementVerification.java
+++ /dev/null
@@ -1,52 +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.manager.matching.v2;
-
-import org.apache.streampipes.model.SpDataStream;
-import org.apache.streampipes.model.base.InvocableStreamPipesEntity;
-import org.apache.streampipes.model.client.matching.MatchingResultMessage;
-import org.apache.streampipes.model.graph.DataProcessorInvocation;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class ElementVerification {
-
- private List<MatchingResultMessage> errorLog;
-
- public ElementVerification() {
- this.errorLog = new ArrayList<>();
- }
-
- public boolean verify(DataProcessorInvocation offer, InvocableStreamPipesEntity requirement) {
- return new StreamMatch()
- .matchIgnoreGrounding(offer.getOutputStream(),
- requirement.getStreamRequirements().get(0), errorLog)
- && new GroundingMatch().match(offer.getSupportedGrounding(), requirement.getSupportedGrounding(), errorLog);
- }
-
- public boolean verify(SpDataStream offer, InvocableStreamPipesEntity requirement) {
- return new StreamMatch().matchIgnoreGrounding(offer, requirement.getStreamRequirements().get(0), errorLog)
- && new GroundingMatch().match(offer.getEventGrounding(), requirement.getSupportedGrounding(), errorLog);
- }
-
- public List<MatchingResultMessage> getErrorLog() {
- return errorLog;
- }
-}
diff --git a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/matching/v2/GroundingMatch.java b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/matching/v2/GroundingMatch.java
deleted file mode 100644
index 27d403a5e2..0000000000
--- a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/matching/v2/GroundingMatch.java
+++ /dev/null
@@ -1,53 +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.manager.matching.v2;
-
-import org.apache.streampipes.manager.matching.v2.utils.MatchingUtils;
-import org.apache.streampipes.model.client.matching.MatchingResultMessage;
-import org.apache.streampipes.model.client.matching.MatchingResultType;
-import org.apache.streampipes.model.grounding.EventGrounding;
-import org.apache.streampipes.model.grounding.TransportProtocol;
-
-import java.util.List;
-
-public class GroundingMatch extends AbstractMatcher<EventGrounding, EventGrounding> {
-
- public GroundingMatch() {
- super(MatchingResultType.GROUNDING_MATCH);
- }
-
- @Override
- public boolean match(EventGrounding offer, EventGrounding requirement, List<MatchingResultMessage> errorLog) {
- return MatchingUtils.nullCheckRightNullDisallowed(offer, requirement)
- || (matchProtocols(offer.getTransportProtocols(), requirement.getTransportProtocols(), errorLog));
- }
-
- private boolean matchProtocols(List<TransportProtocol> offer, List<TransportProtocol> requirement,
- List<MatchingResultMessage> errorLog) {
- boolean match = MatchingUtils.nullCheckBothNullDisallowed(offer, requirement)
- && requirement
- .stream()
- .anyMatch(req -> offer.stream().anyMatch(of -> new ProtocolMatch().match(of, req, errorLog)));
-
- if (!match) {
- buildErrorMessage(errorLog, MatchingResultType.PROTOCOL_MATCH, "Could not find matching protocol");
- }
- return match;
- }
-}
diff --git a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/matching/v2/ProtocolMatch.java b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/matching/v2/ProtocolMatch.java
deleted file mode 100644
index 60cf0679de..0000000000
--- a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/matching/v2/ProtocolMatch.java
+++ /dev/null
@@ -1,44 +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.manager.matching.v2;
-
-import org.apache.streampipes.manager.matching.v2.utils.MatchingUtils;
-import org.apache.streampipes.model.client.matching.MatchingResultMessage;
-import org.apache.streampipes.model.client.matching.MatchingResultType;
-import org.apache.streampipes.model.grounding.TransportProtocol;
-
-import java.util.List;
-
-public class ProtocolMatch extends AbstractMatcher<TransportProtocol, TransportProtocol> {
-
- public ProtocolMatch() {
- super(MatchingResultType.PROTOCOL_MATCH);
- }
-
- @Override
- public boolean match(TransportProtocol offer, TransportProtocol requirement, List<MatchingResultMessage> errorLog) {
- return MatchingUtils.nullCheck(offer, requirement)
- || canonicalName(requirement).equals(canonicalName(offer));
- }
-
- private String canonicalName(TransportProtocol protocol) {
- return protocol.getClass().getCanonicalName();
- }
-
-}
diff --git a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/matching/v2/StreamMatch.java b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/matching/v2/StreamMatch.java
index 4680d7d7b1..49b520612e 100644
--- a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/matching/v2/StreamMatch.java
+++ b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/matching/v2/StreamMatch.java
@@ -22,7 +22,6 @@ import org.apache.streampipes.manager.matching.v2.utils.MatchingUtils;
import org.apache.streampipes.model.SpDataStream;
import org.apache.streampipes.model.client.matching.MatchingResultMessage;
import org.apache.streampipes.model.client.matching.MatchingResultType;
-import org.apache.streampipes.model.grounding.EventGrounding;
import org.apache.streampipes.model.schema.EventSchema;
import java.util.List;
@@ -36,20 +35,7 @@ public class StreamMatch extends AbstractMatcher<SpDataStream, SpDataStream> {
@Override
public boolean match(SpDataStream offer, SpDataStream requirement, List<MatchingResultMessage> errorLog) {
return MatchingUtils.nullCheck(offer, requirement)
- || (checkSchemaMatch(offer.getEventSchema(), requirement.getEventSchema(), errorLog)
- && checkGroundingMatch(offer.getEventGrounding(), requirement.getEventGrounding(), errorLog));
- }
-
- public boolean matchIgnoreGrounding(SpDataStream offer, SpDataStream requirement,
- List<MatchingResultMessage> errorLog) {
- boolean match = /*MatchingUtils.nullCheckReqAllowed(offer, requirement) ||*/
- (checkSchemaMatch(offer.getEventSchema(), requirement.getEventSchema(), errorLog));
- return match;
- }
-
- private boolean checkGroundingMatch(EventGrounding offer,
- EventGrounding requirement, List<MatchingResultMessage> errorLog) {
- return new GroundingMatch().match(offer, requirement, errorLog);
+ || (checkSchemaMatch(offer.getEventSchema(), requirement.getEventSchema(), errorLog));
}
private boolean checkSchemaMatch(EventSchema offer,
diff --git a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/matching/v2/pipeline/ApplyGroundingStep.java b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/matching/v2/pipeline/ApplyGroundingStep.java
index e691f285c0..0ed840ce05 100644
--- a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/matching/v2/pipeline/ApplyGroundingStep.java
+++ b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/matching/v2/pipeline/ApplyGroundingStep.java
@@ -19,11 +19,8 @@
package org.apache.streampipes.manager.matching.v2.pipeline;
import org.apache.streampipes.manager.matching.GroundingBuilder;
-import org.apache.streampipes.manager.matching.v2.GroundingMatch;
-import org.apache.streampipes.model.SpDataStream;
import org.apache.streampipes.model.base.InvocableStreamPipesEntity;
import org.apache.streampipes.model.base.NamedStreamPipesEntity;
-import org.apache.streampipes.model.client.matching.MatchingResultMessage;
import org.apache.streampipes.model.graph.DataProcessorInvocation;
import org.apache.streampipes.model.grounding.EventGrounding;
import org.apache.streampipes.model.pipeline.PipelineElementValidationInfo;
@@ -43,49 +40,30 @@ public class ApplyGroundingStep extends AbstractPipelineValidationStep {
Set<InvocableStreamPipesEntity> allTargets,
List<PipelineElementValidationInfo> validationInfos) throws SpValidationException {
- List<MatchingResultMessage> errorLog = getNewErrorLog();
- boolean match = new GroundingMatch().match(
- getSourceGrounding(source),
- target.getSupportedGrounding(),
- errorLog
- );
-
- if (!match) {
- throw new SpValidationException(errorLog);
+ EventGrounding selectedGrounding;
+ if (!sourceGroundingVisitorMap.containsKey(source.getDom())) {
+ selectedGrounding = new GroundingBuilder(source, allTargets).getEventGrounding();
+ sourceGroundingVisitorMap.put(source.getDom(), selectedGrounding);
} else {
- EventGrounding selectedGrounding;
- if (!sourceGroundingVisitorMap.containsKey(source.getDom())) {
- selectedGrounding = new GroundingBuilder(source, allTargets).getEventGrounding();
- sourceGroundingVisitorMap.put(source.getDom(), selectedGrounding);
- } else {
- selectedGrounding = new EventGrounding(sourceGroundingVisitorMap.get(source.getDom()));
- }
+ selectedGrounding = new EventGrounding(sourceGroundingVisitorMap.get(source.getDom()));
+ }
- if (source instanceof DataProcessorInvocation) {
- ((DataProcessorInvocation) source)
- .getOutputStream()
- .setEventGrounding(selectedGrounding);
- }
+ if (source instanceof DataProcessorInvocation) {
+ ((DataProcessorInvocation) source)
+ .getOutputStream()
+ .setEventGrounding(selectedGrounding);
+ }
- if (!target.getInputStreams().isEmpty()) {
+ if (!target.getInputStreams().isEmpty()) {
- target
- .getInputStreams()
- .get(getIndex(target))
- .setEventGrounding(selectedGrounding);
+ target
+ .getInputStreams()
+ .get(getIndex(target))
+ .setEventGrounding(selectedGrounding);
- if (target.getInputStreams().size() > 1) {
- this.visitorHistory.put(target.getDom(), 1);
- }
+ if (target.getInputStreams().size() > 1) {
+ this.visitorHistory.put(target.getDom(), 1);
}
}
}
-
- private EventGrounding getSourceGrounding(NamedStreamPipesEntity source) {
- if (source instanceof SpDataStream) {
- return ((SpDataStream) source).getEventGrounding();
- } else {
- return ((DataProcessorInvocation) source).getOutputStream().getEventGrounding();
- }
- }
}
diff --git a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/recommender/ElementRecommender.java b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/recommender/ElementRecommender.java
index 2ae61035de..ff932dbc98 100644
--- a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/recommender/ElementRecommender.java
+++ b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/recommender/ElementRecommender.java
@@ -72,7 +72,6 @@ public class ElementRecommender {
private void validate(SpDataStream offer, List<ConsumableStreamPipesEntity> entities) {
for (ConsumableStreamPipesEntity sepa : entities) {
SpDataStream requirement = sepa.getSpDataStreams().get(0);
- requirement.setEventGrounding(sepa.getSupportedGrounding());
boolean matches = new StreamMatch().match(offer, requirement, new ArrayList<>());
if (matches) {
addPossibleElements(sepa);
diff --git a/streampipes-connect-management/src/main/java/org/apache/streampipes/connect/management/util/GroundingUtils.java b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/util/GroundingUtils.java
similarity index 57%
rename from streampipes-connect-management/src/main/java/org/apache/streampipes/connect/management/util/GroundingUtils.java
rename to streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/util/GroundingUtils.java
index 92870f490c..94b50e3401 100644
--- a/streampipes-connect-management/src/main/java/org/apache/streampipes/connect/management/util/GroundingUtils.java
+++ b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/util/GroundingUtils.java
@@ -16,11 +16,11 @@
*
*/
-package org.apache.streampipes.connect.management.util;
+package org.apache.streampipes.manager.util;
-import org.apache.streampipes.model.configuration.SpProtocol;
+import org.apache.streampipes.commons.environment.Environment;
+import org.apache.streampipes.commons.environment.Environments;
import org.apache.streampipes.model.grounding.EventGrounding;
-import org.apache.streampipes.model.grounding.JmsTransportProtocol;
import org.apache.streampipes.model.grounding.KafkaTransportProtocol;
import org.apache.streampipes.model.grounding.MqttTransportProtocol;
import org.apache.streampipes.model.grounding.NatsTransportProtocol;
@@ -36,61 +36,47 @@ public class GroundingUtils {
private static final String TOPIC_PREFIX = "org.apache.streampipes.connect.";
public static EventGrounding createEventGrounding() {
+ var env = Environments.getEnvironment();
EventGrounding eventGrounding = new EventGrounding();
- var messagingSettings = Utils
- .getCoreConfigStorage()
- .get()
- .getMessagingSettings();
-
String topic = TOPIC_PREFIX + UUID.randomUUID().toString();
- TopicDefinition topicDefinition = new SimpleTopicDefinition(topic);
-
- SpProtocol prioritizedProtocol =
- messagingSettings.getPrioritizedProtocols().get(0);
-
- if (isPrioritized(prioritizedProtocol, JmsTransportProtocol.class)) {
- eventGrounding.setTransportProtocol(
- makeJmsTransportProtocol(
- messagingSettings.getJmsHost(),
- messagingSettings.getJmsPort(),
- topicDefinition));
- } else if (isPrioritized(prioritizedProtocol, KafkaTransportProtocol.class)) {
- eventGrounding.setTransportProtocol(
- makeKafkaTransportProtocol(
- messagingSettings.getKafkaHost(),
- messagingSettings.getKafkaPort(),
- topicDefinition));
- } else if (isPrioritized(prioritizedProtocol, MqttTransportProtocol.class)) {
- eventGrounding.setTransportProtocol(
- makeMqttTransportProtocol(
- messagingSettings.getMqttHost(),
- messagingSettings.getMqttPort(),
- topicDefinition));
- } else if (isPrioritized(prioritizedProtocol, NatsTransportProtocol.class)) {
- eventGrounding.setTransportProtocol(
- makeNatsTransportProtocol(
- messagingSettings.getNatsHost(),
- messagingSettings.getNatsPort(),
- topicDefinition));
- } else if (isPrioritized(prioritizedProtocol, PulsarTransportProtocol.class)) {
- eventGrounding.setTransportProtocol(
- makePulsarTransportProtocol(
- messagingSettings.getPulsarUrl(),
- topicDefinition
- )
- );
- }
+
+ var prioritizedProtocol = env.getPrioritizedProtocol().getValueOrDefault();
+
+ eventGrounding.setTransportProtocol(makeProtocol(env, prioritizedProtocol, topic));
return eventGrounding;
}
- private static JmsTransportProtocol makeJmsTransportProtocol(String hostname, Integer port,
- TopicDefinition topicDefinition) {
- JmsTransportProtocol transportProtocol = new JmsTransportProtocol();
- transportProtocol.setPort(port);
- fillTransportProtocol(transportProtocol, hostname, topicDefinition);
-
- return transportProtocol;
+ public static TransportProtocol makeProtocol(Environment env,
+ String prioritizedProtocol,
+ String topic) {
+ var topicDefinition = new SimpleTopicDefinition(topic);
+ switch (prioritizedProtocol) {
+ case KafkaTransportProtocol.BROKER_ID -> {
+ return makeKafkaTransportProtocol(
+ env.getKafkaHost().getValueOrDefault(),
+ env.getKafkaPort().getValueOrDefault(),
+ topicDefinition);
+ }
+ case MqttTransportProtocol.BROKER_ID -> {
+ return makeMqttTransportProtocol(
+ env.getMqttHost().getValueOrDefault(),
+ env.getMqttPort().getValueOrDefault(),
+ topicDefinition);
+ }
+ case NatsTransportProtocol.BROKER_ID -> {
+ return makeNatsTransportProtocol(
+ env.getNatsHost().getValueOrDefault(),
+ env.getNatsPort().getValueOrDefault(),
+ topicDefinition);
+ }
+ case PulsarTransportProtocol.BROKER_ID -> {
+ return makePulsarTransportProtocol(
+ env.getPulsarUrl().getValueOrDefault(),
+ topicDefinition);
+ }
+ }
+ return null;
}
private static MqttTransportProtocol makeMqttTransportProtocol(String hostname, Integer port,
@@ -132,9 +118,4 @@ public class GroundingUtils {
protocol.setBrokerHostname(hostname);
protocol.setTopicDefinition(topicDefinition);
}
-
- public static Boolean isPrioritized(SpProtocol prioritizedProtocol,
- Class<?> protocolClass) {
- return prioritizedProtocol.getProtocolClass().equals(protocolClass.getCanonicalName());
- }
}
diff --git a/streampipes-pipeline-management/src/test/java/org/apache/streampipes/manager/matching/v2/TestGroundingMatch.java b/streampipes-pipeline-management/src/test/java/org/apache/streampipes/manager/matching/v2/TestGroundingMatch.java
deleted file mode 100644
index 2bc0553141..0000000000
--- a/streampipes-pipeline-management/src/test/java/org/apache/streampipes/manager/matching/v2/TestGroundingMatch.java
+++ /dev/null
@@ -1,78 +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.manager.matching.v2;
-
-import org.apache.streampipes.model.client.matching.MatchingResultMessage;
-import org.apache.streampipes.model.grounding.EventGrounding;
-import org.apache.streampipes.model.grounding.TransportProtocol;
-
-import org.junit.jupiter.api.Assertions;
-import org.junit.jupiter.api.Test;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class TestGroundingMatch {
-
- @Test
- public void testPositiveGroundingMatch() {
-
- TransportProtocol offerProtocol = TestUtils.kafkaProtocol();
- TransportProtocol requirementProtocol = TestUtils.kafkaProtocol();
-
- EventGrounding offeredGrounding = new EventGrounding(offerProtocol);
- EventGrounding requiredGrounding = new EventGrounding(requirementProtocol);
-
- List<MatchingResultMessage> errorLog = new ArrayList<>();
-
- boolean matches = new GroundingMatch().match(offeredGrounding, requiredGrounding, errorLog);
- Assertions.assertTrue(matches);
- }
-
- @Test
- public void testNegativeGroundingMatchProtocol() {
-
- TransportProtocol offerProtocol = TestUtils.kafkaProtocol();
- TransportProtocol requirementProtocol = TestUtils.jmsProtocol();
-
- EventGrounding offeredGrounding = new EventGrounding(offerProtocol);
- EventGrounding requiredGrounding = new EventGrounding(requirementProtocol);
-
- List<MatchingResultMessage> errorLog = new ArrayList<>();
-
- boolean matches = new GroundingMatch().match(offeredGrounding, requiredGrounding, errorLog);
- Assertions.assertFalse(matches);
- }
-
- @Test
- public void testNegativeGroundingMatchBoth() {
-
- TransportProtocol offerProtocol = TestUtils.kafkaProtocol();
- TransportProtocol requirementProtocol = TestUtils.jmsProtocol();
-
- EventGrounding offeredGrounding = new EventGrounding(offerProtocol);
- EventGrounding requiredGrounding = new EventGrounding(requirementProtocol);
-
- List<MatchingResultMessage> errorLog = new ArrayList<>();
-
- boolean matches = new GroundingMatch().match(offeredGrounding, requiredGrounding, errorLog);
- Assertions.assertFalse(matches);
- }
-
-}
diff --git a/streampipes-pipeline-management/src/test/java/org/apache/streampipes/manager/matching/v2/TestProtocolMatch.java b/streampipes-pipeline-management/src/test/java/org/apache/streampipes/manager/matching/v2/TestProtocolMatch.java
deleted file mode 100644
index 46fb04822b..0000000000
--- a/streampipes-pipeline-management/src/test/java/org/apache/streampipes/manager/matching/v2/TestProtocolMatch.java
+++ /dev/null
@@ -1,55 +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.manager.matching.v2;
-
-import org.apache.streampipes.model.client.matching.MatchingResultMessage;
-import org.apache.streampipes.model.grounding.TransportProtocol;
-
-import org.junit.jupiter.api.Assertions;
-import org.junit.jupiter.api.Test;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class TestProtocolMatch {
-
- @Test
- public void testPositiveProtocolMatch() {
-
- TransportProtocol offer = TestUtils.kafkaProtocol();
- TransportProtocol requirement = TestUtils.kafkaProtocol();
-
- List<MatchingResultMessage> errorLog = new ArrayList<>();
-
- boolean matches = new ProtocolMatch().match(offer, requirement, errorLog);
- Assertions.assertTrue(matches);
- }
-
- @Test
- public void testNegativeProtocolMatch() {
-
- TransportProtocol offer = TestUtils.kafkaProtocol();
- TransportProtocol requirement = TestUtils.jmsProtocol();
-
- List<MatchingResultMessage> errorLog = new ArrayList<>();
-
- boolean matches = new ProtocolMatch().match(offer, requirement, errorLog);
- Assertions.assertFalse(matches);
- }
-}
diff --git a/streampipes-pipeline-management/src/test/java/org/apache/streampipes/manager/matching/v2/TestUtils.java b/streampipes-pipeline-management/src/test/java/org/apache/streampipes/manager/matching/v2/TestUtils.java
deleted file mode 100644
index ddfee95cdc..0000000000
--- a/streampipes-pipeline-management/src/test/java/org/apache/streampipes/manager/matching/v2/TestUtils.java
+++ /dev/null
@@ -1,34 +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.manager.matching.v2;
-
-import org.apache.streampipes.model.grounding.JmsTransportProtocol;
-import org.apache.streampipes.model.grounding.KafkaTransportProtocol;
-import org.apache.streampipes.model.grounding.TransportProtocol;
-
-public class TestUtils {
-
- public static TransportProtocol kafkaProtocol() {
- return new KafkaTransportProtocol("localhost", 9092, "abc");
- }
-
- public static TransportProtocol jmsProtocol() {
- return new JmsTransportProtocol("localhost", 61616, "abc");
- }
-}
diff --git a/streampipes-rest-extensions/src/main/java/org/apache/streampipes/rest/extensions/AbstractPipelineElementResource.java b/streampipes-rest-extensions/src/main/java/org/apache/streampipes/rest/extensions/AbstractPipelineElementResource.java
index e14a778ba6..7ed606c056 100644
--- a/streampipes-rest-extensions/src/main/java/org/apache/streampipes/rest/extensions/AbstractPipelineElementResource.java
+++ b/streampipes-rest-extensions/src/main/java/org/apache/streampipes/rest/extensions/AbstractPipelineElementResource.java
@@ -23,12 +23,8 @@ import org.apache.streampipes.commons.media.ImageMimeTypeDetector;
import org.apache.streampipes.extensions.api.assets.AssetResolver;
import org.apache.streampipes.extensions.api.pe.IStreamPipesPipelineElement;
import org.apache.streampipes.extensions.management.assets.AssetZipGenerator;
-import org.apache.streampipes.extensions.management.init.DeclarersSingleton;
import org.apache.streampipes.extensions.management.locales.LabelGenerator;
-import org.apache.streampipes.model.base.ConsumableStreamPipesEntity;
import org.apache.streampipes.model.base.NamedStreamPipesEntity;
-import org.apache.streampipes.model.grounding.EventGrounding;
-import org.apache.streampipes.model.grounding.TransportProtocol;
import com.google.common.base.Charsets;
import org.apache.http.HttpStatus;
@@ -40,8 +36,6 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collection;
import java.util.List;
import java.util.Map;
@@ -133,28 +127,10 @@ public abstract class AbstractPipelineElementResource<
e.printStackTrace();
}
}
-
- if (desc instanceof ConsumableStreamPipesEntity) {
- Collection<TransportProtocol> supportedProtocols =
- DeclarersSingleton.getInstance().getSupportedProtocols();
-
- if (!supportedProtocols.isEmpty()) {
- // Overwrite existing grounding from default provided by declarers singleton
- ((ConsumableStreamPipesEntity) desc)
- .setSupportedGrounding(makeGrounding(supportedProtocols));
- }
- }
}
return desc;
}
- private EventGrounding makeGrounding(Collection<TransportProtocol> supportedProtocols) {
- EventGrounding grounding = new EventGrounding();
- grounding.setTransportProtocols(new ArrayList<>(supportedProtocols));
-
- return grounding;
- }
-
protected abstract Map<String, T> getElementDeclarers();
}
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/admin/MessagingConfigurationResource.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/admin/MessagingConfigurationResource.java
deleted file mode 100644
index 7dfe52e37c..0000000000
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/admin/MessagingConfigurationResource.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.streampipes.rest.impl.admin;
-
-import org.apache.streampipes.model.configuration.MessagingSettings;
-import org.apache.streampipes.rest.core.base.impl.AbstractAuthGuardedRestResource;
-import org.apache.streampipes.rest.security.AuthConstants;
-
-import org.springframework.http.MediaType;
-import org.springframework.http.ResponseEntity;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-@RestController
-@RequestMapping("/api/v2/messaging")
-public class MessagingConfigurationResource extends AbstractAuthGuardedRestResource {
-
- @GetMapping(produces = MediaType.APPLICATION_JSON_VALUE)
- @PreAuthorize(AuthConstants.IS_ADMIN_ROLE)
- public ResponseEntity<MessagingSettings> getMessagingSettings() {
- return ok(getSpCoreConfigurationStorage().get().getMessagingSettings());
- }
-
- @PostMapping(
- produces = MediaType.APPLICATION_JSON_VALUE,
- consumes = MediaType.APPLICATION_JSON_VALUE
- )
- @PreAuthorize(AuthConstants.IS_ADMIN_ROLE)
- public ResponseEntity<Void> updateMessagingSettings(@RequestBody MessagingSettings messagingSettings) {
- var cfg = getSpCoreConfigurationStorage().get();
- cfg.setMessagingSettings(messagingSettings);
- getSpCoreConfigurationStorage().updateElement(cfg);
- return ok();
- }
-}
diff --git a/streampipes-sdk-bundle/pom.xml b/streampipes-sdk-bundle/pom.xml
index c7a4807628..a5a9a3c638 100644
--- a/streampipes-sdk-bundle/pom.xml
+++ b/streampipes-sdk-bundle/pom.xml
@@ -42,11 +42,6 @@
<artifactId>streampipes-dataformat</artifactId>
<version>0.99.0-SNAPSHOT</version>
</dependency>
- <dependency>
- <groupId>org.apache.streampipes</groupId>
- <artifactId>streampipes-messaging-jms</artifactId>
- <version>0.99.0-SNAPSHOT</version>
- </dependency>
<dependency>
<groupId>org.apache.streampipes</groupId>
<artifactId>streampipes-messaging-kafka</artifactId>
diff --git a/streampipes-sdk/src/main/java/org/apache/streampipes/sdk/builder/AbstractProcessingElementBuilder.java b/streampipes-sdk/src/main/java/org/apache/streampipes/sdk/builder/AbstractProcessingElementBuilder.java
index 13d8870eba..cc32995b86 100644
--- a/streampipes-sdk/src/main/java/org/apache/streampipes/sdk/builder/AbstractProcessingElementBuilder.java
+++ b/streampipes-sdk/src/main/java/org/apache/streampipes/sdk/builder/AbstractProcessingElementBuilder.java
@@ -21,8 +21,6 @@ package org.apache.streampipes.sdk.builder;
import org.apache.streampipes.model.SpDataStream;
import org.apache.streampipes.model.base.ConsumableStreamPipesEntity;
import org.apache.streampipes.model.constants.PropertySelectorConstants;
-import org.apache.streampipes.model.grounding.EventGrounding;
-import org.apache.streampipes.model.grounding.TransportProtocol;
import org.apache.streampipes.model.schema.EventProperty;
import org.apache.streampipes.model.schema.EventSchema;
import org.apache.streampipes.model.schema.PropertyScope;
@@ -33,7 +31,6 @@ import org.apache.streampipes.sdk.helpers.CollectedStreamRequirements;
import org.apache.streampipes.sdk.helpers.Label;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.List;
public abstract class AbstractProcessingElementBuilder<K extends
@@ -45,8 +42,6 @@ public abstract class AbstractProcessingElementBuilder<K extends
protected List<EventProperty> stream1Properties;
protected List<EventProperty> stream2Properties;
- protected EventGrounding supportedGrounding;
-
protected boolean stream1 = false;
protected boolean stream2 = false;
@@ -56,7 +51,6 @@ public abstract class AbstractProcessingElementBuilder<K extends
this.streamRequirements = new ArrayList<>();
this.stream1Properties = new ArrayList<>();
this.stream2Properties = new ArrayList<>();
- this.supportedGrounding = new EventGrounding();
}
protected AbstractProcessingElementBuilder(String id, T element) {
@@ -64,7 +58,6 @@ public abstract class AbstractProcessingElementBuilder<K extends
this.streamRequirements = new ArrayList<>();
this.stream1Properties = new ArrayList<>();
this.stream2Properties = new ArrayList<>();
- this.supportedGrounding = new EventGrounding();
}
/**
@@ -140,34 +133,6 @@ public abstract class AbstractProcessingElementBuilder<K extends
return me();
}
- /**
- * Assigns supported communication/transport protocols to the pipeline elements that can be handled at runtime (e.g.,
- * Kafka or JMS).
- *
- * @param protocol An arbitrary number of supported
- * {@link org.apache.streampipes.model.grounding.TransportProtocol}s.
- * Use {@link org.apache.streampipes.sdk.helpers.SupportedProtocols} to assign protocols
- * from some pre-defined ones or create your own by following the developer guide.
- * @return this
- */
- public K supportedProtocols(TransportProtocol... protocol) {
- return supportedProtocols(Arrays.asList(protocol));
- }
-
- /**
- * Assigns supported communication/transport protocols to the pipeline elements that can be handled at runtime (e.g.,
- * Kafka or JMS).
- *
- * @param protocols A list of supported {@link org.apache.streampipes.model.grounding.TransportProtocol}s.
- * Use {@link org.apache.streampipes.sdk.helpers.SupportedProtocols} to assign protocols
- * from some pre-defined ones or create your own by following the developer guide.
- * @return this
- */
- public K supportedProtocols(List<TransportProtocol> protocols) {
- this.supportedGrounding.setTransportProtocols(protocols);
- return me();
- }
-
public K withVersion(int version) {
this.elementDescription.setVersion(version);
return me();
@@ -185,8 +150,6 @@ public abstract class AbstractProcessingElementBuilder<K extends
this.streamRequirements.add(buildStream(stream2Properties));
}
- this.elementDescription.setSupportedGrounding(supportedGrounding);
-
for (int i = 0; i < streamRequirements.size(); i++) {
streamRequirements.get(i).setIndex(i);
}
diff --git a/streampipes-sdk/src/main/java/org/apache/streampipes/sdk/helpers/Protocols.java b/streampipes-sdk/src/main/java/org/apache/streampipes/sdk/helpers/Protocols.java
index f20e15f40f..62020fb6f6 100644
--- a/streampipes-sdk/src/main/java/org/apache/streampipes/sdk/helpers/Protocols.java
+++ b/streampipes-sdk/src/main/java/org/apache/streampipes/sdk/helpers/Protocols.java
@@ -18,7 +18,6 @@
package org.apache.streampipes.sdk.helpers;
-import org.apache.streampipes.model.grounding.JmsTransportProtocol;
import org.apache.streampipes.model.grounding.KafkaTransportProtocol;
import org.apache.streampipes.model.grounding.MqttTransportProtocol;
import org.apache.streampipes.model.grounding.WildcardTopicDefinition;
@@ -55,19 +54,6 @@ public class Protocols {
}
- /**
- * Defines the transport protocol JMS used by a data stream at runtime.
- *
- * @param jmsHost The hostname of any JMS broker
- * @param jmsPort The port of any JMS broker
- * @param topic The topic identifier
- * @return The {@link org.apache.streampipes.model.grounding.JmsTransportProtocol} containing URL and topic where data
- * arrives.
- */
- public static JmsTransportProtocol jms(String jmsHost, Integer jmsPort, String topic) {
- return new JmsTransportProtocol(jmsHost, jmsPort, topic);
- }
-
/**
* Defines the transport protocol MQTT used by a data stream at runtime.
*
diff --git a/streampipes-sdk/src/main/java/org/apache/streampipes/sdk/helpers/SupportedProtocols.java b/streampipes-sdk/src/main/java/org/apache/streampipes/sdk/helpers/SupportedProtocols.java
deleted file mode 100644
index 9374742be8..0000000000
--- a/streampipes-sdk/src/main/java/org/apache/streampipes/sdk/helpers/SupportedProtocols.java
+++ /dev/null
@@ -1,62 +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.sdk.helpers;
-
-import org.apache.streampipes.model.grounding.JmsTransportProtocol;
-import org.apache.streampipes.model.grounding.KafkaTransportProtocol;
-import org.apache.streampipes.model.grounding.MqttTransportProtocol;
-import org.apache.streampipes.model.grounding.PulsarTransportProtocol;
-
-public class SupportedProtocols {
-
- /**
- * Defines that a pipeline element (data processor or data sink) supports processing messages arriving from a
- * Kafka broker.
- *
- * @return The {@link org.apache.streampipes.model.grounding.KafkaTransportProtocol}.
- */
- public static KafkaTransportProtocol kafka() {
- return new KafkaTransportProtocol();
- }
-
- /**
- * Defines that a pipeline element (data processor or data sink) supports processing messages arriving from a
- * JMS broker.
- *
- * @return The {@link org.apache.streampipes.model.grounding.JmsTransportProtocol}.
- */
- public static JmsTransportProtocol jms() {
- return new JmsTransportProtocol();
- }
-
- /**
- * Defines that a pipeline element (data processor or data sink) supports processing messages arriving from a
- * Mqtt broker.
- *
- * @return The {@link org.apache.streampipes.model.grounding.MqttTransportProtocol}.
- */
- public static MqttTransportProtocol mqtt() {
- return new MqttTransportProtocol();
- }
-
- public static PulsarTransportProtocol pulsar() {
- return new PulsarTransportProtocol();
- }
-
-}
diff --git a/streampipes-service-core-minimal/pom.xml b/streampipes-service-core-minimal/pom.xml
index 8529f0c0c5..15cf5a7fbf 100644
--- a/streampipes-service-core-minimal/pom.xml
+++ b/streampipes-service-core-minimal/pom.xml
@@ -38,10 +38,6 @@
<version>0.99.0-SNAPSHOT</version>
<classifier>embed</classifier>
<exclusions>
- <exclusion>
- <groupId>org.apache.streampipes</groupId>
- <artifactId>streampipes-messaging-jms</artifactId>
- </exclusion>
<exclusion>
<groupId>org.apache.streampipes</groupId>
<artifactId>streampipes-messaging-kafka</artifactId>
diff --git a/streampipes-service-core/pom.xml b/streampipes-service-core/pom.xml
index c508cc1b9f..caabf9b19d 100644
--- a/streampipes-service-core/pom.xml
+++ b/streampipes-service-core/pom.xml
@@ -63,11 +63,6 @@
<artifactId>streampipes-health-monitoring</artifactId>
<version>0.99.0-SNAPSHOT</version>
</dependency>
- <dependency>
- <groupId>org.apache.streampipes</groupId>
- <artifactId>streampipes-messaging-jms</artifactId>
- <version>0.99.0-SNAPSHOT</version>
- </dependency>
<dependency>
<groupId>org.apache.streampipes</groupId>
<artifactId>streampipes-messaging-mqtt</artifactId>
diff --git a/streampipes-service-core/src/main/java/org/apache/streampipes/service/core/StreamPipesCoreApplication.java b/streampipes-service-core/src/main/java/org/apache/streampipes/service/core/StreamPipesCoreApplication.java
index ed3859743f..d7029f2bcf 100644
--- a/streampipes-service-core/src/main/java/org/apache/streampipes/service/core/StreamPipesCoreApplication.java
+++ b/streampipes-service-core/src/main/java/org/apache/streampipes/service/core/StreamPipesCoreApplication.java
@@ -37,7 +37,6 @@ import org.apache.streampipes.manager.setup.AutoInstallation;
import org.apache.streampipes.manager.setup.StreamPipesEnvChecker;
import org.apache.streampipes.manager.setup.tasks.ApplyDefaultRolesAndPrivilegesTask;
import org.apache.streampipes.messaging.SpProtocolManager;
-import org.apache.streampipes.messaging.jms.SpJmsProtocolFactory;
import org.apache.streampipes.messaging.kafka.SpKafkaProtocolFactory;
import org.apache.streampipes.messaging.mqtt.SpMqttProtocolFactory;
import org.apache.streampipes.messaging.nats.SpNatsProtocolFactory;
@@ -102,9 +101,11 @@ public class StreamPipesCoreApplication extends StreamPipesServiceBase {
public static void main(String[] args) {
StreamPipesCoreApplication application = new StreamPipesCoreApplication();
- application.initialize(() -> List.of(new SpNatsProtocolFactory(), new SpKafkaProtocolFactory(),
- new SpMqttProtocolFactory(), new SpJmsProtocolFactory(),
- new SpPulsarProtocolFactory()),
+ application.initialize(() -> List.of(
+ new SpNatsProtocolFactory(),
+ new SpKafkaProtocolFactory(),
+ new SpMqttProtocolFactory(),
+ new SpPulsarProtocolFactory()),
List.of(
GroovyScriptEngine::new,
GraalJsScriptEngine::new
@@ -159,39 +160,39 @@ public class StreamPipesCoreApplication extends StreamPipesServiceBase {
coreStatusManager.updateCoreStatus(SpCoreConfigurationStatus.READY);
executorService.schedule(new PostStartupTask(getPipelineStorage()),
- env.getInitialHealthCheckDelayInMillis().getValueOrDefault(),
- TimeUnit.MILLISECONDS);
+ env.getInitialHealthCheckDelayInMillis().getValueOrDefault(),
+ TimeUnit.MILLISECONDS);
scheduleHealthChecks(env.getHealthCheckIntervalInMillis().getValueOrDefault(), List
.of(new ServiceHealthCheck(StorageDispatcher.INSTANCE.getNoSqlStore().getExtensionsServiceStorage()),
new ExtensionHealthCheck(
new ResourceProvider(
- StorageDispatcher.INSTANCE.getNoSqlStore().getPipelineStorageAPI(),
- StorageDispatcher.INSTANCE.getNoSqlStore().getAdapterInstanceStorage(),
- new AdapterMasterManagement(
- StorageDispatcher.INSTANCE.getNoSqlStore().getAdapterInstanceStorage(),
- new SpResourceManager().manageAdapters(),
- new SpResourceManager().manageDataStreams(),
- AdapterMetricsManager.INSTANCE.getAdapterMetrics()
- )
+ StorageDispatcher.INSTANCE.getNoSqlStore().getPipelineStorageAPI(),
+ StorageDispatcher.INSTANCE.getNoSqlStore().getAdapterInstanceStorage(),
+ new AdapterMasterManagement(
+ StorageDispatcher.INSTANCE.getNoSqlStore().getAdapterInstanceStorage(),
+ new SpResourceManager().manageAdapters(),
+ new SpResourceManager().manageDataStreams(),
+ AdapterMetricsManager.INSTANCE.getAdapterMetrics()
+ )
)
)));
var logFetchInterval = env.getLogFetchIntervalInMillis().getValueOrDefault();
LOG.info("Extensions logs will be fetched every {} milliseconds", logFetchInterval);
logCheckExecutorService.scheduleAtFixedRate(new ExtensionsServiceLogExecutor(),
- logFetchInterval, logFetchInterval,
- TimeUnit.MILLISECONDS);
+ logFetchInterval, logFetchInterval,
+ TimeUnit.MILLISECONDS);
}
private void scheduleHealthChecks(int healthCheckIntervalInMillis, List<Runnable> checks) {
var healthCheckExecutorService = Executors.newSingleThreadScheduledExecutor();
checks.forEach(check -> {
LOG.info("Health check {} configured to run every {} {}", check.getClass().getCanonicalName(),
- healthCheckIntervalInMillis, TimeUnit.MILLISECONDS);
+ healthCheckIntervalInMillis, TimeUnit.MILLISECONDS);
healthCheckExecutorService.scheduleAtFixedRate(check, healthCheckIntervalInMillis,
- healthCheckIntervalInMillis,
- TimeUnit.MILLISECONDS);
+ healthCheckIntervalInMillis,
+ TimeUnit.MILLISECONDS);
});
}
@@ -207,7 +208,7 @@ public class StreamPipesCoreApplication extends StreamPipesServiceBase {
LOG.info("\n\n**********\n\nWelcome to Apache StreamPipes!\n\n**********\n\n");
LOG.info("We will perform the initial setup, grab some coffee and cross your fingers ;-)...");
LOG.info("Auto-setup will start in {} milliseconds to make sure all services are running...",
- initialSleepBeforeInstallation);
+ initialSleepBeforeInstallation);
try {
TimeUnit.MILLISECONDS.sleep(initialSleepBeforeInstallation);
LOG.info("Starting installation procedure");
diff --git a/streampipes-test-utils/src/main/java/org/apache/streampipes/test/generator/InvocationGraphGenerator.java b/streampipes-test-utils/src/main/java/org/apache/streampipes/test/generator/InvocationGraphGenerator.java
index 35827dcfd6..a609790826 100644
--- a/streampipes-test-utils/src/main/java/org/apache/streampipes/test/generator/InvocationGraphGenerator.java
+++ b/streampipes-test-utils/src/main/java/org/apache/streampipes/test/generator/InvocationGraphGenerator.java
@@ -19,7 +19,6 @@ package org.apache.streampipes.test.generator;
import org.apache.streampipes.model.graph.DataProcessorDescription;
import org.apache.streampipes.model.graph.DataProcessorInvocation;
-import org.apache.streampipes.test.generator.grounding.EventGroundingGenerator;
import java.util.Arrays;
import java.util.List;
@@ -29,7 +28,6 @@ public class InvocationGraphGenerator {
public static DataProcessorInvocation makeEmptyInvocation(DataProcessorDescription description) {
DataProcessorInvocation invocation = new DataProcessorInvocation(description);
- invocation.setSupportedGrounding(EventGroundingGenerator.makeDummyGrounding());
invocation.setOutputStream(EventStreamGenerator.makeEmptyStream());
invocation.setInputStreams(Arrays.asList(EventStreamGenerator.makeEmptyStream()));
diff --git a/streampipes-wrapper-distributed/src/main/java/org/apache/streampipes/wrapper/distributed/runtime/DistributedRuntime.java b/streampipes-wrapper-distributed/src/main/java/org/apache/streampipes/wrapper/distributed/runtime/DistributedRuntime.java
index 1dcaeff0b7..bb80f352ac 100644
--- a/streampipes-wrapper-distributed/src/main/java/org/apache/streampipes/wrapper/distributed/runtime/DistributedRuntime.java
+++ b/streampipes-wrapper-distributed/src/main/java/org/apache/streampipes/wrapper/distributed/runtime/DistributedRuntime.java
@@ -30,7 +30,6 @@ import org.apache.streampipes.messaging.kafka.config.ConsumerConfigFactory;
import org.apache.streampipes.messaging.kafka.config.ProducerConfigFactory;
import org.apache.streampipes.model.SpDataStream;
import org.apache.streampipes.model.base.InvocableStreamPipesEntity;
-import org.apache.streampipes.model.grounding.JmsTransportProtocol;
import org.apache.streampipes.model.grounding.KafkaTransportProtocol;
import org.apache.streampipes.model.grounding.MqttTransportProtocol;
import org.apache.streampipes.model.grounding.TransportProtocol;
@@ -70,10 +69,6 @@ public abstract class DistributedRuntime<
.getActualTopicName();
}
- protected JmsTransportProtocol getJmsProtocol(SpDataStream stream) {
- return new JmsTransportProtocol((JmsTransportProtocol) protocol(stream));
- }
-
protected MqttTransportProtocol getMqttProtocol(SpDataStream stream) {
return new MqttTransportProtocol((MqttTransportProtocol) protocol(stream));
}
@@ -82,10 +77,6 @@ public abstract class DistributedRuntime<
return protocol(stream) instanceof KafkaTransportProtocol;
}
- protected boolean isJmsProtocol(SpDataStream stream) {
- return protocol(stream) instanceof JmsTransportProtocol;
- }
-
protected boolean isMqttProtocol(SpDataStream stream) {
return protocol(stream) instanceof MqttTransportProtocol;
}
diff --git a/ui/src/app/configuration/configuration-sections.providers.ts b/ui/src/app/configuration/configuration-sections.providers.ts
index bb7a387ab4..d446ed9070 100644
--- a/ui/src/app/configuration/configuration-sections.providers.ts
+++ b/ui/src/app/configuration/configuration-sections.providers.ts
@@ -91,16 +91,6 @@ const CORE_CONFIGURATION_SECTIONS: SpConfigurationSection[] = [
),
order: 700,
},
- {
- itemId: 'messaging',
- itemTitle: 'Messaging',
- roles: ['ROLE_ADMIN'],
- loadComponent: () =>
- import('./messaging-configuration/messaging-configuration.component').then(
- m => m.MessagingConfigurationComponent,
- ),
- order: 800,
- },
{
itemId: 'security',
itemTitle: 'Security',
diff --git a/ui/src/app/configuration/messaging-configuration/broker-config/broker-config.component.html b/ui/src/app/configuration/messaging-configuration/broker-config/broker-config.component.html
deleted file mode 100644
index 662df050c3..0000000000
--- a/ui/src/app/configuration/messaging-configuration/broker-config/broker-config.component.html
+++ /dev/null
@@ -1,44 +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.
- ~
- -->
-
-<div fxFlex="100" fxLayout="column">
- <sp-form-field [level]="2" [label]="title">
- <div fxLayout="row" fxLayoutGap="15px" fxFlex="100">
- <sp-form-field [level]="3" [label]="'Host' | translate" fxFlex="50">
- <mat-form-field fxFlex="100">
- <input
- matInput
- [(ngModel)]="host"
- (ngModelChange)="hostChange.emit($event)"
- type="text"
- />
- </mat-form-field>
- </sp-form-field>
- <sp-form-field [level]="3" [label]="'Port' | translate" fxFlex="50">
- <mat-form-field class="form-field" fxFlex="100" color="accent">
- <input
- matInput
- [(ngModel)]="port"
- (ngModelChange)="portChange.emit($event)"
- type="number"
- />
- </mat-form-field>
- </sp-form-field>
- </div>
- </sp-form-field>
-</div>
diff --git a/ui/src/app/configuration/messaging-configuration/broker-config/broker-config.component.ts b/ui/src/app/configuration/messaging-configuration/broker-config/broker-config.component.ts
deleted file mode 100644
index 2703baa7b5..0000000000
--- a/ui/src/app/configuration/messaging-configuration/broker-config/broker-config.component.ts
+++ /dev/null
@@ -1,60 +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.
- *
- */
-
-import { Component, EventEmitter, Input, Output } from '@angular/core';
-import {
- FlexDirective,
- LayoutDirective,
- LayoutGapDirective,
-} from '@ngbracket/ngx-layout/flex';
-import { FormFieldComponent } from '@streampipes/shared-ui';
-import { MatFormField } from '@angular/material/form-field';
-import { MatInput } from '@angular/material/input';
-import { FormsModule } from '@angular/forms';
-import { TranslatePipe } from '@ngx-translate/core';
-
-@Component({
- selector: 'sp-messaging-broker-config',
- templateUrl: './broker-config.component.html',
- imports: [
- FlexDirective,
- LayoutDirective,
- FormFieldComponent,
- LayoutGapDirective,
- MatFormField,
- MatInput,
- FormsModule,
- TranslatePipe,
- ],
-})
-export class SpMessagingBrokerConfigComponent {
- @Input()
- title: string;
-
- @Input()
- host: string;
-
- @Input()
- port: number;
-
- @Output()
- hostChange = new EventEmitter<string>();
-
- @Output()
- portChange = new EventEmitter<number>();
-}
diff --git a/ui/src/app/configuration/messaging-configuration/messaging-configuration.component.html b/ui/src/app/configuration/messaging-configuration/messaging-configuration.component.html
deleted file mode 100644
index ea297ac269..0000000000
--- a/ui/src/app/configuration/messaging-configuration/messaging-configuration.component.html
+++ /dev/null
@@ -1,200 +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.
-~
--->
-
-<sp-basic-nav-tabs [spNavigationItems]="tabs" [activeLink]="'messaging'">
- <div fxLayout="column" class="page-container-padding-inner">
- <sp-split-section
- [title]="'Kafka Settings' | translate"
- [subtitle]="
- 'Manage Kafka settings for pipeline communication' | translate
- "
- >
- <div fxFlex="100" fxLayout="column" fxLayoutAlign="start start">
- @if (loadingCompleted) {
- <form
- (ngSubmit)="updateMessagingSettings()"
- class="w-100"
- fxFlex="100"
- fxLayout="column"
- >
- <sp-form-field [level]="2" [label]="'Batch Size'">
- <mat-form-field class="form-field" fxFlex="100">
- <input
- matInput
- [(ngModel)]="messagingSettings.batchSize"
- [placeholder]="'Batch Size'"
- type="text"
- [ngModelOptions]="{ standalone: true }"
- />
- </mat-form-field>
- </sp-form-field>
- <sp-form-field
- [level]="2"
- [label]="'Message Max Bytes'"
- >
- <mat-form-field class="form-field" fxFlex="100">
- <input
- matInput
- [(ngModel)]="
- messagingSettings.messageMaxBytes
- "
- [placeholder]="'Message Max Bytes'"
- type="text"
- [ngModelOptions]="{ standalone: true }"
- />
- </mat-form-field>
- </sp-form-field>
- <sp-form-field [level]="2" [label]="'Acks'">
- <mat-form-field fxFlex="100">
- <input
- matInput
- [(ngModel)]="messagingSettings.acks"
- [placeholder]="'Acks'"
- type="text"
- [ngModelOptions]="{ standalone: true }"
- />
- </mat-form-field>
- </sp-form-field>
- <sp-form-field [level]="2" [label]="'Linger MS'">
- <mat-form-field fxFlex="100">
- <input
- matInput
- [(ngModel)]="messagingSettings.lingerMs"
- [placeholder]="'Linger MS'"
- type="text"
- [ngModelOptions]="{ standalone: true }"
- />
- </mat-form-field>
- </sp-form-field>
- <div fxLayoutAlign="start center">
- <button
- mat-flat-button
- color="accent"
- type="submit"
- class="md-raised md-primary submit-button"
- >
- <mat-icon>save</mat-icon>
- <span>{{ 'Save' | translate }}</span>
- </button>
- </div>
- </form>
- }
- </div>
- </sp-split-section>
-
- <sp-split-section
- [title]="'Protocols' | translate"
- [subtitle]="'Manage the priority of protocols used' | translate"
- >
- <sp-alert-banner
- type="info"
- [title]="'Restart required' | translate"
- [description]="
- 'Changing the broker priority does not take effect immediately and requires a restart. Use this feature with caution.'
- | translate
- "
- >
- </sp-alert-banner>
- <div fxFlex="100" fxLayout="column" fxLayoutAlign="start start">
- @if (loadingCompleted) {
- <div
- cdkDropList
- class="data-format-list text-sm w-100"
- (cdkDropListDropped)="dropProtocol($event)"
- >
- @for (
- protocol of messagingSettings.prioritizedProtocols;
- track protocol
- ) {
- <div class="data-format-box" cdkDrag>
- {{ protocol }}
- </div>
- }
- </div>
- }
- <div fxLayoutAlign="start center" class="mt-md">
- <button
- mat-flat-button
- color="accent"
- type="submit"
- class="md-raised md-primary submit-button"
- (click)="updateMessagingSettings()"
- >
- <mat-icon>save</mat-icon>
- <span>{{ 'Save' | translate }}</span>
- </button>
- </div>
- </div>
- </sp-split-section>
-
- @if (loadingCompleted) {
- <sp-split-section
- [title]="'Broker Configuration' | translate"
- [subtitle]="'Manage broker connectivity' | translate"
- >
- <sp-messaging-broker-config
- title="JMS"
- [(host)]="messagingSettings.jmsHost"
- [(port)]="messagingSettings.jmsPort"
- ></sp-messaging-broker-config>
- <sp-messaging-broker-config
- title="Kafka"
- [(host)]="messagingSettings.kafkaHost"
- [(port)]="messagingSettings.kafkaPort"
- ></sp-messaging-broker-config>
- <sp-messaging-broker-config
- title="MQTT"
- [(host)]="messagingSettings.mqttHost"
- [(port)]="messagingSettings.mqttPort"
- ></sp-messaging-broker-config>
- <sp-messaging-broker-config
- title="Nats"
- [(host)]="messagingSettings.natsHost"
- [(port)]="messagingSettings.natsPort"
- ></sp-messaging-broker-config>
- <div fxLayout="column">
- <div class="subsection-title">Pulsar</div>
- <mat-form-field
- class="form-field"
- fxFlex="100"
- color="accent"
- >
- <mat-label>URL</mat-label>
- <input
- matInput
- [(ngModel)]="messagingSettings.pulsarUrl"
- type="text"
- />
- </mat-form-field>
- </div>
- <div fxLayoutAlign="start center" class="mt-lg">
- <button
- mat-flat-button
- color="accent"
- type="submit"
- class="md-raised md-primary submit-button"
- (click)="updateMessagingSettings()"
- >
- <mat-icon>save</mat-icon>
- <span>{{ 'Save' | translate }}</span>
- </button>
- </div>
- </sp-split-section>
- }
- </div>
-</sp-basic-nav-tabs>
diff --git a/ui/src/app/configuration/messaging-configuration/messaging-configuration.component.scss b/ui/src/app/configuration/messaging-configuration/messaging-configuration.component.scss
deleted file mode 100644
index 2d56b560e2..0000000000
--- a/ui/src/app/configuration/messaging-configuration/messaging-configuration.component.scss
+++ /dev/null
@@ -1,70 +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.
- *
- */
-
-.form-width {
- width: 80%;
-}
-
-.data-format-list {
- max-width: 100%;
- border: solid 1px var(--color-bg-3);
- min-height: 60px;
- display: block;
- background: var(--color-bg-dialog);
- border-radius: 4px;
- overflow: hidden;
-}
-
-.data-format-box {
- padding: 1rem 0.5rem;
- border-bottom: solid 1px var(--color-bg-3);
- color: var(--color-default-text);
- display: flex;
- flex-direction: row;
- align-items: center;
- justify-content: space-between;
- box-sizing: border-box;
- cursor: move;
- background: var(--color-bg-dialog);
-}
-
-.cdk-drag-preview {
- box-sizing: border-box;
- border-radius: 4px;
- box-shadow:
- 0 5px 5px -3px rgba(0, 0, 0, 0.2),
- 0 8px 10px 1px rgba(0, 0, 0, 0.14),
- 0 3px 14px 2px rgba(0, 0, 0, 0.12);
-}
-
-.cdk-drag-placeholder {
- opacity: 0;
-}
-
-.cdk-drag-animating {
- transition: transform 250ms cubic-bezier(0, 0, 0.2, 1);
-}
-
-.data-format-box:last-child {
- border: none;
-}
-
-.data-format-list.cdk-drop-list-dragging
- .data-format-box:not(.cdk-drag-placeholder) {
- transition: transform 250ms cubic-bezier(0, 0, 0.2, 1);
-}
diff --git a/ui/src/app/configuration/messaging-configuration/messaging-configuration.component.ts b/ui/src/app/configuration/messaging-configuration/messaging-configuration.component.ts
deleted file mode 100644
index a94d4c8204..0000000000
--- a/ui/src/app/configuration/messaging-configuration/messaging-configuration.component.ts
+++ /dev/null
@@ -1,116 +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.
- *
- */
-
-import { Component, OnInit } from '@angular/core';
-import { ConfigurationService } from '../shared/configuration.service';
-import {
- CdkDrag,
- CdkDragDrop,
- CdkDropList,
- moveItemInArray,
-} from '@angular/cdk/drag-drop';
-import { SpConfigurationTabsService } from '../configuration-tabs.service';
-import {
- FormFieldComponent,
- SpAlertBannerComponent,
- SpBasicNavTabsComponent,
- SpBreadcrumbService,
- SplitSectionComponent,
- SpNavigationItem,
-} from '@streampipes/shared-ui';
-import { SpConfigurationRoutes } from '../configuration.breadcrumb';
-import { MessagingSettings } from '@streampipes/platform-services';
-import {
- FlexDirective,
- LayoutAlignDirective,
- LayoutDirective,
-} from '@ngbracket/ngx-layout/flex';
-import { FormsModule } from '@angular/forms';
-import { MatFormField, MatLabel } from '@angular/material/form-field';
-import { MatInput } from '@angular/material/input';
-import { MatButton } from '@angular/material/button';
-import { MatIcon } from '@angular/material/icon';
-import { SpMessagingBrokerConfigComponent } from './broker-config/broker-config.component';
-import { TranslatePipe } from '@ngx-translate/core';
-
-@Component({
- selector: 'sp-messaging-configuration',
- templateUrl: './messaging-configuration.component.html',
- styleUrls: ['./messaging-configuration.component.scss'],
- imports: [
- SpBasicNavTabsComponent,
- LayoutDirective,
- SplitSectionComponent,
- FlexDirective,
- LayoutAlignDirective,
- FormsModule,
- FormFieldComponent,
- MatFormField,
- MatInput,
- MatButton,
- MatIcon,
- SpAlertBannerComponent,
- CdkDropList,
- CdkDrag,
- SpMessagingBrokerConfigComponent,
- MatLabel,
- TranslatePipe,
- ],
-})
-export class MessagingConfigurationComponent implements OnInit {
- tabs: SpNavigationItem[] = [];
-
- messagingSettings: MessagingSettings;
- loadingCompleted = false;
-
- constructor(
- private configurationService: ConfigurationService,
- private breadcrumbService: SpBreadcrumbService,
- private tabService: SpConfigurationTabsService,
- ) {}
-
- ngOnInit() {
- this.tabs = this.tabService.getTabs();
- this.breadcrumbService.updateBreadcrumb([
- SpConfigurationRoutes.BASE,
- { label: this.tabService.getTabTitle('messaging') },
- ]);
- this.getMessagingSettings();
- }
-
- getMessagingSettings() {
- this.configurationService.getMessagingSettings().subscribe(response => {
- this.messagingSettings = response;
- this.loadingCompleted = true;
- });
- }
-
- updateMessagingSettings() {
- this.configurationService
- .updateMessagingSettings(this.messagingSettings)
- .subscribe(response => this.getMessagingSettings());
- }
-
- dropProtocol(event: CdkDragDrop<string[]>) {
- moveItemInArray(
- this.messagingSettings.prioritizedProtocols,
- event.previousIndex,
- event.currentIndex,
- );
- }
-}