You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by cd...@apache.org on 2021/01/31 11:20:44 UTC
[plc4x] 32/45: - Cleanup after preparing the release
This is an automated email from the ASF dual-hosted git repository.
cdutz pushed a commit to branch feature/plc4c
in repository https://gitbox.apache.org/repos/asf/plc4x.git
commit a4e33434ebcfc88ed47a1d1a405ed3da5fdfb086
Author: Christofer Dutz <ch...@c-ware.de>
AuthorDate: Mon Jan 25 14:00:27 2021 +0100
- Cleanup after preparing the release
---
plc4j/examples/dummy-driver/pom.xml | 96 ----------------------
.../java/examples/dummydriver/DummyDriver.java | 67 ---------------
.../dummydriver/connection/DummyConnection.java | 82 ------------------
.../examples/dummydriver/model/DummyField.java | 35 --------
.../examples/dummydriver/netty/DummyProtocol.java | 75 -----------------
.../services/org.apache.plc4x.java.api.PlcDriver | 19 -----
plc4j/examples/hello-webservice/pom.xml | 7 --
plc4j/examples/hello-world-plc4x/pom.xml | 7 --
plc4j/examples/replay-test/pom.xml | 78 ------------------
pom.xml | 1 -
10 files changed, 467 deletions(-)
diff --git a/plc4j/examples/dummy-driver/pom.xml b/plc4j/examples/dummy-driver/pom.xml
deleted file mode 100644
index 8205ce0..0000000
--- a/plc4j/examples/dummy-driver/pom.xml
+++ /dev/null
@@ -1,96 +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.examples</groupId>
- <artifactId>plc4j-examples</artifactId>
- <version>0.9.0-SNAPSHOT</version>
- </parent>
-
- <artifactId>plc4j-dummy-driver</artifactId>
- <name>PLC4J: Examples: Protocol: Dummy</name>
- <description>
- Implementation of a PLC4X driver able to speak a non existent dummy protocol.
- This module should be used as inspiration for implementing own drivers.
- </description>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.plc4x</groupId>
- <artifactId>plc4j-api</artifactId>
- <version>0.9.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.plc4x</groupId>
- <artifactId>plc4j-spi</artifactId>
- <version>0.9.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.plc4x</groupId>
- <artifactId>plc4j-transport-tcp</artifactId>
- <version>0.9.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>io.netty</groupId>
- <artifactId>netty-buffer</artifactId>
- </dependency>
- <dependency>
- <groupId>io.netty</groupId>
- <artifactId>netty-codec</artifactId>
- </dependency>
- <dependency>
- <groupId>io.netty</groupId>
- <artifactId>netty-transport</artifactId>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <!-- Disable building the uber-jar -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-shade-plugin</artifactId>
- <executions>
- <execution>
- <id>generate-uber-jar</id>
- <phase>none</phase>
- <goals>
- <goal>shade</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <!-- This is currently a work in progress ... skip this till it reaches a slightly more mature state -->
- <plugin>
- <groupId>org.sonarsource.scanner.maven</groupId>
- <artifactId>sonar-maven-plugin</artifactId>
- <configuration>
- <skip>true</skip>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
\ No newline at end of file
diff --git a/plc4j/examples/dummy-driver/src/main/java/org/apache/plc4x/java/examples/dummydriver/DummyDriver.java b/plc4j/examples/dummy-driver/src/main/java/org/apache/plc4x/java/examples/dummydriver/DummyDriver.java
deleted file mode 100644
index f398eab..0000000
--- a/plc4j/examples/dummy-driver/src/main/java/org/apache/plc4x/java/examples/dummydriver/DummyDriver.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied. See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-package org.apache.plc4x.java.examples.dummydriver;
-
-import org.apache.plc4x.java.api.PlcConnection;
-import org.apache.plc4x.java.api.authentication.PlcAuthentication;
-import org.apache.plc4x.java.api.exceptions.PlcConnectionException;
-import org.apache.plc4x.java.examples.dummydriver.connection.DummyConnection;
-import org.apache.plc4x.java.api.PlcDriver;
-
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-public class DummyDriver implements PlcDriver {
-
- private static final Pattern DUMMY_URI_PATTERN = Pattern.compile("^dummy://(?<host>.*)");
-
- @Override
- public String getProtocolCode() {
- return "dummy";
- }
-
- @Override
- public String getProtocolName() {
- return "Dummy";
- }
-
- @Override
- public PlcConnection connect(String url) throws PlcConnectionException {
- Matcher matcher = DUMMY_URI_PATTERN.matcher(url);
- if (!matcher.matches()) {
- throw new PlcConnectionException(
- "Connection url doesn't match the format 'dummy://{host|ip}'");
- }
- String host = matcher.group("host");
- try {
- InetAddress hostAddress = InetAddress.getByName(host);
- return new DummyConnection(hostAddress);
- } catch (UnknownHostException e) {
- throw new PlcConnectionException("Error", e);
- }
- }
-
- @Override
- public PlcConnection connect(String url, PlcAuthentication authentication) throws PlcConnectionException {
- throw new PlcConnectionException("Dummy connections don't support authentication.");
- }
-
-}
diff --git a/plc4j/examples/dummy-driver/src/main/java/org/apache/plc4x/java/examples/dummydriver/connection/DummyConnection.java b/plc4j/examples/dummy-driver/src/main/java/org/apache/plc4x/java/examples/dummydriver/connection/DummyConnection.java
deleted file mode 100644
index c5fec41..0000000
--- a/plc4j/examples/dummy-driver/src/main/java/org/apache/plc4x/java/examples/dummydriver/connection/DummyConnection.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied. See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-package org.apache.plc4x.java.examples.dummydriver.connection;
-
-import io.netty.channel.Channel;
-import io.netty.channel.ChannelHandler;
-import io.netty.channel.ChannelInitializer;
-import org.apache.plc4x.java.api.messages.PlcReadRequest;
-import org.apache.plc4x.java.api.messages.PlcReadResponse;
-import org.apache.plc4x.java.api.messages.PlcWriteRequest;
-import org.apache.plc4x.java.api.messages.PlcWriteResponse;
-import org.apache.plc4x.java.spi.connection.NettyPlcConnection;
-import org.apache.plc4x.java.spi.messages.InternalPlcReadResponse;
-import org.apache.plc4x.java.spi.messages.InternalPlcWriteRequest;
-import org.apache.plc4x.java.spi.messages.PlcReader;
-import org.apache.plc4x.java.spi.messages.PlcRequestContainer;
-import org.apache.plc4x.java.spi.messages.PlcWriter;
-import org.apache.plc4x.java.transport.tcp.TcpSocketChannelFactory;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.net.InetAddress;
-import java.util.concurrent.CompletableFuture;
-
-public class DummyConnection extends NettyPlcConnection implements PlcReader, PlcWriter {
-
- @SuppressWarnings("unused")
- private static final Logger logger = LoggerFactory.getLogger(DummyConnection.class);
-
- @SuppressWarnings("unused")
- private boolean connected;
-
- public DummyConnection(InetAddress host) {
- super(new TcpSocketChannelFactory(host, 42));
- }
-
- @Override
- protected ChannelHandler getChannelHandler(CompletableFuture<Void> sessionSetupCompleteFuture) {
- return new ChannelInitializer<Channel>() {
- @Override
- protected void initChannel(Channel channel) {
- }
- };
- }
-
- @Override
- public CompletableFuture<PlcReadResponse> read(PlcReadRequest readRequest) {
- CompletableFuture<InternalPlcReadResponse> readFuture = new CompletableFuture<>();
- PlcRequestContainer<InternalPlcReadRequest, InternalPlcReadResponse> container =
- new PlcRequestContainer<>((InternalPlcReadRequest) readRequest, readFuture);
- channel.writeAndFlush(container);
- return readFuture
- .thenApply(PlcReadResponse.class::cast);
- }
-
- @Override
- public CompletableFuture<PlcWriteResponse> write(PlcWriteRequest writeRequest) {
- CompletableFuture<InternalPlcWriteResponse> writeFuture = new CompletableFuture<>();
- PlcRequestContainer<InternalPlcWriteRequest, InternalPlcWriteResponse> container =
- new PlcRequestContainer<>((InternalPlcWriteRequest) writeRequest, writeFuture);
- channel.writeAndFlush(container);
- return writeFuture
- .thenApply(PlcWriteResponse.class::cast);
- }
-
-}
diff --git a/plc4j/examples/dummy-driver/src/main/java/org/apache/plc4x/java/examples/dummydriver/model/DummyField.java b/plc4j/examples/dummy-driver/src/main/java/org/apache/plc4x/java/examples/dummydriver/model/DummyField.java
deleted file mode 100644
index ab45b4f..0000000
--- a/plc4j/examples/dummy-driver/src/main/java/org/apache/plc4x/java/examples/dummydriver/model/DummyField.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.examples.dummydriver.model;
-
-import org.apache.plc4x.java.api.model.PlcField;
-
-public class DummyField implements PlcField {
-
- private final int address;
-
- public DummyField(int address) {
- this.address = address;
- }
-
- public int getAddress() {
- return address;
- }
-
-}
diff --git a/plc4j/examples/dummy-driver/src/main/java/org/apache/plc4x/java/examples/dummydriver/netty/DummyProtocol.java b/plc4j/examples/dummy-driver/src/main/java/org/apache/plc4x/java/examples/dummydriver/netty/DummyProtocol.java
deleted file mode 100644
index 5e7f5e7..0000000
--- a/plc4j/examples/dummy-driver/src/main/java/org/apache/plc4x/java/examples/dummydriver/netty/DummyProtocol.java
+++ /dev/null
@@ -1,75 +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.examples.dummydriver.netty;
-
-import io.netty.buffer.ByteBuf;
-import io.netty.buffer.ByteBufUtil;
-import io.netty.buffer.Unpooled;
-import io.netty.channel.ChannelHandlerContext;
-import io.netty.handler.codec.MessageToMessageCodec;
-import org.apache.plc4x.java.api.messages.PlcReadRequest;
-import org.apache.plc4x.java.api.messages.PlcRequest;
-import org.apache.plc4x.java.spi.messages.PlcRequestContainer;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.List;
-
-public class DummyProtocol extends MessageToMessageCodec<ByteBuf, PlcRequestContainer> {
-
- private static final Logger logger = LoggerFactory.getLogger(DummyProtocol.class);
-
- @Override
- protected void encode(ChannelHandlerContext ctx, PlcRequestContainer in, List<Object> out) {
- PlcRequest request = in.getRequest();
- if (request instanceof PlcReadRequest) {
-
- // Simple ICMP (Ping packet)
- byte[] rawData = new byte[] {
- // Type (ICMP Ping Request) & Code (just 0)
- (byte) 0x08, (byte) 0x00,
- // Checksum
- (byte) 0xe3, (byte) 0xe5,
- // Identifier
- (byte) 0x00, (byte) 0x01,
- // Sequence Number
- (byte) 0x00, (byte) 0x00,
- // Payload (Just random data that was used to fit to the checksum)
- (byte) 0x00, (byte) 0x01, (byte) 0x02, (byte) 0x03, (byte) 0x04, (byte) 0x05, (byte) 0x06, (byte) 0x07, (byte) 0x08, (byte) 0x09};
-
- ByteBuf buf = Unpooled.buffer();
- buf.writeBytes(rawData);
-
- out.add(buf);
- }
- }
-
- @Override
- protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) {
- if(logger.isTraceEnabled()) {
- logger.trace("Got Data: {}", ByteBufUtil.hexDump(in));
- }
- // If at least 4 bytes are readable, peek into them (without changing the read position)
- // and get the packet length. Only if the available amount of readable bytes is larger or
- // equal to this, continue processing the rest.
- if(in.readableBytes() >= 4) {
- }
- }
-
-}
diff --git a/plc4j/examples/dummy-driver/src/main/resources/META-INF/services/org.apache.plc4x.java.api.PlcDriver b/plc4j/examples/dummy-driver/src/main/resources/META-INF/services/org.apache.plc4x.java.api.PlcDriver
deleted file mode 100644
index b8ccc4d..0000000
--- a/plc4j/examples/dummy-driver/src/main/resources/META-INF/services/org.apache.plc4x.java.api.PlcDriver
+++ /dev/null
@@ -1,19 +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.java.examples.dummydriver.DummyDriver
diff --git a/plc4j/examples/hello-webservice/pom.xml b/plc4j/examples/hello-webservice/pom.xml
index 181853b..dea0870 100644
--- a/plc4j/examples/hello-webservice/pom.xml
+++ b/plc4j/examples/hello-webservice/pom.xml
@@ -72,13 +72,6 @@
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</dependency>
-
- <!--dependency>
- <groupId>org.apache.plc4x.sandbox</groupId>
- <artifactId>test-java-amsads-driver</artifactId>
- <version>0.9.0-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency-->
</dependencies>
<build>
diff --git a/plc4j/examples/hello-world-plc4x/pom.xml b/plc4j/examples/hello-world-plc4x/pom.xml
index d2c3797..331dbf0 100644
--- a/plc4j/examples/hello-world-plc4x/pom.xml
+++ b/plc4j/examples/hello-world-plc4x/pom.xml
@@ -60,13 +60,6 @@
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</dependency>
-
- <!--dependency>
- <groupId>org.apache.plc4x.sandbox</groupId>
- <artifactId>test-java-amsads-driver</artifactId>
- <version>0.9.0-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency-->
</dependencies>
<build>
diff --git a/plc4j/examples/replay-test/pom.xml b/plc4j/examples/replay-test/pom.xml
deleted file mode 100644
index 8c3de6e..0000000
--- a/plc4j/examples/replay-test/pom.xml
+++ /dev/null
@@ -1,78 +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.examples</groupId>
- <artifactId>plc4j-examples</artifactId>
- <version>0.9.0-SNAPSHOT</version>
- </parent>
-
- <artifactId>plc4j-replay-test</artifactId>
- <name>PLC4J: Examples: Replay-Test</name>
- <description>Replay test, that replays a given network capture against a given driver and tries if this can process all packets it contains.</description>
-
- <properties>
- <app.main.class>org.apache.plc4x.java.examples.replay.Plc4xReplayTest</app.main.class>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.plc4x</groupId>
- <artifactId>plc4j-api</artifactId>
- <version>0.9.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>commons-cli</groupId>
- <artifactId>commons-cli</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>log4j-over-slf4j</artifactId>
- </dependency>
- <dependency>
- <groupId>ch.qos.logback</groupId>
- <artifactId>logback-classic</artifactId>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <configuration>
- <usedDependencies combine.children="append">
- <usedDependency>org.slf4j:log4j-over-slf4j</usedDependency>
- </usedDependencies>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 7f1a5d2..2e3f14d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -44,7 +44,6 @@
<connection>scm:git:https://gitbox.apache.org/repos/asf/plc4x.git</connection>
<developerConnection>scm:git:https://gitbox.apache.org/repos/asf/plc4x.git</developerConnection>
<url>https://github.com/apache/plc4x</url>
- <tag>release/0.8</tag>
</scm>
<!-- Only configure the site distribution as the rest is handled by the apache parent -->