This is an automated email from the ASF dual-hosted git repository. sruehl pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/plc4x.git
commit 8997b357d85c79530d3c020f67e274ffd1e414b2 Author: Sebastian Rühl <[email protected]> AuthorDate: Tue Oct 4 11:28:49 2022 +0200 chore(build): Removed everything related to edgent for real this time --- plc4j/examples/hello-integration-edgent/pom.xml | 71 ---------------- .../examples/integration/edgent/CliOptions.java | 98 ---------------------- .../examples/integration/edgent/PlcLogger.java | 59 ------------- .../src/main/resources/logback.xml | 34 -------- plc4j/examples/pom.xml | 1 - 5 files changed, 263 deletions(-) diff --git a/plc4j/examples/hello-integration-edgent/pom.xml b/plc4j/examples/hello-integration-edgent/pom.xml deleted file mode 100644 index 0d8b1e551..000000000 --- a/plc4j/examples/hello-integration-edgent/pom.xml +++ /dev/null @@ -1,71 +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 - - https://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.11.0-SNAPSHOT</version> - </parent> - - <artifactId>plc4j-examples-hello-integration-edgent</artifactId> - <name>PLC4J: Examples: Edgent</name> - <description>Application using Edgent to output PLC data to the console.</description> - - <properties> - <app.main.class>org.apache.plc4x.java.examples.integration.edgent.PlcLogger</app.main.class> - </properties> - - <dependencies> - <dependency> - <groupId>org.apache.plc4x</groupId> - <artifactId>plc4j-apache-edgent</artifactId> - <version>0.10.0-SNAPSHOT</version> - </dependency> - - <dependency> - <groupId>org.apache.edgent</groupId> - <artifactId>edgent-api-function</artifactId> - <version>1.2.0</version> - </dependency> - <dependency> - <groupId>org.apache.edgent</groupId> - <artifactId>edgent-api-topology</artifactId> - <version>1.2.0</version> - </dependency> - <dependency> - <groupId>org.apache.edgent</groupId> - <artifactId>edgent-providers-direct</artifactId> - <version>1.2.0</version> - </dependency> - - <dependency> - <groupId>commons-cli</groupId> - <artifactId>commons-cli</artifactId> - </dependency> - <dependency> - <groupId>ch.qos.logback</groupId> - <artifactId>logback-classic</artifactId> - </dependency> - </dependencies> - -</project> \ No newline at end of file diff --git a/plc4j/examples/hello-integration-edgent/src/main/java/org/apache/plc4x/java/examples/integration/edgent/CliOptions.java b/plc4j/examples/hello-integration-edgent/src/main/java/org/apache/plc4x/java/examples/integration/edgent/CliOptions.java deleted file mode 100644 index 6a524169c..000000000 --- a/plc4j/examples/hello-integration-edgent/src/main/java/org/apache/plc4x/java/examples/integration/edgent/CliOptions.java +++ /dev/null @@ -1,98 +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 - * - * https://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.integration.edgent; - -import org.apache.commons.cli.*; - -public class CliOptions { - - private static Options options; - - private final String connectionString; - private final String fieldAddress; - private final int pollingInterval; - - public static CliOptions fromArgs(String[] args) { - options = new Options(); - // Required arguments - options.addOption( - Option.builder() - .type(String.class) - .longOpt("connection-string") - .hasArg() - .desc("Connection String") - .required() - .build()); - options.addOption( - Option.builder() - .type(String.class) - .longOpt("field-address") - .hasArg() - .desc("Field Address.") - .required() - .build()); - options.addOption( - Option.builder() - .type(Integer.class) - .longOpt("polling-interval") - .hasArg() - .desc("Polling Interval (milliseconds).") - .required() - .build()); - - CommandLineParser parser = new DefaultParser(); - CommandLine commandLine; - try { - commandLine = parser.parse(options, args); - - String connectionString = commandLine.getOptionValue("connection-string"); - String fieldAddress = commandLine.getOptionValue("field-address"); - int pollingInterval = Integer.parseInt(commandLine.getOptionValue("polling-interval")); - - return new CliOptions(connectionString, fieldAddress, pollingInterval); - } catch (ParseException e) { - System.err.println(e.getMessage()); - return null; - } - } - - public static void printHelp() { - HelpFormatter formatter = new HelpFormatter(); - formatter.printHelp("PlcLogger", options); - } - - public CliOptions(String connectionString, String fieldAddress, int pollingInterval) { - this.connectionString = connectionString; - this.fieldAddress = fieldAddress; - this.pollingInterval = pollingInterval; - } - - public String getConnectionString() { - return connectionString; - } - - public String getFieldAddress() { - return fieldAddress; - } - - public int getPollingInterval() { - return pollingInterval; - } - -} diff --git a/plc4j/examples/hello-integration-edgent/src/main/java/org/apache/plc4x/java/examples/integration/edgent/PlcLogger.java b/plc4j/examples/hello-integration-edgent/src/main/java/org/apache/plc4x/java/examples/integration/edgent/PlcLogger.java deleted file mode 100644 index 248124549..000000000 --- a/plc4j/examples/hello-integration-edgent/src/main/java/org/apache/plc4x/java/examples/integration/edgent/PlcLogger.java +++ /dev/null @@ -1,59 +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 - * - * https://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.integration.edgent; - -import org.apache.edgent.function.Supplier; -import org.apache.edgent.providers.direct.DirectProvider; -import org.apache.edgent.topology.TStream; -import org.apache.edgent.topology.Topology; -import org.apache.plc4x.edgent.PlcConnectionAdapter; -import org.apache.plc4x.edgent.PlcFunctions; - -import java.util.concurrent.TimeUnit; - -public class PlcLogger { - - public static void main(String[] args) throws Exception { - CliOptions options = CliOptions.fromArgs(args); - if (options == null) { - CliOptions.printHelp(); - // Could not parse. - System.exit(1); - } - - // Get a plc connection. - try (PlcConnectionAdapter plcAdapter = new PlcConnectionAdapter(options.getConnectionString())) { - // Initialize the Edgent core. - DirectProvider dp = new DirectProvider(); - Topology top = dp.newTopology(); - - // Define the event stream. - // 1) PLC4X source generating a stream of bytes. - Supplier<Byte> plcSupplier = PlcFunctions.byteSupplier(plcAdapter, options.getFieldAddress()); - // 2) Use polling to get an item from the byte-stream in regular intervals. - TStream<Byte> source = top.poll(plcSupplier, options.getPollingInterval(), TimeUnit.MILLISECONDS); - // 3) Output the events in the stream on the console. - source.print(); - - // Submit the topology and hereby start the event streams. - dp.submit(top); - } - } - -} diff --git a/plc4j/examples/hello-integration-edgent/src/main/resources/logback.xml b/plc4j/examples/hello-integration-edgent/src/main/resources/logback.xml deleted file mode 100644 index 16b83b488..000000000 --- a/plc4j/examples/hello-integration-edgent/src/main/resources/logback.xml +++ /dev/null @@ -1,34 +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 - - https://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. - --> -<configuration xmlns="http://ch.qos.logback/xml/ns/logback" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://ch.qos.logback/xml/ns/logback https://raw.githubusercontent.com/enricopulatzo/logback-XSD/master/src/main/xsd/logback.xsd"> - - <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> - <encoder> - <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern> - </encoder> - </appender> - - <root level="warn"> - <appender-ref ref="STDOUT" /> - </root> - -</configuration> \ No newline at end of file diff --git a/plc4j/examples/pom.xml b/plc4j/examples/pom.xml index 46936f894..79975bf2c 100644 --- a/plc4j/examples/pom.xml +++ b/plc4j/examples/pom.xml @@ -44,7 +44,6 @@ <module>hello-discovery</module> <module>hello-connectivity-mqtt</module> <module>hello-influx-data-collection</module> - <module>hello-integration-edgent</module> <module>hello-integration-iotdb</module> <!--module>hello-nats</module--> <module>hello-opm</module>
