This is an automated email from the ASF dual-hosted git repository.
cdutz pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git
The following commit(s) were added to refs/heads/develop by this push:
new 269e42a - Removed the StreamPipes modules as these are now integrated
in the StreamPipes Project. - Bumped the Boost version to the latest and
updated the download URL to a working version
269e42a is described below
commit 269e42a44e3a09bd00f166ea1edb6a51136a9b99
Author: cdutz <[email protected]>
AuthorDate: Tue May 25 10:54:40 2021 +0200
- Removed the StreamPipes modules as these are now integrated in the
StreamPipes Project.
- Bumped the Boost version to the latest and updated the download URL to a
working version
---
pom.xml | 6 +-
sandbox/pom.xml | 4 -
sandbox/test-streampipes-plc4x-adapters/Dockerfile | 24 --
.../test-streampipes-plc4x-adapters/READMME.adoc | 49 ---
.../env/development | 26 --
sandbox/test-streampipes-plc4x-adapters/pom.xml | 282 ---------------
.../java/streampipes/adapters/Plc4xAdapters.java | 43 ---
.../streampipes/adapters/config/ConfigKeys.java | 33 --
.../adapters/config/ConnectWorkerConfig.java | 86 -----
.../adapters/source/bacnetip/BacNetIpAdapter.java | 381 ---------------------
.../adapters/source/knxnetip/KnxNetIpAdapter.java | 222 ------------
.../test-streampipes-plc4x-processors/Dockerfile | 24 --
.../test-streampipes-plc4x-processors/READMME.adoc | 49 ---
.../env/development | 24 --
sandbox/test-streampipes-plc4x-processors/pom.xml | 374 --------------------
.../processors/Plc4xProcessorsInit.java | 55 ---
.../java/streampipes/processors/config/Config.java | 88 -----
.../streampipes/processors/config/ConfigKeys.java | 35 --
.../ede/BacNetIpEdeDataEnrichmentController.java | 88 -----
.../enrich/knxnetip/ets5/Ets5DataEnrichment.java | 110 ------
.../ets5/Ets5DataEnrichmentController.java | 93 -----
.../ets5/Ets5DataEnrichmentParameters.java | 43 ---
.../strings.en | 27 --
.../strings.en | 30 --
sandbox/test-streampipes-plc4x-shared/pom.xml | 32 --
.../shared/source/bacnetip/Constants.java | 25 --
.../shared/source/knxnetip/Constants.java | 28 --
27 files changed, 3 insertions(+), 2278 deletions(-)
diff --git a/pom.xml b/pom.xml
index 33f1b55..6c51865 100644
--- a/pom.xml
+++ b/pom.xml
@@ -109,8 +109,8 @@
<!-- TODO: the currently available version is 2.0.5 and anything above
1.4.3 is no longer compatible with our code -->
<bit-io.version>1.4.3</bit-io.version>
<bouncycastle.version>1.67</bouncycastle.version>
- <boost.version>1.74.0</boost.version>
- <boost.version.underline-short>1_74</boost.version.underline-short>
+ <boost.version>1.76.0</boost.version>
+ <boost.version.underline-short>1_76</boost.version.underline-short>
<boost.version.underline>${boost.version.underline-short}_0</boost.version.underline>
<byte-buddy.version>1.10.18</byte-buddy.version>
<!-- Be sure to keep this version set to the version of the
cmake-maven-plugin -->
@@ -1437,7 +1437,7 @@
<cmake.url>https://github.com/Kitware/CMake/releases/download/v${cmake-version}/cmake-${cmake-version}-Linux-x86_64.tar.gz</cmake.url>
<cmake.root>${project.build.directory}/cmake-${cmake-version}-Linux-x86_64/bin/</cmake.root>
<cmake.generator>Unix Makefiles</cmake.generator>
-
<boost.url>https://dl.bintray.com/boostorg/release/${boost.version}/source/boost_${boost.version.underline}.tar.gz</boost.url>
+
<boost.url>https://boostorg.jfrog.io/artifactory/main/release/${boost.version}/source/boost_${boost.version.underline}.tar.gz</boost.url>
<boost.bootstrap.executable>./bootstrap.sh</boost.bootstrap.executable>
<boost.build.executable>./b2</boost.build.executable>
<thrift.bootstrap.executable>./bootstrap.sh</thrift.bootstrap.executable>
diff --git a/sandbox/pom.xml b/sandbox/pom.xml
index 9bfac6c..56cefb7 100644
--- a/sandbox/pom.xml
+++ b/sandbox/pom.xml
@@ -42,10 +42,6 @@
<module>test-java-bacnetip-driver</module>
<module>test-java-df1-driver</module>
- <module>test-streampipes-plc4x-adapters</module>
- <module>test-streampipes-plc4x-processors</module>
- <module>test-streampipes-plc4x-shared</module>
-
<!-- Examples -->
<module>hello-influx-data-collection</module>
</modules>
diff --git a/sandbox/test-streampipes-plc4x-adapters/Dockerfile
b/sandbox/test-streampipes-plc4x-adapters/Dockerfile
deleted file mode 100644
index 2a70d90..0000000
--- a/sandbox/test-streampipes-plc4x-adapters/Dockerfile
+++ /dev/null
@@ -1,24 +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.
-
-FROM adoptopenjdk/openjdk8-openj9:alpine-slim
-
-EXPOSE 8090
-ENV CONSUL_LOCATION consul
-
-ARG JAR_FILE
-ADD ./target/${JAR_FILE} /streampipes-processing-element-container.jar
-
-ENTRYPOINT ["java", "-jar", "/streampipes-processing-element-container.jar"]
diff --git a/sandbox/test-streampipes-plc4x-adapters/READMME.adoc
b/sandbox/test-streampipes-plc4x-adapters/READMME.adoc
deleted file mode 100644
index fa94660..0000000
--- a/sandbox/test-streampipes-plc4x-adapters/READMME.adoc
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-== Setting up for development.
-
-1. Install StreamPipes (Using `./streampipes start` with the installer,
choosing a real IP address)
-2. When asked for the IP address, enter: `host.docker.internal`
-3. Edit your `hosts` file (Mac: `/private/ect/hosts`) to direct
`host.docker.internal` to `127.0.0.1_`
-
-== Setting up the Worker
-
-1. Make sure the `EnvFile` plugin is installed in IntelliJ
-2. Create a new `Application` run configuration targeting the
`BacNetIpAdapter.BacNetIpAdapterInit` class
-3. Go to the run-configuration and select the `EnvFile` tab
-4. Check the `Enable EnvFile`
-5. Add the env file in `env/development`
-
-== Running the Worker
-
-1. Execute the new run configuration (This will fail with an error: `Web
server failed to start. Port 8098 was already in use.`)
-2. Stop the running configuration.
-3. Go to the `Consul` configuration page on `http://localhost:8500`
-4. Select `Key/Value`
-5. Navigate to `sp/v1/{name of your worker}
-6. Change `SP_CONNECT_CONTAINER_WORKER_PORT` to an unused port: `8198`
-7. Change `SP_CONNECT_CONTAINER_WORKER_HOST` and `SP_KAFKA_HOST` from
`localhost` to the fixed ip you told the setup to use
-8. Restart the run configuration
-
-== Using the Worker
-
-1. Go to the StreamPipes UI section `StreamPipes connect`
-2. Search for your Worker
-3. Give it a name
-4. Start it
-5. Now it should appear in the `Data Streams` section of the pipeline editor
\ No newline at end of file
diff --git a/sandbox/test-streampipes-plc4x-adapters/env/development
b/sandbox/test-streampipes-plc4x-adapters/env/development
deleted file mode 100644
index 1d1b919..0000000
--- a/sandbox/test-streampipes-plc4x-adapters/env/development
+++ /dev/null
@@ -1,26 +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.
-# ----------------------------------------------------------------------------
-
-# Redirect some parameters for local development.
-SP_CONNECT_CONTAINER_WORKER_HOST=host.docker.internal
-SP_CONNECT_CONTAINER_HOST=host.docker.internal
-SP_CONNECT_CONTAINER_MASTER_HOST=localhost
-SP_DATA_LOCATION=./test_data/
-SP_DEBUG=true
-SP_DEBUG_CONNECT=false
\ No newline at end of file
diff --git a/sandbox/test-streampipes-plc4x-adapters/pom.xml
b/sandbox/test-streampipes-plc4x-adapters/pom.xml
deleted file mode 100644
index 34b92d4..0000000
--- a/sandbox/test-streampipes-plc4x-adapters/pom.xml
+++ /dev/null
@@ -1,282 +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">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.plc4x.sandbox</groupId>
- <artifactId>plc4x-sandbox</artifactId>
- <version>0.9.0-SNAPSHOT</version>
- </parent>
-
- <artifactId>test-streampipes-plc4x-adapters</artifactId>
-
- <name>Sandbox: StreamPipes Adapters</name>
-
- <properties>
- <streampipes.version>0.66.0</streampipes.version>
- </properties>
-
- <build>
- <plugins>
- <!-- Repackage the project as SpringBoot application -->
- <plugin>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-maven-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>repackage</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.plc4x</groupId>
- <artifactId>plc4j-transport-tcp</artifactId>
- <version>0.9.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.plc4x</groupId>
- <artifactId>plc4j-transport-udp</artifactId>
- <version>0.9.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.plc4x</groupId>
- <artifactId>plc4j-transport-raw-socket</artifactId>
- <version>0.9.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.plc4x</groupId>
- <artifactId>plc4j-transport-pcap-replay</artifactId>
- <version>0.9.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.plc4x</groupId>
- <artifactId>plc4j-transport-serial</artifactId>
- <version>0.9.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.plc4x.sandbox</groupId>
- <artifactId>test-streampipes-plc4x-shared</artifactId>
- <version>0.9.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.plc4x</groupId>
- <artifactId>plc4j-driver-knxnetip</artifactId>
- <version>0.9.0-SNAPSHOT</version>
- <exclusions>
- <exclusion>
- <groupId>commons-codec</groupId>
- <artifactId>commons-codec</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.plc4x.sandbox</groupId>
- <artifactId>test-java-bacnetip-driver</artifactId>
- <version>0.9.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.streampipes</groupId>
- <artifactId>streampipes-connect-container-worker</artifactId>
- <version>${streampipes.version}</version>
- <exclusions>
- <exclusion>
- <artifactId>javax.ws.rs-api</artifactId>
- <groupId>javax.ws.rs</groupId>
- </exclusion>
- <exclusion>
- <artifactId>javax.servlet-api</artifactId>
- <groupId>javax.servlet</groupId>
- </exclusion>
- <exclusion>
- <artifactId>javax.annotation-api</artifactId>
- <groupId>javax.annotation</groupId>
- </exclusion>
- <exclusion>
- <artifactId>javax.inject</artifactId>
- <groupId>javax.inject</groupId>
- </exclusion>
- <exclusion>
- <artifactId>aopalliance</artifactId>
- <groupId>aopalliance</groupId>
- </exclusion>
- <exclusion>
- <artifactId>aopalliance-repackaged</artifactId>
- <groupId>org.glassfish.hk2.external</groupId>
- </exclusion>
- <exclusion>
- <artifactId>tomcat-embed-el</artifactId>
- <groupId>org.apache.tomcat.embed</groupId>
- </exclusion>
- <exclusion>
- <artifactId>persistence-api</artifactId>
- <groupId>javax.persistence</groupId>
- </exclusion>
- <exclusion>
- <artifactId>jboss-annotations-api_1.2_spec</artifactId>
- <groupId>org.jboss.spec.javax.annotation</groupId>
- </exclusion>
- <exclusion>
- <artifactId>jaxb-api</artifactId>
- <groupId>javax.xml.bind</groupId>
- </exclusion>
- <exclusion>
- <artifactId>httpcore</artifactId>
- <groupId>org.apache.httpcomponents</groupId>
- </exclusion>
- <exclusion>
- <groupId>commons-codec</groupId>
- <artifactId>commons-codec</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.pcap4j</groupId>
- <artifactId>pcap4j-core</artifactId>
- </dependency>
-
- <dependency>
- <groupId>ch.qos.logback</groupId>
- <artifactId>logback-classic</artifactId>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>ch.qos.logback</groupId>
- <artifactId>logback-core</artifactId>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>org.apache.plc4x</groupId>
- <artifactId>plc4j-spi</artifactId>
- <version>0.9.0-SNAPSHOT</version>
- <exclusions>
- <exclusion>
- <groupId>commons-codec</groupId>
- <artifactId>commons-codec</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>com.squareup.okhttp3</groupId>
- <artifactId>okhttp</artifactId>
- <version>3.14.3</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-aop</artifactId>
- <version>5.2.1.RELEASE</version>
- </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.datatype</groupId>
- <artifactId>jackson-datatype-jdk8</artifactId>
- <version>2.10.0</version>
- </dependency>
- <dependency>
- <groupId>org.javassist</groupId>
- <artifactId>javassist</artifactId>
- <version>3.25.0-GA</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-beans</artifactId>
- <version>5.2.1.RELEASE</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-context</artifactId>
- <version>5.2.1.RELEASE</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-core</artifactId>
- <version>5.2.1.RELEASE</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-web</artifactId>
- <version>5.2.1.RELEASE</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.logging</groupId>
- <artifactId>jboss-logging</artifactId>
- <version>3.4.1.Final</version>
- </dependency>
- <dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpclient-osgi</artifactId>
- <version>4.5.10</version>
- </dependency>
- </dependencies>
- </dependencyManagement>
-
- <profiles>
- <profile>
- <id>with-docker</id>
- <build>
- <plugins>
- <!-- Build the Docker image -->
- <plugin>
- <groupId>com.spotify</groupId>
- <artifactId>dockerfile-maven-plugin</artifactId>
- <version>1.4.13</version>
- <executions>
- <execution>
- <id>default</id>
- <goals>
- <goal>build</goal>
- <goal>push</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <repository>apache/plc4x-streampipes-adapters</repository>
- <tag>${project.version}</tag>
- <buildArgs>
- <JAR_FILE>${project.build.finalName}.jar</JAR_FILE>
- </buildArgs>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
-</project>
\ No newline at end of file
diff --git
a/sandbox/test-streampipes-plc4x-adapters/src/main/java/org/apache/plc4x/java/streampipes/adapters/Plc4xAdapters.java
b/sandbox/test-streampipes-plc4x-adapters/src/main/java/org/apache/plc4x/java/streampipes/adapters/Plc4xAdapters.java
deleted file mode 100644
index 5141ce6..0000000
---
a/sandbox/test-streampipes-plc4x-adapters/src/main/java/org/apache/plc4x/java/streampipes/adapters/Plc4xAdapters.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.plc4x.java.streampipes.adapters;
-
-
-import org.apache.plc4x.java.streampipes.adapters.config.ConnectWorkerConfig;
-import
org.apache.plc4x.java.streampipes.adapters.source.bacnetip.BacNetIpAdapter;
-import
org.apache.plc4x.java.streampipes.adapters.source.knxnetip.KnxNetIpAdapter;
-import
org.apache.streampipes.connect.container.worker.init.AdapterWorkerContainer;
-import org.apache.streampipes.connect.init.AdapterDeclarerSingleton;
-
-public class Plc4xAdapters extends AdapterWorkerContainer {
-
- public static void main(String[] args) {
- // Declare the data-sources.
- AdapterDeclarerSingleton
- .getInstance()
- .add(new KnxNetIpAdapter())
- .add(new BacNetIpAdapter());
-
- String workerUrl =
ConnectWorkerConfig.INSTANCE.getConnectContainerWorkerUrl();
- String masterUrl =
ConnectWorkerConfig.INSTANCE.getConnectContainerMasterUrl();
- Integer workerPort =
ConnectWorkerConfig.INSTANCE.getConnectContainerWorkerPort();
- new Plc4xAdapters().init(workerUrl, masterUrl, workerPort);
- }
-
-}
diff --git
a/sandbox/test-streampipes-plc4x-adapters/src/main/java/org/apache/plc4x/java/streampipes/adapters/config/ConfigKeys.java
b/sandbox/test-streampipes-plc4x-adapters/src/main/java/org/apache/plc4x/java/streampipes/adapters/config/ConfigKeys.java
deleted file mode 100644
index 3542ae8..0000000
---
a/sandbox/test-streampipes-plc4x-adapters/src/main/java/org/apache/plc4x/java/streampipes/adapters/config/ConfigKeys.java
+++ /dev/null
@@ -1,33 +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.plc4x.java.streampipes.adapters.config;
-
-public class ConfigKeys {
-
- final static String KAFKA_HOST = "SP_KAFKA_HOST";
- final static String KAFKA_PORT = "SP_KAFKA_PORT";
-
- final static String CONNECT_CONTAINER_WORKER_HOST =
"SP_CONNECT_CONTAINER_WORKER_HOST";
- final static String CONNECT_CONTAINER_WORKER_PORT =
"SP_CONNECT_CONTAINER_WORKER_PORT";
-
- final static String CONNECT_CONTAINER_MASTER_HOST =
"SP_CONNECT_CONTAINER_MASTER_HOST";
- final static String CONNECT_CONTAINER_MASTER_PORT =
"SP_CONNECT_CONTAINER_MASTER_PORT";
-
-}
diff --git
a/sandbox/test-streampipes-plc4x-adapters/src/main/java/org/apache/plc4x/java/streampipes/adapters/config/ConnectWorkerConfig.java
b/sandbox/test-streampipes-plc4x-adapters/src/main/java/org/apache/plc4x/java/streampipes/adapters/config/ConnectWorkerConfig.java
deleted file mode 100644
index f1b262f..0000000
---
a/sandbox/test-streampipes-plc4x-adapters/src/main/java/org/apache/plc4x/java/streampipes/adapters/config/ConnectWorkerConfig.java
+++ /dev/null
@@ -1,86 +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.plc4x.java.streampipes.adapters.config;
-
-import org.apache.streampipes.config.SpConfig;
-import org.apache.streampipes.connect.init.Config;
-
-public enum ConnectWorkerConfig {
-
- INSTANCE;
-
- private SpConfig config;
-
- ConnectWorkerConfig() {
- // The name this config will be saved under
- // Can be found/edited/deleted here:
http://localhost:8500/ui/dc1/kv/sp/v1/
- String name = "plc4x-connect-worker-main";
- config = SpConfig.getSpConfig(name);
-
- // Only used, if there is no configuration available in consul.
- config.register(ConfigKeys.KAFKA_HOST, "kafka", "Hostname for backend
service for kafka");
- config.register(ConfigKeys.KAFKA_PORT, 9092, "Port for backend service
for kafka");
- config.register(ConfigKeys.CONNECT_CONTAINER_WORKER_PORT, 8198, "The
port of the connect container");
- config.register(ConfigKeys.CONNECT_CONTAINER_WORKER_HOST, name, "The
hostname of the connect container");
- config.register(ConfigKeys.CONNECT_CONTAINER_MASTER_PORT,
Config.MASTER_PORT, "The port of the connect container");
- config.register(ConfigKeys.CONNECT_CONTAINER_MASTER_HOST,
Config.MASTER_HOST, "The hostname of the connect container");
- }
-
- public String getConnectContainerWorkerUrl() {
- return "http://" +
config.getString(ConfigKeys.CONNECT_CONTAINER_WORKER_HOST) + ":" +
config.getInteger(ConfigKeys.CONNECT_CONTAINER_WORKER_PORT) + "/";
- }
-
- public String getConnectContainerMasterUrl() {
- return "http://" +
config.getString(ConfigKeys.CONNECT_CONTAINER_MASTER_HOST) + ":" +
config.getInteger(ConfigKeys.CONNECT_CONTAINER_MASTER_PORT) + "/";
- }
-
- public String getKafkaHost() {
- return config.getString(ConfigKeys.KAFKA_HOST);
- }
-
- public void setKafkaHost(String s) {
- config.setString(ConfigKeys.KAFKA_HOST, s);
- }
-
- public int getKafkaPort() {
- return config.getInteger(ConfigKeys.KAFKA_PORT);
- }
-
- public String getKafkaUrl() {
- return getKafkaHost() + ":" + getKafkaPort();
- }
-
- public String getConnectContainerWorkerHost() {
- return config.getString(ConfigKeys.CONNECT_CONTAINER_WORKER_HOST);
- }
-
- public Integer getConnectContainerWorkerPort() {
- return config.getInteger(ConfigKeys.CONNECT_CONTAINER_WORKER_PORT);
- }
-
- public String getConnectContainerMasterHost() {
- return config.getString(ConfigKeys.CONNECT_CONTAINER_MASTER_HOST);
- }
-
- public Integer getConnectContainerMasterPort() {
- return config.getInteger(ConfigKeys.CONNECT_CONTAINER_MASTER_PORT);
- }
-
-}
diff --git
a/sandbox/test-streampipes-plc4x-adapters/src/main/java/org/apache/plc4x/java/streampipes/adapters/source/bacnetip/BacNetIpAdapter.java
b/sandbox/test-streampipes-plc4x-adapters/src/main/java/org/apache/plc4x/java/streampipes/adapters/source/bacnetip/BacNetIpAdapter.java
deleted file mode 100644
index e684aec..0000000
---
a/sandbox/test-streampipes-plc4x-adapters/src/main/java/org/apache/plc4x/java/streampipes/adapters/source/bacnetip/BacNetIpAdapter.java
+++ /dev/null
@@ -1,381 +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.plc4x.java.streampipes.adapters.source.bacnetip;
-
-import org.apache.plc4x.java.api.exceptions.PlcConnectionException;
-import org.apache.plc4x.java.spi.connection.DefaultNettyPlcConnection;
-import org.pcap4j.core.*;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.streampipes.connect.adapter.Adapter;
-import org.apache.streampipes.connect.adapter.exception.AdapterException;
-import org.apache.streampipes.connect.adapter.exception.ParseException;
-import
org.apache.streampipes.connect.adapter.model.specific.SpecificDataStreamAdapter;
-import org.apache.streampipes.connect.adapter.sdk.ParameterExtractor;
-import org.apache.streampipes.model.AdapterType;
-import
org.apache.streampipes.model.connect.adapter.SpecificAdapterStreamDescription;
-import org.apache.streampipes.model.connect.guess.GuessSchema;
-import org.apache.streampipes.model.schema.EventProperty;
-import org.apache.streampipes.model.schema.EventSchema;
-import org.apache.streampipes.model.staticproperty.*;
-import org.apache.streampipes.sdk.StaticProperties;
-import org.apache.streampipes.sdk.builder.PrimitivePropertyBuilder;
-import
org.apache.streampipes.sdk.builder.adapter.SpecificDataStreamAdapterBuilder;
-import org.apache.streampipes.sdk.helpers.*;
-import org.apache.streampipes.sdk.utils.Datatypes;
-
-import java.util.*;
-
-public class BacNetIpAdapter extends SpecificDataStreamAdapter {
-
- public static final String ID =
"http://plc4x.apache.org/streampipes/adapter/bacnetip";
-
- public static final String MAPPING_FIELD_TIME = "time";
- public static final String MAPPING_FIELD_OBJECT_ID = "objectId";
- public static final String MAPPING_FIELD_OBJECT_TYPE = "objectType";
- public static final String MAPPING_FIELD_NOTIFICATION_INSTANCE_NUMBER =
"notificationInstanceNumber";
- public static final String MAPPING_FIELD_NOTIFICATION_TYPE =
"notificationType";
- public static final String MAPPING_FIELD_VALUE_TYPE = "valueType";
- public static final String MAPPING_FIELD_VALUE = "value";
- public static final String MAPPING_FIELD_STATUS = "status";
-
- private static final Logger logger =
LoggerFactory.getLogger(BacNetIpAdapter.class);
-
- private String deviceName;
- private String pcapFile;
- private DefaultNettyPlcConnection connection;
-
- public BacNetIpAdapter() {
- super();
- }
-
- public BacNetIpAdapter(SpecificAdapterStreamDescription
adapterDescription, String deviceName, String pcapFile) {
- super(adapterDescription);
- this.deviceName = deviceName;
- this.pcapFile = pcapFile;
- }
-
- @Override
- public SpecificAdapterStreamDescription declareModel() {
- Label fileLabel = Labels.from("pcap-file", "PCAP File", "File
containing the network traffic recording");
-
- Tuple2<String, String>[] deviceList = null;
- try {
- final List<PcapNetworkInterface> allDevs = Pcaps.findAllDevs();
- deviceList = new Tuple2[allDevs.size()];
- for (int i = 0; i < allDevs.size(); i++) {
- final PcapNetworkInterface pcapNetworkInterface =
allDevs.get(i);
- StringBuilder deviceName = new
StringBuilder((pcapNetworkInterface.getDescription() != null) ?
pcapNetworkInterface.getDescription() : pcapNetworkInterface.getName());
- deviceName.append(" (");
- for (PcapAddress address :
pcapNetworkInterface.getAddresses()) {
- if (address instanceof PcapIpV4Address) {
-
deviceName.append(address.getAddress().toString()).append("/").append(address.getNetmask().toString()).append(",
");
- }
- }
- String name = deviceName.toString();
- name = name.substring(0, name.length() - 2) +
((name.endsWith(", ")) ? ")" : "");
- deviceList[i] = new Tuple2<>(pcapNetworkInterface.getName(),
name);
- }
- } catch (PcapNativeException e) {
- logger.error("Error getting the list of installed network
devices");
- }
-
- SpecificAdapterStreamDescription description =
SpecificDataStreamAdapterBuilder.create(ID, "BACnet/IP", "")
- .iconUrl("bacnetip.png")
- .category(AdapterType.Manufacturing)
- .requiredAlternatives(Labels.from("source", "Source", "Select the
source, where the data is read from"),
- Alternatives.from(Labels.from("device", "Network", "Capture
data via network device"),
-
StaticProperties.singleValueSelection(Labels.from("network-device", "Network
Device", "Network device used for capturing"),
- Options.from(deviceList))),
- Alternatives.from(Labels.from("file", "File", "Capture data
from a PCAP network recording"),
- new FileStaticProperty(fileLabel.getInternalId(),
fileLabel.getLabel(), fileLabel.getDescription())))
- .build();
- description.setAppId(ID);
- return description;
- }
-
- @Override
- public GuessSchema getSchema(SpecificAdapterStreamDescription
specificAdapterStreamDescription) throws AdapterException, ParseException {
- EventSchema eventSchema = new EventSchema();
- List<EventProperty> allProperties = new ArrayList<>();
-
- allProperties.add(
- PrimitivePropertyBuilder
- .create(Datatypes.Long, MAPPING_FIELD_TIME)
- .label("Time")
- .description("The time the event was processed in the BACnet
adapter")
- .build());
-
- allProperties.add(
- PrimitivePropertyBuilder
- .create(Datatypes.Integer, MAPPING_FIELD_OBJECT_ID)
- .label("Object id")
- .description("Id of the BACnet object emitting the event
(usually 'device id')")
- .build());
- allProperties.add(
- PrimitivePropertyBuilder
- .create(Datatypes.Integer, MAPPING_FIELD_OBJECT_TYPE)
- .label("Object type")
- .description("Type of BACnet object emitting the event
(usually 'device')")
- .build());
- allProperties.add(
- PrimitivePropertyBuilder
- .create(Datatypes.Integer,
MAPPING_FIELD_NOTIFICATION_INSTANCE_NUMBER)
- .label("Notification instance number")
- .description("The instance number of the component emitting
the event (usually the id of the property changed on a device)")
- .build());
-
- allProperties.add(
- PrimitivePropertyBuilder
- .create(Datatypes.Integer, MAPPING_FIELD_NOTIFICATION_TYPE)
- .label("Notification type")
- .description("The type of notification this event resembles
(usually some type of input)")
- .build());
-
- allProperties.add(
- PrimitivePropertyBuilder
- .create(Datatypes.Integer, MAPPING_FIELD_VALUE_TYPE)
- .label("Value type")
- .description("The type the value has (real, uint, int,
bit-string, ...)")
- .build());
-
- allProperties.add(
- PrimitivePropertyBuilder
- .create(Datatypes.String, MAPPING_FIELD_VALUE)
- .label("Value")
- .description("This is the actual payload of the event.")
- .build());
-
- allProperties.add(
- PrimitivePropertyBuilder
- .create(Datatypes.Sequence, MAPPING_FIELD_STATUS)
- .label("Status")
- .description("Some times an array of status bits are passed
along.")
- .build());
-
- eventSchema.setEventProperties(allProperties);
-
- GuessSchema guessSchema = new GuessSchema();
- guessSchema.setEventSchema(eventSchema);
- guessSchema.setPropertyProbabilityList(new ArrayList<>());
-
- return guessSchema;
- }
-
- @Override
- public void startAdapter() throws AdapterException {
- /*try {
- ChannelFactory channelFactory;
- if (deviceName != null) {
- channelFactory = new RawSocketChannelFactory(deviceName, null,
- PassiveBacNetIpDriver.BACNET_IP_PORT,
PcapSocketAddress.ALL_PROTOCOLS,
- new
org.apache.plc4x.java.utils.rawsockets.netty.UdpIpPacketHandler());
- } else if (pcapFile != null) {
- channelFactory = new PcapChannelFactory(new File(pcapFile),
null,
- PassiveBacNetIpDriver.BACNET_IP_PORT,
PcapSocketAddress.ALL_PROTOCOLS,
- PcapSocketChannelConfig.SPEED_REALTIME,
- new UdpIpPacketHandler());
- } else {
- throw new AdapterException("Configuration Exception. Either
device or file have to be selected.");
- }
-
- connection = new PassiveBacNetIpPlcConnection(channelFactory, "",
- new PlcMessageToMessageCodec<BVLC, PlcRequestContainer>() {
-
- @Override
- protected void decode(ChannelHandlerContext
channelHandlerContext, BVLC packet, List<Object> list) throws Exception {
- NPDU npdu = null;
- if (packet instanceof BVLCOriginalUnicastNPDU) {
- npdu = ((BVLCOriginalUnicastNPDU)
packet).getNpdu();
- } else if (packet instanceof BVLCForwardedNPDU) {
- npdu = ((BVLCForwardedNPDU) packet).getNpdu();
- } else if (packet instanceof
BVLCOriginalBroadcastNPDU) {
- npdu = ((BVLCOriginalBroadcastNPDU)
packet).getNpdu();
- } else {
- throw new RuntimeException("Unexpected type of
packet");
- }
- final APDU apdu = npdu.getApdu();
- if (apdu instanceof APDUConfirmedRequest) {
- APDUConfirmedRequest request =
(APDUConfirmedRequest) apdu;
- final BACnetConfirmedServiceRequest serviceRequest
= request.getServiceRequest();
- if (serviceRequest instanceof
BACnetConfirmedServiceRequestConfirmedCOVNotification) {
-
BACnetConfirmedServiceRequestConfirmedCOVNotification covNotification =
(BACnetConfirmedServiceRequestConfirmedCOVNotification) serviceRequest;
- final BACnetTagWithContent[] notifications =
covNotification.getNotifications();
-
- String objectType =
Integer.toString(covNotification.getMonitoredObjectType());
- String objectId =
Long.toString(covNotification.getMonitoredObjectInstanceNumber());
-
- String notificationType =
Integer.toString(covNotification.getIssueConfirmedNotificationsType());
- String notificationInstanceNumber =
Long.toString(covNotification.getMonitoredObjectInstanceNumber());
-
- String type = null;
- Object value = null;
- boolean[] status = null;
- for (BACnetTagWithContent notification :
notifications) {
- // Id of the property that changed
- short propertyId =
notification.getPropertyIdentifier()[0];
-
- // Present-Value has the property id 85
- // (This is the actual value to which a
given property has changed)
- if (propertyId == 85) {
- // Depending on the type of object,
parse the data accordingly.
- if (notification.getValue() instanceof
BACnetTagApplicationBoolean) {
- type = "boolean";
- final BACnetTagApplicationBoolean
val = (BACnetTagApplicationBoolean) notification.getValue();
-
- } else if (notification.getValue()
instanceof BACnetTagApplicationUnsignedInteger) {
- type = "uint";
- final
BACnetTagApplicationUnsignedInteger val = (BACnetTagApplicationUnsignedInteger)
notification.getValue();
- // Convert any number of bytes
into an unsigned integer.
- switch (val.getData().length) {
- case 1:
- value =
Byte.toString(val.getData()[0]);
- break;
- case 2:
- value =
Short.toString(ByteBuffer.wrap(val.getData()).getShort());
- break;
- case 3:
- byte[] extValues = new
byte[4];
- extValues[0] = 0x00;
- for (int i = 0; i < 3;
i++) {
- extValues[i + 1] =
val.getData()[i];
- }
- value =
ByteBuffer.wrap(extValues).getInt();
- break;
- default:
- value = "Hurz";
- break;
- }
- } else if (notification.getValue()
instanceof BACnetTagApplicationSignedInteger) {
- type = "int";
- final
BACnetTagApplicationSignedInteger val = (BACnetTagApplicationSignedInteger)
notification.getValue();
-
- } else if (notification.getValue()
instanceof BACnetTagApplicationReal) {
- type = "real";
- final BACnetTagApplicationReal val
= (BACnetTagApplicationReal) notification.getValue();
- value =
Float.intBitsToFloat(ByteBuffer.wrap(val.getData()).getInt());
- } else if (notification.getValue()
instanceof BACnetTagApplicationDouble) {
- type = "double";
- final BACnetTagApplicationDouble
val = (BACnetTagApplicationDouble) notification.getValue();
-
- } else if (notification.getValue()
instanceof BACnetTagApplicationBitString) {
- type = "bit-string";
- final
BACnetTagApplicationBitString val = (BACnetTagApplicationBitString)
notification.getValue();
- int numBits =
(val.getData().length * 8) - val.getUnusedBits();
- BitSet bitSet =
BitSet.valueOf(val.getData());
- boolean[] bits = new
boolean[numBits];
- for (int i = 0; i < numBits; i++) {
- bits[i] = bitSet.get(i);
- }
- value = bits;
- } else if (notification.getValue()
instanceof BACnetTagApplicationEnumerated) {
- type = "enumeration";
- final
BACnetTagApplicationEnumerated val = (BACnetTagApplicationEnumerated)
notification.getValue();
- }
- }
-
- // Status-Flags have the property id 111
- // (This is some additional information
passed along)
- else if (propertyId == 111) {
- final BACnetTagApplicationBitString
val = (BACnetTagApplicationBitString) notification.getValue();
- int numBits = (val.getData().length *
8) - val.getUnusedBits();
- BitSet bitSet =
BitSet.valueOf(val.getData());
- boolean[] bits = new boolean[numBits];
- for (int i = 0; i < numBits; i++) {
- bits[i] = bitSet.get(i);
- }
- status = bits;
- }
- }
-
- if (value != null) {
- // Create the event object.
- Map<String, Object> event = new
HashMap<>();
- event.put(MAPPING_FIELD_TIME,
System.currentTimeMillis());
-
- event.put(MAPPING_FIELD_OBJECT_ID,
objectId);
- event.put(MAPPING_FIELD_OBJECT_TYPE,
objectType);
-
event.put(MAPPING_FIELD_NOTIFICATION_INSTANCE_NUMBER,
notificationInstanceNumber);
-
- event.put(MAPPING_FIELD_NOTIFICATION_TYPE,
notificationType);
- event.put(MAPPING_FIELD_VALUE_TYPE, type);
- event.put(MAPPING_FIELD_VALUE, value);
- event.put(MAPPING_FIELD_STATUS, status);
-
- // Send it to StreamPipes
- adapterPipeline.process(event);
- }
- }
- }
- }
-
- @Override
- protected void encode(ChannelHandlerContext ctx,
PlcRequestContainer msg, List<Object> out) throws Exception {
- // Ignore this as we don't send anything.
- }
- });
- connection.connect();
- } catch (PlcConnectionException e) {
- logger.error("An error occurred starting the BACnet/IP driver", e);
- throw new AdapterException("An error occurred starting the
BACnet/IP driver");
- }*/
- }
-
- @Override
- public void stopAdapter() throws AdapterException {
- if (connection != null) {
- try {
- connection.close();
- } catch (PlcConnectionException e) {
- logger.error("An error occurred stopping the BACnet/IP
driver", e);
- throw new AdapterException("An error occurred stopping the
BACnet/IP driver");
- }
- }
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public Adapter getInstance(SpecificAdapterStreamDescription
specificAdapterStreamDescription) {
- ParameterExtractor extractor = new
ParameterExtractor(specificAdapterStreamDescription.getConfig());
- String deviceName = null;
- String pcapFile = null;
-
- StaticPropertyAlternatives sources = (StaticPropertyAlternatives)
extractor.getStaticPropertyByName("source");
- final Optional<StaticPropertyAlternative> selectedAlternative =
sources.getAlternatives().stream().filter(
- StaticPropertyAlternative::getSelected).findFirst();
- if (selectedAlternative.isPresent()) {
- final StaticPropertyAlternative staticPropertyAlternative =
selectedAlternative.get();
- if ("device".equals(staticPropertyAlternative.getInternalName())) {
- final Optional<Option> first =
- ((OneOfStaticProperty)
staticPropertyAlternative.getStaticProperty()).getOptions().stream().filter(
- Option::isSelected).findFirst();
- deviceName = first.isPresent() ? first.get().getName() :
"Unknown";
- } else {
- pcapFile = ((FileStaticProperty)
staticPropertyAlternative.getStaticProperty()).getLocationPath();
- }
- }
- return new BacNetIpAdapter(specificAdapterStreamDescription,
deviceName, pcapFile);
- }
-
- @Override
- public String getId() {
- return ID;
- }
-
-}
diff --git
a/sandbox/test-streampipes-plc4x-adapters/src/main/java/org/apache/plc4x/java/streampipes/adapters/source/knxnetip/KnxNetIpAdapter.java
b/sandbox/test-streampipes-plc4x-adapters/src/main/java/org/apache/plc4x/java/streampipes/adapters/source/knxnetip/KnxNetIpAdapter.java
deleted file mode 100644
index 96b0136..0000000
---
a/sandbox/test-streampipes-plc4x-adapters/src/main/java/org/apache/plc4x/java/streampipes/adapters/source/knxnetip/KnxNetIpAdapter.java
+++ /dev/null
@@ -1,222 +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.plc4x.java.streampipes.adapters.source.knxnetip;
-
-import org.apache.plc4x.java.api.exceptions.PlcConnectionException;
-import org.apache.plc4x.java.knxnetip.readwrite.KnxAddress;
-import org.apache.plc4x.java.spi.connection.DefaultNettyPlcConnection;
-import org.apache.plc4x.java.streampipes.shared.source.knxnetip.Constants;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.streampipes.connect.adapter.Adapter;
-import org.apache.streampipes.connect.adapter.exception.AdapterException;
-import org.apache.streampipes.connect.adapter.exception.ParseException;
-import
org.apache.streampipes.connect.adapter.model.specific.SpecificDataStreamAdapter;
-import org.apache.streampipes.connect.adapter.sdk.ParameterExtractor;
-import org.apache.streampipes.model.AdapterType;
-import
org.apache.streampipes.model.connect.adapter.SpecificAdapterStreamDescription;
-import org.apache.streampipes.model.connect.guess.GuessSchema;
-import org.apache.streampipes.model.schema.EventProperty;
-import org.apache.streampipes.model.schema.EventSchema;
-import org.apache.streampipes.model.staticproperty.FreeTextStaticProperty;
-import org.apache.streampipes.sdk.builder.PrimitivePropertyBuilder;
-import
org.apache.streampipes.sdk.builder.adapter.SpecificDataStreamAdapterBuilder;
-import org.apache.streampipes.sdk.helpers.Labels;
-import org.apache.streampipes.sdk.utils.Datatypes;
-import org.apache.streampipes.vocabulary.SO;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class KnxNetIpAdapter extends SpecificDataStreamAdapter {
-
- public static final String MAPPING_FIELD_TIME = "time";
- public static final String MAPPING_FIELD_SOURCE_ADDRESS = "sourceAddress";
- public static final String MAPPING_FIELD_DESTINATION_ADDRESS =
"destinationAddress";
- public static final String MAPPING_FIELD_PAYLOAD = "payload";
-
- private static final Logger logger =
LoggerFactory.getLogger(KnxNetIpAdapter.class);
-
- private String gatewayIp;
- private DefaultNettyPlcConnection connection;
-
- public KnxNetIpAdapter() {
- super();
- }
-
- public KnxNetIpAdapter(SpecificAdapterStreamDescription
adapterDescription, String gatewayIp) {
- super(adapterDescription);
- this.gatewayIp = gatewayIp;
- }
-
- @Override
- public SpecificAdapterStreamDescription declareModel() {
- SpecificAdapterStreamDescription description =
SpecificDataStreamAdapterBuilder.create(Constants.KNXNET_ID, "KNXnet/IP", "")
- .iconUrl("knxnetip.png")
- .category(AdapterType.Manufacturing)
- .requiredTextParameter(Labels.from("gatewayIp", "KNXnet/IP
Gateway", "Ip of the KNX gateway."))
- .build();
- description.setAppId(Constants.KNXNET_ID);
- return description;
- }
-
- @Override
- public GuessSchema getSchema(SpecificAdapterStreamDescription
specificAdapterStreamDescription) throws AdapterException, ParseException {
- List<EventProperty> allProperties = new ArrayList<>();
- allProperties.add(
- PrimitivePropertyBuilder
- .create(Datatypes.Long, MAPPING_FIELD_TIME)
- .domainProperty(SO.DateTime)
- .label("Time")
- .description("The time the event was processed in the
KNXnet/IP driver.")
- .build());
- allProperties.add(
- PrimitivePropertyBuilder
- .create(Datatypes.Integer, MAPPING_FIELD_SOURCE_ADDRESS)
- .domainProperty(Constants.KNXNET_ID_SOURCE_ADDRESS)
- .label("Source Address")
- .description("Source address from which the event originated.")
- .build());
- allProperties.add(
- PrimitivePropertyBuilder
- .create(Datatypes.Integer, MAPPING_FIELD_DESTINATION_ADDRESS)
- .domainProperty(Constants.KNXNET_ID_DESTINATION_ADDRESS)
- .label("Destination Address")
- .description("Destination address to which the event is
targeted.")
- .build());
- allProperties.add(
- PrimitivePropertyBuilder
- .create(Datatypes.String, MAPPING_FIELD_PAYLOAD)
- .domainProperty(Constants.KNXNET_ID_PAYLOAD)
- .label("Payload")
- .description("Raw payload of the event.")
- .build());
-
- EventSchema eventSchema = new EventSchema();
- eventSchema.setEventProperties(allProperties);
-
- GuessSchema guessSchema = new GuessSchema();
- guessSchema.setEventSchema(eventSchema);
- guessSchema.setPropertyProbabilityList(new ArrayList<>());
-
- return guessSchema;
- }
-
- @Override
- public void startAdapter() throws AdapterException {
- if((connection != null) && (connection.isConnected())) {
- return;
- }
- /*
- try {
- InetAddress inetAddress = InetAddress.getByName(gatewayIp);
- ChannelFactory channelFactory = new
UdpSocketChannelFactory(inetAddress, KnxNetIpConnection.KNXNET_IP_PORT);
-
- connection = new KnxNetIpConnection(channelFactory, "",
- new PlcMessageToMessageCodec<KNXNetIPMessage,
PlcRequestContainer>() {
-
- @Override
- protected void decode(ChannelHandlerContext
channelHandlerContext, KNXNetIPMessage packet, List<Object> list) throws
Exception {
- if(packet instanceof TunnelingRequest) {
- TunnelingRequest request = (TunnelingRequest) packet;
- CEMI cemiPayload = request.getCemi();
- if(cemiPayload instanceof CEMIBusmonInd) {
- CEMIBusmonInd cemiBusmonInd = (CEMIBusmonInd)
cemiPayload;
- if(cemiBusmonInd.getCemiFrame() instanceof
CEMIFrameData) {
- CEMIFrameData cemiDataFrame = (CEMIFrameData)
cemiBusmonInd.getCemiFrame();
-
- // The first byte is actually just 6 bit long,
but we'll treat it as a full one.
- // So here we create a byte array containing
the first and all the following bytes.
- byte[] payload = new byte[1 +
cemiDataFrame.getData().length];
- payload[0] = cemiDataFrame.getDataFirstByte();
- System.arraycopy(cemiDataFrame.getData(), 0,
payload, 1, cemiDataFrame.getData().length);
-
- Map<String, Object> event = new HashMap<>();
- event.put(MAPPING_FIELD_TIME,
System.currentTimeMillis());
- event.put(MAPPING_FIELD_SOURCE_ADDRESS,
addressToString(cemiDataFrame.getSourceAddress()));
- event.put(MAPPING_FIELD_DESTINATION_ADDRESS,
Hex.encodeHex(cemiDataFrame.getDestinationAddress()));
- // Encode the payload as Hex String.
- event.put(MAPPING_FIELD_PAYLOAD,
Hex.encodeHexString(payload));
-
- // Send it to StreamPipes
- adapterPipeline.process(event);
- } else if (cemiBusmonInd.getCemiFrame() instanceof
CEMIFrameAck){
- // Just ignore this ...
- } else {
- System.out.println(packet);
- }
- } else {
- System.out.println(packet);
- }
- } else {
- System.out.println(packet);
- }
- }
-
- @Override
- protected void encode(ChannelHandlerContext ctx,
PlcRequestContainer msg, List<Object> out) {
- // Ignore this as we don't send anything.
- }
- });
- connection.connect();
-
- } catch (PlcConnectionException e) {
- logger.error("An error occurred starting the BACnet/IP driver", e);
- throw new AdapterException("An error occurred starting the
BACnet/IP driver");
- } catch (UnknownHostException e) {
- logger.error("Error connecting to host " + gatewayIp, e);
- throw new AdapterException("Error connecting to host " +
gatewayIp);
- } catch (Exception e) {
- logger.error("Something strange went wrong.", e);
- }
- */
- }
-
- @Override
- public void stopAdapter() throws AdapterException {
- if(connection != null) {
- try {
- connection.close();
- } catch (PlcConnectionException e) {
- logger.error("An error occurred stopping the BACnet/IP
driver", e);
- throw new AdapterException("An error occurred stopping the
BACnet/IP driver");
- }
- }
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public Adapter getInstance(SpecificAdapterStreamDescription
specificAdapterStreamDescription) {
- ParameterExtractor extractor = new
ParameterExtractor(specificAdapterStreamDescription.getConfig());
-
- FreeTextStaticProperty gatewayIpProperty = (FreeTextStaticProperty)
extractor.getStaticPropertyByName("gatewayIp");
- gatewayIp = gatewayIpProperty.getValue();
- return new KnxNetIpAdapter(specificAdapterStreamDescription,
gatewayIp);
- }
-
- @Override
- public String getId() {
- return Constants.KNXNET_ID;
- }
-
- private String addressToString(KnxAddress knxAddress) {
- return knxAddress.getMainGroup() + "." + knxAddress.getMiddleGroup() +
"." + knxAddress.getSubGroup();
- }
-
-}
diff --git a/sandbox/test-streampipes-plc4x-processors/Dockerfile
b/sandbox/test-streampipes-plc4x-processors/Dockerfile
deleted file mode 100644
index 2a70d90..0000000
--- a/sandbox/test-streampipes-plc4x-processors/Dockerfile
+++ /dev/null
@@ -1,24 +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.
-
-FROM adoptopenjdk/openjdk8-openj9:alpine-slim
-
-EXPOSE 8090
-ENV CONSUL_LOCATION consul
-
-ARG JAR_FILE
-ADD ./target/${JAR_FILE} /streampipes-processing-element-container.jar
-
-ENTRYPOINT ["java", "-jar", "/streampipes-processing-element-container.jar"]
diff --git a/sandbox/test-streampipes-plc4x-processors/READMME.adoc
b/sandbox/test-streampipes-plc4x-processors/READMME.adoc
deleted file mode 100644
index fa94660..0000000
--- a/sandbox/test-streampipes-plc4x-processors/READMME.adoc
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-== Setting up for development.
-
-1. Install StreamPipes (Using `./streampipes start` with the installer,
choosing a real IP address)
-2. When asked for the IP address, enter: `host.docker.internal`
-3. Edit your `hosts` file (Mac: `/private/ect/hosts`) to direct
`host.docker.internal` to `127.0.0.1_`
-
-== Setting up the Worker
-
-1. Make sure the `EnvFile` plugin is installed in IntelliJ
-2. Create a new `Application` run configuration targeting the
`BacNetIpAdapter.BacNetIpAdapterInit` class
-3. Go to the run-configuration and select the `EnvFile` tab
-4. Check the `Enable EnvFile`
-5. Add the env file in `env/development`
-
-== Running the Worker
-
-1. Execute the new run configuration (This will fail with an error: `Web
server failed to start. Port 8098 was already in use.`)
-2. Stop the running configuration.
-3. Go to the `Consul` configuration page on `http://localhost:8500`
-4. Select `Key/Value`
-5. Navigate to `sp/v1/{name of your worker}
-6. Change `SP_CONNECT_CONTAINER_WORKER_PORT` to an unused port: `8198`
-7. Change `SP_CONNECT_CONTAINER_WORKER_HOST` and `SP_KAFKA_HOST` from
`localhost` to the fixed ip you told the setup to use
-8. Restart the run configuration
-
-== Using the Worker
-
-1. Go to the StreamPipes UI section `StreamPipes connect`
-2. Search for your Worker
-3. Give it a name
-4. Start it
-5. Now it should appear in the `Data Streams` section of the pipeline editor
\ No newline at end of file
diff --git a/sandbox/test-streampipes-plc4x-processors/env/development
b/sandbox/test-streampipes-plc4x-processors/env/development
deleted file mode 100644
index f07810b..0000000
--- a/sandbox/test-streampipes-plc4x-processors/env/development
+++ /dev/null
@@ -1,24 +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.
-# ----------------------------------------------------------------------------
-
-# Redirect some parameters for local development.
-SP_PORT=8091
-SP_HOST=host.docker.internal
-SP_DEBUG=true
-
diff --git a/sandbox/test-streampipes-plc4x-processors/pom.xml
b/sandbox/test-streampipes-plc4x-processors/pom.xml
deleted file mode 100644
index 01fd626..0000000
--- a/sandbox/test-streampipes-plc4x-processors/pom.xml
+++ /dev/null
@@ -1,374 +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">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.plc4x.sandbox</groupId>
- <artifactId>plc4x-sandbox</artifactId>
- <version>0.9.0-SNAPSHOT</version>
- </parent>
-
- <artifactId>test-streampipes-plc4x-processors</artifactId>
- <name>Sandbox: StreamPipes Processors</name>
-
- <properties>
- <streampipes.version>0.66.0</streampipes.version>
- </properties>
-
- <build>
- <plugins>
- <!-- Repackage the project as SpringBoot application -->
- <plugin>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-maven-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>repackage</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.plc4x</groupId>
- <artifactId>plc4j-transport-tcp</artifactId>
- <version>0.9.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.plc4x</groupId>
- <artifactId>plc4j-driver-knxnetip</artifactId>
- <version>0.9.0-SNAPSHOT</version>
- <exclusions>
- <exclusion>
- <groupId>commons-codec</groupId>
- <artifactId>commons-codec</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.apache.streampipes</groupId>
- <artifactId>streampipes-wrapper</artifactId>
- <version>${streampipes.version}</version>
- <exclusions>
- <exclusion>
- <groupId>com.google.code.findbugs</groupId>
- <artifactId>jsr305</artifactId>
- </exclusion>
- <exclusion>
- <artifactId>aopalliance</artifactId>
- <groupId>aopalliance</groupId>
- </exclusion>
- <exclusion>
- <artifactId>ow2-jpa-1.0-spec</artifactId>
- <groupId>org.ow2.spec.ee</groupId>
- </exclusion>
- <exclusion>
- <artifactId>javax.ws.rs-api</artifactId>
- <groupId>javax.ws.rs</groupId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.streampipes</groupId>
- <artifactId>streampipes-wrapper-standalone</artifactId>
- <version>${streampipes.version}</version>
- <exclusions>
- <exclusion>
- <groupId>com.google.code.findbugs</groupId>
- <artifactId>jsr305</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.streampipes</groupId>
- <artifactId>streampipes-sdk</artifactId>
- <version>${streampipes.version}</version>
- <exclusions>
- <exclusion>
- <artifactId>aopalliance</artifactId>
- <groupId>aopalliance</groupId>
- </exclusion>
- <exclusion>
- <artifactId>ow2-jpa-1.0-spec</artifactId>
- <groupId>org.ow2.spec.ee</groupId>
- </exclusion>
- <exclusion>
- <artifactId>javax.inject</artifactId>
- <groupId>javax.inject</groupId>
- </exclusion>
- <exclusion>
- <artifactId>javax.activation-api</artifactId>
- <groupId>javax.activation</groupId>
- </exclusion>
- <exclusion>
- <artifactId>commons-codec</artifactId>
- <groupId>commons-codec</groupId>
- </exclusion>
- <exclusion>
- <artifactId>httpcore</artifactId>
- <groupId>org.apache.httpcomponents</groupId>
- </exclusion>
- <exclusion>
- <artifactId>jaxb-api</artifactId>
- <groupId>javax.xml.bind</groupId>
- </exclusion>
- <exclusion>
- <artifactId>jaxb-api</artifactId>
- <groupId>javax.xml.bind</groupId>
- </exclusion>
- <exclusion>
- <artifactId>jaxb-api</artifactId>
- <groupId>javax.xml.bind</groupId>
- </exclusion>
- <exclusion>
- <artifactId>jaxb-api</artifactId>
- <groupId>javax.xml.bind</groupId>
- </exclusion>
- <exclusion>
- <artifactId>jaxb-api</artifactId>
- <groupId>javax.xml.bind</groupId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.streampipes</groupId>
- <artifactId>streampipes-config</artifactId>
- <version>${streampipes.version}</version>
- <exclusions>
- <exclusion>
- <artifactId>jsr305</artifactId>
- <groupId>com.google.code.findbugs</groupId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.streampipes</groupId>
- <artifactId>streampipes-messaging-kafka</artifactId>
- <version>${streampipes.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.streampipes</groupId>
- <artifactId>streampipes-dataformat-cbor</artifactId>
- <version>${streampipes.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.streampipes</groupId>
- <artifactId>streampipes-dataformat-fst</artifactId>
- <version>${streampipes.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.streampipes</groupId>
- <artifactId>streampipes-dataformat-smile</artifactId>
- <version>${streampipes.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.streampipes</groupId>
- <artifactId>streampipes-dataformat-json</artifactId>
- <version>${streampipes.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.streampipes</groupId>
- <artifactId>streampipes-container-standalone</artifactId>
- <version>${streampipes.version}</version>
- <exclusions>
- <exclusion>
- <artifactId>aopalliance-repackaged</artifactId>
- <groupId>org.glassfish.hk2.external</groupId>
- </exclusion>
- <exclusion>
- <artifactId>tomcat-embed-el</artifactId>
- <groupId>org.apache.tomcat.embed</groupId>
- </exclusion>
- <exclusion>
- <artifactId>jboss-annotations-api_1.2_spec</artifactId>
- <groupId>org.jboss.spec.javax.annotation</groupId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.plc4x.sandbox</groupId>
- <artifactId>test-streampipes-plc4x-shared</artifactId>
- <version>0.9.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>ch.qos.logback</groupId>
- <artifactId>logback-classic</artifactId>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>ch.qos.logback</groupId>
- <artifactId>logback-core</artifactId>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>org.apache.plc4x</groupId>
- <artifactId>plc4j-spi</artifactId>
- <version>0.9.0-SNAPSHOT</version>
- <exclusions>
- <exclusion>
- <groupId>commons-codec</groupId>
- <artifactId>commons-codec</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.datatype</groupId>
- <artifactId>jackson-datatype-jdk8</artifactId>
- <version>2.10.0</version>
- </dependency>
- <dependency>
- <groupId>com.squareup.okhttp3</groupId>
- <artifactId>okhttp</artifactId>
- <version>3.14.3</version>
- </dependency>
- <dependency>
- <groupId>org.javassist</groupId>
- <artifactId>javassist</artifactId>
- <version>3.25.0-GA</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-aop</artifactId>
- <version>5.2.1.RELEASE</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-beans</artifactId>
- <version>5.2.1.RELEASE</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-context</artifactId>
- <version>5.2.1.RELEASE</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-core</artifactId>
- <version>5.2.1.RELEASE</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-web</artifactId>
- <version>5.2.1.RELEASE</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.logging</groupId>
- <artifactId>jboss-logging</artifactId>
- <version>3.4.1.Final</version>
- </dependency>
- <dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpclient-osgi</artifactId>
- <version>4.5.10</version>
- </dependency>
- <dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpclient</artifactId>
- <exclusions>
- <exclusion>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpcore</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>io.fogsy</groupId>
- <artifactId>empire-cp-common-utils</artifactId>
- <exclusions>
- <exclusion>
- <groupId>javax.xml.bind</groupId>
- <artifactId>jaxb-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.eclipse.rdf4j</groupId>
- <artifactId>rdf4j-rio-api</artifactId>
- <exclusions>
- <exclusion>
- <groupId>javax.xml.bind</groupId>
- <artifactId>jaxb-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>io.fogsy</groupId>
- <artifactId>empire-pinto</artifactId>
- <exclusions>
- <exclusion>
- <groupId>commons-codec</groupId>
- <artifactId>commons-codec</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- </dependencies>
- </dependencyManagement>
-
- <profiles>
- <profile>
- <id>with-docker</id>
- <build>
- <plugins>
- <!-- Build the Docker image -->
- <plugin>
- <groupId>com.spotify</groupId>
- <artifactId>dockerfile-maven-plugin</artifactId>
- <version>1.4.13</version>
- <executions>
- <execution>
- <id>default</id>
- <goals>
- <goal>build</goal>
- <goal>push</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <repository>apache/plc4x-streampipes-processors</repository>
- <tag>${project.version}</tag>
- <buildArgs>
- <JAR_FILE>${project.build.finalName}.jar</JAR_FILE>
- </buildArgs>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
-</project>
\ No newline at end of file
diff --git
a/sandbox/test-streampipes-plc4x-processors/src/main/java/org/apache/plc4x/java/streampipes/processors/Plc4xProcessorsInit.java
b/sandbox/test-streampipes-plc4x-processors/src/main/java/org/apache/plc4x/java/streampipes/processors/Plc4xProcessorsInit.java
deleted file mode 100644
index e135dea..0000000
---
a/sandbox/test-streampipes-plc4x-processors/src/main/java/org/apache/plc4x/java/streampipes/processors/Plc4xProcessorsInit.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied. See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-package org.apache.plc4x.java.streampipes.processors;
-
-import org.apache.plc4x.java.streampipes.processors.config.Config;
-import
org.apache.plc4x.java.streampipes.processors.enrich.knxnetip.ets5.Ets5DataEnrichmentController;
-import org.apache.streampipes.container.init.DeclarersSingleton;
-import
org.apache.streampipes.container.standalone.init.StandaloneModelSubmitter;
-import org.apache.streampipes.dataformat.cbor.CborDataFormatFactory;
-import org.apache.streampipes.dataformat.fst.FstDataFormatFactory;
-import org.apache.streampipes.dataformat.json.JsonDataFormatFactory;
-import org.apache.streampipes.dataformat.smile.SmileDataFormatFactory;
-import org.apache.streampipes.messaging.kafka.SpKafkaProtocolFactory;
-
-public class Plc4xProcessorsInit extends StandaloneModelSubmitter {
-
- public static void main(String[] args) {
- // Declare the processors.
- DeclarersSingleton
- .getInstance()
-// .add(new BacNetIpEdeDataEnrichmentController())
- .add(new Ets5DataEnrichmentController());
-
- // Declare the data formats the
- DeclarersSingleton.getInstance().registerDataFormats(
- new JsonDataFormatFactory(),
- new CborDataFormatFactory(),
- new SmileDataFormatFactory(),
- new FstDataFormatFactory());
-
- // Declare which methods can be used to actually read the data
- // as well as how to transport it to the next pipeline-element.
- DeclarersSingleton.getInstance().registerProtocol(new
SpKafkaProtocolFactory());
-
- // Initialize these modules components.
- new Plc4xProcessorsInit().init(Config.INSTANCE);
- }
-
-}
diff --git
a/sandbox/test-streampipes-plc4x-processors/src/main/java/org/apache/plc4x/java/streampipes/processors/config/Config.java
b/sandbox/test-streampipes-plc4x-processors/src/main/java/org/apache/plc4x/java/streampipes/processors/config/Config.java
deleted file mode 100644
index ea81de0..0000000
---
a/sandbox/test-streampipes-plc4x-processors/src/main/java/org/apache/plc4x/java/streampipes/processors/config/Config.java
+++ /dev/null
@@ -1,88 +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.plc4x.java.streampipes.processors.config;
-
-import org.apache.streampipes.config.SpConfig;
-import org.apache.streampipes.container.model.PeConfig;
-
-public enum Config implements PeConfig {
-
- INSTANCE;
-
- public final static String serverUrl;
- private final static String SERVICE_ID =
"pe/org.apache.plc4x.streampipes.processors";
-
- static {
- serverUrl = Config.INSTANCE.getHost() + ":" +
Config.INSTANCE.getPort();
- }
-
- private SpConfig config;
-
- Config() {
- // The name this config will be saved under
- // Can be found/edited/deleted here:
http://localhost:8500/ui/dc1/kv/sp/v1/
- String name = "pe/org.apache.plc4x.streampipes.processors";
- config = SpConfig.getSpConfig(name);
-
- // Only used, if there is no configuration available in consul.
- config.register(ConfigKeys.HOST, "processors-plc4x", "Hostname for the
pe sinks");
- config.register(ConfigKeys.PORT, 8090, "Port for the pe sinks");
- config.register(ConfigKeys.SERVICE_NAME, "PLC4X Processors", "");
- }
-
- public String getHost() {
- return config.getString(ConfigKeys.HOST);
- }
-
- public int getPort() {
- return config.getInteger(ConfigKeys.PORT);
- }
-
- public String getKafkaHost() {
- return config.getString(ConfigKeys.KAFKA_HOST);
- }
-
- public int getKafkaPort() {
- return config.getInteger(ConfigKeys.KAFKA_PORT);
- }
-
- public String getKafkaUrl() {
- return getKafkaHost() + ":" + getKafkaPort();
- }
-
- public String getZookeeperHost() {
- return config.getString(ConfigKeys.ZOOKEEPER_HOST);
- }
-
- public int getZookeeperPort() {
- return config.getInteger(ConfigKeys.ZOOKEEPER_PORT);
- }
-
- @Override
- public String getId() {
- return SERVICE_ID;
- }
-
- @Override
- public String getName() {
- return config.getString(ConfigKeys.SERVICE_NAME);
- }
-
-}
diff --git
a/sandbox/test-streampipes-plc4x-processors/src/main/java/org/apache/plc4x/java/streampipes/processors/config/ConfigKeys.java
b/sandbox/test-streampipes-plc4x-processors/src/main/java/org/apache/plc4x/java/streampipes/processors/config/ConfigKeys.java
deleted file mode 100644
index 936aa31..0000000
---
a/sandbox/test-streampipes-plc4x-processors/src/main/java/org/apache/plc4x/java/streampipes/processors/config/ConfigKeys.java
+++ /dev/null
@@ -1,35 +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.plc4x.java.streampipes.processors.config;
-
-public class ConfigKeys {
-
- final static String HOST = "SP_HOST";
- final static String PORT = "SP_PORT";
-
- final static String KAFKA_HOST = "SP_KAFKA_HOST";
- final static String KAFKA_PORT = "SP_KAFKA_PORT";
-
- final static String ZOOKEEPER_HOST = "SP_ZOOKEEPER_HOST";
- final static String ZOOKEEPER_PORT = "SP_ZOOKEEPER_PORT";
-
- final static String SERVICE_NAME = "SP_SERVICE_NAME";
-
-}
\ No newline at end of file
diff --git
a/sandbox/test-streampipes-plc4x-processors/src/main/java/org/apache/plc4x/java/streampipes/processors/enrich/bacnetip/ede/BacNetIpEdeDataEnrichmentController.java
b/sandbox/test-streampipes-plc4x-processors/src/main/java/org/apache/plc4x/java/streampipes/processors/enrich/bacnetip/ede/BacNetIpEdeDataEnrichmentController.java
deleted file mode 100644
index dced5a1..0000000
---
a/sandbox/test-streampipes-plc4x-processors/src/main/java/org/apache/plc4x/java/streampipes/processors/enrich/bacnetip/ede/BacNetIpEdeDataEnrichmentController.java
+++ /dev/null
@@ -1,88 +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.plc4x.java.streampipes.processors.enrich.bacnetip.ede;
-
-import
org.apache.plc4x.java.streampipes.processors.enrich.knxnetip.ets5.Ets5DataEnrichment;
-import
org.apache.plc4x.java.streampipes.processors.enrich.knxnetip.ets5.Ets5DataEnrichmentParameters;
-import org.apache.plc4x.java.streampipes.shared.source.knxnetip.Constants;
-import org.apache.streampipes.model.DataProcessorType;
-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.sdk.builder.PrimitivePropertyBuilder;
-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.Locales;
-import org.apache.streampipes.sdk.helpers.OutputStrategies;
-import org.apache.streampipes.sdk.utils.Assets;
-import org.apache.streampipes.sdk.utils.Datatypes;
-import org.apache.streampipes.wrapper.standalone.ConfiguredEventProcessor;
-import
org.apache.streampipes.wrapper.standalone.declarer.StandaloneEventProcessingDeclarer;
-
-public class BacNetIpEdeDataEnrichmentController extends
StandaloneEventProcessingDeclarer<Ets5DataEnrichmentParameters> {
-
- public static final String ID =
"org.apache.plc4x.streampipes.processors.enrich.bacnetip.ede";
-
- private static final String DESTINATION_ID_MAPPING =
"destination-id-mapping";
- private static final String PAYLOAD_ID_MAPPING = "payload-id-mapping";
-
- public static final String MAPPING_FIELD_DECODED_GROUP_ADDRESS =
"decodedGroupAddress";
- public static final String MAPPING_FIELD_TYPE = "type";
- public static final String MAPPING_FIELD_LOCATION = "location";
- public static final String MAPPING_FIELD_FUNCTION = "function";
- public static final String MAPPING_FIELD_MEANING = "meaning";
- public static final String MAPPING_FIELD_DECODED_PROPERTY_VALUE =
"decodedPropertyValue";
-
- @Override
- public DataProcessorDescription declareModel() {
- return ProcessingElementBuilder
- .create(ID, "ETS5", "Processor that interprets a data stream from
a KXNnet/IP Datasource according to the settings in the ETS5 'knxproj' file")
- .category(DataProcessorType.ENRICH)
- .withAssets(Assets.DOCUMENTATION, Assets.ICON)
- .withLocales(Locales.EN)
- .requiredStream(StreamRequirementsBuilder
- .create()
-
.requiredPropertyWithUnaryMapping(EpRequirements.domainPropertyReq(Constants.KNXNET_ID_DESTINATION_ADDRESS),
Labels.withId(DESTINATION_ID_MAPPING), PropertyScope.NONE)
-
.requiredPropertyWithUnaryMapping(EpRequirements.domainPropertyReq(Constants.KNXNET_ID_PAYLOAD),
Labels.withId(PAYLOAD_ID_MAPPING), PropertyScope.NONE)
- .build())
- .outputStrategy(OutputStrategies.append(
- PrimitivePropertyBuilder.create(Datatypes.String,
MAPPING_FIELD_DECODED_GROUP_ADDRESS).build(),
- PrimitivePropertyBuilder.create(Datatypes.String,
MAPPING_FIELD_TYPE).build(),
- PrimitivePropertyBuilder.create(Datatypes.String,
MAPPING_FIELD_LOCATION).build(),
- PrimitivePropertyBuilder.create(Datatypes.String,
MAPPING_FIELD_FUNCTION).build(),
- PrimitivePropertyBuilder.create(Datatypes.String,
MAPPING_FIELD_MEANING).build(),
- PrimitivePropertyBuilder.create(Datatypes.String,
MAPPING_FIELD_DECODED_PROPERTY_VALUE).build()
- ))
- .requiredFile(Labels.from("File", "ETS5 Project File", "ETS5
Project File (.knxproj)"))
- .build();
- }
-
- @Override
- public ConfiguredEventProcessor<Ets5DataEnrichmentParameters>
onInvocation(DataProcessorInvocation graph, ProcessingElementParameterExtractor
extractor) {
- String destinationIdFieldName =
extractor.mappingPropertyValue(DESTINATION_ID_MAPPING);
- String payloadIdFieldName =
extractor.mappingPropertyValue(PAYLOAD_ID_MAPPING);
-
- Ets5DataEnrichmentParameters params = new
Ets5DataEnrichmentParameters(graph, destinationIdFieldName, payloadIdFieldName);
- return new ConfiguredEventProcessor<>(params, Ets5DataEnrichment::new);
- }
-
-}
diff --git
a/sandbox/test-streampipes-plc4x-processors/src/main/java/org/apache/plc4x/java/streampipes/processors/enrich/knxnetip/ets5/Ets5DataEnrichment.java
b/sandbox/test-streampipes-plc4x-processors/src/main/java/org/apache/plc4x/java/streampipes/processors/enrich/knxnetip/ets5/Ets5DataEnrichment.java
deleted file mode 100644
index 44e6026..0000000
---
a/sandbox/test-streampipes-plc4x-processors/src/main/java/org/apache/plc4x/java/streampipes/processors/enrich/knxnetip/ets5/Ets5DataEnrichment.java
+++ /dev/null
@@ -1,110 +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.plc4x.java.streampipes.processors.enrich.knxnetip.ets5;
-
-import org.apache.commons.codec.DecoderException;
-import org.apache.commons.codec.binary.Hex;
-import org.apache.plc4x.java.api.value.PlcValue;
-import org.apache.plc4x.java.knxnetip.ets5.Ets5Parser;
-import org.apache.plc4x.java.knxnetip.ets5.model.Ets5Model;
-import org.apache.plc4x.java.knxnetip.ets5.model.GroupAddress;
-import org.apache.plc4x.java.knxnetip.readwrite.io.KnxDatapointIO;
-import org.apache.plc4x.java.spi.generation.ParseException;
-import org.apache.plc4x.java.spi.generation.ReadBuffer;
-import org.apache.plc4x.java.spi.generation.ReadBufferByteBased;
-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;
-
-import java.io.File;
-
-public class Ets5DataEnrichment implements
EventProcessor<Ets5DataEnrichmentParameters> {
-
- private String destinationIdFieldName;
- private String payloadIdFieldName;
- // TODO: Make this dynamic.
- private static final Ets5Model ets5Model = new Ets5Parser().parse(new
File("/Users/christofer.dutz/Projects/Apache/PLC4X-Documents/KNX/Stettiner Str.
13/StettinerStr-Soll-Ist-Temperatur.knxproj"));
-
- @Override
- public void onInvocation(Ets5DataEnrichmentParameters params,
SpOutputCollector spOutputCollector,
- EventProcessorRuntimeContext
eventProcessorRuntimeContext) {
- destinationIdFieldName = params.getDestinationIdFieldName();
- payloadIdFieldName = params.getPayloadIdFieldName();
- }
-
- @Override
- public void onEvent(Event event, SpOutputCollector spOutputCollector) {
- try {
- // Get the raw group address data.
- String destinationFieldValue =
event.getFieldBySelector(this.destinationIdFieldName).getAsPrimitive().getAsString();
- byte[] destinationGroupAddress =
Hex.decodeHex(destinationFieldValue);
- // Decode the group address depending on the project settings.
- String destinationAddress =
Ets5Model.parseGroupAddress(ets5Model.getGroupAddressType(),
destinationGroupAddress);
- final GroupAddress groupAddress =
ets5Model.getGroupAddresses().get(destinationAddress);
-
- // Get the raw HEX-encoded data
- String hexEncodedRawData =
event.getFieldBySelector(this.payloadIdFieldName).getAsPrimitive().getAsString();
- // Convert the HEX-encoded data back to byte[]
- byte[] rawData = Hex.decodeHex(hexEncodedRawData);
- ReadBuffer rawDataReader = new ReadBufferByteBased(rawData);
-
- if (groupAddress != null) {
- // Decode the raw data.
- /*final PlcValue plcValue =
KnxDatapointIO.staticParse(rawDataReader,
groupAddress.getType().getFormatName());
-
- // Serialize the decoded object to json
- final String jsonDatapoint =
datapoint.toString(ToStringStyle.JSON_STYLE);
-
- // Add the additional properties.
-
event.addField(Ets5DataEnrichmentController.MAPPING_FIELD_DECODED_GROUP_ADDRESS,
- toGroupAddressString(destinationAddress));
- event.addField(Ets5DataEnrichmentController.MAPPING_FIELD_TYPE,
- groupAddress.getType().getName());
-
event.addField(Ets5DataEnrichmentController.MAPPING_FIELD_LOCATION,
- groupAddress.getFunction().getSpaceName());
-
event.addField(Ets5DataEnrichmentController.MAPPING_FIELD_FUNCTION,
- groupAddress.getFunction().getName());
-
event.addField(Ets5DataEnrichmentController.MAPPING_FIELD_MEANING,
- groupAddress.getName());
-
event.addField(Ets5DataEnrichmentController.MAPPING_FIELD_DECODED_PROPERTY_VALUE,
- jsonDatapoint);
-
- System.out.println(hexEncodedRawData + " decoded to: " +
jsonDatapoint + " " + groupAddress.getType().getMainType() + " " +
groupAddress.getType().getSubType());
-
- //Event enrichedEvent = new Event()
- spOutputCollector.collect(event);*/
- } else {
- System.out.println("Couldn't decode group address " +
destinationAddress);
- }
- /*} catch (ParseException e) {
- // Driver Decoding
- e.printStackTrace();*/
- } catch (DecoderException e) {
- // Hex Decoding
- e.printStackTrace();
- }
- }
-
- @Override
- public void onDetach() {
-
- }
-
-}
diff --git
a/sandbox/test-streampipes-plc4x-processors/src/main/java/org/apache/plc4x/java/streampipes/processors/enrich/knxnetip/ets5/Ets5DataEnrichmentController.java
b/sandbox/test-streampipes-plc4x-processors/src/main/java/org/apache/plc4x/java/streampipes/processors/enrich/knxnetip/ets5/Ets5DataEnrichmentController.java
deleted file mode 100644
index 449df83..0000000
---
a/sandbox/test-streampipes-plc4x-processors/src/main/java/org/apache/plc4x/java/streampipes/processors/enrich/knxnetip/ets5/Ets5DataEnrichmentController.java
+++ /dev/null
@@ -1,93 +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.plc4x.java.streampipes.processors.enrich.knxnetip.ets5;
-
-import org.apache.plc4x.java.streampipes.shared.source.knxnetip.Constants;
-import org.apache.streampipes.model.DataProcessorType;
-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.sdk.builder.PrimitivePropertyBuilder;
-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.Locales;
-import org.apache.streampipes.sdk.helpers.OutputStrategies;
-import org.apache.streampipes.sdk.utils.Datatypes;
-import org.apache.streampipes.wrapper.standalone.ConfiguredEventProcessor;
-import
org.apache.streampipes.wrapper.standalone.declarer.StandaloneEventProcessingDeclarer;
-
-import java.io.IOException;
-
-public class Ets5DataEnrichmentController extends
StandaloneEventProcessingDeclarer<Ets5DataEnrichmentParameters> {
-
- public static final String ID =
"org.apache.plc4x.streampipes.processors.enrich.knxnetip.ets5";
-
- private static final String PROJECT_FILE_KEY = "project-fIle";
- private static final String DESTINATION_ID_MAPPING =
"destination-id-mapping";
- private static final String PAYLOAD_ID_MAPPING = "payload-id-mapping";
-
- public static final String MAPPING_FIELD_DECODED_GROUP_ADDRESS =
"decodedGroupAddress";
- public static final String MAPPING_FIELD_TYPE = "type";
- public static final String MAPPING_FIELD_LOCATION = "location";
- public static final String MAPPING_FIELD_FUNCTION = "function";
- public static final String MAPPING_FIELD_MEANING = "meaning";
- public static final String MAPPING_FIELD_DECODED_PROPERTY_VALUE =
"decodedPropertyValue";
-
- @Override
- public DataProcessorDescription declareModel() {
- return ProcessingElementBuilder
- .create(ID, "ETS5", "Processor that interprets a data stream from
a KXNnet/IP Datasource according to the settings in the ETS5 'knxproj' file")
- .category(DataProcessorType.ENRICH)
- //.withAssets(Assets.DOCUMENTATION, Assets.ICON)
- .withLocales(Locales.EN)
- .requiredStream(StreamRequirementsBuilder
- .create()
-
.requiredPropertyWithUnaryMapping(EpRequirements.domainPropertyReq(Constants.KNXNET_ID_DESTINATION_ADDRESS),
Labels.withId(DESTINATION_ID_MAPPING), PropertyScope.NONE)
-
.requiredPropertyWithUnaryMapping(EpRequirements.domainPropertyReq(Constants.KNXNET_ID_PAYLOAD),
Labels.withId(PAYLOAD_ID_MAPPING), PropertyScope.NONE)
- .build())
- .outputStrategy(OutputStrategies.append(
- PrimitivePropertyBuilder.create(Datatypes.String,
MAPPING_FIELD_DECODED_GROUP_ADDRESS).build(),
- PrimitivePropertyBuilder.create(Datatypes.String,
MAPPING_FIELD_TYPE).build(),
- PrimitivePropertyBuilder.create(Datatypes.String,
MAPPING_FIELD_LOCATION).build(),
- PrimitivePropertyBuilder.create(Datatypes.String,
MAPPING_FIELD_FUNCTION).build(),
- PrimitivePropertyBuilder.create(Datatypes.String,
MAPPING_FIELD_MEANING).build(),
- PrimitivePropertyBuilder.create(Datatypes.String,
MAPPING_FIELD_DECODED_PROPERTY_VALUE).build()
- ))
- .requiredFile(Labels.withId(PROJECT_FILE_KEY))
- .build();
- }
-
- @Override
- public ConfiguredEventProcessor<Ets5DataEnrichmentParameters>
onInvocation(DataProcessorInvocation graph, ProcessingElementParameterExtractor
extractor) {
- String destinationIdFieldName =
extractor.mappingPropertyValue(DESTINATION_ID_MAPPING);
- String payloadIdFieldName =
extractor.mappingPropertyValue(PAYLOAD_ID_MAPPING);
- String fileContents = null;
- try {
- fileContents = extractor.fileContentsAsString(PROJECT_FILE_KEY);
- } catch (IOException e) {
- logger.error("Error accessing the " + PROJECT_FILE_KEY + "
contents", e);
- }
- Ets5DataEnrichmentParameters params = new
Ets5DataEnrichmentParameters(graph, destinationIdFieldName, payloadIdFieldName);
- return new ConfiguredEventProcessor<>(params, Ets5DataEnrichment::new);
- }
-
-}
diff --git
a/sandbox/test-streampipes-plc4x-processors/src/main/java/org/apache/plc4x/java/streampipes/processors/enrich/knxnetip/ets5/Ets5DataEnrichmentParameters.java
b/sandbox/test-streampipes-plc4x-processors/src/main/java/org/apache/plc4x/java/streampipes/processors/enrich/knxnetip/ets5/Ets5DataEnrichmentParameters.java
deleted file mode 100644
index 6928cf4..0000000
---
a/sandbox/test-streampipes-plc4x-processors/src/main/java/org/apache/plc4x/java/streampipes/processors/enrich/knxnetip/ets5/Ets5DataEnrichmentParameters.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.plc4x.java.streampipes.processors.enrich.knxnetip.ets5;
-
-import org.apache.streampipes.model.graph.DataProcessorInvocation;
-import
org.apache.streampipes.wrapper.params.binding.EventProcessorBindingParams;
-
-public class Ets5DataEnrichmentParameters extends EventProcessorBindingParams {
-
- private final String destinationIdFieldName;
- private final String payloadIdFieldName;
-
- public Ets5DataEnrichmentParameters(DataProcessorInvocation graph, String
destinationIdFieldName, String payloadIdFieldName) {
- super(graph);
- this.destinationIdFieldName = destinationIdFieldName;
- this.payloadIdFieldName = payloadIdFieldName;
- }
-
- public String getDestinationIdFieldName() {
- return destinationIdFieldName;
- }
-
- public String getPayloadIdFieldName() {
- return payloadIdFieldName;
- }
-
-}
diff --git
a/sandbox/test-streampipes-plc4x-processors/src/main/resources/org.apache.plc4x.streampipes.processors.enrich.bacnetip.ede/strings.en
b/sandbox/test-streampipes-plc4x-processors/src/main/resources/org.apache.plc4x.streampipes.processors.enrich.bacnetip.ede/strings.en
deleted file mode 100644
index e605754..0000000
---
a/sandbox/test-streampipes-plc4x-processors/src/main/resources/org.apache.plc4x.streampipes.processors.enrich.bacnetip.ede/strings.en
+++ /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.
-#
-
-org.apache.plc4x.streampipes.processors.enrich.bacnetip.ede.title=EDE
-org.apache.plc4x.streampipes.processors.enrich.bacnetip.ede.description=Processor
that interprets a data stream from a BACnet/IP Datasource according to the
settings in the BACnet 'ede' file
-
-payload-id-mapping.title=Payload Id Field
-payload-id-mapping.description=
-
-destination-id-mapping.title=Destination Id Field
-destination-id-mapping.description=
diff --git
a/sandbox/test-streampipes-plc4x-processors/src/main/resources/org.apache.plc4x.streampipes.processors.enrich.knxnetip.ets5/strings.en
b/sandbox/test-streampipes-plc4x-processors/src/main/resources/org.apache.plc4x.streampipes.processors.enrich.knxnetip.ets5/strings.en
deleted file mode 100644
index 5f5c591..0000000
---
a/sandbox/test-streampipes-plc4x-processors/src/main/resources/org.apache.plc4x.streampipes.processors.enrich.knxnetip.ets5/strings.en
+++ /dev/null
@@ -1,30 +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.
-#
-
-org.apache.plc4x.streampipes.processors.enrich.knxnetip.ets5.title=ETS5
-org.apache.plc4x.streampipes.processors.enrich.knxnetip.ets5.description=Processor
that interprets a data stream from a KXNnet/IP Datasource according to the
settings in the ETS5 'knxproj' file
-
-payload-id-mapping.title=Payload Id Field
-payload-id-mapping.description=
-
-destination-id-mapping.title=Destination Id Field
-destination-id-mapping.description=
-
-project-fIle.title=ETS5 Project File
-project-fIle.description=ETS5 Project File (.knxproj)
\ No newline at end of file
diff --git a/sandbox/test-streampipes-plc4x-shared/pom.xml
b/sandbox/test-streampipes-plc4x-shared/pom.xml
deleted file mode 100644
index 2c9332f..0000000
--- a/sandbox/test-streampipes-plc4x-shared/pom.xml
+++ /dev/null
@@ -1,32 +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">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <artifactId>plc4x-sandbox</artifactId>
- <groupId>org.apache.plc4x.sandbox</groupId>
- <version>0.9.0-SNAPSHOT</version>
- </parent>
-
- <artifactId>test-streampipes-plc4x-shared</artifactId>
- <name>Sandbox: StreamPipes Shared</name>
-
-</project>
\ No newline at end of file
diff --git
a/sandbox/test-streampipes-plc4x-shared/src/main/java/org/apache/plc4x/java/streampipes/shared/source/bacnetip/Constants.java
b/sandbox/test-streampipes-plc4x-shared/src/main/java/org/apache/plc4x/java/streampipes/shared/source/bacnetip/Constants.java
deleted file mode 100644
index 1c10a30..0000000
---
a/sandbox/test-streampipes-plc4x-shared/src/main/java/org/apache/plc4x/java/streampipes/shared/source/bacnetip/Constants.java
+++ /dev/null
@@ -1,25 +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.plc4x.java.streampipes.shared.source.bacnetip;
-
-public class Constants {
-
- public static final String KNXNET_ID =
"http://plc4x.apache.org/streampipes/source/bacnetup";
-
-}
diff --git
a/sandbox/test-streampipes-plc4x-shared/src/main/java/org/apache/plc4x/java/streampipes/shared/source/knxnetip/Constants.java
b/sandbox/test-streampipes-plc4x-shared/src/main/java/org/apache/plc4x/java/streampipes/shared/source/knxnetip/Constants.java
deleted file mode 100644
index e337b95..0000000
---
a/sandbox/test-streampipes-plc4x-shared/src/main/java/org/apache/plc4x/java/streampipes/shared/source/knxnetip/Constants.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.plc4x.java.streampipes.shared.source.knxnetip;
-
-public class Constants {
-
- public static final String KNXNET_ID =
"http://plc4x.apache.org/streampipes/source/knxnetip";
- public static final String KNXNET_ID_SOURCE_ADDRESS = KNXNET_ID +
"/source-address";
- public static final String KNXNET_ID_DESTINATION_ADDRESS = KNXNET_ID +
"/destination-address";
- public static final String KNXNET_ID_PAYLOAD = KNXNET_ID + "/payload";
-
-}