This is an automated email from the ASF dual-hosted git repository.
riemer pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-streampipes.git
The following commit(s) were added to refs/heads/dev by this push:
new e6e858e Remove examples as they've been moved to a separate repo
e6e858e is described below
commit e6e858e968ef9475b90c13764fa3e44675f6d07a
Author: Dominik Riemer <[email protected]>
AuthorDate: Sat Dec 28 10:53:54 2019 +0100
Remove examples as they've been moved to a separate repo
---
.../pom.xml | 79 ----------------
.../streampipes/pe/examples/jvm/ExamplesInit.java | 77 ----------------
.../pe/examples/jvm/base/DummyController.java | 41 ---------
.../pe/examples/jvm/base/DummyEngine.java | 43 ---------
.../pe/examples/jvm/base/DummyParameters.java | 28 ------
.../pe/examples/jvm/config/ConfigKeys.java | 27 ------
.../pe/examples/jvm/config/ExamplesJvmConfig.java | 87 ------------------
.../examples/jvm/engine/ExampleExternalEngine.java | 41 ---------
.../engine/ExampleExternalEngineController.java | 50 ----------
.../engine/ExampleExternalEngineParameters.java | 28 ------
.../jvm/eventmodel/EventModelExamples.java | 72 ---------------
.../jvm/outputstrategy/AppendOutputController.java | 62 -------------
.../jvm/outputstrategy/CustomOutputController.java | 61 -------------
.../CustomTransformOutputController.java | 76 ----------------
.../jvm/outputstrategy/FixedOutputController.java | 61 -------------
.../jvm/outputstrategy/KeepOutputController.java | 58 ------------
.../outputstrategy/TransformOutputController.java | 67 --------------
.../requirements/ListRequirementsController.java | 60 ------------
.../requirements/NestedRequirementsController.java | 21 -----
.../SimpleStreamRequirementsController.java | 66 --------------
.../CollectionExampleController.java | 69 --------------
.../MultiValueSelectionExampleController.java | 69 --------------
.../NaryMappingPropertyExampleController.java | 66 --------------
.../NumberParameterExampleController.java | 74 ---------------
.../NumberParameterWithRangeExampleController.java | 69 --------------
.../RuntimeResolvableSingleValue.java | 101 ---------------------
.../SecretStaticPropertyExampleController.java | 68 --------------
.../SingleValueSelectionExampleController.java | 68 --------------
.../StaticPropertyAlternativesController.java | 82 -----------------
.../TextParameterExampleController.java | 67 --------------
.../UnaryMappingPropertyExampleController.java | 64 -------------
31 files changed, 1902 deletions(-)
diff --git a/streampipes-pipeline-elements-examples-processors-jvm/pom.xml
b/streampipes-pipeline-elements-examples-processors-jvm/pom.xml
deleted file mode 100644
index 1f2d908..0000000
--- a/streampipes-pipeline-elements-examples-processors-jvm/pom.xml
+++ /dev/null
@@ -1,79 +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>
- <artifactId>streampipes-pipeline-elements-examples</artifactId>
- <groupId>org.apache.streampipes</groupId>
- <version>0.65.1-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
-
-
<artifactId>streampipes-pipeline-elements-examples-processors-jvm</artifactId>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.streampipes</groupId>
- <artifactId>streampipes-wrapper-standalone</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.streampipes</groupId>
- <artifactId>streampipes-sdk</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.streampipes</groupId>
- <artifactId>streampipes-container-standalone</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.streampipes</groupId>
- <artifactId>streampipes-config</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.streampipes</groupId>
- <artifactId>streampipes-dataformat-json</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.streampipes</groupId>
- <artifactId>streampipes-messaging-kafka</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.streampipes</groupId>
- <artifactId>streampipes-messaging-jms</artifactId>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-maven-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>repackage</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- <finalName>streampipes-processors-examples-jvm</finalName>
- </build>
-</project>
\ No newline at end of file
diff --git
a/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/ExamplesInit.java
b/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/ExamplesInit.java
deleted file mode 100644
index 8fb9487..0000000
---
a/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/ExamplesInit.java
+++ /dev/null
@@ -1,77 +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.pe.examples.jvm;
-
-import org.apache.streampipes.container.init.DeclarersSingleton;
-import
org.apache.streampipes.container.standalone.init.StandaloneModelSubmitter;
-import org.apache.streampipes.dataformat.json.JsonDataFormatFactory;
-import org.apache.streampipes.messaging.jms.SpJmsProtocolFactory;
-import org.apache.streampipes.messaging.kafka.SpKafkaProtocolFactory;
-import org.apache.streampipes.pe.examples.jvm.config.ExamplesJvmConfig;
-import
org.apache.streampipes.pe.examples.jvm.engine.ExampleExternalEngineController;
-import
org.apache.streampipes.pe.examples.jvm.outputstrategy.AppendOutputController;
-import
org.apache.streampipes.pe.examples.jvm.outputstrategy.CustomOutputController;
-import
org.apache.streampipes.pe.examples.jvm.outputstrategy.CustomTransformOutputController;
-import
org.apache.streampipes.pe.examples.jvm.outputstrategy.FixedOutputController;
-import
org.apache.streampipes.pe.examples.jvm.outputstrategy.KeepOutputController;
-import
org.apache.streampipes.pe.examples.jvm.outputstrategy.TransformOutputController;
-import
org.apache.streampipes.pe.examples.jvm.staticproperty.CollectionExampleController;
-import
org.apache.streampipes.pe.examples.jvm.staticproperty.MultiValueSelectionExampleController;
-import
org.apache.streampipes.pe.examples.jvm.staticproperty.NaryMappingPropertyExampleController;
-import
org.apache.streampipes.pe.examples.jvm.staticproperty.NumberParameterExampleController;
-import
org.apache.streampipes.pe.examples.jvm.staticproperty.NumberParameterWithRangeExampleController;
-import
org.apache.streampipes.pe.examples.jvm.staticproperty.RuntimeResolvableSingleValue;
-import
org.apache.streampipes.pe.examples.jvm.staticproperty.SecretStaticPropertyExampleController;
-import
org.apache.streampipes.pe.examples.jvm.staticproperty.SingleValueSelectionExampleController;
-import
org.apache.streampipes.pe.examples.jvm.staticproperty.StaticPropertyAlternativesController;
-import
org.apache.streampipes.pe.examples.jvm.staticproperty.TextParameterExampleController;
-import
org.apache.streampipes.pe.examples.jvm.staticproperty.UnaryMappingPropertyExampleController;
-
-public class ExamplesInit extends StandaloneModelSubmitter {
-
- public static void main(String[] args) {
- DeclarersSingleton
- .getInstance()
- .add(new TextParameterExampleController())
- .add(new NumberParameterExampleController())
- .add(new NumberParameterWithRangeExampleController())
- .add(new UnaryMappingPropertyExampleController())
- .add(new NaryMappingPropertyExampleController())
- .add(new SingleValueSelectionExampleController())
- .add(new MultiValueSelectionExampleController())
- .add(new CollectionExampleController())
- .add(new RuntimeResolvableSingleValue())
- .add(new StaticPropertyAlternativesController())
- .add(new SecretStaticPropertyExampleController())
-
- .add(new AppendOutputController())
- .add(new CustomOutputController())
- .add(new FixedOutputController())
- .add(new CustomTransformOutputController())
- .add(new TransformOutputController())
- .add(new KeepOutputController())
-
- .add(new ExampleExternalEngineController());
-
- DeclarersSingleton.getInstance().registerDataFormat(new
JsonDataFormatFactory());
- DeclarersSingleton.getInstance().registerProtocol(new
SpKafkaProtocolFactory());
- DeclarersSingleton.getInstance().registerProtocol(new
SpJmsProtocolFactory());
-
- new ExamplesInit().init(ExamplesJvmConfig.INSTANCE);
- }
-}
diff --git
a/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/base/DummyController.java
b/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/base/DummyController.java
deleted file mode 100644
index 9dda049..0000000
---
a/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/base/DummyController.java
+++ /dev/null
@@ -1,41 +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.pe.examples.jvm.base;
-
-import org.apache.streampipes.model.graph.DataProcessorDescription;
-import org.apache.streampipes.model.graph.DataProcessorInvocation;
-import
org.apache.streampipes.sdk.extractor.ProcessingElementParameterExtractor;
-import
org.apache.streampipes.wrapper.params.binding.EventProcessorBindingParams;
-import org.apache.streampipes.wrapper.standalone.ConfiguredEventProcessor;
-import
org.apache.streampipes.wrapper.standalone.declarer.StandaloneEventProcessingDeclarer;
-
-public class DummyController<B extends EventProcessorBindingParams> extends
- StandaloneEventProcessingDeclarer<B> {
-
- @Override
- public DataProcessorDescription declareModel() {
- return null;
- }
-
- @Override
- public ConfiguredEventProcessor<B> onInvocation(DataProcessorInvocation
graph, ProcessingElementParameterExtractor extractor) {
- return null;
- }
-
-
-}
diff --git
a/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/base/DummyEngine.java
b/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/base/DummyEngine.java
deleted file mode 100644
index cfe579f..0000000
---
a/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/base/DummyEngine.java
+++ /dev/null
@@ -1,43 +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.pe.examples.jvm.base;
-
-import org.apache.streampipes.commons.exceptions.SpRuntimeException;
-import org.apache.streampipes.model.runtime.Event;
-import org.apache.streampipes.wrapper.context.EventProcessorRuntimeContext;
-import org.apache.streampipes.wrapper.routing.SpOutputCollector;
-import org.apache.streampipes.wrapper.runtime.EventProcessor;
-
-public class DummyEngine implements EventProcessor<DummyParameters> {
-
- @Override
- public void onInvocation(DummyParameters parameters, SpOutputCollector
spOutputCollector,
- EventProcessorRuntimeContext runtimeContext) throws
SpRuntimeException {
-
- }
-
- @Override
- public void onEvent(Event event, SpOutputCollector collector) throws
SpRuntimeException {
-
- }
-
- @Override
- public void onDetach() throws SpRuntimeException {
-
- }
-}
diff --git
a/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/base/DummyParameters.java
b/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/base/DummyParameters.java
deleted file mode 100644
index cbba25e..0000000
---
a/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/base/DummyParameters.java
+++ /dev/null
@@ -1,28 +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.pe.examples.jvm.base;
-
-import org.apache.streampipes.model.graph.DataProcessorInvocation;
-import
org.apache.streampipes.wrapper.params.binding.EventProcessorBindingParams;
-
-public class DummyParameters extends EventProcessorBindingParams {
-
- public DummyParameters(DataProcessorInvocation graph) {
- super(graph);
- }
-}
diff --git
a/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/config/ConfigKeys.java
b/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/config/ConfigKeys.java
deleted file mode 100644
index 612ff00..0000000
---
a/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/config/ConfigKeys.java
+++ /dev/null
@@ -1,27 +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.pe.examples.jvm.config;
-
-public class ConfigKeys {
- final static String HOST = "SP_HOST";
- final static String PORT = "SP_PORT";
- final static String ICON_HOST = "SP_ICON_HOST";
- final static String ICON_PORT = "SP_ICON_PORT";
- final static String SERVICE_NAME_KEY = "SP_SERVICE_NAME";
-}
diff --git
a/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/config/ExamplesJvmConfig.java
b/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/config/ExamplesJvmConfig.java
deleted file mode 100644
index 345c777..0000000
---
a/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/config/ExamplesJvmConfig.java
+++ /dev/null
@@ -1,87 +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.pe.examples.jvm.config;
-
-
-import org.apache.streampipes.config.SpConfig;
-import org.apache.streampipes.container.model.PeConfig;
-
-public enum ExamplesJvmConfig implements PeConfig {
- INSTANCE;
-
- private SpConfig config;
-
- public final static String serverUrl;
- public final static String iconBaseUrl;
-
- private final static String service_id =
"pe/org.apache.streampipes.processors.examples.jvm";
- private final static String service_name = "Processors Examples JVM";
- private final static String service_container_name =
"processors-examples-jvm";
-
- ExamplesJvmConfig() {
- config = SpConfig.getSpConfig(service_id);
- config.register(ConfigKeys.HOST, service_container_name, "Hostname for the
pe esper");
- config.register(ConfigKeys.PORT, 8090, "Port for the pe esper");
-
- config.register(ConfigKeys.ICON_HOST, "backend", "Hostname for the icon
host");
- config.register(ConfigKeys.ICON_PORT, 80, "Port for the icons in nginx");
-
- config.register(ConfigKeys.SERVICE_NAME_KEY, service_name, "The name of
the service");
-
- }
-
- static {
- serverUrl = ExamplesJvmConfig.INSTANCE.getHost() + ":" +
ExamplesJvmConfig.INSTANCE.getPort();
- iconBaseUrl = "http://" + ExamplesJvmConfig.INSTANCE.getIconHost() + ":" +
ExamplesJvmConfig.INSTANCE.getIconPort() + "/assets/img/pe_icons";
- }
-
- public static final String getIconUrl(String pictureName) {
- return iconBaseUrl + "/" + pictureName + ".png";
- }
-
- @Override
- public String getHost() {
- return config.getString(ConfigKeys.HOST);
- }
-
- @Override
- public int getPort() {
- return config.getInteger(ConfigKeys.PORT);
- }
-
- public String getIconHost() {
- return config.getString(ConfigKeys.ICON_HOST);
- }
-
- public int getIconPort() {
- return config.getInteger(ConfigKeys.ICON_PORT);
- }
-
- @Override
- public String getId() {
- return service_id;
- }
-
- @Override
- public String getName() {
- return config.getString(ConfigKeys.SERVICE_NAME_KEY);
- }
-
-
-}
diff --git
a/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/engine/ExampleExternalEngine.java
b/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/engine/ExampleExternalEngine.java
deleted file mode 100644
index 09fc94f..0000000
---
a/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/engine/ExampleExternalEngine.java
+++ /dev/null
@@ -1,41 +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.pe.examples.jvm.engine;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.streampipes.commons.exceptions.SpRuntimeException;
-import org.apache.streampipes.wrapper.context.EventProcessorRuntimeContext;
-import org.apache.streampipes.wrapper.runtime.ExternalEventProcessor;
-
-public class ExampleExternalEngine
- implements ExternalEventProcessor<ExampleExternalEngineParameters> {
-
- private static final Logger LOG =
LoggerFactory.getLogger(ExampleExternalEngine.class);
-
- @Override
- public void onInvocation(ExampleExternalEngineParameters parameters,
- EventProcessorRuntimeContext runtimeContext)
throws SpRuntimeException {
- LOG.info("I'm invoked!");
- }
-
- @Override
- public void onDetach() throws SpRuntimeException {
- LOG.info("I'm detached!");
- }
-}
diff --git
a/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/engine/ExampleExternalEngineController.java
b/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/engine/ExampleExternalEngineController.java
deleted file mode 100644
index 8acbb8c..0000000
---
a/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/engine/ExampleExternalEngineController.java
+++ /dev/null
@@ -1,50 +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.pe.examples.jvm.engine;
-
-import org.apache.streampipes.model.graph.DataProcessorDescription;
-import org.apache.streampipes.model.graph.DataProcessorInvocation;
-import org.apache.streampipes.sdk.builder.ProcessingElementBuilder;
-import org.apache.streampipes.sdk.builder.StreamRequirementsBuilder;
-import
org.apache.streampipes.sdk.extractor.ProcessingElementParameterExtractor;
-import org.apache.streampipes.sdk.helpers.EpRequirements;
-import org.apache.streampipes.sdk.helpers.OutputStrategies;
-import
org.apache.streampipes.wrapper.standalone.ConfiguredExternalEventProcessor;
-import
org.apache.streampipes.wrapper.standalone.declarer.StandaloneExternalEventProcessingDeclarer;
-
-public class ExampleExternalEngineController
- extends
StandaloneExternalEventProcessingDeclarer<ExampleExternalEngineParameters> {
-
- @Override
- public DataProcessorDescription declareModel() {
- return
ProcessingElementBuilder.create("org.apache.streampipes.examples.engine.external",
"Example " +
- "External Engine", "")
- .requiredStream(StreamRequirementsBuilder.
- create()
- .requiredProperty(EpRequirements.anyProperty())
- .build())
- .outputStrategy(OutputStrategies.keep())
- .build();
- }
-
- @Override
- public ConfiguredExternalEventProcessor<ExampleExternalEngineParameters>
onInvocation(DataProcessorInvocation graph, ProcessingElementParameterExtractor
extractor) {
- return new ConfiguredExternalEventProcessor<>(new
ExampleExternalEngineParameters(graph),
- ExampleExternalEngine::new);
- }
-}
diff --git
a/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/engine/ExampleExternalEngineParameters.java
b/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/engine/ExampleExternalEngineParameters.java
deleted file mode 100644
index 6f15a65..0000000
---
a/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/engine/ExampleExternalEngineParameters.java
+++ /dev/null
@@ -1,28 +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.pe.examples.jvm.engine;
-
-import org.apache.streampipes.model.graph.DataProcessorInvocation;
-import
org.apache.streampipes.wrapper.params.binding.EventProcessorBindingParams;
-
-public class ExampleExternalEngineParameters extends
EventProcessorBindingParams {
-
- public ExampleExternalEngineParameters(DataProcessorInvocation graph) {
- super(graph);
- }
-}
diff --git
a/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/eventmodel/EventModelExamples.java
b/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/eventmodel/EventModelExamples.java
deleted file mode 100644
index 6e50c02..0000000
---
a/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/eventmodel/EventModelExamples.java
+++ /dev/null
@@ -1,72 +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.pe.examples.jvm.eventmodel;
-
-import org.apache.streampipes.commons.exceptions.SpRuntimeException;
-import org.apache.streampipes.model.runtime.Event;
-import org.apache.streampipes.pe.examples.jvm.base.DummyParameters;
-import org.apache.streampipes.wrapper.context.EventProcessorRuntimeContext;
-import org.apache.streampipes.wrapper.routing.SpOutputCollector;
-import org.apache.streampipes.wrapper.runtime.EventProcessor;
-
-import java.util.List;
-
-public class EventModelExamples implements EventProcessor<DummyParameters> {
-
- /**
- * Example event:
- * { "timestamp" : 12345, "temperature" : 45.6, "deviceId" : "sensor1",
"running" : true,
- * "location" : {"latitude" : 34.4, "longitude" : -47}, "lastValues" : [45,
22, 21]}
- */
-
- private String temperatureSelector;
- private String runningSelector;
- private String deviceIdSelector;
- private String latitudeSelector;
- private String lastValueSelector;
-
- @Override
- public void onInvocation(DummyParameters parameters, SpOutputCollector
spOutputCollector, EventProcessorRuntimeContext runtimeContext) throws
SpRuntimeException {
-
- // usually, the fields such as temperatureSelector would be retrieved from
the parameter class
- }
-
- @Override
- public void onEvent(Event event, SpOutputCollector collector) throws
SpRuntimeException {
-
- Float temperatureValue =
event.getFieldBySelector(temperatureSelector).getAsPrimitive().getAsFloat();
- String deviceId =
event.getFieldBySelector(deviceIdSelector).getAsPrimitive().getAsString();
-
- Double latitude =
event.getFieldBySelector(latitudeSelector).getAsPrimitive().getAsDouble();
-
- Boolean running =
event.getFieldBySelector(runningSelector).getAsPrimitive().getAsBoolean();
-
- List<Integer> lastValues =
event.getFieldBySelector(lastValueSelector).getAsList().parseAsSimpleType(Integer.class);
-
-
- event.addField("city", "Karlsruhe");
- event.removeFieldBySelector(temperatureSelector);
- event.addField("fahrenheit", 48);
-
- }
-
- @Override
- public void onDetach() throws SpRuntimeException {
-
- }
-}
diff --git
a/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/outputstrategy/AppendOutputController.java
b/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/outputstrategy/AppendOutputController.java
deleted file mode 100644
index 94b106b..0000000
---
a/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/outputstrategy/AppendOutputController.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.pe.examples.jvm.outputstrategy;
-
-import org.apache.streampipes.model.graph.DataProcessorDescription;
-import org.apache.streampipes.model.graph.DataProcessorInvocation;
-import org.apache.streampipes.pe.examples.jvm.base.DummyEngine;
-import org.apache.streampipes.pe.examples.jvm.base.DummyParameters;
-import org.apache.streampipes.sdk.builder.ProcessingElementBuilder;
-import org.apache.streampipes.sdk.builder.StreamRequirementsBuilder;
-import
org.apache.streampipes.sdk.extractor.ProcessingElementParameterExtractor;
-import org.apache.streampipes.sdk.helpers.EpProperties;
-import org.apache.streampipes.sdk.helpers.EpRequirements;
-import org.apache.streampipes.sdk.helpers.Labels;
-import org.apache.streampipes.sdk.helpers.OutputStrategies;
-import org.apache.streampipes.sdk.helpers.SupportedFormats;
-import org.apache.streampipes.sdk.helpers.SupportedProtocols;
-import org.apache.streampipes.vocabulary.SO;
-import org.apache.streampipes.wrapper.standalone.ConfiguredEventProcessor;
-import
org.apache.streampipes.wrapper.standalone.declarer.StandaloneEventProcessingDeclarer;
-
-public class AppendOutputController extends
StandaloneEventProcessingDeclarer<DummyParameters> {
-
- @Override
- public DataProcessorDescription declareModel() {
- return
ProcessingElementBuilder.create("org.apache.streampipes.examples.outputstrategy"
+
- ".append", "Append output example", "")
- .requiredStream(StreamRequirementsBuilder.
- create()
- .requiredProperty(EpRequirements.anyProperty())
- .build())
- .supportedProtocols(SupportedProtocols.kafka())
- .supportedFormats(SupportedFormats.jsonFormat())
-
-
.outputStrategy(OutputStrategies.append(EpProperties.integerEp(Labels.from("avg",
- "The average value", ""), "avg", SO.Number)))
-
- .build();
- }
-
- @Override
- public ConfiguredEventProcessor<DummyParameters>
onInvocation(DataProcessorInvocation graph, ProcessingElementParameterExtractor
extractor) {
-
-
- return new ConfiguredEventProcessor<>(new DummyParameters(graph),
DummyEngine::new);
- }
-}
diff --git
a/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/outputstrategy/CustomOutputController.java
b/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/outputstrategy/CustomOutputController.java
deleted file mode 100644
index fb0eff9..0000000
---
a/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/outputstrategy/CustomOutputController.java
+++ /dev/null
@@ -1,61 +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.pe.examples.jvm.outputstrategy;
-
-import org.apache.streampipes.model.graph.DataProcessorDescription;
-import org.apache.streampipes.model.graph.DataProcessorInvocation;
-import org.apache.streampipes.pe.examples.jvm.base.DummyEngine;
-import org.apache.streampipes.pe.examples.jvm.base.DummyParameters;
-import org.apache.streampipes.sdk.builder.ProcessingElementBuilder;
-import org.apache.streampipes.sdk.builder.StreamRequirementsBuilder;
-import
org.apache.streampipes.sdk.extractor.ProcessingElementParameterExtractor;
-import org.apache.streampipes.sdk.helpers.EpRequirements;
-import org.apache.streampipes.sdk.helpers.OutputStrategies;
-import org.apache.streampipes.sdk.helpers.SupportedFormats;
-import org.apache.streampipes.sdk.helpers.SupportedProtocols;
-import org.apache.streampipes.wrapper.standalone.ConfiguredEventProcessor;
-import
org.apache.streampipes.wrapper.standalone.declarer.StandaloneEventProcessingDeclarer;
-
-import java.util.List;
-
-public class CustomOutputController extends
StandaloneEventProcessingDeclarer<DummyParameters> {
-
- @Override
- public DataProcessorDescription declareModel() {
- return
ProcessingElementBuilder.create("org.apache.streampipes.examples.outputstrategy"
+
- ".custom", "Custom output example", "")
- .requiredStream(StreamRequirementsBuilder.
- create()
- .requiredProperty(EpRequirements.anyProperty())
- .build())
- .supportedProtocols(SupportedProtocols.kafka())
- .supportedFormats(SupportedFormats.jsonFormat())
-
- .outputStrategy(OutputStrategies.custom())
-
- .build();
- }
-
- @Override
- public ConfiguredEventProcessor<DummyParameters>
onInvocation(DataProcessorInvocation graph, ProcessingElementParameterExtractor
extractor) {
-
- List<String> outputSelectors = extractor.outputKeySelectors();
-
- return new ConfiguredEventProcessor<>(new DummyParameters(graph),
DummyEngine::new);
- }
-}
diff --git
a/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/outputstrategy/CustomTransformOutputController.java
b/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/outputstrategy/CustomTransformOutputController.java
deleted file mode 100644
index 14741f0..0000000
---
a/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/outputstrategy/CustomTransformOutputController.java
+++ /dev/null
@@ -1,76 +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.pe.examples.jvm.outputstrategy;
-
-import org.apache.streampipes.commons.exceptions.SpRuntimeException;
-import
org.apache.streampipes.container.api.ResolvesContainerProvidedOutputStrategy;
-import org.apache.streampipes.model.graph.DataProcessorDescription;
-import org.apache.streampipes.model.graph.DataProcessorInvocation;
-import org.apache.streampipes.model.schema.EventSchema;
-import org.apache.streampipes.model.schema.PropertyScope;
-import org.apache.streampipes.pe.examples.jvm.base.DummyEngine;
-import org.apache.streampipes.pe.examples.jvm.base.DummyParameters;
-import org.apache.streampipes.sdk.builder.ProcessingElementBuilder;
-import org.apache.streampipes.sdk.builder.StreamRequirementsBuilder;
-import
org.apache.streampipes.sdk.extractor.ProcessingElementParameterExtractor;
-import org.apache.streampipes.sdk.helpers.EpProperties;
-import org.apache.streampipes.sdk.helpers.EpRequirements;
-import org.apache.streampipes.sdk.helpers.Labels;
-import org.apache.streampipes.sdk.helpers.OutputStrategies;
-import org.apache.streampipes.sdk.helpers.SupportedFormats;
-import org.apache.streampipes.sdk.helpers.SupportedProtocols;
-import org.apache.streampipes.vocabulary.SO;
-import org.apache.streampipes.wrapper.standalone.ConfiguredEventProcessor;
-import
org.apache.streampipes.wrapper.standalone.declarer.StandaloneEventProcessingDeclarer;
-
-import java.util.Arrays;
-
-public class CustomTransformOutputController extends
- StandaloneEventProcessingDeclarer<DummyParameters> implements
- ResolvesContainerProvidedOutputStrategy<DataProcessorInvocation,
ProcessingElementParameterExtractor> {
-
- @Override
- public DataProcessorDescription declareModel() {
- return
ProcessingElementBuilder.create("org.apache.streampipes.examples.outputstrategy"
+
- ".customtransform", "Custom transform output example example", "")
- .requiredStream(StreamRequirementsBuilder.
- create()
-
.requiredPropertyWithUnaryMapping(EpRequirements.stringReq(), Labels.from
- ("str", "The date property as a string", ""),
PropertyScope.NONE)
- .build())
- .supportedProtocols(SupportedProtocols.kafka())
- .supportedFormats(SupportedFormats.jsonFormat())
-
- .outputStrategy(OutputStrategies.customTransformation())
-
- .build();
- }
-
- @Override
- public ConfiguredEventProcessor<DummyParameters>
onInvocation(DataProcessorInvocation graph, ProcessingElementParameterExtractor
extractor) {
-
- return new ConfiguredEventProcessor<>(new DummyParameters(graph),
DummyEngine::new);
- }
-
- @Override
- public EventSchema resolveOutputStrategy(DataProcessorInvocation
processingElement, ProcessingElementParameterExtractor parameterExtractor)
throws SpRuntimeException {
- return new EventSchema(Arrays
- .asList(EpProperties
- .stringEp(Labels.from("runtime", "I was added at runtime",
""), "runtime", SO.Text)));
- }
-}
diff --git
a/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/outputstrategy/FixedOutputController.java
b/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/outputstrategy/FixedOutputController.java
deleted file mode 100644
index 81c5da1..0000000
---
a/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/outputstrategy/FixedOutputController.java
+++ /dev/null
@@ -1,61 +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.pe.examples.jvm.outputstrategy;
-
-import org.apache.streampipes.model.graph.DataProcessorDescription;
-import org.apache.streampipes.model.graph.DataProcessorInvocation;
-import org.apache.streampipes.pe.examples.jvm.base.DummyEngine;
-import org.apache.streampipes.pe.examples.jvm.base.DummyParameters;
-import org.apache.streampipes.sdk.builder.ProcessingElementBuilder;
-import org.apache.streampipes.sdk.builder.StreamRequirementsBuilder;
-import
org.apache.streampipes.sdk.extractor.ProcessingElementParameterExtractor;
-import org.apache.streampipes.sdk.helpers.EpProperties;
-import org.apache.streampipes.sdk.helpers.EpRequirements;
-import org.apache.streampipes.sdk.helpers.Labels;
-import org.apache.streampipes.sdk.helpers.OutputStrategies;
-import org.apache.streampipes.sdk.helpers.SupportedFormats;
-import org.apache.streampipes.sdk.helpers.SupportedProtocols;
-import org.apache.streampipes.vocabulary.SO;
-import org.apache.streampipes.wrapper.standalone.ConfiguredEventProcessor;
-import
org.apache.streampipes.wrapper.standalone.declarer.StandaloneEventProcessingDeclarer;
-
-public class FixedOutputController extends
StandaloneEventProcessingDeclarer<DummyParameters> {
-
- @Override
- public DataProcessorDescription declareModel() {
- return
ProcessingElementBuilder.create("org.apache.streampipes.examples.outputstrategy"
+
- ".fixed", "Fixed output example", "")
- .requiredStream(StreamRequirementsBuilder.
- create()
- .requiredProperty(EpRequirements.anyProperty())
- .build())
- .supportedProtocols(SupportedProtocols.kafka())
- .supportedFormats(SupportedFormats.jsonFormat())
-
-
.outputStrategy(OutputStrategies.fixed(EpProperties.timestampProperty("timestamp"),
- EpProperties.doubleEp(Labels.from("avg", "Average value",
""), "avg", SO.Number)))
-
- .build();
- }
-
- @Override
- public ConfiguredEventProcessor<DummyParameters>
onInvocation(DataProcessorInvocation graph, ProcessingElementParameterExtractor
extractor) {
-
- return new ConfiguredEventProcessor<>(new DummyParameters(graph),
DummyEngine::new);
- }
-}
diff --git
a/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/outputstrategy/KeepOutputController.java
b/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/outputstrategy/KeepOutputController.java
deleted file mode 100644
index 9506ffc..0000000
---
a/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/outputstrategy/KeepOutputController.java
+++ /dev/null
@@ -1,58 +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.pe.examples.jvm.outputstrategy;
-
-import org.apache.streampipes.model.graph.DataProcessorDescription;
-import org.apache.streampipes.model.graph.DataProcessorInvocation;
-import org.apache.streampipes.pe.examples.jvm.base.DummyEngine;
-import org.apache.streampipes.pe.examples.jvm.base.DummyParameters;
-import org.apache.streampipes.sdk.builder.ProcessingElementBuilder;
-import org.apache.streampipes.sdk.builder.StreamRequirementsBuilder;
-import
org.apache.streampipes.sdk.extractor.ProcessingElementParameterExtractor;
-import org.apache.streampipes.sdk.helpers.EpRequirements;
-import org.apache.streampipes.sdk.helpers.OutputStrategies;
-import org.apache.streampipes.sdk.helpers.SupportedFormats;
-import org.apache.streampipes.sdk.helpers.SupportedProtocols;
-import org.apache.streampipes.wrapper.standalone.ConfiguredEventProcessor;
-import
org.apache.streampipes.wrapper.standalone.declarer.StandaloneEventProcessingDeclarer;
-
-public class KeepOutputController extends
StandaloneEventProcessingDeclarer<DummyParameters> {
-
- @Override
- public DataProcessorDescription declareModel() {
- return
ProcessingElementBuilder.create("org.apache.streampipes.examples.outputstrategy"
+
- ".keep", "Keep output example example", "")
- .requiredStream(StreamRequirementsBuilder.
- create()
- .requiredProperty(EpRequirements.anyProperty())
- .build())
- .supportedProtocols(SupportedProtocols.kafka())
- .supportedFormats(SupportedFormats.jsonFormat())
-
- .outputStrategy(OutputStrategies.keep())
-
- .build();
- }
-
- @Override
- public ConfiguredEventProcessor<DummyParameters>
onInvocation(DataProcessorInvocation graph, ProcessingElementParameterExtractor
extractor) {
-
-
- return new ConfiguredEventProcessor<>(new DummyParameters(graph),
DummyEngine::new);
- }
-}
diff --git
a/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/outputstrategy/TransformOutputController.java
b/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/outputstrategy/TransformOutputController.java
deleted file mode 100644
index 7aff086..0000000
---
a/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/outputstrategy/TransformOutputController.java
+++ /dev/null
@@ -1,67 +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.pe.examples.jvm.outputstrategy;
-
-import org.apache.streampipes.model.graph.DataProcessorDescription;
-import org.apache.streampipes.model.graph.DataProcessorInvocation;
-import org.apache.streampipes.model.schema.PropertyScope;
-import org.apache.streampipes.pe.examples.jvm.base.DummyEngine;
-import org.apache.streampipes.pe.examples.jvm.base.DummyParameters;
-import org.apache.streampipes.sdk.builder.ProcessingElementBuilder;
-import org.apache.streampipes.sdk.builder.StreamRequirementsBuilder;
-import
org.apache.streampipes.sdk.extractor.ProcessingElementParameterExtractor;
-import org.apache.streampipes.sdk.helpers.EpRequirements;
-import org.apache.streampipes.sdk.helpers.Labels;
-import org.apache.streampipes.sdk.helpers.OutputStrategies;
-import org.apache.streampipes.sdk.helpers.SupportedFormats;
-import org.apache.streampipes.sdk.helpers.SupportedProtocols;
-import org.apache.streampipes.sdk.helpers.TransformOperations;
-import org.apache.streampipes.sdk.utils.Datatypes;
-import org.apache.streampipes.wrapper.standalone.ConfiguredEventProcessor;
-import
org.apache.streampipes.wrapper.standalone.declarer.StandaloneEventProcessingDeclarer;
-
-import java.util.List;
-
-public class TransformOutputController extends
StandaloneEventProcessingDeclarer<DummyParameters> {
-
- @Override
- public DataProcessorDescription declareModel() {
- return
ProcessingElementBuilder.create("org.apache.streampipes.examples.outputstrategy"
+
- ".transform", "Transform output example example", "")
- .requiredStream(StreamRequirementsBuilder.
- create()
-
.requiredPropertyWithUnaryMapping(EpRequirements.stringReq(), Labels.from
- ("str", "The date property as a string", ""),
PropertyScope.NONE)
- .build())
- .supportedProtocols(SupportedProtocols.kafka())
- .supportedFormats(SupportedFormats.jsonFormat())
-
- .outputStrategy(OutputStrategies.transform(TransformOperations
- .staticDatatypeTransformation("str", Datatypes.Long)))
-
- .build();
- }
-
- @Override
- public ConfiguredEventProcessor<DummyParameters>
onInvocation(DataProcessorInvocation graph, ProcessingElementParameterExtractor
extractor) {
-
- List<String> outputSelectors = extractor.outputKeySelectors();
-
- return new ConfiguredEventProcessor<>(new DummyParameters(graph),
DummyEngine::new);
- }
-}
diff --git
a/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/requirements/ListRequirementsController.java
b/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/requirements/ListRequirementsController.java
deleted file mode 100644
index 604ac82..0000000
---
a/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/requirements/ListRequirementsController.java
+++ /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.
- *
- */
-package org.apache.streampipes.pe.examples.jvm.requirements;
-
-import org.apache.streampipes.model.graph.DataProcessorDescription;
-import org.apache.streampipes.model.graph.DataProcessorInvocation;
-import org.apache.streampipes.pe.examples.jvm.base.DummyParameters;
-import org.apache.streampipes.sdk.builder.ProcessingElementBuilder;
-import org.apache.streampipes.sdk.builder.StreamRequirementsBuilder;
-import
org.apache.streampipes.sdk.extractor.ProcessingElementParameterExtractor;
-import org.apache.streampipes.sdk.helpers.EpRequirements;
-import org.apache.streampipes.sdk.helpers.OutputStrategies;
-import org.apache.streampipes.sdk.helpers.SupportedFormats;
-import org.apache.streampipes.sdk.helpers.SupportedProtocols;
-import org.apache.streampipes.sdk.utils.Datatypes;
-import org.apache.streampipes.wrapper.standalone.ConfiguredEventProcessor;
-import
org.apache.streampipes.wrapper.standalone.declarer.StandaloneEventProcessingDeclarer;
-
-public class ListRequirementsController extends
StandaloneEventProcessingDeclarer<DummyParameters> {
-
- @Override
- public DataProcessorDescription declareModel() {
- return
ProcessingElementBuilder.create("org.apache.streampipes.examples.requirements" +
- ".list", "List requirements specification examples", "")
- .requiredStream(StreamRequirementsBuilder.
- create()
-
.requiredProperty(EpRequirements.listRequirement(Datatypes.Integer))
-
.requiredProperty(EpRequirements.listRequirement(Datatypes.Double))
-
.requiredProperty(EpRequirements.listRequirement(Datatypes.Boolean))
-
.requiredProperty(EpRequirements.listRequirement(Datatypes.String))
- .build())
-
-
- .supportedProtocols(SupportedProtocols.kafka())
- .supportedFormats(SupportedFormats.jsonFormat())
- .outputStrategy(OutputStrategies.keep())
-
- .build();
- }
-
- @Override
- public ConfiguredEventProcessor<DummyParameters>
onInvocation(DataProcessorInvocation graph, ProcessingElementParameterExtractor
extractor) {
- return null;
- }
-}
diff --git
a/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/requirements/NestedRequirementsController.java
b/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/requirements/NestedRequirementsController.java
deleted file mode 100644
index 16f9a53..0000000
---
a/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/requirements/NestedRequirementsController.java
+++ /dev/null
@@ -1,21 +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.pe.examples.jvm.requirements;
-
-public class NestedRequirementsController {
-}
diff --git
a/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/requirements/SimpleStreamRequirementsController.java
b/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/requirements/SimpleStreamRequirementsController.java
deleted file mode 100644
index 70a6bcb..0000000
---
a/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/requirements/SimpleStreamRequirementsController.java
+++ /dev/null
@@ -1,66 +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.pe.examples.jvm.requirements;
-
-import org.apache.streampipes.model.graph.DataProcessorDescription;
-import org.apache.streampipes.model.graph.DataProcessorInvocation;
-import org.apache.streampipes.pe.examples.jvm.base.DummyParameters;
-import org.apache.streampipes.sdk.builder.ProcessingElementBuilder;
-import org.apache.streampipes.sdk.builder.StreamRequirementsBuilder;
-import
org.apache.streampipes.sdk.extractor.ProcessingElementParameterExtractor;
-import org.apache.streampipes.sdk.helpers.EpRequirements;
-import org.apache.streampipes.sdk.helpers.OutputStrategies;
-import org.apache.streampipes.sdk.helpers.SupportedFormats;
-import org.apache.streampipes.sdk.helpers.SupportedProtocols;
-import org.apache.streampipes.vocabulary.SO;
-import org.apache.streampipes.wrapper.standalone.ConfiguredEventProcessor;
-import
org.apache.streampipes.wrapper.standalone.declarer.StandaloneEventProcessingDeclarer;
-
-public class SimpleStreamRequirementsController extends
StandaloneEventProcessingDeclarer<DummyParameters> {
-
- @Override
- public DataProcessorDescription declareModel() {
- return
ProcessingElementBuilder.create("org.apache.streampipes.examples.requirements" +
- ".simple", "Simple requirements specification examples", "")
- .requiredStream(StreamRequirementsBuilder.
- create()
- .requiredProperty(EpRequirements.numberReq()) // any number
- .requiredProperty(EpRequirements.doubleReq()) // any field
of type double
- .requiredProperty(EpRequirements.booleanReq()) // any
field of type boolean
- .requiredProperty(EpRequirements.integerReq()) // any
field of type integer
- .requiredProperty(EpRequirements.stringReq()) // any field
of type string
- .requiredProperty(EpRequirements.anyProperty()) // any
field allowed (no restriction)
- .requiredProperty(EpRequirements.timestampReq()) // any
timestamp field
-
-
.requiredProperty(EpRequirements.domainPropertyReq(SO.Latitude))
-
.requiredProperty(EpRequirements.domainPropertyReq(SO.Longitude))
- .build())
-
-
- .supportedProtocols(SupportedProtocols.kafka())
- .supportedFormats(SupportedFormats.jsonFormat())
- .outputStrategy(OutputStrategies.keep())
-
- .build();
- }
-
- @Override
- public ConfiguredEventProcessor<DummyParameters>
onInvocation(DataProcessorInvocation graph, ProcessingElementParameterExtractor
extractor) {
- return null;
- }
-}
diff --git
a/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/staticproperty/CollectionExampleController.java
b/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/staticproperty/CollectionExampleController.java
deleted file mode 100644
index eacd294..0000000
---
a/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/staticproperty/CollectionExampleController.java
+++ /dev/null
@@ -1,69 +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.pe.examples.jvm.staticproperty;
-
-import org.apache.streampipes.model.graph.DataProcessorDescription;
-import org.apache.streampipes.model.graph.DataProcessorInvocation;
-import org.apache.streampipes.pe.examples.jvm.base.DummyEngine;
-import org.apache.streampipes.pe.examples.jvm.base.DummyParameters;
-import org.apache.streampipes.sdk.StaticProperties;
-import org.apache.streampipes.sdk.builder.ProcessingElementBuilder;
-import org.apache.streampipes.sdk.builder.StreamRequirementsBuilder;
-import
org.apache.streampipes.sdk.extractor.ProcessingElementParameterExtractor;
-import org.apache.streampipes.sdk.helpers.EpRequirements;
-import org.apache.streampipes.sdk.helpers.Labels;
-import org.apache.streampipes.sdk.helpers.OutputStrategies;
-import org.apache.streampipes.sdk.helpers.SupportedFormats;
-import org.apache.streampipes.sdk.helpers.SupportedProtocols;
-import org.apache.streampipes.wrapper.standalone.ConfiguredEventProcessor;
-import
org.apache.streampipes.wrapper.standalone.declarer.StandaloneEventProcessingDeclarer;
-
-import java.util.List;
-
-public class CollectionExampleController extends
StandaloneEventProcessingDeclarer<DummyParameters> {
-
- @Override
- public DataProcessorDescription declareModel() {
- return
ProcessingElementBuilder.create("org.apache.streampipes.examples.staticproperty"
+
- ".collection", "Collection Example", "")
- .requiredStream(StreamRequirementsBuilder.
- create()
- .requiredProperty(EpRequirements.anyProperty())
- .build())
- .outputStrategy(OutputStrategies.keep())
- .supportedProtocols(SupportedProtocols.kafka())
- .supportedFormats(SupportedFormats.jsonFormat())
-
- // create a collection parameter
- .requiredParameterAsCollection(Labels.from("collection", "Example
Name", "Example " +
- "Description"),
StaticProperties.stringFreeTextProperty(Labels
- .from("text-property","Text","")))
- .build();
- }
-
- @Override
- public ConfiguredEventProcessor<DummyParameters>
onInvocation(DataProcessorInvocation graph, ProcessingElementParameterExtractor
extractor) {
-
- // Extract the text parameter value
- List<String> textParameters =
extractor.singleValueParameterFromCollection("collection", String.class);
-
- // now the text parameter would be added to a parameter class (omitted for
this example)
-
- return new ConfiguredEventProcessor<>(new DummyParameters(graph),
DummyEngine::new);
- }
-}
diff --git
a/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/staticproperty/MultiValueSelectionExampleController.java
b/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/staticproperty/MultiValueSelectionExampleController.java
deleted file mode 100644
index dfbb362..0000000
---
a/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/staticproperty/MultiValueSelectionExampleController.java
+++ /dev/null
@@ -1,69 +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.pe.examples.jvm.staticproperty;
-
-import org.apache.streampipes.model.graph.DataProcessorDescription;
-import org.apache.streampipes.model.graph.DataProcessorInvocation;
-import org.apache.streampipes.pe.examples.jvm.base.DummyEngine;
-import org.apache.streampipes.pe.examples.jvm.base.DummyParameters;
-import org.apache.streampipes.sdk.builder.ProcessingElementBuilder;
-import org.apache.streampipes.sdk.builder.StreamRequirementsBuilder;
-import
org.apache.streampipes.sdk.extractor.ProcessingElementParameterExtractor;
-import org.apache.streampipes.sdk.helpers.EpRequirements;
-import org.apache.streampipes.sdk.helpers.Labels;
-import org.apache.streampipes.sdk.helpers.Options;
-import org.apache.streampipes.sdk.helpers.OutputStrategies;
-import org.apache.streampipes.sdk.helpers.SupportedFormats;
-import org.apache.streampipes.sdk.helpers.SupportedProtocols;
-import org.apache.streampipes.wrapper.standalone.ConfiguredEventProcessor;
-import
org.apache.streampipes.wrapper.standalone.declarer.StandaloneEventProcessingDeclarer;
-
-import java.util.List;
-
-public class MultiValueSelectionExampleController extends
StandaloneEventProcessingDeclarer<DummyParameters> {
-
- @Override
- public DataProcessorDescription declareModel() {
- return
ProcessingElementBuilder.create("org.apache.streampipes.examples.staticproperty"
+
- ".multivalue", "Multi value selection example", "")
- .requiredStream(StreamRequirementsBuilder.
- create()
- .requiredProperty(EpRequirements.anyProperty())
- .build())
- .outputStrategy(OutputStrategies.keep())
- .supportedProtocols(SupportedProtocols.kafka())
- .supportedFormats(SupportedFormats.jsonFormat())
-
- // create a simple text parameter
- .requiredMultiValueSelection(Labels.from("id", "Example Name",
"Example " +
- "Description"), Options.from("Value A", "Value B", "Value
C"))
-
- .build();
- }
-
- @Override
- public ConfiguredEventProcessor<DummyParameters>
onInvocation(DataProcessorInvocation graph, ProcessingElementParameterExtractor
extractor) {
-
- // Extract the text parameter value
- List<String> selectedSingleValue = extractor.selectedMultiValues("id",
String.class);
-
- // now the text parameter would be added to a parameter class (omitted for
this example)
-
- return new ConfiguredEventProcessor<>(new DummyParameters(graph),
DummyEngine::new);
- }
-}
diff --git
a/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/staticproperty/NaryMappingPropertyExampleController.java
b/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/staticproperty/NaryMappingPropertyExampleController.java
deleted file mode 100644
index 14354ee..0000000
---
a/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/staticproperty/NaryMappingPropertyExampleController.java
+++ /dev/null
@@ -1,66 +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.pe.examples.jvm.staticproperty;
-
-import org.apache.streampipes.model.graph.DataProcessorDescription;
-import org.apache.streampipes.model.graph.DataProcessorInvocation;
-import org.apache.streampipes.model.schema.PropertyScope;
-import org.apache.streampipes.pe.examples.jvm.base.DummyEngine;
-import org.apache.streampipes.pe.examples.jvm.base.DummyParameters;
-import org.apache.streampipes.sdk.builder.ProcessingElementBuilder;
-import org.apache.streampipes.sdk.builder.StreamRequirementsBuilder;
-import
org.apache.streampipes.sdk.extractor.ProcessingElementParameterExtractor;
-import org.apache.streampipes.sdk.helpers.EpRequirements;
-import org.apache.streampipes.sdk.helpers.Labels;
-import org.apache.streampipes.sdk.helpers.OutputStrategies;
-import org.apache.streampipes.sdk.helpers.SupportedFormats;
-import org.apache.streampipes.sdk.helpers.SupportedProtocols;
-import org.apache.streampipes.wrapper.standalone.ConfiguredEventProcessor;
-import
org.apache.streampipes.wrapper.standalone.declarer.StandaloneEventProcessingDeclarer;
-
-import java.util.List;
-
-public class NaryMappingPropertyExampleController extends
- StandaloneEventProcessingDeclarer<DummyParameters> {
-
- @Override
- public DataProcessorDescription declareModel() {
- return
ProcessingElementBuilder.create("org.apache.streampipes.examples.staticproperty"
+
- ".mappingnary", "Nary Mapping Property Example", "")
- .requiredStream(StreamRequirementsBuilder.
- create()
-
.requiredPropertyWithNaryMapping(EpRequirements.numberReq(),
- Labels.from("mp-key", "My Mapping", ""),
- PropertyScope.NONE)
- .build())
- .outputStrategy(OutputStrategies.keep())
- .supportedProtocols(SupportedProtocols.kafka())
- .supportedFormats(SupportedFormats.jsonFormat())
-
- .build();
- }
-
- @Override
- public ConfiguredEventProcessor<DummyParameters>
onInvocation(DataProcessorInvocation graph, ProcessingElementParameterExtractor
extractor) {
-
- // Extract the mapping property value
- List<String> mappingPropertySelectors =
extractor.mappingPropertyValues("mp-key");
-
- return new ConfiguredEventProcessor<>(new DummyParameters(graph),
DummyEngine::new);
- }
-}
diff --git
a/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/staticproperty/NumberParameterExampleController.java
b/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/staticproperty/NumberParameterExampleController.java
deleted file mode 100644
index 595fdae..0000000
---
a/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/staticproperty/NumberParameterExampleController.java
+++ /dev/null
@@ -1,74 +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.pe.examples.jvm.staticproperty;
-
-import org.apache.streampipes.model.graph.DataProcessorDescription;
-import org.apache.streampipes.model.graph.DataProcessorInvocation;
-import org.apache.streampipes.pe.examples.jvm.base.DummyEngine;
-import org.apache.streampipes.pe.examples.jvm.base.DummyParameters;
-import org.apache.streampipes.sdk.builder.ProcessingElementBuilder;
-import org.apache.streampipes.sdk.builder.StreamRequirementsBuilder;
-import
org.apache.streampipes.sdk.extractor.ProcessingElementParameterExtractor;
-import org.apache.streampipes.sdk.helpers.EpRequirements;
-import org.apache.streampipes.sdk.helpers.Labels;
-import org.apache.streampipes.sdk.helpers.OutputStrategies;
-import org.apache.streampipes.sdk.helpers.SupportedFormats;
-import org.apache.streampipes.sdk.helpers.SupportedProtocols;
-import org.apache.streampipes.wrapper.standalone.ConfiguredEventProcessor;
-import
org.apache.streampipes.wrapper.standalone.declarer.StandaloneEventProcessingDeclarer;
-
-public class NumberParameterExampleController extends
StandaloneEventProcessingDeclarer<DummyParameters> {
-
- private static final String SP_KEY = "my-example-key";
-
- @Override
- public DataProcessorDescription declareModel() {
- return
ProcessingElementBuilder.create("org.apache.streampipes.examples.staticproperty"
+
- ".numberparameter", "Number Parameter Example", "")
- .requiredStream(StreamRequirementsBuilder.
- create()
- .requiredProperty(EpRequirements.anyProperty())
- .build())
- .outputStrategy(OutputStrategies.keep())
- .supportedProtocols(SupportedProtocols.kafka())
- .supportedFormats(SupportedFormats.jsonFormat())
-
- // create an integer parameter
- .requiredIntegerParameter(Labels.from(SP_KEY, "Integer Parameter",
"Example Description"))
-
- // create a float parameter
- .requiredFloatParameter(Labels.from("float-key", "Float
Parameter", "Example Description"))
-
-
- .build();
- }
-
- @Override
- public ConfiguredEventProcessor<DummyParameters>
onInvocation(DataProcessorInvocation graph, ProcessingElementParameterExtractor
extractor) {
-
- // Extract the integer parameter value
- Integer integerParameter = extractor.singleValueParameter(SP_KEY,
Integer.class);
-
- // Extract the float parameter value
- Float floatParameter = extractor.singleValueParameter("float-key",
Float.class);
-
- // now the parameters would be added to a parameter class (omitted for
this example)
-
- return new ConfiguredEventProcessor<>(new DummyParameters(graph),
DummyEngine::new);
- }
-}
diff --git
a/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/staticproperty/NumberParameterWithRangeExampleController.java
b/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/staticproperty/NumberParameterWithRangeExampleController.java
deleted file mode 100644
index d1b57e2..0000000
---
a/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/staticproperty/NumberParameterWithRangeExampleController.java
+++ /dev/null
@@ -1,69 +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.pe.examples.jvm.staticproperty;
-
-import org.apache.streampipes.model.graph.DataProcessorDescription;
-import org.apache.streampipes.model.graph.DataProcessorInvocation;
-import org.apache.streampipes.pe.examples.jvm.base.DummyEngine;
-import org.apache.streampipes.pe.examples.jvm.base.DummyParameters;
-import org.apache.streampipes.sdk.builder.ProcessingElementBuilder;
-import org.apache.streampipes.sdk.builder.StreamRequirementsBuilder;
-import
org.apache.streampipes.sdk.extractor.ProcessingElementParameterExtractor;
-import org.apache.streampipes.sdk.helpers.EpRequirements;
-import org.apache.streampipes.sdk.helpers.Labels;
-import org.apache.streampipes.sdk.helpers.OutputStrategies;
-import org.apache.streampipes.sdk.helpers.SupportedFormats;
-import org.apache.streampipes.sdk.helpers.SupportedProtocols;
-import org.apache.streampipes.wrapper.standalone.ConfiguredEventProcessor;
-import
org.apache.streampipes.wrapper.standalone.declarer.StandaloneEventProcessingDeclarer;
-
-public class NumberParameterWithRangeExampleController extends
- StandaloneEventProcessingDeclarer<DummyParameters> {
-
- private static final String SP_KEY = "my-example-key";
-
- @Override
- public DataProcessorDescription declareModel() {
- return
ProcessingElementBuilder.create("org.apache.streampipes.examples.staticproperty"
+
- ".numberparameterrange", "Number Parameter With Range", "")
- .requiredStream(StreamRequirementsBuilder.
- create()
- .requiredProperty(EpRequirements.anyProperty())
- .build())
- .outputStrategy(OutputStrategies.keep())
- .supportedProtocols(SupportedProtocols.kafka())
- .supportedFormats(SupportedFormats.jsonFormat())
-
- // create an integer parameter
- .requiredIntegerParameter(Labels.from(SP_KEY, "Integer Parameter",
"Example " +
- "Description"), 0, 100, 1)
-
- .build();
- }
-
- @Override
- public ConfiguredEventProcessor<DummyParameters>
onInvocation(DataProcessorInvocation graph, ProcessingElementParameterExtractor
extractor) {
-
- // Extract the integer parameter value
- Integer integerParameter = extractor.singleValueParameter(SP_KEY,
Integer.class);
-
- // now the parameter would be added to a parameter class (omitted for this
example)
-
- return new ConfiguredEventProcessor<>(new DummyParameters(graph),
DummyEngine::new);
- }
-}
diff --git
a/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/staticproperty/RuntimeResolvableSingleValue.java
b/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/staticproperty/RuntimeResolvableSingleValue.java
deleted file mode 100644
index 2bc7e7e..0000000
---
a/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/staticproperty/RuntimeResolvableSingleValue.java
+++ /dev/null
@@ -1,101 +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.pe.examples.jvm.staticproperty;
-
-import org.apache.kafka.clients.consumer.KafkaConsumer;
-import org.apache.streampipes.container.api.ResolvesContainerProvidedOptions;
-import org.apache.streampipes.model.graph.DataProcessorDescription;
-import org.apache.streampipes.model.graph.DataProcessorInvocation;
-import org.apache.streampipes.model.staticproperty.Option;
-import org.apache.streampipes.pe.examples.jvm.base.DummyEngine;
-import org.apache.streampipes.pe.examples.jvm.base.DummyParameters;
-import org.apache.streampipes.sdk.builder.ProcessingElementBuilder;
-import org.apache.streampipes.sdk.builder.StreamRequirementsBuilder;
-import
org.apache.streampipes.sdk.extractor.ProcessingElementParameterExtractor;
-import org.apache.streampipes.sdk.extractor.StaticPropertyExtractor;
-import org.apache.streampipes.sdk.helpers.EpRequirements;
-import org.apache.streampipes.sdk.helpers.Labels;
-import org.apache.streampipes.sdk.helpers.OutputStrategies;
-import org.apache.streampipes.sdk.helpers.SupportedFormats;
-import org.apache.streampipes.sdk.helpers.SupportedProtocols;
-import org.apache.streampipes.wrapper.standalone.ConfiguredEventProcessor;
-import
org.apache.streampipes.wrapper.standalone.declarer.StandaloneEventProcessingDeclarer;
-
-import java.util.Arrays;
-import java.util.List;
-import java.util.Properties;
-import java.util.Set;
-import java.util.stream.Collectors;
-
-public class RuntimeResolvableSingleValue extends
- StandaloneEventProcessingDeclarer<DummyParameters> implements
ResolvesContainerProvidedOptions {
-
- private static final String KafkaHost = "kafka-host";
- private static final String KafkaPort = "kafka-port";
-
- @Override
- public DataProcessorDescription declareModel() {
- return
ProcessingElementBuilder.create("org.apache.streampipes.examples.staticproperty"
+
- ".runtimeresolvablesingle", "Runtime-resolvable single value
example", "")
- .requiredStream(StreamRequirementsBuilder.
- create()
- .requiredProperty(EpRequirements.anyProperty())
- .build())
- .outputStrategy(OutputStrategies.keep())
- .supportedProtocols(SupportedProtocols.kafka())
- .supportedFormats(SupportedFormats.jsonFormat())
- .requiredTextParameter(Labels.from(KafkaHost, "Kafka Host", ""))
- .requiredIntegerParameter(Labels.from(KafkaPort, "Kafka Port", ""))
-
- // create a single value selection parameter that is resolved at
runtime
- .requiredSingleValueSelectionFromContainer(Labels.from("id",
"Example Name", "Example " +
- "Description"), Arrays.asList(KafkaHost, KafkaPort))
-
- .build();
- }
-
- @Override
- public ConfiguredEventProcessor<DummyParameters>
onInvocation(DataProcessorInvocation graph, ProcessingElementParameterExtractor
extractor) {
-
- // Extract the text parameter value
- String selectedSingleValue = extractor.selectedSingleValue("id",
String.class);
-
- // now the text parameter would be added to a parameter class (omitted for
this example)
-
- return new ConfiguredEventProcessor<>(new DummyParameters(graph),
DummyEngine::new);
- }
-
- @Override
- public List<Option> resolveOptions(String requestId, StaticPropertyExtractor
extractor) {
- String host = extractor.singleValueParameter(KafkaHost, String.class);
- Integer port = extractor.singleValueParameter(KafkaPort, Integer.class);
-
- String kafkaAddress = host + ":" + port;
-
- Properties props = new Properties();
- props.put("bootstrap.servers", kafkaAddress);
- props.put("group.id", "test-consumer-group");
- props.put("key.deserializer",
"org.apache.kafka.common.serialization.StringDeserializer");
- props.put("value.deserializer",
"org.apache.kafka.common.serialization.StringDeserializer");
-
- KafkaConsumer<String, String> consumer = new KafkaConsumer<String,
String>(props);
- Set<String> topics = consumer.listTopics().keySet();
- consumer.close();
- return topics.stream().map(Option::new).collect(Collectors.toList());
- }
-}
diff --git
a/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/staticproperty/SecretStaticPropertyExampleController.java
b/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/staticproperty/SecretStaticPropertyExampleController.java
deleted file mode 100644
index 3435c6e..0000000
---
a/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/staticproperty/SecretStaticPropertyExampleController.java
+++ /dev/null
@@ -1,68 +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.pe.examples.jvm.staticproperty;
-
-import org.apache.streampipes.model.graph.DataProcessorDescription;
-import org.apache.streampipes.model.graph.DataProcessorInvocation;
-import org.apache.streampipes.pe.examples.jvm.base.DummyEngine;
-import org.apache.streampipes.pe.examples.jvm.base.DummyParameters;
-import org.apache.streampipes.sdk.builder.ProcessingElementBuilder;
-import org.apache.streampipes.sdk.builder.StreamRequirementsBuilder;
-import
org.apache.streampipes.sdk.extractor.ProcessingElementParameterExtractor;
-import org.apache.streampipes.sdk.helpers.EpRequirements;
-import org.apache.streampipes.sdk.helpers.Labels;
-import org.apache.streampipes.sdk.helpers.OutputStrategies;
-import org.apache.streampipes.sdk.helpers.SupportedFormats;
-import org.apache.streampipes.sdk.helpers.SupportedProtocols;
-import org.apache.streampipes.wrapper.standalone.ConfiguredEventProcessor;
-import
org.apache.streampipes.wrapper.standalone.declarer.StandaloneEventProcessingDeclarer;
-
-public class SecretStaticPropertyExampleController extends
StandaloneEventProcessingDeclarer<DummyParameters> {
-
- private static final String SP_KEY = "my-secret-key";
-
- @Override
- public DataProcessorDescription declareModel() {
- return
ProcessingElementBuilder.create("org.apache.streampipes.examples.staticproperty"
+
- ".secret", "Secret Parameter Example", "")
- .requiredStream(StreamRequirementsBuilder.
- create()
- .requiredProperty(EpRequirements.anyProperty())
- .build())
- .outputStrategy(OutputStrategies.keep())
- .supportedProtocols(SupportedProtocols.kafka())
- .supportedFormats(SupportedFormats.jsonFormat())
-
- // create a simple text parameter
- .requiredSecret(Labels.from(SP_KEY, "Secret Password", "Secret
Password Example"))
-
- .build();
- }
-
- @Override
- public ConfiguredEventProcessor<DummyParameters>
onInvocation(DataProcessorInvocation graph, ProcessingElementParameterExtractor
extractor) {
-
- // Extract the text parameter value
- String textParameter = extractor.secretValue(SP_KEY);
-
- // now the text parameter would be added to a parameter class (omitted for
this example)
-
- return new ConfiguredEventProcessor<>(new DummyParameters(graph),
DummyEngine::new);
- }
-}
-
diff --git
a/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/staticproperty/SingleValueSelectionExampleController.java
b/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/staticproperty/SingleValueSelectionExampleController.java
deleted file mode 100644
index e461a79..0000000
---
a/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/staticproperty/SingleValueSelectionExampleController.java
+++ /dev/null
@@ -1,68 +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.pe.examples.jvm.staticproperty;
-
-import org.apache.streampipes.model.graph.DataProcessorDescription;
-import org.apache.streampipes.model.graph.DataProcessorInvocation;
-import org.apache.streampipes.pe.examples.jvm.base.DummyEngine;
-import org.apache.streampipes.pe.examples.jvm.base.DummyParameters;
-import org.apache.streampipes.sdk.builder.ProcessingElementBuilder;
-import org.apache.streampipes.sdk.builder.StreamRequirementsBuilder;
-import
org.apache.streampipes.sdk.extractor.ProcessingElementParameterExtractor;
-import org.apache.streampipes.sdk.helpers.EpRequirements;
-import org.apache.streampipes.sdk.helpers.Labels;
-import org.apache.streampipes.sdk.helpers.Options;
-import org.apache.streampipes.sdk.helpers.OutputStrategies;
-import org.apache.streampipes.sdk.helpers.SupportedFormats;
-import org.apache.streampipes.sdk.helpers.SupportedProtocols;
-import org.apache.streampipes.wrapper.standalone.ConfiguredEventProcessor;
-import
org.apache.streampipes.wrapper.standalone.declarer.StandaloneEventProcessingDeclarer;
-
-public class SingleValueSelectionExampleController extends
- StandaloneEventProcessingDeclarer<DummyParameters> {
-
- @Override
- public DataProcessorDescription declareModel() {
- return
ProcessingElementBuilder.create("org.apache.streampipes.examples.staticproperty"
+
- ".singlevalue", "Single value selection example", "")
- .requiredStream(StreamRequirementsBuilder.
- create()
- .requiredProperty(EpRequirements.anyProperty())
- .build())
- .outputStrategy(OutputStrategies.keep())
- .supportedProtocols(SupportedProtocols.kafka())
- .supportedFormats(SupportedFormats.jsonFormat())
-
- // create a single value selection parameter
- .requiredSingleValueSelection(Labels.from("id", "Example Name",
"Example " +
- "Description"), Options.from("Option A", "Option B",
"Option C"))
-
- .build();
- }
-
- @Override
- public ConfiguredEventProcessor<DummyParameters>
onInvocation(DataProcessorInvocation graph, ProcessingElementParameterExtractor
extractor) {
-
- // Extract the text parameter value
- String selectedSingleValue = extractor.selectedSingleValue("id",
String.class);
-
- // now the text parameter would be added to a parameter class (omitted for
this example)
-
- return new ConfiguredEventProcessor<>(new DummyParameters(graph),
DummyEngine::new);
- }
-}
diff --git
a/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/staticproperty/StaticPropertyAlternativesController.java
b/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/staticproperty/StaticPropertyAlternativesController.java
deleted file mode 100644
index 9a51b6e..0000000
---
a/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/staticproperty/StaticPropertyAlternativesController.java
+++ /dev/null
@@ -1,82 +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.pe.examples.jvm.staticproperty;
-
-import org.apache.streampipes.model.graph.DataProcessorDescription;
-import org.apache.streampipes.model.graph.DataProcessorInvocation;
-import org.apache.streampipes.pe.examples.jvm.base.DummyEngine;
-import org.apache.streampipes.pe.examples.jvm.base.DummyParameters;
-import org.apache.streampipes.sdk.StaticProperties;
-import org.apache.streampipes.sdk.builder.ProcessingElementBuilder;
-import org.apache.streampipes.sdk.builder.StreamRequirementsBuilder;
-import
org.apache.streampipes.sdk.extractor.ProcessingElementParameterExtractor;
-import org.apache.streampipes.sdk.helpers.Alternatives;
-import org.apache.streampipes.sdk.helpers.EpRequirements;
-import org.apache.streampipes.sdk.helpers.Labels;
-import org.apache.streampipes.sdk.helpers.Options;
-import org.apache.streampipes.sdk.helpers.OutputStrategies;
-import org.apache.streampipes.sdk.helpers.SupportedFormats;
-import org.apache.streampipes.sdk.helpers.SupportedProtocols;
-import org.apache.streampipes.wrapper.standalone.ConfiguredEventProcessor;
-import
org.apache.streampipes.wrapper.standalone.declarer.StandaloneEventProcessingDeclarer;
-
-public class StaticPropertyAlternativesController extends
- StandaloneEventProcessingDeclarer<DummyParameters> {
-
- private static final String KafkaHost = "kafka-host";
- private static final String KafkaPort = "kafka-port";
-
- @Override
- public DataProcessorDescription declareModel() {
- return
ProcessingElementBuilder.create("org.apache.streampipes.examples.staticproperty"
+
- ".alternatives", "Static property alternatives example", "")
- .requiredStream(StreamRequirementsBuilder.
- create()
- .requiredProperty(EpRequirements.anyProperty())
- .build())
- .outputStrategy(OutputStrategies.keep())
- .supportedProtocols(SupportedProtocols.kafka())
- .supportedFormats(SupportedFormats.jsonFormat())
- .requiredTextParameter(Labels.from(KafkaHost, "Kafka Host", ""))
-
- .requiredAlternatives(Labels.from("window", "Window", ""),
- Alternatives.from(Labels.from("count", "Count Window", ""),
-
StaticProperties.integerFreeTextProperty(Labels.from("count-window-size",
- "Count Window Size", ""))),
- Alternatives.from(Labels.from("time", "Time Window", ""),
- StaticProperties.group(Labels.from("group", "",
""),
-
StaticProperties.integerFreeTextProperty(Labels.from("time" +
- "-window-size", "Time Window
Size", "")),
-
StaticProperties.singleValueSelection(Labels.from("time" +
- "-window-unit", "Time Unit", ""),
- Options.from("Seconds", "Minutes",
"Hours")))))
- .build();
- }
-
- @Override
- public ConfiguredEventProcessor<DummyParameters>
onInvocation(DataProcessorInvocation graph, ProcessingElementParameterExtractor
extractor) {
-
- String selectedAlternative =
extractor.selectedAlternativeInternalId("window");
- if (selectedAlternative.equals("time")) {
- Integer timeWindowSize =
extractor.singleValueParameter("time-window-size", Integer.class);
- }
-
- return new ConfiguredEventProcessor<>(new DummyParameters(graph),
DummyEngine::new);
- }
-
-}
diff --git
a/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/staticproperty/TextParameterExampleController.java
b/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/staticproperty/TextParameterExampleController.java
deleted file mode 100644
index d610806..0000000
---
a/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/staticproperty/TextParameterExampleController.java
+++ /dev/null
@@ -1,67 +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.pe.examples.jvm.staticproperty;
-
-import org.apache.streampipes.model.graph.DataProcessorDescription;
-import org.apache.streampipes.model.graph.DataProcessorInvocation;
-import org.apache.streampipes.pe.examples.jvm.base.DummyEngine;
-import org.apache.streampipes.pe.examples.jvm.base.DummyParameters;
-import org.apache.streampipes.sdk.builder.ProcessingElementBuilder;
-import org.apache.streampipes.sdk.builder.StreamRequirementsBuilder;
-import
org.apache.streampipes.sdk.extractor.ProcessingElementParameterExtractor;
-import org.apache.streampipes.sdk.helpers.EpRequirements;
-import org.apache.streampipes.sdk.helpers.Labels;
-import org.apache.streampipes.sdk.helpers.OutputStrategies;
-import org.apache.streampipes.sdk.helpers.SupportedFormats;
-import org.apache.streampipes.sdk.helpers.SupportedProtocols;
-import org.apache.streampipes.wrapper.standalone.ConfiguredEventProcessor;
-import
org.apache.streampipes.wrapper.standalone.declarer.StandaloneEventProcessingDeclarer;
-
-public class TextParameterExampleController extends
StandaloneEventProcessingDeclarer<DummyParameters> {
-
- private static final String SP_KEY = "my-example-key";
-
- @Override
- public DataProcessorDescription declareModel() {
- return
ProcessingElementBuilder.create("org.apache.streampipes.examples.staticproperty"
+
- ".textparameter", "Text Parameter Example", "")
- .requiredStream(StreamRequirementsBuilder.
- create()
- .requiredProperty(EpRequirements.anyProperty())
- .build())
- .outputStrategy(OutputStrategies.keep())
- .supportedProtocols(SupportedProtocols.kafka())
- .supportedFormats(SupportedFormats.jsonFormat())
-
- // create a simple text parameter
- .requiredTextParameter(Labels.from(SP_KEY, "Example Name",
"Example Description"))
-
- .build();
- }
-
- @Override
- public ConfiguredEventProcessor<DummyParameters>
onInvocation(DataProcessorInvocation graph, ProcessingElementParameterExtractor
extractor) {
-
- // Extract the text parameter value
- String textParameter = extractor.singleValueParameter(SP_KEY,
String.class);
-
- // now the text parameter would be added to a parameter class (omitted for
this example)
-
- return new ConfiguredEventProcessor<>(new DummyParameters(graph),
DummyEngine::new);
- }
-}
diff --git
a/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/staticproperty/UnaryMappingPropertyExampleController.java
b/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/staticproperty/UnaryMappingPropertyExampleController.java
deleted file mode 100644
index 0ddeec6..0000000
---
a/streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/pe/examples/jvm/staticproperty/UnaryMappingPropertyExampleController.java
+++ /dev/null
@@ -1,64 +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.pe.examples.jvm.staticproperty;
-
-import org.apache.streampipes.model.graph.DataProcessorDescription;
-import org.apache.streampipes.model.graph.DataProcessorInvocation;
-import org.apache.streampipes.model.schema.PropertyScope;
-import org.apache.streampipes.pe.examples.jvm.base.DummyEngine;
-import org.apache.streampipes.pe.examples.jvm.base.DummyParameters;
-import org.apache.streampipes.sdk.builder.ProcessingElementBuilder;
-import org.apache.streampipes.sdk.builder.StreamRequirementsBuilder;
-import
org.apache.streampipes.sdk.extractor.ProcessingElementParameterExtractor;
-import org.apache.streampipes.sdk.helpers.EpRequirements;
-import org.apache.streampipes.sdk.helpers.Labels;
-import org.apache.streampipes.sdk.helpers.OutputStrategies;
-import org.apache.streampipes.sdk.helpers.SupportedFormats;
-import org.apache.streampipes.sdk.helpers.SupportedProtocols;
-import org.apache.streampipes.wrapper.standalone.ConfiguredEventProcessor;
-import
org.apache.streampipes.wrapper.standalone.declarer.StandaloneEventProcessingDeclarer;
-
-public class UnaryMappingPropertyExampleController extends
- StandaloneEventProcessingDeclarer<DummyParameters> {
-
- @Override
- public DataProcessorDescription declareModel() {
- return
ProcessingElementBuilder.create("org.apache.streampipes.examples.staticproperty"
+
- ".mappingunary", "Unary Mapping Property Example", "")
- .requiredStream(StreamRequirementsBuilder.
- create()
-
.requiredPropertyWithUnaryMapping(EpRequirements.numberReq(),
- Labels.from("mp-key", "My Mapping", ""),
- PropertyScope.NONE)
- .build())
- .outputStrategy(OutputStrategies.keep())
- .supportedProtocols(SupportedProtocols.kafka())
- .supportedFormats(SupportedFormats.jsonFormat())
-
- .build();
- }
-
- @Override
- public ConfiguredEventProcessor<DummyParameters>
onInvocation(DataProcessorInvocation graph, ProcessingElementParameterExtractor
extractor) {
-
- // Extract the mapping property value
- String mappingPropertySelector = extractor.mappingPropertyValue("mp-key");
-
- return new ConfiguredEventProcessor<>(new DummyParameters(graph),
DummyEngine::new);
- }
-}