You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by jf...@apache.org on 2019/12/18 12:36:35 UTC
[plc4x] branch next-gen-core updated: Created plc4j-spi and moved
driver-protocol-base classes there.
This is an automated email from the ASF dual-hosted git repository.
jfeinauer pushed a commit to branch next-gen-core
in repository https://gitbox.apache.org/repos/asf/plc4x.git
The following commit(s) were added to refs/heads/next-gen-core by this push:
new 90dc156 Created plc4j-spi and moved driver-protocol-base classes there.
90dc156 is described below
commit 90dc156441c75a4043f21a3989bee81fb27e5e86
Author: Julian Feinauer <j....@pragmaticminds.de>
AuthorDate: Wed Dec 18 13:36:08 2019 +0100
Created plc4j-spi and moved driver-protocol-base classes there.
---
.../org/apache/plc4x/java/PlcDriverManager.java | 2 +-
.../apache/plc4x/java/{spi => api}/PlcDriver.java | 3 +-
.../org/apache/plc4x/java/mock/MockDriver.java | 2 +-
...cDriver => org.apache.plc4x.java.api.PlcDriver} | 0
...cDriver => org.apache.plc4x.java.api.PlcDriver} | 0
.../org/apache/plc4x/java/abeth/AbEthDriver.java | 2 +-
.../java/abeth/connection/AbEthPlcConnection.java | 7 +-
...cDriver => org.apache.plc4x.java.api.PlcDriver} | 0
.../org/apache/plc4x/java/ads/AdsPlcDriver.java | 2 +-
.../ads/connection/AdsAbstractPlcConnection.java | 1 -
.../java/ads/connection/AdsTcpPlcConnection.java | 2 -
...cDriver => org.apache.plc4x.java.api.PlcDriver} | 0
.../connection/AdsAbstractPlcConnectionTest.java | 1 -
.../ads/connection/AdsTcpPlcConnectionTests.java | 1 -
.../plc4x/java/ethernetip/EtherNetIpPlcDriver.java | 2 +-
.../connection/BaseEtherNetIpPlcConnection.java | 1 -
.../connection/EtherNetIpTcpPlcConnection.java | 1 -
...cDriver => org.apache.plc4x.java.api.PlcDriver} | 0
.../apache/plc4x/java/modbus/ModbusPlcDriver.java | 2 +-
.../modbus/connection/BaseModbusPlcConnection.java | 1 -
.../modbus/connection/ModbusTcpPlcConnection.java | 1 -
...cDriver => org.apache.plc4x.java.api.PlcDriver} | 0
.../apache/plc4x/java/opcua/OpcuaPlcDriver.java | 2 +-
.../opcua/connection/BaseOpcuaPlcConnection.java | 1 -
.../opcua/connection/OpcuaTcpPlcConnection.java | 2 -
.../java/opcua/protocol/OpcuaPlcFieldHandler.java | 1 -
...cDriver => org.apache.plc4x.java.api.PlcDriver} | 0
plc4j/drivers/pom.xml | 14 +-
.../java/org/apache/plc4x/java/s7/S7PlcDriver.java | 2 +-
.../plc4x/java/s7/connection/S7PlcConnection.java | 1 -
...cDriver => org.apache.plc4x.java.api.PlcDriver} | 0
.../java/org/apache/plc4x/java/s7/BenchmarkS7.java | 1 -
.../plc4x/java/simulated/SimulatedPlcDriver.java | 2 +-
.../connection/SimulatedPlcConnection.java | 2 -
.../simulated/connection/TestFieldHandler.java | 1 -
...cDriver => org.apache.plc4x.java.api.PlcDriver} | 0
.../java/examples/dummydriver/DummyDriver.java | 2 +-
.../dummydriver/connection/DummyConnection.java | 8 +-
...cDriver => org.apache.plc4x.java.api.PlcDriver} | 0
.../java/org/apache/plc4x/camel/MockDriver.java | 2 +-
...cDriver => org.apache.plc4x.java.api.PlcDriver} | 0
.../apache/plc4x/edgent/mock/MockConnection.java | 1 -
.../org/apache/plc4x/edgent/mock/MockDriver.java | 2 +-
...cDriver => org.apache.plc4x.java.api.PlcDriver} | 0
plc4j/pom.xml | 1 +
.../plc4x/java/ads/model/AdsPlcFieldHandler.java | 1 -
.../plc4x/java/ads/protocol/Plc4x2AdsProtocol.java | 1 -
.../ads/protocol/util/LittleEndianDecoder.java | 1 -
.../java/ads/model/AdsPlcFieldHandlerTest.java | 1 -
.../java/ads/protocol/Plc4x2AdsProtocolTest.java | 1 -
plc4j/protocols/driver-bases/base/pom.xml | 101 ---
.../plc4x/java/base/connection/ChannelFactory.java | 33 -
.../plc4x/java/base/events/ConnectEvent.java | 22 -
.../plc4x/java/base/events/ConnectedEvent.java | 22 -
.../plc4x/java/base/events/DisconnectEvent.java | 39 --
.../plc4x/java/base/events/DisconnectedEvent.java | 22 -
.../messages/DefaultPlcProprietaryRequest.java | 43 --
.../messages/DefaultPlcProprietaryResponse.java | 42 --
.../messages/DefaultPlcUnsubscriptionResponse.java | 36 -
.../base/messages/InternalPlcFieldRequest.java | 31 -
.../base/messages/InternalPlcFieldResponse.java | 26 -
.../java/base/messages/InternalPlcMessage.java | 23 -
.../messages/InternalPlcProprietaryRequest.java | 22 -
.../messages/InternalPlcProprietaryResponse.java | 22 -
.../java/base/messages/InternalPlcReadRequest.java | 26 -
.../base/messages/InternalPlcReadResponse.java | 31 -
.../java/base/messages/InternalPlcRequest.java | 24 -
.../java/base/messages/InternalPlcResponse.java | 25 -
.../messages/InternalPlcSubscriptionEvent.java | 25 -
.../messages/InternalPlcSubscriptionRequest.java | 36 -
.../messages/InternalPlcSubscriptionResponse.java | 30 -
.../messages/InternalPlcUnsubscriptionRequest.java | 29 -
.../InternalPlcUnsubscriptionResponse.java | 25 -
.../base/messages/InternalPlcWriteRequest.java | 36 -
.../base/messages/InternalPlcWriteResponse.java | 28 -
.../java/base/messages/PlcProprietaryRequest.java | 25 -
.../java/base/messages/PlcProprietaryResponse.java | 25 -
.../java/base/messages/PlcProprietarySender.java | 25 -
.../java/base/messages/PlcProtocolMessage.java | 25 -
.../plc4x/java/base/messages/PlcRawMessage.java | 46 --
.../apache/plc4x/java/base/messages/PlcReader.java | 40 --
.../apache/plc4x/java/base/messages/PlcWriter.java | 40 --
.../messages/items/DefaultLocalDateFieldItem.java | 50 --
.../messages/items/DefaultLocalTimeFieldItem.java | 50 --
.../messages/items/DefaultStringFieldItem.java | 48 --
.../model/InternalPlcConsumerRegistration.java | 32 -
.../base/model/InternalPlcSubscriptionHandle.java | 25 -
.../messages/DefaultPlcReadResponseSpec.groovy | 86 ---
.../base/messages/items/DefaultItemsSpec.groovy | 217 ------
.../base/connection/AbstractPlcConnectionTest.java | 101 ---
.../base/connection/NettyPlcConnectionTest.java | 92 ---
.../messages/DefaultPlcProprietaryRequestTest.java | 48 --
.../DefaultPlcProprietaryResponseTest.java | 50 --
.../base/messages/DefaultPlcReadRequestTest.java | 116 ----
.../base/messages/DefaultPlcReadResponseTest.java | 120 ----
.../messages/DefaultPlcSubscriptionEventTest.java | 68 --
.../DefaultPlcSubscriptionRequestTest.java | 157 -----
.../DefaultPlcSubscriptionResponseTest.java | 124 ----
.../DefaultPlcUnsubscriptionRequestTest.java | 91 ---
.../DefaultPlcUnsubscriptionResponseTest.java | 48 --
.../base/messages/DefaultPlcWriteRequestTest.java | 70 --
.../base/messages/DefaultPlcWriteResponseTest.java | 91 ---
.../java/base/messages/PlcRawMessageTest.java | 57 --
.../base/messages/PlcRequestContainerTest.java | 82 ---
.../messages/items/DefaultLongFieldItemTest.java | 114 ----
.../model/DefaultPlcConsumerRegistrationTest.java | 88 ---
.../model/DefaultPlcSubscriptionHandleTest.java | 73 ---
.../java/base/model/SubscriptionPlcFieldTest.java | 68 --
.../SingleItemToSingleRequestProtocolTest.java | 729 ---------------------
...spockframework.report.IReportCreator.properties | 66 --
plc4j/protocols/driver-bases/pom.xml | 1 -
.../apache/plc4x/java/mock/PlcMockConnection.java | 12 +-
.../org/apache/plc4x/java/mock/PlcMockDriver.java | 2 +-
...cDriver => org.apache.plc4x.java.api.PlcDriver} | 0
.../ethernetip/netty/Plc4XEtherNetIpProtocol.java | 1 -
.../java/modbus/netty/Plc4XModbusProtocol.java | 1 -
.../java/modbus/netty/Plc4XModbusProtocolTest.java | 1 -
plc4j/protocols/pom.xml | 19 +-
.../plc4x/java/s7/netty/Plc4XS7Protocol.java | 2 -
.../java/s7/netty/util/S7PlcFieldHandler.java | 1 -
.../plc4x/java/s7/netty/Plc4XS7ProtocolSpec.groovy | 1 -
.../plc4x/java/s7/netty/Plc4XS7ProtocolTest.java | 1 -
.../java/s7/netty/util/S7PlcFieldHandlerTest.java | 1 -
plc4j/spi/pom.xml | 54 ++
.../plc4x/java/spi}/ConversationContext.java | 2 +-
.../apache/plc4x/java/spi}/Plc4xNettyWrapper.java | 17 +-
.../apache/plc4x/java/spi}/Plc4xProtocolBase.java | 4 +-
.../plc4x/java/spi}/PlcByteToMessageCodec.java | 34 +-
.../plc4x/java/spi}/PlcMessageToMessageCodec.java | 36 +-
.../spi}/connection/AbstractPlcConnection.java | 38 +-
.../plc4x/java/spi/connection/ChannelFactory.java | 13 +-
.../spi}/connection/DefaultPlcFieldHandler.java | 36 +-
.../java/spi}/connection/NettyPlcConnection.java | 36 +-
.../java/spi}/connection/PlcFieldHandler.java | 38 +-
.../apache/plc4x/java/spi/events/ConnectEvent.java | 10 +-
.../plc4x/java/spi/events/ConnectedEvent.java | 10 +-
.../plc4x/java/spi/events/DisconnectEvent.java | 19 +-
.../plc4x/java/spi/events/DisconnectedEvent.java | 10 +-
.../spi/messages/DefaultPlcProprietaryRequest.java | 31 +-
.../messages/DefaultPlcProprietaryResponse.java | 28 +-
.../java/spi}/messages/DefaultPlcReadRequest.java | 47 +-
.../java/spi}/messages/DefaultPlcReadResponse.java | 38 +-
.../spi}/messages/DefaultPlcSubscriptionEvent.java | 36 +-
.../messages/DefaultPlcSubscriptionRequest.java | 47 +-
.../messages/DefaultPlcSubscriptionResponse.java | 34 +-
.../messages/DefaultPlcUnsubscriptionRequest.java | 36 +-
.../messages/DefaultPlcUnsubscriptionResponse.java | 16 +-
.../java/spi}/messages/DefaultPlcWriteRequest.java | 49 +-
.../spi}/messages/DefaultPlcWriteResponse.java | 36 +-
.../java/spi/messages/InternalPlcFieldRequest.java | 11 +-
.../spi/messages/InternalPlcFieldResponse.java | 8 +-
.../java/spi/messages/InternalPlcMessage.java | 9 +-
.../messages/InternalPlcProprietaryRequest.java | 10 +-
.../messages/InternalPlcProprietaryResponse.java | 12 +-
.../java/spi/messages/InternalPlcReadRequest.java | 10 +-
.../java/spi/messages/InternalPlcReadResponse.java | 13 +-
.../java/spi/messages/InternalPlcRequest.java | 10 +-
.../java/spi/messages/InternalPlcResponse.java | 9 +-
.../spi/messages/InternalPlcSubscriptionEvent.java | 9 +-
.../messages/InternalPlcSubscriptionRequest.java | 16 +-
.../messages/InternalPlcSubscriptionResponse.java | 14 +-
.../messages/InternalPlcUnsubscriptionRequest.java | 11 +-
.../InternalPlcUnsubscriptionResponse.java | 9 +-
.../java/spi/messages/InternalPlcWriteRequest.java | 16 +-
.../spi/messages/InternalPlcWriteResponse.java | 12 +-
.../java/spi/messages/PlcProprietaryRequest.java | 11 +-
.../java/spi/messages/PlcProprietaryResponse.java | 11 +-
.../java/spi/messages/PlcProprietarySender.java | 11 +-
.../java/spi/messages/PlcProtocolMessage.java | 9 +-
.../plc4x/java/spi/messages/PlcRawMessage.java | 26 +-
.../apache/plc4x/java/spi/messages/PlcReader.java | 20 +-
.../java/spi}/messages/PlcRequestContainer.java | 34 +-
.../plc4x/java/spi}/messages/PlcSubscriber.java | 34 +-
.../apache/plc4x/java/spi/messages/PlcWriter.java | 20 +-
.../spi}/messages/items/BaseDefaultFieldItem.java | 36 +-
.../messages/items/DefaultBigDecimalFieldItem.java | 36 +-
.../messages/items/DefaultBigIntegerFieldItem.java | 36 +-
.../messages/items/DefaultBooleanFieldItem.java | 36 +-
.../messages/items/DefaultByteArrayFieldItem.java | 36 +-
.../spi}/messages/items/DefaultByteFieldItem.java | 36 +-
.../messages/items/DefaultDoubleFieldItem.java | 36 +-
.../spi}/messages/items/DefaultFloatFieldItem.java | 36 +-
.../messages/items/DefaultIntegerFieldItem.java | 36 +-
.../messages/items/DefaultLocalDateFieldItem.java | 34 +-
.../items/DefaultLocalDateTimeFieldItem.java | 36 +-
.../messages/items/DefaultLocalTimeFieldItem.java | 34 +-
.../spi}/messages/items/DefaultLongFieldItem.java | 36 +-
.../spi}/messages/items/DefaultShortFieldItem.java | 36 +-
.../spi/messages/items/DefaultStringFieldItem.java | 28 +-
.../spi}/model/DefaultPlcConsumerRegistration.java | 36 +-
.../spi}/model/DefaultPlcSubscriptionHandle.java | 36 +-
.../spi/model/InternalPlcConsumerRegistration.java | 12 +-
.../spi/model/InternalPlcSubscriptionHandle.java | 11 +-
.../java/spi}/model/SubscriptionPlcField.java | 34 +-
.../SingleItemToSingleRequestProtocol.java | 63 +-
.../utils/connectionpool/PooledDummyDriver.java | 2 +-
.../connectionpool/PooledPlcDriverManagerTest.java | 2 +-
...cDriver => org.apache.plc4x.java.api.PlcDriver} | 0
plc4j/utils/driver-base-java/pom.xml | 14 +
.../spi}/GeneratedDriverByteToMessageCodec.java | 36 +-
.../java/opm/PlcEntityManagerComplexTest.java | 2 -
.../triggeredscraper/TriggeredScraperImpl.java | 3 +-
.../apache/plc4x/java/amsads/AMSADSPlcDriver.java | 2 +-
.../connection/AdsAbstractPlcConnection.java | 1 -
.../amsads/connection/AdsTcpPlcConnection.java | 1 -
.../java/amsads/model/AdsPlcFieldHandler.java | 1 -
.../java/amsads/protocol/Plc4x2AdsProtocol.java | 1 -
.../amsads/protocol/util/LittleEndianDecoder.java | 1 -
...cDriver => org.apache.plc4x.java.api.PlcDriver} | 0
.../plc4x/java/bacnetip/PassiveBacNetIpDriver.java | 2 +-
.../connection/PassiveBacNetIpPlcConnection.java | 2 -
...cDriver => org.apache.plc4x.java.api.PlcDriver} | 0
.../org/apache/plc4x/java/df1/DF1PlcDriver.java | 2 +-
.../java/df1/connection/SerialDf1Connection.java | 1 -
...cDriver => org.apache.plc4x.java.api.PlcDriver} | 0
.../passive/knxnetip/PassiveKnxNetIpDriver.java | 2 +-
.../connection/PassiveKnxNetIpPlcConnection.java | 1 -
...cDriver => org.apache.plc4x.java.api.PlcDriver} | 0
.../apache/plc4x/java/knxnetip/KnxNetIpDriver.java | 2 +-
.../knxnetip/connection/KnxNetIpConnection.java | 1 -
...cDriver => org.apache.plc4x.java.api.PlcDriver} | 0
.../plc4x/javapassive/s7/PassiveS7PlcDriver.java | 2 +-
...cDriver => org.apache.plc4x.java.api.PlcDriver} | 0
sandbox/test-java-s7-driver/pom.xml | 6 +
.../apache/plc4x/java/s7/readwrite/S7Driver.java | 2 +-
.../java/s7/readwrite/connection/S7Connection.java | 22 +-
.../s7/readwrite/protocol/Plc4xS7Protocol.java | 26 +-
.../java/s7/readwrite/protocol/S7Protocol.java | 2 +-
.../java/s7/readwrite/utils/S7PlcFieldHandler.java | 14 +-
...cDriver => org.apache.plc4x.java.api.PlcDriver} | 0
230 files changed, 1134 insertions(+), 4959 deletions(-)
diff --git a/plc4j/api/src/main/java/org/apache/plc4x/java/PlcDriverManager.java b/plc4j/api/src/main/java/org/apache/plc4x/java/PlcDriverManager.java
index 2115a56..710cdb1 100644
--- a/plc4j/api/src/main/java/org/apache/plc4x/java/PlcDriverManager.java
+++ b/plc4j/api/src/main/java/org/apache/plc4x/java/PlcDriverManager.java
@@ -22,7 +22,7 @@ import org.apache.plc4x.java.api.Changed;
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.spi.PlcDriver;
+import org.apache.plc4x.java.api.PlcDriver;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/plc4j/api/src/main/java/org/apache/plc4x/java/spi/PlcDriver.java b/plc4j/api/src/main/java/org/apache/plc4x/java/api/PlcDriver.java
similarity index 96%
rename from plc4j/api/src/main/java/org/apache/plc4x/java/spi/PlcDriver.java
rename to plc4j/api/src/main/java/org/apache/plc4x/java/api/PlcDriver.java
index 9d758d1..f1291b3 100644
--- a/plc4j/api/src/main/java/org/apache/plc4x/java/spi/PlcDriver.java
+++ b/plc4j/api/src/main/java/org/apache/plc4x/java/api/PlcDriver.java
@@ -16,9 +16,8 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.plc4x.java.spi;
+package org.apache.plc4x.java.api;
-import org.apache.plc4x.java.api.PlcConnection;
import org.apache.plc4x.java.api.authentication.PlcAuthentication;
import org.apache.plc4x.java.api.exceptions.PlcConnectionException;
diff --git a/plc4j/api/src/test/java/org/apache/plc4x/java/mock/MockDriver.java b/plc4j/api/src/test/java/org/apache/plc4x/java/mock/MockDriver.java
index 749ab8a..669378e 100644
--- a/plc4j/api/src/test/java/org/apache/plc4x/java/mock/MockDriver.java
+++ b/plc4j/api/src/test/java/org/apache/plc4x/java/mock/MockDriver.java
@@ -20,7 +20,7 @@ package org.apache.plc4x.java.mock;
import org.apache.plc4x.java.api.PlcConnection;
import org.apache.plc4x.java.api.authentication.PlcAuthentication;
-import org.apache.plc4x.java.spi.PlcDriver;
+import org.apache.plc4x.java.api.PlcDriver;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
diff --git a/plc4j/api/src/test/resources/META-INF/services/org.apache.plc4x.java.spi.PlcDriver b/plc4j/api/src/test/resources/META-INF/services/org.apache.plc4x.java.api.PlcDriver
similarity index 100%
rename from plc4j/api/src/test/resources/META-INF/services/org.apache.plc4x.java.spi.PlcDriver
rename to plc4j/api/src/test/resources/META-INF/services/org.apache.plc4x.java.api.PlcDriver
diff --git a/plc4j/api/src/test/resources/test/META-INF/services/org.apache.plc4x.java.spi.PlcDriver b/plc4j/api/src/test/resources/test/META-INF/services/org.apache.plc4x.java.api.PlcDriver
similarity index 100%
rename from plc4j/api/src/test/resources/test/META-INF/services/org.apache.plc4x.java.spi.PlcDriver
rename to plc4j/api/src/test/resources/test/META-INF/services/org.apache.plc4x.java.api.PlcDriver
diff --git a/plc4j/drivers/ab-eth/src/main/java/org/apache/plc4x/java/abeth/AbEthDriver.java b/plc4j/drivers/ab-eth/src/main/java/org/apache/plc4x/java/abeth/AbEthDriver.java
index 708de9b..8e9c9f9 100644
--- a/plc4j/drivers/ab-eth/src/main/java/org/apache/plc4x/java/abeth/AbEthDriver.java
+++ b/plc4j/drivers/ab-eth/src/main/java/org/apache/plc4x/java/abeth/AbEthDriver.java
@@ -22,7 +22,7 @@ import org.apache.plc4x.java.abeth.connection.AbEthPlcConnection;
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.spi.PlcDriver;
+import org.apache.plc4x.java.api.PlcDriver;
import java.net.InetAddress;
import java.net.UnknownHostException;
diff --git a/plc4j/drivers/ab-eth/src/main/java/org/apache/plc4x/java/abeth/connection/AbEthPlcConnection.java b/plc4j/drivers/ab-eth/src/main/java/org/apache/plc4x/java/abeth/connection/AbEthPlcConnection.java
index db93855..07638bb 100644
--- a/plc4j/drivers/ab-eth/src/main/java/org/apache/plc4x/java/abeth/connection/AbEthPlcConnection.java
+++ b/plc4j/drivers/ab-eth/src/main/java/org/apache/plc4x/java/abeth/connection/AbEthPlcConnection.java
@@ -23,7 +23,6 @@ import org.apache.commons.lang3.StringUtils;
import org.apache.plc4x.java.abeth.model.AbEthField;
import org.apache.plc4x.java.abeth.protocol.AbEthProtocol;
import org.apache.plc4x.java.abeth.protocol.Plc4xAbEthProtocol;
-import org.apache.plc4x.java.api.exceptions.PlcConnectionException;
import org.apache.plc4x.java.api.exceptions.PlcInvalidFieldException;
import org.apache.plc4x.java.api.messages.PlcReadRequest;
import org.apache.plc4x.java.api.messages.PlcReadResponse;
@@ -32,7 +31,11 @@ import org.apache.plc4x.java.base.connection.ChannelFactory;
import org.apache.plc4x.java.base.connection.NettyPlcConnection;
import org.apache.plc4x.java.base.events.ConnectEvent;
import org.apache.plc4x.java.base.events.ConnectedEvent;
-import org.apache.plc4x.java.base.messages.*;
+import org.apache.plc4x.java.base.messages.DefaultPlcReadRequest;
+import org.apache.plc4x.java.base.messages.InternalPlcReadRequest;
+import org.apache.plc4x.java.base.messages.InternalPlcReadResponse;
+import org.apache.plc4x.java.base.messages.PlcReader;
+import org.apache.plc4x.java.base.messages.PlcRequestContainer;
import org.apache.plc4x.java.tcp.connection.TcpSocketChannelFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/plc4j/drivers/ab-eth/src/main/resources/META-INF/services/org.apache.plc4x.java.spi.PlcDriver b/plc4j/drivers/ab-eth/src/main/resources/META-INF/services/org.apache.plc4x.java.api.PlcDriver
similarity index 100%
rename from plc4j/drivers/ab-eth/src/main/resources/META-INF/services/org.apache.plc4x.java.spi.PlcDriver
rename to plc4j/drivers/ab-eth/src/main/resources/META-INF/services/org.apache.plc4x.java.api.PlcDriver
diff --git a/plc4j/drivers/ads/src/main/java/org/apache/plc4x/java/ads/AdsPlcDriver.java b/plc4j/drivers/ads/src/main/java/org/apache/plc4x/java/ads/AdsPlcDriver.java
index e6f3c34..966efb2 100644
--- a/plc4j/drivers/ads/src/main/java/org/apache/plc4x/java/ads/AdsPlcDriver.java
+++ b/plc4j/drivers/ads/src/main/java/org/apache/plc4x/java/ads/AdsPlcDriver.java
@@ -25,7 +25,7 @@ import org.apache.plc4x.java.ads.connection.AdsConnectionFactory;
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.spi.PlcDriver;
+import org.apache.plc4x.java.api.PlcDriver;
import org.osgi.service.component.annotations.Component;
import java.net.InetAddress;
diff --git a/plc4j/drivers/ads/src/main/java/org/apache/plc4x/java/ads/connection/AdsAbstractPlcConnection.java b/plc4j/drivers/ads/src/main/java/org/apache/plc4x/java/ads/connection/AdsAbstractPlcConnection.java
index bce172e..2d0d314 100644
--- a/plc4j/drivers/ads/src/main/java/org/apache/plc4x/java/ads/connection/AdsAbstractPlcConnection.java
+++ b/plc4j/drivers/ads/src/main/java/org/apache/plc4x/java/ads/connection/AdsAbstractPlcConnection.java
@@ -36,7 +36,6 @@ import org.apache.plc4x.java.api.exceptions.PlcRuntimeException;
import org.apache.plc4x.java.api.messages.*;
import org.apache.plc4x.java.base.connection.ChannelFactory;
import org.apache.plc4x.java.base.connection.NettyPlcConnection;
-import org.apache.plc4x.java.base.messages.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/plc4j/drivers/ads/src/main/java/org/apache/plc4x/java/ads/connection/AdsTcpPlcConnection.java b/plc4j/drivers/ads/src/main/java/org/apache/plc4x/java/ads/connection/AdsTcpPlcConnection.java
index 5c5c915..5156c96 100644
--- a/plc4j/drivers/ads/src/main/java/org/apache/plc4x/java/ads/connection/AdsTcpPlcConnection.java
+++ b/plc4j/drivers/ads/src/main/java/org/apache/plc4x/java/ads/connection/AdsTcpPlcConnection.java
@@ -41,14 +41,12 @@ import org.apache.plc4x.java.api.model.PlcField;
import org.apache.plc4x.java.api.model.PlcSubscriptionHandle;
import org.apache.plc4x.java.api.types.PlcResponseCode;
import org.apache.plc4x.java.tcp.connection.TcpSocketChannelFactory;
-import org.apache.plc4x.java.base.messages.*;
import org.apache.plc4x.java.base.messages.items.BaseDefaultFieldItem;
import org.apache.plc4x.java.base.model.DefaultPlcConsumerRegistration;
import org.apache.plc4x.java.base.model.InternalPlcConsumerRegistration;
import org.apache.plc4x.java.base.model.InternalPlcSubscriptionHandle;
import org.apache.plc4x.java.base.model.SubscriptionPlcField;
import org.apache.plc4x.java.base.protocol.SingleItemToSingleRequestProtocol;
-import org.apache.plc4x.java.tcp.connection.TcpSocketChannelFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/plc4j/drivers/ads/src/main/resources/META-INF/services/org.apache.plc4x.java.spi.PlcDriver b/plc4j/drivers/ads/src/main/resources/META-INF/services/org.apache.plc4x.java.api.PlcDriver
similarity index 100%
rename from plc4j/drivers/ads/src/main/resources/META-INF/services/org.apache.plc4x.java.spi.PlcDriver
rename to plc4j/drivers/ads/src/main/resources/META-INF/services/org.apache.plc4x.java.api.PlcDriver
diff --git a/plc4j/drivers/ads/src/test/java/org/apache/plc4x/java/ads/connection/AdsAbstractPlcConnectionTest.java b/plc4j/drivers/ads/src/test/java/org/apache/plc4x/java/ads/connection/AdsAbstractPlcConnectionTest.java
index db48b07..bfa4857 100644
--- a/plc4j/drivers/ads/src/test/java/org/apache/plc4x/java/ads/connection/AdsAbstractPlcConnectionTest.java
+++ b/plc4j/drivers/ads/src/test/java/org/apache/plc4x/java/ads/connection/AdsAbstractPlcConnectionTest.java
@@ -36,7 +36,6 @@ import org.apache.plc4x.java.api.messages.PlcFieldRequest;
import org.apache.plc4x.java.api.messages.PlcReadResponse;
import org.apache.plc4x.java.api.messages.PlcWriteResponse;
import org.apache.plc4x.java.base.connection.ChannelFactory;
-import org.apache.plc4x.java.base.messages.*;
import org.assertj.core.api.WithAssertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Nested;
diff --git a/plc4j/drivers/ads/src/test/java/org/apache/plc4x/java/ads/connection/AdsTcpPlcConnectionTests.java b/plc4j/drivers/ads/src/test/java/org/apache/plc4x/java/ads/connection/AdsTcpPlcConnectionTests.java
index fbc4d21..d5d4f97 100644
--- a/plc4j/drivers/ads/src/test/java/org/apache/plc4x/java/ads/connection/AdsTcpPlcConnectionTests.java
+++ b/plc4j/drivers/ads/src/test/java/org/apache/plc4x/java/ads/connection/AdsTcpPlcConnectionTests.java
@@ -43,7 +43,6 @@ import org.apache.plc4x.java.ads.model.DirectAdsField;
import org.apache.plc4x.java.ads.protocol.Plc4x2AdsProtocol;
import org.apache.plc4x.java.api.messages.PlcSubscriptionEvent;
import org.apache.plc4x.java.api.types.PlcSubscriptionType;
-import org.apache.plc4x.java.base.messages.*;
import org.apache.plc4x.java.base.model.InternalPlcConsumerRegistration;
import org.apache.plc4x.java.base.model.SubscriptionPlcField;
import org.assertj.core.api.WithAssertions;
diff --git a/plc4j/drivers/ethernet-ip/src/main/java/org/apache/plc4x/java/ethernetip/EtherNetIpPlcDriver.java b/plc4j/drivers/ethernet-ip/src/main/java/org/apache/plc4x/java/ethernetip/EtherNetIpPlcDriver.java
index 9a98e08..0e0f39f 100644
--- a/plc4j/drivers/ethernet-ip/src/main/java/org/apache/plc4x/java/ethernetip/EtherNetIpPlcDriver.java
+++ b/plc4j/drivers/ethernet-ip/src/main/java/org/apache/plc4x/java/ethernetip/EtherNetIpPlcDriver.java
@@ -22,7 +22,7 @@ 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.ethernetip.connection.EtherNetIpTcpPlcConnection;
-import org.apache.plc4x.java.spi.PlcDriver;
+import org.apache.plc4x.java.api.PlcDriver;
import org.osgi.service.component.annotations.Component;
import java.net.InetAddress;
diff --git a/plc4j/drivers/ethernet-ip/src/main/java/org/apache/plc4x/java/ethernetip/connection/BaseEtherNetIpPlcConnection.java b/plc4j/drivers/ethernet-ip/src/main/java/org/apache/plc4x/java/ethernetip/connection/BaseEtherNetIpPlcConnection.java
index 332fd9b..cb80020 100644
--- a/plc4j/drivers/ethernet-ip/src/main/java/org/apache/plc4x/java/ethernetip/connection/BaseEtherNetIpPlcConnection.java
+++ b/plc4j/drivers/ethernet-ip/src/main/java/org/apache/plc4x/java/ethernetip/connection/BaseEtherNetIpPlcConnection.java
@@ -25,7 +25,6 @@ import org.apache.plc4x.java.api.messages.PlcWriteRequest;
import org.apache.plc4x.java.api.messages.PlcWriteResponse;
import org.apache.plc4x.java.base.connection.ChannelFactory;
import org.apache.plc4x.java.base.connection.NettyPlcConnection;
-import org.apache.plc4x.java.base.messages.*;
import org.apache.plc4x.java.ethernetip.netty.util.EnipPlcFieldHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/plc4j/drivers/ethernet-ip/src/main/java/org/apache/plc4x/java/ethernetip/connection/EtherNetIpTcpPlcConnection.java b/plc4j/drivers/ethernet-ip/src/main/java/org/apache/plc4x/java/ethernetip/connection/EtherNetIpTcpPlcConnection.java
index ccf1ee1..d1d891c 100644
--- a/plc4j/drivers/ethernet-ip/src/main/java/org/apache/plc4x/java/ethernetip/connection/EtherNetIpTcpPlcConnection.java
+++ b/plc4j/drivers/ethernet-ip/src/main/java/org/apache/plc4x/java/ethernetip/connection/EtherNetIpTcpPlcConnection.java
@@ -25,7 +25,6 @@ import org.apache.plc4x.java.base.events.ConnectEvent;
import org.apache.plc4x.java.base.events.ConnectedEvent;
import org.apache.plc4x.java.ethernetip.netty.EnipCodec;
import org.apache.plc4x.java.ethernetip.netty.Plc4XEtherNetIpProtocol;
-import org.apache.plc4x.java.tcp.connection.TcpSocketChannelFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/plc4j/drivers/ethernet-ip/src/main/resources/META-INF/services/org.apache.plc4x.java.spi.PlcDriver b/plc4j/drivers/ethernet-ip/src/main/resources/META-INF/services/org.apache.plc4x.java.api.PlcDriver
similarity index 100%
rename from plc4j/drivers/ethernet-ip/src/main/resources/META-INF/services/org.apache.plc4x.java.spi.PlcDriver
rename to plc4j/drivers/ethernet-ip/src/main/resources/META-INF/services/org.apache.plc4x.java.api.PlcDriver
diff --git a/plc4j/drivers/modbus/src/main/java/org/apache/plc4x/java/modbus/ModbusPlcDriver.java b/plc4j/drivers/modbus/src/main/java/org/apache/plc4x/java/modbus/ModbusPlcDriver.java
index 4801feb..7fba2f7 100644
--- a/plc4j/drivers/modbus/src/main/java/org/apache/plc4x/java/modbus/ModbusPlcDriver.java
+++ b/plc4j/drivers/modbus/src/main/java/org/apache/plc4x/java/modbus/ModbusPlcDriver.java
@@ -23,7 +23,7 @@ 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.modbus.connection.ModbusConnectionFactory;
-import org.apache.plc4x.java.spi.PlcDriver;
+import org.apache.plc4x.java.api.PlcDriver;
import org.osgi.service.component.annotations.Component;
import java.net.InetAddress;
diff --git a/plc4j/drivers/modbus/src/main/java/org/apache/plc4x/java/modbus/connection/BaseModbusPlcConnection.java b/plc4j/drivers/modbus/src/main/java/org/apache/plc4x/java/modbus/connection/BaseModbusPlcConnection.java
index 713acd5..3b166c8 100644
--- a/plc4j/drivers/modbus/src/main/java/org/apache/plc4x/java/modbus/connection/BaseModbusPlcConnection.java
+++ b/plc4j/drivers/modbus/src/main/java/org/apache/plc4x/java/modbus/connection/BaseModbusPlcConnection.java
@@ -25,7 +25,6 @@ import org.apache.plc4x.java.api.messages.PlcWriteRequest;
import org.apache.plc4x.java.api.messages.PlcWriteResponse;
import org.apache.plc4x.java.base.connection.ChannelFactory;
import org.apache.plc4x.java.base.connection.NettyPlcConnection;
-import org.apache.plc4x.java.base.messages.*;
import org.apache.plc4x.java.modbus.util.ModbusPlcFieldHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/plc4j/drivers/modbus/src/main/java/org/apache/plc4x/java/modbus/connection/ModbusTcpPlcConnection.java b/plc4j/drivers/modbus/src/main/java/org/apache/plc4x/java/modbus/connection/ModbusTcpPlcConnection.java
index da2c99f..9ef30d5 100644
--- a/plc4j/drivers/modbus/src/main/java/org/apache/plc4x/java/modbus/connection/ModbusTcpPlcConnection.java
+++ b/plc4j/drivers/modbus/src/main/java/org/apache/plc4x/java/modbus/connection/ModbusTcpPlcConnection.java
@@ -28,7 +28,6 @@ import org.apache.plc4x.java.base.connection.ChannelFactory;
import org.apache.plc4x.java.tcp.connection.TcpSocketChannelFactory;
import org.apache.plc4x.java.base.protocol.SingleItemToSingleRequestProtocol;
import org.apache.plc4x.java.modbus.netty.Plc4XModbusProtocol;
-import org.apache.plc4x.java.tcp.connection.TcpSocketChannelFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/plc4j/drivers/modbus/src/main/resources/META-INF/services/org.apache.plc4x.java.spi.PlcDriver b/plc4j/drivers/modbus/src/main/resources/META-INF/services/org.apache.plc4x.java.api.PlcDriver
similarity index 100%
rename from plc4j/drivers/modbus/src/main/resources/META-INF/services/org.apache.plc4x.java.spi.PlcDriver
rename to plc4j/drivers/modbus/src/main/resources/META-INF/services/org.apache.plc4x.java.api.PlcDriver
diff --git a/plc4j/drivers/opcua/src/main/java/org/apache/plc4x/java/opcua/OpcuaPlcDriver.java b/plc4j/drivers/opcua/src/main/java/org/apache/plc4x/java/opcua/OpcuaPlcDriver.java
index 185de95..61bf3ab 100644
--- a/plc4j/drivers/opcua/src/main/java/org/apache/plc4x/java/opcua/OpcuaPlcDriver.java
+++ b/plc4j/drivers/opcua/src/main/java/org/apache/plc4x/java/opcua/OpcuaPlcDriver.java
@@ -23,7 +23,7 @@ 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.opcua.connection.OpcuaConnectionFactory;
-import org.apache.plc4x.java.spi.PlcDriver;
+import org.apache.plc4x.java.api.PlcDriver;
import org.osgi.service.component.annotations.Component;
import java.net.InetAddress;
diff --git a/plc4j/drivers/opcua/src/main/java/org/apache/plc4x/java/opcua/connection/BaseOpcuaPlcConnection.java b/plc4j/drivers/opcua/src/main/java/org/apache/plc4x/java/opcua/connection/BaseOpcuaPlcConnection.java
index a7a2d43..8f8ba00 100644
--- a/plc4j/drivers/opcua/src/main/java/org/apache/plc4x/java/opcua/connection/BaseOpcuaPlcConnection.java
+++ b/plc4j/drivers/opcua/src/main/java/org/apache/plc4x/java/opcua/connection/BaseOpcuaPlcConnection.java
@@ -24,7 +24,6 @@ import org.apache.plc4x.java.api.messages.PlcSubscriptionRequest;
import org.apache.plc4x.java.api.messages.PlcUnsubscriptionRequest;
import org.apache.plc4x.java.api.messages.PlcWriteRequest;
import org.apache.plc4x.java.base.connection.AbstractPlcConnection;
-import org.apache.plc4x.java.base.messages.*;
import org.apache.plc4x.java.opcua.protocol.OpcuaPlcFieldHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/plc4j/drivers/opcua/src/main/java/org/apache/plc4x/java/opcua/connection/OpcuaTcpPlcConnection.java b/plc4j/drivers/opcua/src/main/java/org/apache/plc4x/java/opcua/connection/OpcuaTcpPlcConnection.java
index 1270972..b24843f 100644
--- a/plc4j/drivers/opcua/src/main/java/org/apache/plc4x/java/opcua/connection/OpcuaTcpPlcConnection.java
+++ b/plc4j/drivers/opcua/src/main/java/org/apache/plc4x/java/opcua/connection/OpcuaTcpPlcConnection.java
@@ -27,8 +27,6 @@ import org.apache.plc4x.java.api.model.PlcConsumerRegistration;
import org.apache.plc4x.java.api.model.PlcField;
import org.apache.plc4x.java.api.model.PlcSubscriptionHandle;
import org.apache.plc4x.java.api.types.PlcResponseCode;
-import org.apache.plc4x.java.base.messages.*;
-import org.apache.plc4x.java.base.messages.items.*;
import org.apache.plc4x.java.base.model.SubscriptionPlcField;
import org.apache.plc4x.java.opcua.protocol.OpcuaField;
import org.apache.plc4x.java.opcua.protocol.OpcuaSubsriptionHandle;
diff --git a/plc4j/drivers/opcua/src/main/java/org/apache/plc4x/java/opcua/protocol/OpcuaPlcFieldHandler.java b/plc4j/drivers/opcua/src/main/java/org/apache/plc4x/java/opcua/protocol/OpcuaPlcFieldHandler.java
index bf4e052..c4ecc41 100644
--- a/plc4j/drivers/opcua/src/main/java/org/apache/plc4x/java/opcua/protocol/OpcuaPlcFieldHandler.java
+++ b/plc4j/drivers/opcua/src/main/java/org/apache/plc4x/java/opcua/protocol/OpcuaPlcFieldHandler.java
@@ -22,7 +22,6 @@ package org.apache.plc4x.java.opcua.protocol;
import org.apache.plc4x.java.api.exceptions.PlcInvalidFieldException;
import org.apache.plc4x.java.api.model.PlcField;
import org.apache.plc4x.java.base.connection.DefaultPlcFieldHandler;
-import org.apache.plc4x.java.base.messages.items.*;
import java.math.BigInteger;
import java.util.ArrayList;
diff --git a/plc4j/drivers/opcua/src/main/resources/META-INF/services/org.apache.plc4x.java.spi.PlcDriver b/plc4j/drivers/opcua/src/main/resources/META-INF/services/org.apache.plc4x.java.api.PlcDriver
similarity index 100%
rename from plc4j/drivers/opcua/src/main/resources/META-INF/services/org.apache.plc4x.java.spi.PlcDriver
rename to plc4j/drivers/opcua/src/main/resources/META-INF/services/org.apache.plc4x.java.api.PlcDriver
diff --git a/plc4j/drivers/pom.xml b/plc4j/drivers/pom.xml
index d346db2..7782afd 100644
--- a/plc4j/drivers/pom.xml
+++ b/plc4j/drivers/pom.xml
@@ -34,13 +34,13 @@
<description>Wrapper project for all PLC4J driver implementations.</description>
<modules>
- <module>ab-eth</module>
- <module>ads</module>
- <module>ethernet-ip</module>
- <module>modbus</module>
- <module>s7</module>
- <module>simulated</module>
- <module>opcua</module>
+<!-- <module>ab-eth</module>-->
+<!-- <module>ads</module>-->
+<!-- <module>ethernet-ip</module>-->
+<!-- <module>modbus</module>-->
+<!-- <module>s7</module>-->
+<!-- <module>simulated</module>-->
+<!-- <module>opcua</module>-->
</modules>
</project>
diff --git a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/S7PlcDriver.java b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/S7PlcDriver.java
index 8612e47..4780e34 100644
--- a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/S7PlcDriver.java
+++ b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/S7PlcDriver.java
@@ -22,7 +22,7 @@ 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.s7.connection.S7PlcConnection;
-import org.apache.plc4x.java.spi.PlcDriver;
+import org.apache.plc4x.java.api.PlcDriver;
import org.osgi.service.component.annotations.Component;
import java.net.InetAddress;
diff --git a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/connection/S7PlcConnection.java b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/connection/S7PlcConnection.java
index 0de6483..d6e1fa6 100644
--- a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/connection/S7PlcConnection.java
+++ b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/connection/S7PlcConnection.java
@@ -35,7 +35,6 @@ import org.apache.plc4x.java.base.connection.NettyPlcConnection;
import org.apache.plc4x.java.tcp.connection.TcpSocketChannelFactory;
import org.apache.plc4x.java.base.events.ConnectEvent;
import org.apache.plc4x.java.base.events.ConnectedEvent;
-import org.apache.plc4x.java.base.messages.*;
import org.apache.plc4x.java.isoontcp.protocol.IsoOnTcpProtocol;
import org.apache.plc4x.java.isotp.protocol.IsoTPProtocol;
import org.apache.plc4x.java.isotp.protocol.model.tpdus.DisconnectRequestTpdu;
diff --git a/plc4j/drivers/s7/src/main/resources/META-INF/services/org.apache.plc4x.java.spi.PlcDriver b/plc4j/drivers/s7/src/main/resources/META-INF/services/org.apache.plc4x.java.api.PlcDriver
similarity index 100%
rename from plc4j/drivers/s7/src/main/resources/META-INF/services/org.apache.plc4x.java.spi.PlcDriver
rename to plc4j/drivers/s7/src/main/resources/META-INF/services/org.apache.plc4x.java.api.PlcDriver
diff --git a/plc4j/drivers/s7/src/test/java/org/apache/plc4x/java/s7/BenchmarkS7.java b/plc4j/drivers/s7/src/test/java/org/apache/plc4x/java/s7/BenchmarkS7.java
index 827ea3e..3ad97f7 100644
--- a/plc4j/drivers/s7/src/test/java/org/apache/plc4x/java/s7/BenchmarkS7.java
+++ b/plc4j/drivers/s7/src/test/java/org/apache/plc4x/java/s7/BenchmarkS7.java
@@ -33,7 +33,6 @@ import org.apache.plc4x.java.s7.types.S7ControllerType;
import java.util.List;
import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.ExecutionException;
public class BenchmarkS7 {
diff --git a/plc4j/drivers/simulated/src/main/java/org/apache/plc4x/java/simulated/SimulatedPlcDriver.java b/plc4j/drivers/simulated/src/main/java/org/apache/plc4x/java/simulated/SimulatedPlcDriver.java
index d1e1ef4..d72c961 100644
--- a/plc4j/drivers/simulated/src/main/java/org/apache/plc4x/java/simulated/SimulatedPlcDriver.java
+++ b/plc4j/drivers/simulated/src/main/java/org/apache/plc4x/java/simulated/SimulatedPlcDriver.java
@@ -23,7 +23,7 @@ import org.apache.plc4x.java.api.authentication.PlcAuthentication;
import org.apache.plc4x.java.api.exceptions.PlcConnectionException;
import org.apache.plc4x.java.simulated.connection.SimulatedPlcConnection;
import org.apache.plc4x.java.simulated.connection.TestDevice;
-import org.apache.plc4x.java.spi.PlcDriver;
+import org.apache.plc4x.java.api.PlcDriver;
import org.osgi.service.component.annotations.Component;
/**
diff --git a/plc4j/drivers/simulated/src/main/java/org/apache/plc4x/java/simulated/connection/SimulatedPlcConnection.java b/plc4j/drivers/simulated/src/main/java/org/apache/plc4x/java/simulated/connection/SimulatedPlcConnection.java
index 805d9af..3a31233 100644
--- a/plc4j/drivers/simulated/src/main/java/org/apache/plc4x/java/simulated/connection/SimulatedPlcConnection.java
+++ b/plc4j/drivers/simulated/src/main/java/org/apache/plc4x/java/simulated/connection/SimulatedPlcConnection.java
@@ -25,9 +25,7 @@ import org.apache.plc4x.java.api.model.PlcConsumerRegistration;
import org.apache.plc4x.java.api.model.PlcSubscriptionHandle;
import org.apache.plc4x.java.api.types.PlcResponseCode;
import org.apache.plc4x.java.base.connection.AbstractPlcConnection;
-import org.apache.plc4x.java.base.messages.*;
import org.apache.plc4x.java.base.messages.items.BaseDefaultFieldItem;
-import org.apache.plc4x.java.base.model.*;
import java.time.Instant;
import java.util.*;
diff --git a/plc4j/drivers/simulated/src/main/java/org/apache/plc4x/java/simulated/connection/TestFieldHandler.java b/plc4j/drivers/simulated/src/main/java/org/apache/plc4x/java/simulated/connection/TestFieldHandler.java
index 44d7151..6664d3a 100644
--- a/plc4j/drivers/simulated/src/main/java/org/apache/plc4x/java/simulated/connection/TestFieldHandler.java
+++ b/plc4j/drivers/simulated/src/main/java/org/apache/plc4x/java/simulated/connection/TestFieldHandler.java
@@ -23,7 +23,6 @@ import org.apache.plc4x.java.api.exceptions.PlcInvalidFieldException;
import org.apache.plc4x.java.api.exceptions.PlcRuntimeException;
import org.apache.plc4x.java.api.model.PlcField;
import org.apache.plc4x.java.base.connection.PlcFieldHandler;
-import org.apache.plc4x.java.base.messages.items.*;
import java.math.BigDecimal;
import java.math.BigInteger;
diff --git a/plc4j/drivers/simulated/src/main/resources/META-INF/services/org.apache.plc4x.java.spi.PlcDriver b/plc4j/drivers/simulated/src/main/resources/META-INF/services/org.apache.plc4x.java.api.PlcDriver
similarity index 100%
rename from plc4j/drivers/simulated/src/main/resources/META-INF/services/org.apache.plc4x.java.spi.PlcDriver
rename to plc4j/drivers/simulated/src/main/resources/META-INF/services/org.apache.plc4x.java.api.PlcDriver
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
index 76e54f1..f398eab 100644
--- 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
@@ -22,7 +22,7 @@ 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.spi.PlcDriver;
+import org.apache.plc4x.java.api.PlcDriver;
import java.net.InetAddress;
import java.net.UnknownHostException;
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
index 5925f9c..1883603 100644
--- 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
@@ -26,8 +26,14 @@ 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.base.connection.NettyPlcConnection;
+import org.apache.plc4x.java.base.messages.InternalPlcReadRequest;
+import org.apache.plc4x.java.base.messages.InternalPlcReadResponse;
+import org.apache.plc4x.java.base.messages.InternalPlcWriteRequest;
+import org.apache.plc4x.java.base.messages.InternalPlcWriteResponse;
+import org.apache.plc4x.java.base.messages.PlcReader;
+import org.apache.plc4x.java.base.messages.PlcRequestContainer;
+import org.apache.plc4x.java.base.messages.PlcWriter;
import org.apache.plc4x.java.tcp.connection.TcpSocketChannelFactory;
-import org.apache.plc4x.java.base.messages.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/plc4j/examples/dummy-driver/src/main/resources/META-INF/services/org.apache.plc4x.java.spi.PlcDriver b/plc4j/examples/dummy-driver/src/main/resources/META-INF/services/org.apache.plc4x.java.api.PlcDriver
similarity index 100%
rename from plc4j/examples/dummy-driver/src/main/resources/META-INF/services/org.apache.plc4x.java.spi.PlcDriver
rename to plc4j/examples/dummy-driver/src/main/resources/META-INF/services/org.apache.plc4x.java.api.PlcDriver
diff --git a/plc4j/integrations/apache-camel/src/test/java/org/apache/plc4x/camel/MockDriver.java b/plc4j/integrations/apache-camel/src/test/java/org/apache/plc4x/camel/MockDriver.java
index cb4e00b..85b5683 100644
--- a/plc4j/integrations/apache-camel/src/test/java/org/apache/plc4x/camel/MockDriver.java
+++ b/plc4j/integrations/apache-camel/src/test/java/org/apache/plc4x/camel/MockDriver.java
@@ -24,7 +24,7 @@ import org.apache.plc4x.java.api.messages.*;
import org.apache.plc4x.java.base.messages.DefaultPlcSubscriptionResponse;
import org.apache.plc4x.java.base.messages.InternalPlcSubscriptionRequest;
import org.apache.plc4x.java.base.messages.PlcSubscriber;
-import org.apache.plc4x.java.spi.PlcDriver;
+import org.apache.plc4x.java.api.PlcDriver;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/plc4j/integrations/apache-camel/src/test/resources/META-INF/services/org.apache.plc4x.java.spi.PlcDriver b/plc4j/integrations/apache-camel/src/test/resources/META-INF/services/org.apache.plc4x.java.api.PlcDriver
similarity index 100%
rename from plc4j/integrations/apache-camel/src/test/resources/META-INF/services/org.apache.plc4x.java.spi.PlcDriver
rename to plc4j/integrations/apache-camel/src/test/resources/META-INF/services/org.apache.plc4x.java.api.PlcDriver
diff --git a/plc4j/integrations/apache-edgent/src/test/java/org/apache/plc4x/edgent/mock/MockConnection.java b/plc4j/integrations/apache-edgent/src/test/java/org/apache/plc4x/edgent/mock/MockConnection.java
index 05d8b5d..79407e2 100644
--- a/plc4j/integrations/apache-edgent/src/test/java/org/apache/plc4x/edgent/mock/MockConnection.java
+++ b/plc4j/integrations/apache-edgent/src/test/java/org/apache/plc4x/edgent/mock/MockConnection.java
@@ -28,7 +28,6 @@ import org.apache.plc4x.java.api.messages.PlcWriteRequest;
import org.apache.plc4x.java.api.messages.PlcWriteResponse;
import org.apache.plc4x.java.api.model.PlcField;
import org.apache.plc4x.java.api.types.PlcResponseCode;
-import org.apache.plc4x.java.base.messages.*;
import org.apache.plc4x.java.base.messages.items.BaseDefaultFieldItem;
import java.util.HashMap;
diff --git a/plc4j/integrations/apache-edgent/src/test/java/org/apache/plc4x/edgent/mock/MockDriver.java b/plc4j/integrations/apache-edgent/src/test/java/org/apache/plc4x/edgent/mock/MockDriver.java
index 0a13907..f7b3107 100644
--- a/plc4j/integrations/apache-edgent/src/test/java/org/apache/plc4x/edgent/mock/MockDriver.java
+++ b/plc4j/integrations/apache-edgent/src/test/java/org/apache/plc4x/edgent/mock/MockDriver.java
@@ -21,7 +21,7 @@ package org.apache.plc4x.edgent.mock;
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.spi.PlcDriver;
+import org.apache.plc4x.java.api.PlcDriver;
public class MockDriver implements PlcDriver {
diff --git a/plc4j/integrations/apache-edgent/src/test/resources/META-INF/services/org.apache.plc4x.java.spi.PlcDriver b/plc4j/integrations/apache-edgent/src/test/resources/META-INF/services/org.apache.plc4x.java.api.PlcDriver
similarity index 100%
rename from plc4j/integrations/apache-edgent/src/test/resources/META-INF/services/org.apache.plc4x.java.spi.PlcDriver
rename to plc4j/integrations/apache-edgent/src/test/resources/META-INF/services/org.apache.plc4x.java.api.PlcDriver
diff --git a/plc4j/pom.xml b/plc4j/pom.xml
index 1da9579..abc3bb4 100644
--- a/plc4j/pom.xml
+++ b/plc4j/pom.xml
@@ -42,6 +42,7 @@
<module>examples</module>
<module>integrations</module>
<module>karaf-features</module>
+ <module>spi</module>
</modules>
<build>
diff --git a/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/model/AdsPlcFieldHandler.java b/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/model/AdsPlcFieldHandler.java
index ef05777..7ad3cef 100644
--- a/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/model/AdsPlcFieldHandler.java
+++ b/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/model/AdsPlcFieldHandler.java
@@ -22,7 +22,6 @@ import org.apache.plc4x.java.api.exceptions.PlcInvalidFieldException;
import org.apache.plc4x.java.api.exceptions.PlcRuntimeException;
import org.apache.plc4x.java.api.model.PlcField;
import org.apache.plc4x.java.base.connection.DefaultPlcFieldHandler;
-import org.apache.plc4x.java.base.messages.items.*;
import java.math.BigDecimal;
import java.math.BigInteger;
diff --git a/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/protocol/Plc4x2AdsProtocol.java b/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/protocol/Plc4x2AdsProtocol.java
index ba64cc4..2c42c3e 100644
--- a/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/protocol/Plc4x2AdsProtocol.java
+++ b/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/protocol/Plc4x2AdsProtocol.java
@@ -41,7 +41,6 @@ import org.apache.plc4x.java.api.messages.PlcRequest;
import org.apache.plc4x.java.api.messages.PlcWriteRequest;
import org.apache.plc4x.java.api.model.PlcField;
import org.apache.plc4x.java.api.types.PlcResponseCode;
-import org.apache.plc4x.java.base.messages.*;
import org.apache.plc4x.java.base.messages.items.BaseDefaultFieldItem;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/protocol/util/LittleEndianDecoder.java b/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/protocol/util/LittleEndianDecoder.java
index f8eed41..26dcecc 100644
--- a/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/protocol/util/LittleEndianDecoder.java
+++ b/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/protocol/util/LittleEndianDecoder.java
@@ -24,7 +24,6 @@ import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.NotImplementedException;
import org.apache.plc4x.java.ads.model.AdsDataType;
import org.apache.plc4x.java.api.exceptions.PlcUnsupportedDataTypeException;
-import org.apache.plc4x.java.base.messages.items.*;
import java.io.ByteArrayOutputStream;
import java.math.BigInteger;
diff --git a/plc4j/protocols/ads/src/test/java/org/apache/plc4x/java/ads/model/AdsPlcFieldHandlerTest.java b/plc4j/protocols/ads/src/test/java/org/apache/plc4x/java/ads/model/AdsPlcFieldHandlerTest.java
index d81df63..0b6b3df 100644
--- a/plc4j/protocols/ads/src/test/java/org/apache/plc4x/java/ads/model/AdsPlcFieldHandlerTest.java
+++ b/plc4j/protocols/ads/src/test/java/org/apache/plc4x/java/ads/model/AdsPlcFieldHandlerTest.java
@@ -21,7 +21,6 @@ package org.apache.plc4x.java.ads.model;
import org.apache.plc4x.java.api.exceptions.PlcRuntimeException;
import org.apache.plc4x.java.api.model.PlcField;
-import org.apache.plc4x.java.base.messages.items.*;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.TestInfo;
diff --git a/plc4j/protocols/ads/src/test/java/org/apache/plc4x/java/ads/protocol/Plc4x2AdsProtocolTest.java b/plc4j/protocols/ads/src/test/java/org/apache/plc4x/java/ads/protocol/Plc4x2AdsProtocolTest.java
index 0ab4c67..37ea88d 100644
--- a/plc4j/protocols/ads/src/test/java/org/apache/plc4x/java/ads/protocol/Plc4x2AdsProtocolTest.java
+++ b/plc4j/protocols/ads/src/test/java/org/apache/plc4x/java/ads/protocol/Plc4x2AdsProtocolTest.java
@@ -33,7 +33,6 @@ import org.apache.plc4x.java.ads.api.generic.types.AmsPort;
import org.apache.plc4x.java.ads.api.generic.types.Invoke;
import org.apache.plc4x.java.ads.model.AdsDataType;
import org.apache.plc4x.java.ads.model.AdsPlcFieldHandler;
-import org.apache.plc4x.java.base.messages.*;
import org.apache.plc4x.java.mock.protocol.Plc4XSupportedDataTypes;
import org.junit.Before;
import org.junit.Ignore;
diff --git a/plc4j/protocols/driver-bases/base/pom.xml b/plc4j/protocols/driver-bases/base/pom.xml
deleted file mode 100644
index c6d152f..0000000
--- a/plc4j/protocols/driver-bases/base/pom.xml
+++ /dev/null
@@ -1,101 +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</groupId>
- <artifactId>plc4j-protocols-driver-bases</artifactId>
- <version>0.6.0-SNAPSHOT</version>
- </parent>
-
- <artifactId>plc4j-protocol-driver-base</artifactId>
- <name>PLC4J: Protocol: Driver-Base: Base</name>
- <description>Base classes needed to implement all of the other driver bases.</description>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.plc4x</groupId>
- <artifactId>plc4j-api</artifactId>
- <version>0.6.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.plc4x</groupId>
- <artifactId>plc4j-utils-driver-base-java</artifactId>
- <version>0.6.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-lang3</artifactId>
- </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-common</artifactId>
- </dependency>
- <dependency>
- <groupId>io.netty</groupId>
- <artifactId>netty-transport</artifactId>
- </dependency>
- <dependency>
- <groupId>commons-codec</groupId>
- <artifactId>commons-codec</artifactId>
- </dependency>
-
- <dependency>
- <groupId>ch.qos.logback</groupId>
- <artifactId>logback-classic</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.assertj</groupId>
- <artifactId>assertj-core</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.spockframework</groupId>
- <artifactId>spock-core</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.athaydes</groupId>
- <artifactId>spock-reports</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>nl.jqno.equalsverifier</groupId>
- <artifactId>equalsverifier</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
-</project>
\ No newline at end of file
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/connection/ChannelFactory.java b/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/connection/ChannelFactory.java
deleted file mode 100644
index b03daee..0000000
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/connection/ChannelFactory.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.base.connection;
-
-import io.netty.channel.Channel;
-import io.netty.channel.ChannelHandler;
-import org.apache.plc4x.java.api.exceptions.PlcConnectionException;
-import org.apache.plc4x.java.api.exceptions.PlcException;
-
-public interface ChannelFactory {
-
- Channel createChannel(ChannelHandler channelHandler)
- throws PlcConnectionException;
-
- void ping() throws PlcException;
-
-}
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/events/ConnectEvent.java b/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/events/ConnectEvent.java
deleted file mode 100644
index 6df4aed..0000000
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/events/ConnectEvent.java
+++ /dev/null
@@ -1,22 +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.base.events;
-
-public class ConnectEvent {
-}
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/events/ConnectedEvent.java b/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/events/ConnectedEvent.java
deleted file mode 100644
index db93765..0000000
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/events/ConnectedEvent.java
+++ /dev/null
@@ -1,22 +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.base.events;
-
-public class ConnectedEvent {
-}
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/events/DisconnectEvent.java b/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/events/DisconnectEvent.java
deleted file mode 100644
index 24cf2d8..0000000
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/events/DisconnectEvent.java
+++ /dev/null
@@ -1,39 +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.base.events;
-
-import java.util.concurrent.CompletableFuture;
-
-public class DisconnectEvent {
-
- private final CompletableFuture<Void> future;
-
- public DisconnectEvent() {
- this.future = null;
- }
-
- public DisconnectEvent(CompletableFuture<Void> future) {
- this.future = future;
- }
-
- public CompletableFuture<Void> getFuture() {
- return future;
- }
-
-}
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/events/DisconnectedEvent.java b/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/events/DisconnectedEvent.java
deleted file mode 100644
index 7adf3d9..0000000
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/events/DisconnectedEvent.java
+++ /dev/null
@@ -1,22 +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.base.events;
-
-public class DisconnectedEvent {
-}
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/DefaultPlcProprietaryRequest.java b/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/DefaultPlcProprietaryRequest.java
deleted file mode 100644
index fc06a26..0000000
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/DefaultPlcProprietaryRequest.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.base.messages;
-
-import org.apache.plc4x.java.api.exceptions.PlcRuntimeException;
-import org.apache.plc4x.java.api.messages.PlcResponse;
-
-import java.util.concurrent.CompletableFuture;
-
-public class DefaultPlcProprietaryRequest<REQUEST> implements InternalPlcProprietaryRequest<REQUEST> {
-
- @Override
- public CompletableFuture<PlcResponse> execute() {
- throw new PlcRuntimeException("not supported"); // TODO: figure out what to do with this
- }
-
- private REQUEST proprietaryRequest;
-
- public DefaultPlcProprietaryRequest(REQUEST proprietaryRequest) {
- this.proprietaryRequest = proprietaryRequest;
- }
-
- @Override
- public REQUEST getProprietaryRequest() {
- return proprietaryRequest;
- }
-}
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/DefaultPlcProprietaryResponse.java b/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/DefaultPlcProprietaryResponse.java
deleted file mode 100644
index d36dc23..0000000
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/DefaultPlcProprietaryResponse.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-package org.apache.plc4x.java.base.messages;
-
-public class DefaultPlcProprietaryResponse<RESPONSE> implements InternalPlcProprietaryResponse<RESPONSE> {
-
- private final InternalPlcProprietaryRequest plcProprietaryRequest;
-
- private final RESPONSE proprietaryResponse;
-
- public DefaultPlcProprietaryResponse(InternalPlcProprietaryRequest plcProprietaryRequest, RESPONSE proprietaryResponse) {
- this.plcProprietaryRequest = plcProprietaryRequest;
- this.proprietaryResponse = proprietaryResponse;
- }
-
- @Override
- public RESPONSE getResponse() {
- return proprietaryResponse;
- }
-
- @Override
- public InternalPlcProprietaryRequest getRequest() {
- return plcProprietaryRequest;
- }
-
-}
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/DefaultPlcUnsubscriptionResponse.java b/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/DefaultPlcUnsubscriptionResponse.java
deleted file mode 100644
index c26ac85..0000000
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/DefaultPlcUnsubscriptionResponse.java
+++ /dev/null
@@ -1,36 +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.base.messages;
-
-import org.apache.plc4x.java.api.messages.PlcUnsubscriptionRequest;
-
-public class DefaultPlcUnsubscriptionResponse implements InternalPlcUnsubscriptionResponse {
-
- private final InternalPlcUnsubscriptionRequest request;
-
- public DefaultPlcUnsubscriptionResponse(InternalPlcUnsubscriptionRequest request) {
- this.request = request;
- }
-
- @Override
- public PlcUnsubscriptionRequest getRequest() {
- return request;
- }
-
-}
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/InternalPlcFieldRequest.java b/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/InternalPlcFieldRequest.java
deleted file mode 100644
index 2e869c3..0000000
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/InternalPlcFieldRequest.java
+++ /dev/null
@@ -1,31 +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.base.messages;
-
-import org.apache.commons.lang3.tuple.Pair;
-import org.apache.plc4x.java.api.messages.PlcFieldRequest;
-import org.apache.plc4x.java.api.model.PlcField;
-
-import java.util.List;
-
-public interface InternalPlcFieldRequest extends PlcFieldRequest, InternalPlcRequest {
-
- List<Pair<String, PlcField>> getNamedFields();
-
-}
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/InternalPlcFieldResponse.java b/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/InternalPlcFieldResponse.java
deleted file mode 100644
index 78f6320..0000000
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/InternalPlcFieldResponse.java
+++ /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.
- */
-package org.apache.plc4x.java.base.messages;
-
-import org.apache.plc4x.java.api.messages.PlcFieldResponse;
-
-public interface InternalPlcFieldResponse extends PlcFieldResponse {
-
-
-}
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/InternalPlcMessage.java b/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/InternalPlcMessage.java
deleted file mode 100644
index ac26a30..0000000
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/InternalPlcMessage.java
+++ /dev/null
@@ -1,23 +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.base.messages;
-
-public interface InternalPlcMessage {
-}
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/InternalPlcProprietaryRequest.java b/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/InternalPlcProprietaryRequest.java
deleted file mode 100644
index 33b5272..0000000
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/InternalPlcProprietaryRequest.java
+++ /dev/null
@@ -1,22 +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.base.messages;
-
-public interface InternalPlcProprietaryRequest<REQUEST> extends PlcProprietaryRequest<REQUEST>, InternalPlcRequest {
-}
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/InternalPlcProprietaryResponse.java b/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/InternalPlcProprietaryResponse.java
deleted file mode 100644
index d42dabf..0000000
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/InternalPlcProprietaryResponse.java
+++ /dev/null
@@ -1,22 +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.base.messages;
-
-public interface InternalPlcProprietaryResponse<RESPONSE> extends PlcProprietaryResponse<RESPONSE>, InternalPlcResponse {
-}
\ No newline at end of file
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/InternalPlcReadRequest.java b/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/InternalPlcReadRequest.java
deleted file mode 100644
index c787f00..0000000
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/InternalPlcReadRequest.java
+++ /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.
- */
-package org.apache.plc4x.java.base.messages;
-
-import org.apache.plc4x.java.api.messages.PlcReadRequest;
-
-public interface InternalPlcReadRequest extends PlcReadRequest, InternalPlcFieldRequest, InternalPlcRequest {
-
-}
-
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/InternalPlcReadResponse.java b/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/InternalPlcReadResponse.java
deleted file mode 100644
index 50d0e4d..0000000
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/InternalPlcReadResponse.java
+++ /dev/null
@@ -1,31 +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.base.messages;
-
-import org.apache.commons.lang3.tuple.Pair;
-import org.apache.plc4x.java.api.messages.PlcReadResponse;
-import org.apache.plc4x.java.api.types.PlcResponseCode;
-import org.apache.plc4x.java.base.messages.items.BaseDefaultFieldItem;
-
-import java.util.Map;
-
-public interface InternalPlcReadResponse extends PlcReadResponse, InternalPlcResponse {
-
- Map<String, Pair<PlcResponseCode, BaseDefaultFieldItem>> getValues();
-}
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/InternalPlcRequest.java b/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/InternalPlcRequest.java
deleted file mode 100644
index b031ee3..0000000
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/InternalPlcRequest.java
+++ /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.
- */
-package org.apache.plc4x.java.base.messages;
-
-import org.apache.plc4x.java.api.messages.PlcRequest;
-
-public interface InternalPlcRequest extends PlcRequest, InternalPlcMessage {
-}
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/InternalPlcResponse.java b/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/InternalPlcResponse.java
deleted file mode 100644
index dde16f0..0000000
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/InternalPlcResponse.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.base.messages;
-
-import org.apache.plc4x.java.api.messages.PlcResponse;
-
-public interface InternalPlcResponse extends PlcResponse {
-
-}
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/InternalPlcSubscriptionEvent.java b/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/InternalPlcSubscriptionEvent.java
deleted file mode 100644
index 79ce09d..0000000
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/InternalPlcSubscriptionEvent.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.base.messages;
-
-import org.apache.plc4x.java.api.messages.PlcSubscriptionEvent;
-
-public interface InternalPlcSubscriptionEvent extends PlcSubscriptionEvent {
-
-}
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/InternalPlcSubscriptionRequest.java b/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/InternalPlcSubscriptionRequest.java
deleted file mode 100644
index 1e727ad..0000000
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/InternalPlcSubscriptionRequest.java
+++ /dev/null
@@ -1,36 +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.base.messages;
-
-import org.apache.commons.lang3.tuple.Pair;
-import org.apache.plc4x.java.api.messages.PlcSubscriptionRequest;
-import org.apache.plc4x.java.base.model.SubscriptionPlcField;
-
-import java.util.LinkedHashMap;
-import java.util.List;
-
-public interface InternalPlcSubscriptionRequest extends PlcSubscriptionRequest, InternalPlcFieldRequest {
-
- List<SubscriptionPlcField> getSubscriptionFields();
-
- LinkedHashMap<String, SubscriptionPlcField> getSubscriptionPlcFieldMap();
-
- List<Pair<String, SubscriptionPlcField>> getNamedSubscriptionFields();
-
-}
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/InternalPlcSubscriptionResponse.java b/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/InternalPlcSubscriptionResponse.java
deleted file mode 100644
index 561a99a..0000000
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/InternalPlcSubscriptionResponse.java
+++ /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.
- */
-package org.apache.plc4x.java.base.messages;
-
-import org.apache.commons.lang3.tuple.Pair;
-import org.apache.plc4x.java.api.messages.PlcSubscriptionResponse;
-import org.apache.plc4x.java.api.model.PlcSubscriptionHandle;
-import org.apache.plc4x.java.api.types.PlcResponseCode;
-
-import java.util.Map;
-
-public interface InternalPlcSubscriptionResponse extends PlcSubscriptionResponse, InternalPlcResponse {
- Map<String, Pair<PlcResponseCode, PlcSubscriptionHandle>> getValues();
-}
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/InternalPlcUnsubscriptionRequest.java b/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/InternalPlcUnsubscriptionRequest.java
deleted file mode 100644
index fd5b3ca..0000000
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/InternalPlcUnsubscriptionRequest.java
+++ /dev/null
@@ -1,29 +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.base.messages;
-
-import org.apache.plc4x.java.api.messages.PlcUnsubscriptionRequest;
-import org.apache.plc4x.java.base.model.InternalPlcSubscriptionHandle;
-
-import java.util.Collection;
-
-public interface InternalPlcUnsubscriptionRequest extends PlcUnsubscriptionRequest, InternalPlcRequest {
-
- Collection<? extends InternalPlcSubscriptionHandle> getInternalPlcSubscriptionHandles();
-}
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/InternalPlcUnsubscriptionResponse.java b/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/InternalPlcUnsubscriptionResponse.java
deleted file mode 100644
index 8529d55..0000000
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/InternalPlcUnsubscriptionResponse.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.base.messages;
-
-import org.apache.plc4x.java.api.messages.PlcUnsubscriptionResponse;
-
-public interface InternalPlcUnsubscriptionResponse extends PlcUnsubscriptionResponse, InternalPlcResponse {
-
-}
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/InternalPlcWriteRequest.java b/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/InternalPlcWriteRequest.java
deleted file mode 100644
index 5a68f63..0000000
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/InternalPlcWriteRequest.java
+++ /dev/null
@@ -1,36 +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.base.messages;
-
-import org.apache.commons.lang3.tuple.Triple;
-import org.apache.plc4x.java.api.messages.PlcWriteRequest;
-import org.apache.plc4x.java.api.model.PlcField;
-import org.apache.plc4x.java.base.messages.items.BaseDefaultFieldItem;
-
-import java.util.List;
-
-public interface InternalPlcWriteRequest extends PlcWriteRequest, InternalPlcRequest {
-
- BaseDefaultFieldItem getFieldItem(String name);
-
- List<BaseDefaultFieldItem> getFieldItems();
-
- List<Triple<String, PlcField, BaseDefaultFieldItem>> getNamedFieldTriples();
-
-}
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/InternalPlcWriteResponse.java b/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/InternalPlcWriteResponse.java
deleted file mode 100644
index 06d4ad7..0000000
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/InternalPlcWriteResponse.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.base.messages;
-
-import org.apache.plc4x.java.api.messages.PlcWriteResponse;
-import org.apache.plc4x.java.api.types.PlcResponseCode;
-
-import java.util.Map;
-
-public interface InternalPlcWriteResponse extends PlcWriteResponse, InternalPlcResponse {
- Map<String, PlcResponseCode> getValues();
-}
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/PlcProprietaryRequest.java b/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/PlcProprietaryRequest.java
deleted file mode 100644
index fdc7558..0000000
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/PlcProprietaryRequest.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.base.messages;
-
-import org.apache.plc4x.java.api.messages.PlcRequest;
-
-public interface PlcProprietaryRequest<REQUEST> extends PlcRequest {
- REQUEST getProprietaryRequest();
-}
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/PlcProprietaryResponse.java b/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/PlcProprietaryResponse.java
deleted file mode 100644
index 94af885..0000000
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/PlcProprietaryResponse.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.base.messages;
-
-import org.apache.plc4x.java.api.messages.PlcResponse;
-
-public interface PlcProprietaryResponse<T> extends PlcResponse {
- T getResponse();
-}
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/PlcProprietarySender.java b/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/PlcProprietarySender.java
deleted file mode 100644
index 8a0ed3d..0000000
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/PlcProprietarySender.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.base.messages;
-
-import java.util.concurrent.CompletableFuture;
-
-public interface PlcProprietarySender {
- <T> CompletableFuture<PlcProprietaryResponse<T>> send(PlcProprietaryRequest proprietaryRequest);
-}
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/PlcProtocolMessage.java b/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/PlcProtocolMessage.java
deleted file mode 100644
index cacc6b1..0000000
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/PlcProtocolMessage.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.base.messages;
-
-public interface PlcProtocolMessage {
-
- PlcProtocolMessage getParent();
-
-}
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/PlcRawMessage.java b/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/PlcRawMessage.java
deleted file mode 100644
index b6205d9..0000000
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/PlcRawMessage.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied. See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-package org.apache.plc4x.java.base.messages;
-
-import io.netty.buffer.ByteBuf;
-
-public class PlcRawMessage implements PlcProtocolMessage {
-
- private final ByteBuf userData;
- private final PlcProtocolMessage parent;
-
- public PlcRawMessage(ByteBuf userData) {
- this(userData, null);
- }
-
- public PlcRawMessage(ByteBuf userData, PlcProtocolMessage parent) {
- this.userData = userData;
- this.parent = parent;
- }
-
- public ByteBuf getUserData() {
- return userData;
- }
-
- @Override
- public PlcProtocolMessage getParent() {
- return parent;
- }
-
-}
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/PlcReader.java b/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/PlcReader.java
deleted file mode 100644
index c403ca1..0000000
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/PlcReader.java
+++ /dev/null
@@ -1,40 +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.base.messages;
-
-import org.apache.plc4x.java.api.messages.PlcReadRequest;
-import org.apache.plc4x.java.api.messages.PlcReadResponse;
-
-import java.util.concurrent.CompletableFuture;
-import java.util.function.Consumer;
-
-/**
- * Interface implemented by all PlcConnections that are able to read from remote resources.
- */
-public interface PlcReader {
-
- /**
- * Reads a requested value from a PLC.
- *
- * @param readRequest object describing the type and location of the value.
- * @return a {@link CompletableFuture} giving async access to the returned value.
- */
- CompletableFuture<PlcReadResponse> read(PlcReadRequest readRequest);
-
-}
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/PlcWriter.java b/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/PlcWriter.java
deleted file mode 100644
index 13a83f4..0000000
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/PlcWriter.java
+++ /dev/null
@@ -1,40 +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.base.messages;
-
-import org.apache.plc4x.java.api.messages.PlcWriteRequest;
-import org.apache.plc4x.java.api.messages.PlcWriteResponse;
-
-import java.util.concurrent.CompletableFuture;
-import java.util.function.Consumer;
-
-/**
- * Interface implemented by all PlcConnections that are able to write to remote resources.
- */
-public interface PlcWriter {
-
- /**
- * Writes a given value to a PLC.
- *
- * @param writeRequest object describing the type, location and value that whould be written.
- * @return a {@link CompletableFuture} giving async access to the response of the write operation.
- */
- CompletableFuture<PlcWriteResponse> write(PlcWriteRequest writeRequest);
-
-}
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/items/DefaultLocalDateFieldItem.java b/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/items/DefaultLocalDateFieldItem.java
deleted file mode 100644
index 70cb68c..0000000
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/items/DefaultLocalDateFieldItem.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied. See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-package org.apache.plc4x.java.base.messages.items;
-
-import org.apache.plc4x.java.api.exceptions.PlcIncompatibleDatatypeException;
-
-import java.time.LocalDate;
-
-public class DefaultLocalDateFieldItem extends BaseDefaultFieldItem<LocalDate> {
-
- public DefaultLocalDateFieldItem(LocalDate... values) {
- super(values);
- }
-
- @Override
- public Object getObject(int index) {
- return getValue(index);
- }
-
- @Override
- public boolean isValidDate(int index) {
- return getValue(index) != null;
- }
-
- @Override
- public LocalDate getDate(int index) {
- if (!isValidDate(index)) {
- throw new PlcIncompatibleDatatypeException(LocalDate.class, index);
- }
- return getValue(index);
- }
-
-}
-
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/items/DefaultLocalTimeFieldItem.java b/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/items/DefaultLocalTimeFieldItem.java
deleted file mode 100644
index 59c7d8b..0000000
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/items/DefaultLocalTimeFieldItem.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied. See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-package org.apache.plc4x.java.base.messages.items;
-
-import org.apache.plc4x.java.api.exceptions.PlcIncompatibleDatatypeException;
-
-import java.time.LocalTime;
-
-public class DefaultLocalTimeFieldItem extends BaseDefaultFieldItem<LocalTime> {
-
- public DefaultLocalTimeFieldItem(LocalTime... values) {
- super(values);
- }
-
- @Override
- public Object getObject(int index) {
- return getValue(index);
- }
-
- @Override
- public boolean isValidTime(int index) {
- return getValue(index) != null;
- }
-
- @Override
- public LocalTime getTime(int index) {
- if (!isValidTime(index)) {
- throw new PlcIncompatibleDatatypeException(LocalTime.class, index);
- }
- return getValue(index);
- }
-
-}
-
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/items/DefaultStringFieldItem.java b/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/items/DefaultStringFieldItem.java
deleted file mode 100644
index ee44319..0000000
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/items/DefaultStringFieldItem.java
+++ /dev/null
@@ -1,48 +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.base.messages.items;
-
-import org.apache.plc4x.java.api.exceptions.PlcIncompatibleDatatypeException;
-
-public class DefaultStringFieldItem extends BaseDefaultFieldItem<String> {
-
- public DefaultStringFieldItem(String... values) {
- super(values);
- }
-
- @Override
- public Object getObject(int index) {
- return getValue(index);
- }
-
- @Override
- public boolean isValidString(int index) {
- return getValue(index) != null;
- }
-
- @Override
- public String getString(int index) {
- if (!isValidString(index)) {
- throw new PlcIncompatibleDatatypeException(String.class, index);
- }
- return getValue(index);
- }
-
-}
-
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/model/InternalPlcConsumerRegistration.java b/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/model/InternalPlcConsumerRegistration.java
deleted file mode 100644
index 0133111..0000000
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/model/InternalPlcConsumerRegistration.java
+++ /dev/null
@@ -1,32 +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.base.model;
-
-import org.apache.plc4x.java.api.model.PlcConsumerRegistration;
-import org.apache.plc4x.java.base.messages.InternalPlcMessage;
-
-import java.util.Collection;
-
-public interface InternalPlcConsumerRegistration extends PlcConsumerRegistration, InternalPlcMessage {
-
- int getConsumerHash();
-
- Collection<? extends InternalPlcSubscriptionHandle> getAssociatedHandles();
-
-}
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/model/InternalPlcSubscriptionHandle.java b/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/model/InternalPlcSubscriptionHandle.java
deleted file mode 100644
index e8fbc37..0000000
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/model/InternalPlcSubscriptionHandle.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.base.model;
-
-import org.apache.plc4x.java.api.model.PlcSubscriptionHandle;
-import org.apache.plc4x.java.base.messages.InternalPlcMessage;
-
-public interface InternalPlcSubscriptionHandle extends PlcSubscriptionHandle, InternalPlcMessage {
-}
diff --git a/plc4j/protocols/driver-bases/base/src/test/groovy/org/apache/plc4x/java/base/messages/DefaultPlcReadResponseSpec.groovy b/plc4j/protocols/driver-bases/base/src/test/groovy/org/apache/plc4x/java/base/messages/DefaultPlcReadResponseSpec.groovy
deleted file mode 100644
index 744dcb2..0000000
--- a/plc4j/protocols/driver-bases/base/src/test/groovy/org/apache/plc4x/java/base/messages/DefaultPlcReadResponseSpec.groovy
+++ /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.base.messages
-
-import org.apache.commons.lang3.tuple.ImmutablePair
-import org.apache.plc4x.java.api.exceptions.PlcFieldRangeException
-import org.apache.plc4x.java.api.types.PlcResponseCode
-import org.apache.plc4x.java.base.messages.items.*
-import spock.lang.Specification
-import spock.lang.Unroll
-
-import java.time.LocalDate
-import java.time.LocalDateTime
-import java.time.LocalTime
-
-class DefaultPlcReadResponseSpec extends Specification {
-
- @Unroll
- def "Using the different types of getters should work '#dataType'"(def dataType, def fieldType, def fieldValues) {
- setup:
- InternalPlcReadRequest request = Mock(InternalPlcReadRequest)
- request.getFieldNames() >> ['foo']
-
- when:
- DefaultPlcReadResponse SUT = new DefaultPlcReadResponse(request,
- ["foo": new ImmutablePair<>(PlcResponseCode.OK, fieldType.newInstance(*fieldValues))])
-
- and:
- def fieldNames = SUT.getFieldNames()
- // The time fields have a "Local" added to their type names, so we must cut that off.
- def name = dataType.simpleName.replaceAll("Local", "")
- def valid = SUT."isValid${name}"("foo")
- def numberOfValues = SUT.getNumberOfValues("foo")
- def responseCode = SUT.getResponseCode("foo")
- def firstValue = SUT."get${name}"("foo")
- def secondValue = SUT."get${name}"("foo", 1)
- def allValues = SUT."getAll${name}s"("foo")
- SUT.getObject("foo")
- SUT.getAllObjects("foo")
- SUT."get${name}"("foo", 2)
-
- then:
- assert fieldNames == ['foo'] as LinkedHashSet
- assert valid
- assert numberOfValues == fieldValues.length
- assert responseCode == PlcResponseCode.OK
- assert fieldValues[0] == firstValue
- assert fieldValues[1] == secondValue
- assert fieldValues == allValues
- thrown PlcFieldRangeException
-
- where:
- dataType | fieldType | fieldValues
- Boolean | DefaultBooleanFieldItem | [true, false] as boolean[]
- Byte | DefaultByteFieldItem | [42, 23] as byte[]
- Short | DefaultShortFieldItem | [42, 23] as short[]
- Integer | DefaultIntegerFieldItem | [42, 23] as int[]
- Long | DefaultLongFieldItem | [42, 23] as long[]
- BigInteger | DefaultBigDecimalFieldItem | [42, 23] as BigInteger[]
- Float | DefaultFloatFieldItem | [42, 23] as float[]
- Double | DefaultDoubleFieldItem | [42, 23] as double[]
- BigDecimal | DefaultBigDecimalFieldItem | [42, 23] as BigDecimal[]
- String | DefaultStringFieldItem | ["foo", "bar"] as String[]
- LocalTime | DefaultLocalTimeFieldItem | [LocalTime.NOON, LocalTime.MIDNIGHT] as LocalTime[]
- LocalDate | DefaultLocalDateFieldItem | [LocalDate.MIN, LocalDate.MAX] as LocalDate[]
- LocalDateTime | DefaultLocalDateTimeFieldItem | [LocalDateTime.MIN, LocalDateTime.MAX] as LocalDateTime[]
- }
-
-}
diff --git a/plc4j/protocols/driver-bases/base/src/test/groovy/org/apache/plc4x/java/base/messages/items/DefaultItemsSpec.groovy b/plc4j/protocols/driver-bases/base/src/test/groovy/org/apache/plc4x/java/base/messages/items/DefaultItemsSpec.groovy
deleted file mode 100644
index c845896..0000000
--- a/plc4j/protocols/driver-bases/base/src/test/groovy/org/apache/plc4x/java/base/messages/items/DefaultItemsSpec.groovy
+++ /dev/null
@@ -1,217 +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.base.messages.items
-
-import nl.jqno.equalsverifier.EqualsVerifier
-import nl.jqno.equalsverifier.Warning
-import org.apache.commons.lang3.StringUtils
-import org.apache.plc4x.java.api.exceptions.PlcIncompatibleDatatypeException
-import spock.lang.Specification
-import spock.lang.Unroll
-
-import java.time.LocalDate
-import java.time.LocalDateTime
-import java.time.LocalTime
-
-class DefaultItemsSpec extends Specification {
-
- @Unroll
- def "The '#fieldItemType.simpleName'.isValidXYZ methods should respect the correct boundaries of the type XYZ and "(
- Class<? extends BaseDefaultFieldItem> fieldItemType, Object value, Boolean isValidBoolean, Boolean isValidByte, Boolean isValidShort, Boolean isValidInteger,
- Boolean isValidLong, Boolean isValidBigInteger, Boolean isValidFloat, Boolean isValidDouble, Boolean isValidBigDecimal,
- Boolean isValidString, Boolean isValidTime, Boolean isValidDate, Boolean isValidDateTime, Boolean isValidByteArray) {
-
- setup:
- Object[] values = new Object[2]
- values[0] = value
- values[1] = null
- BaseDefaultFieldItem fieldItem = fieldItemType.newInstance(values)
-
- expect:
- assert fieldItem.getNumberOfValues() == 2
- assert fieldItem.getObject(0) == value
- assert fieldItem.getObject(1) == null
- assert fieldItem.getValues()[0] == value
- assertItem(fieldItem, "Boolean", isValidBoolean)
- assertItem(fieldItem, "Byte", isValidByte)
- assertItem(fieldItem, "Short", isValidShort)
- assertItem(fieldItem, "Integer", isValidInteger)
- assertItem(fieldItem, "Long", isValidLong)
- assertItem(fieldItem, "BigInteger", isValidBigInteger)
- assertItem(fieldItem, "Float", isValidFloat)
- assertItem(fieldItem, "Double", isValidDouble)
- assertItem(fieldItem, "BigDecimal", isValidBigDecimal)
- assertItem(fieldItem, "String", isValidString)
- assertItem(fieldItem, "Time", isValidTime)
- assertItem(fieldItem, "Date", isValidDate)
- assertItem(fieldItem, "DateTime", isValidDateTime)
- assertItem(fieldItem, "ByteArray", isValidByteArray)
- EqualsVerifier.forClass(fieldItemType).suppress(Warning.STRICT_INHERITANCE).verify()
- assert StringUtils.isNotBlank(fieldItem.toString())
-
- where:
- fieldItemType | value || isValidBoolean | isValidByte | isValidShort | isValidInteger | isValidLong | isValidBigInteger | isValidFloat | isValidDouble | isValidBigDecimal | isValidString | isValidTime | isValidDate | isValidDateTime | isValidByteArray
- DefaultBooleanFieldItem | true || true | true | true | true | true | true | true | true | true | false | false | false | false | false
- DefaultBooleanFieldItem | false || true | true | true | true | true | true | true | true | true | false | false | false | false | false
-
-// fieldItemType | value || isValidBoolean | isValidByte | isValidShort | isValidInteger | isValidLong | isValidBigInteger | isValidFloat | isValidDouble | isValidBigDecimal | isValidString | isValidTime | isValidDate | isValidDateTime | isValidByteArray
- DefaultByteFieldItem | (byte) 0 || true | true | true | true | true | true | true | true | true | false | false | false | false | false
- DefaultByteFieldItem | (byte) 42 || true | true | true | true | true | true | true | true | true | false | false | false | false | false
- DefaultByteFieldItem | Byte.MAX_VALUE || true | true | true | true | true | true | true | true | true | false | false | false | false | false
- DefaultByteFieldItem | Byte.MIN_VALUE || true | true | true | true | true | true | true | true | true | false | false | false | false | false
-
-// fieldItemType | value || isValidBoolean | isValidByte | isValidShort | isValidInteger | isValidLong | isValidBigInteger | isValidFloat | isValidDouble | isValidBigDecimal | isValidString | isValidTime | isValidDate | isValidDateTime | isValidByteArray
- DefaultShortFieldItem | (short) 0 || true | true | true | true | true | true | true | true | true | false | false | false | false | false
- DefaultShortFieldItem | (short) 42 || true | true | true | true | true | true | true | true | true | false | false | false | false | false
- DefaultShortFieldItem | Byte.MIN_VALUE || true | true | true | true | true | true | true | true | true | false | false | false | false | false
- DefaultShortFieldItem | Byte.MAX_VALUE || true | true | true | true | true | true | true | true | true | false | false | false | false | false
- DefaultShortFieldItem | Short.MAX_VALUE || true | false | true | true | true | true | true | true | true | false | false | false | false | false
- DefaultShortFieldItem | Short.MIN_VALUE || true | false | true | true | true | true | true | true | true | false | false | false | false | false
-
-// fieldItemType | value || isValidBoolean | isValidByte | isValidShort | isValidInteger | isValidLong | isValidBigInteger | isValidFloat | isValidDouble | isValidBigDecimal | isValidString | isValidTime | isValidDate | isValidDateTime | isValidByteArray
- DefaultIntegerFieldItem | (int) 0 || true | true | true | true | true | true | true | true | true | false | false | false | false | false
- DefaultIntegerFieldItem | (int) 42 || true | true | true | true | true | true | true | true | true | false | false | false | false | false
- DefaultIntegerFieldItem | Byte.MIN_VALUE || true | true | true | true | true | true | true | true | true | false | false | false | false | false
- DefaultIntegerFieldItem | Byte.MAX_VALUE || true | true | true | true | true | true | true | true | true | false | false | false | false | false
- DefaultIntegerFieldItem | Short.MAX_VALUE || true | false | true | true | true | true | true | true | true | false | false | false | false | false
- DefaultIntegerFieldItem | Short.MIN_VALUE || true | false | true | true | true | true | true | true | true | false | false | false | false | false
- DefaultIntegerFieldItem | Integer.MAX_VALUE || true | false | false | true | true | true | true | true | true | false | false | false | false | false
- DefaultIntegerFieldItem | Integer.MIN_VALUE || true | false | false | true | true | true | true | true | true | false | false | false | false | false
-
-// fieldItemType | value || isValidBoolean | isValidByte | isValidShort | isValidInteger | isValidLong | isValidBigInteger | isValidFloat | isValidDouble | isValidBigDecimal | isValidString | isValidTime | isValidDate | isValidDateTime | isValidByteArray
- DefaultLongFieldItem | (int) 0 || true | true | true | true | true | true | true | true | true | false | false | false | false | false
- DefaultLongFieldItem | (int) 42 || true | true | true | true | true | true | true | true | true | false | false | false | false | false
- DefaultLongFieldItem | Byte.MIN_VALUE || true | true | true | true | true | true | true | true | true | false | false | false | false | false
- DefaultLongFieldItem | Byte.MAX_VALUE || true | true | true | true | true | true | true | true | true | false | false | false | false | false
- DefaultLongFieldItem | Short.MAX_VALUE || true | false | true | true | true | true | true | true | true | false | false | false | false | false
- DefaultLongFieldItem | Short.MIN_VALUE || true | false | true | true | true | true | true | true | true | false | false | false | false | false
- DefaultLongFieldItem | Integer.MAX_VALUE || true | false | false | true | true | true | true | true | true | false | false | false | false | false
- DefaultLongFieldItem | Integer.MIN_VALUE || true | false | false | true | true | true | true | true | true | false | false | false | false | false
- DefaultLongFieldItem | Long.MAX_VALUE || true | false | false | false | true | true | true | true | true | false | false | false | false | false
- DefaultLongFieldItem | Long.MIN_VALUE || true | false | false | false | true | true | true | true | true | false | false | false | false | false
-
-// fieldItemType | value || isValidBoolean | isValidByte | isValidShort | isValidInteger | isValidLong | isValidBigInteger | isValidFloat | isValidDouble | isValidBigDecimal | isValidString | isValidTime | isValidDate | isValidDateTime | isValidByteArray
- DefaultBigIntegerFieldItem | (int) 0 || true | true | true | true | true | true | true | true | true | false | false | false | false | false
- DefaultBigIntegerFieldItem | (int) 42 || true | true | true | true | true | true | true | true | true | false | false | false | false | false
- DefaultBigIntegerFieldItem | Byte.MIN_VALUE || true | true | true | true | true | true | true | true | true | false | false | false | false | false
- DefaultBigIntegerFieldItem | Byte.MAX_VALUE || true | true | true | true | true | true | true | true | true | false | false | false | false | false
- DefaultBigIntegerFieldItem | Short.MIN_VALUE || true | false | true | true | true | true | true | true | true | false | false | false | false | false
- DefaultBigIntegerFieldItem | Short.MAX_VALUE || true | false | true | true | true | true | true | true | true | false | false | false | false | false
- DefaultBigIntegerFieldItem | Integer.MIN_VALUE || true | false | false | true | true | true | true | true | true | false | false | false | false | false
- DefaultBigIntegerFieldItem | Integer.MAX_VALUE || true | false | false | true | true | true | true | true | true | false | false | false | false | false
- DefaultBigIntegerFieldItem | Long.MIN_VALUE || true | false | false | false | true | true | true | true | true | false | false | false | false | false
- DefaultBigIntegerFieldItem | Long.MAX_VALUE || true | false | false | false | true | true | true | true | true | false | false | false | false | false
- DefaultBigIntegerFieldItem | BigInteger.valueOf(Long.MIN_VALUE).multiply(2) || true | false | false | false | false | true | true | true | true | false | false | false | false | false
- DefaultBigIntegerFieldItem | BigInteger.valueOf(Long.MAX_VALUE).multiply(2) || true | false | false | false | false | true | true | true | true | false | false | false | false | false
-
-// fieldItemType | value || isValidBoolean | isValidByte | isValidShort | isValidInteger | isValidLong | isValidBigInteger | isValidFloat | isValidDouble | isValidBigDecimal | isValidString | isValidTime | isValidDate | isValidDateTime | isValidByteArray
- DefaultFloatFieldItem | (int) 0 || true | true | true | true | true | true | true | true | true | false | false | false | false | false
- DefaultFloatFieldItem | (int) 42 || true | true | true | true | true | true | true | true | true | false | false | false | false | false
- DefaultFloatFieldItem | Byte.MIN_VALUE || true | true | true | true | true | true | true | true | true | false | false | false | false | false
- DefaultFloatFieldItem | Byte.MAX_VALUE || true | true | true | true | true | true | true | true | true | false | false | false | false | false
- DefaultFloatFieldItem | Short.MIN_VALUE || true | false | true | true | true | true | true | true | true | false | false | false | false | false
- DefaultFloatFieldItem | Short.MAX_VALUE || true | false | true | true | true | true | true | true | true | false | false | false | false | false
- DefaultFloatFieldItem | Integer.MIN_VALUE || true | false | false | true | true | true | true | true | true | false | false | false | false | false
-// In this case the conversion to Float results in a rounding error
-// DefaultFloatFieldItem | Integer.MAX_VALUE || true | false | false | true | true | true | true | true | true | false | false | false | false | false
- DefaultFloatFieldItem | Long.MIN_VALUE || true | false | false | false | true | true | true | true | true | false | false | false | false | false
- DefaultFloatFieldItem | Long.MAX_VALUE || true | false | false | false | true | true | true | true | true | false | false | false | false | false
- DefaultFloatFieldItem | 1.2345678912345f || true | true | true | true | true | true | true | true | true | false | false | false | false | false
- DefaultFloatFieldItem | Float.MIN_VALUE || true | true | true | true | true | true | true | true | true | false | false | false | false | false
- DefaultFloatFieldItem | -Float.MAX_VALUE || true | false | false | false | false | true | true | true | true | false | false | false | false | false
- DefaultFloatFieldItem | Float.MAX_VALUE || true | false | false | false | false | true | true | true | true | false | false | false | false | false
-
-// fieldItemType | value || isValidBoolean | isValidByte | isValidShort | isValidInteger | isValidLong | isValidBigInteger | isValidFloat | isValidDouble | isValidBigDecimal | isValidString | isValidTime | isValidDate | isValidDateTime | isValidByteArray
- DefaultDoubleFieldItem | (int) 0 || true | true | true | true | true | true | true | true | true | false | false | false | false | false
- DefaultDoubleFieldItem | (int) 42 || true | true | true | true | true | true | true | true | true | false | false | false | false | false
- DefaultDoubleFieldItem | Byte.MIN_VALUE || true | true | true | true | true | true | true | true | true | false | false | false | false | false
- DefaultDoubleFieldItem | Byte.MAX_VALUE || true | true | true | true | true | true | true | true | true | false | false | false | false | false
- DefaultDoubleFieldItem | Short.MIN_VALUE || true | false | true | true | true | true | true | true | true | false | false | false | false | false
- DefaultDoubleFieldItem | Short.MAX_VALUE || true | false | true | true | true | true | true | true | true | false | false | false | false | false
- DefaultDoubleFieldItem | Integer.MIN_VALUE || true | false | false | true | true | true | true | true | true | false | false | false | false | false
- DefaultDoubleFieldItem | Integer.MAX_VALUE || true | false | false | true | true | true | true | true | true | false | false | false | false | false
- DefaultDoubleFieldItem | Long.MIN_VALUE || true | false | false | false | true | true | true | true | true | false | false | false | false | false
- DefaultDoubleFieldItem | Long.MAX_VALUE || true | false | false | false | true | true | true | true | true | false | false | false | false | false
- DefaultDoubleFieldItem | 1.23456789123456f || true | true | true | true | true | true | true | true | true | false | false | false | false | false
- DefaultDoubleFieldItem | Float.MIN_VALUE || true | true | true | true | true | true | true | true | true | false | false | false | false | false
- DefaultDoubleFieldItem | -Float.MAX_VALUE || true | false | false | false | false | true | true | true | true | false | false | false | false | false
- DefaultDoubleFieldItem | Float.MAX_VALUE || true | false | false | false | false | true | true | true | true | false | false | false | false | false
- DefaultDoubleFieldItem | 1.23456789012345d || true | true | true | true | true | true | true | true | true | false | false | false | false | false
- DefaultDoubleFieldItem | Double.MIN_VALUE || true | true | true | true | true | true | true | true | true | false | false | false | false | false
- DefaultDoubleFieldItem | -Double.MAX_VALUE || true | false | false | false | false | true | false | true | true | false | false | false | false | false
- DefaultDoubleFieldItem | Double.MAX_VALUE || true | false | false | false | false | true | false | true | true | false | false | false | false | false
-
-// fieldItemType | value || isValidBoolean | isValidByte | isValidShort | isValidInteger | isValidLong | isValidBigInteger | isValidFloat | isValidDouble | isValidBigDecimal | isValidString | isValidTime | isValidDate | isValidDateTime | isValidByteArray
- DefaultBigDecimalFieldItem | BigDecimal.ZERO || true | true | true | true | true | true | true | true | true | false | false | false | false | false
- DefaultBigDecimalFieldItem | BigDecimal.ONE || true | true | true | true | true | true | true | true | true | false | false | false | false | false
- DefaultBigDecimalFieldItem | BigDecimal.valueOf(42) || true | true | true | true | true | true | true | true | true | false | false | false | false | false
- DefaultBigDecimalFieldItem | BigDecimal.valueOf(Byte.MIN_VALUE) || true | true | true | true | true | true | true | true | true | false | false | false | false | false
- DefaultBigDecimalFieldItem | BigDecimal.valueOf(Byte.MAX_VALUE) || true | true | true | true | true | true | true | true | true | false | false | false | false | false
- DefaultBigDecimalFieldItem | BigDecimal.valueOf(Short.MIN_VALUE) || true | false | true | true | true | true | true | true | true | false | false | false | false | false
- DefaultBigDecimalFieldItem | BigDecimal.valueOf(Short.MAX_VALUE) || true | false | true | true | true | true | true | true | true | false | false | false | false | false
- DefaultBigDecimalFieldItem | BigDecimal.valueOf(Integer.MIN_VALUE) || true | false | false | true | true | true | true | true | true | false | false | false | false | false
- DefaultBigDecimalFieldItem | BigDecimal.valueOf(Integer.MAX_VALUE) || true | false | false | true | true | true | true | true | true | false | false | false | false | false
- DefaultBigDecimalFieldItem | BigDecimal.valueOf(Long.MIN_VALUE) || true | false | false | false | true | true | true | true | true | false | false | false | false | false
- DefaultBigDecimalFieldItem | BigDecimal.valueOf(Long.MAX_VALUE) || true | false | false | false | true | true | true | true | true | false | false | false | false | false
- DefaultBigDecimalFieldItem | BigDecimal.valueOf(1.23456789123456f) || true | true | true | true | true | true | true | true | true | false | false | false | false | false
- DefaultBigDecimalFieldItem | BigDecimal.valueOf(Float.MIN_VALUE) || true | true | true | true | true | true | true | true | true | false | false | false | false | false
- DefaultBigDecimalFieldItem | BigDecimal.valueOf(-Float.MAX_VALUE) || true | false | false | false | false | true | true | true | true | false | false | false | false | false
- DefaultBigDecimalFieldItem | BigDecimal.valueOf(Float.MAX_VALUE) || true | false | false | false | false | true | true | true | true | false | false | false | false | false
- DefaultBigDecimalFieldItem | BigDecimal.valueOf(1.23456789012345d) || true | true | true | true | true | true | true | true | true | false | false | false | false | false
- DefaultBigDecimalFieldItem | BigDecimal.valueOf(Double.MIN_VALUE) || true | true | true | true | true | true | true | true | true | false | false | false | false | false
- DefaultBigDecimalFieldItem | BigDecimal.valueOf(-Double.MAX_VALUE) || true | false | false | false | false | true | false | true | true | false | false | false | false | false
- DefaultBigDecimalFieldItem | BigDecimal.valueOf(Double.MAX_VALUE) || true | false | false | false | false | true | false | true | true | false | false | false | false | false
-
-// fieldItemType | value || isValidBoolean | isValidByte | isValidShort | isValidInteger | isValidLong | isValidBigInteger | isValidFloat | isValidDouble | isValidBigDecimal | isValidString | isValidTime | isValidDate | isValidDateTime | isValidByteArray
- DefaultLocalTimeFieldItem | LocalTime.now() || false | false | false | false | false | false | false | false | false | false | true | false | false | false
-
-// fieldItemType | value || isValidBoolean | isValidByte | isValidShort | isValidInteger | isValidLong | isValidBigInteger | isValidFloat | isValidDouble | isValidBigDecimal | isValidString | isValidTime | isValidDate | isValidDateTime | isValidByteArray
- DefaultLocalDateFieldItem | LocalDate.now() || false | false | false | false | false | false | false | false | false | false | false | true | false | false
-
-// fieldItemType | value || isValidBoolean | isValidByte | isValidShort | isValidInteger | isValidLong | isValidBigInteger | isValidFloat | isValidDouble | isValidBigDecimal | isValidString | isValidTime | isValidDate | isValidDateTime | isValidByteArray
- DefaultLocalDateTimeFieldItem | LocalDateTime.now() || false | false | false | false | false | false | false | false | false | false | true | true | true | false
-
-// fieldItemType | value || isValidBoolean | isValidByte | isValidShort | isValidInteger | isValidLong | isValidBigInteger | isValidFloat | isValidDouble | isValidBigDecimal | isValidString | isValidTime | isValidDate | isValidDateTime | isValidByteArray
- DefaultStringFieldItem | "foo" || false | false | false | false | false | false | false | false | false | true | false | false | false | false
- }
-
- Boolean assertItem(BaseDefaultFieldItem fieldItem, String type, Boolean expectedToBeValid) {
- assert fieldItem."isValid$type"(0) == expectedToBeValid
- if (expectedToBeValid) {
- assert fieldItem."get$type"(0) != null
- } else {
- assert getExecutionException({ fieldItem."get$type"(0) }) instanceof PlcIncompatibleDatatypeException
- }
- getExecutionException({ fieldItem."get$type"(42) }) instanceof PlcIncompatibleDatatypeException
- getExecutionException({ fieldItem."get$type"(1) }) instanceof PlcIncompatibleDatatypeException
- return true
- }
-
- Exception getExecutionException(Closure c) {
- try {
- c.call()
- return null
- } catch (Exception e) {
- return e
- }
- }
-
-}
-
-
diff --git a/plc4j/protocols/driver-bases/base/src/test/java/org/apache/plc4x/java/base/connection/AbstractPlcConnectionTest.java b/plc4j/protocols/driver-bases/base/src/test/java/org/apache/plc4x/java/base/connection/AbstractPlcConnectionTest.java
deleted file mode 100644
index 2064709..0000000
--- a/plc4j/protocols/driver-bases/base/src/test/java/org/apache/plc4x/java/base/connection/AbstractPlcConnectionTest.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-package org.apache.plc4x.java.base.connection;
-
-import org.apache.commons.lang3.NotImplementedException;
-import org.apache.plc4x.java.api.exceptions.PlcUnsupportedOperationException;
-import org.apache.plc4x.java.base.messages.DefaultPlcReadRequest;
-import org.apache.plc4x.java.base.messages.PlcReader;
-import org.assertj.core.api.WithAssertions;
-import org.junit.jupiter.api.Test;
-
-import static org.junit.jupiter.api.Assertions.assertThrows;
-import static org.mockito.Mockito.mock;
-
-class AbstractPlcConnectionTest implements WithAssertions {
-
- AbstractPlcConnection SUT = new AbstractPlcConnection() {
- @Override
- public void connect() {
- throw new NotImplementedException("not used");
- }
-
- @Override
- public boolean isConnected() {
- throw new NotImplementedException("not used");
- }
-
- @Override
- public void close() {
- throw new NotImplementedException("not used");
- }
- };
-
- @Test
- void getMetadata() {
- assertThat(SUT.getMetadata()).isNotNull().isSameAs(SUT);
- }
-
- @Test
- void canRead() {
- assertThat(SUT.canRead()).isFalse();
- }
-
- @Test
- void canWrite() {
- assertThat(SUT.canWrite()).isFalse();
- }
-
- @Test
- void canSubscribe() {
- assertThat(SUT.canSubscribe()).isFalse();
- }
-
- @Test
- void readRequestBuilder() {
- assertThatThrownBy(() -> SUT.readRequestBuilder()).isInstanceOf(PlcUnsupportedOperationException.class);
- }
-
- @Test
- void writeRequestBuilder() {
- assertThatThrownBy(() -> SUT.writeRequestBuilder()).isInstanceOf(PlcUnsupportedOperationException.class);
- }
-
- @Test
- void subscriptionRequestBuilder() {
- assertThatThrownBy(() -> SUT.subscriptionRequestBuilder()).isInstanceOf(PlcUnsupportedOperationException.class);
- }
-
- @Test
- void unsubscriptionRequestBuilder() {
- assertThatThrownBy(() -> SUT.unsubscriptionRequestBuilder()).isInstanceOf(PlcUnsupportedOperationException.class);
- }
-
- @Test
- void checkInternalTest() {
- assertThrows(IllegalArgumentException.class, () -> SUT.checkInternal("Test", DefaultPlcReadRequest.class));
- DefaultPlcReadRequest readRequest = SUT.checkInternal(
- new DefaultPlcReadRequest.Builder(mock(PlcReader.class), mock(PlcFieldHandler.class)).build(),
- DefaultPlcReadRequest.class);
- assertThat(readRequest).isNotNull();
- }
-
-
-}
\ No newline at end of file
diff --git a/plc4j/protocols/driver-bases/base/src/test/java/org/apache/plc4x/java/base/connection/NettyPlcConnectionTest.java b/plc4j/protocols/driver-bases/base/src/test/java/org/apache/plc4x/java/base/connection/NettyPlcConnectionTest.java
deleted file mode 100644
index 9625502..0000000
--- a/plc4j/protocols/driver-bases/base/src/test/java/org/apache/plc4x/java/base/connection/NettyPlcConnectionTest.java
+++ /dev/null
@@ -1,92 +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.base.connection;
-
-import io.netty.channel.Channel;
-import io.netty.channel.ChannelHandler;
-import io.netty.channel.ChannelHandlerContext;
-import io.netty.channel.embedded.EmbeddedChannel;
-import org.apache.plc4x.java.api.exceptions.PlcConnectionException;
-import org.apache.plc4x.java.base.events.ConnectEvent;
-import org.assertj.core.api.WithAssertions;
-import org.junit.jupiter.api.Test;
-
-import java.util.concurrent.CompletableFuture;
-
-
-public class NettyPlcConnectionTest implements WithAssertions {
-
- private final ChannelFactory channelFactory = new ChannelFactory() {
- @Override
- public Channel createChannel(ChannelHandler channelHandler) throws PlcConnectionException {
- return new EmbeddedChannel();
- }
-
- @Override
- public void ping() {
- // Ignore ...
- }
-
- };
-
- NettyPlcConnection SUT = new NettyPlcConnection(channelFactory, true) {
- @Override
- protected ChannelHandler getChannelHandler(CompletableFuture<Void> sessionSetupCompleteFuture) {
- sessionSetupCompleteFuture.complete(null);
-
- return new ChannelHandler() {
- @Override
- public void handlerAdded(ChannelHandlerContext ctx) {
- }
-
- @Override
- public void handlerRemoved(ChannelHandlerContext ctx) {
- }
-
- @Override
- public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
- }
- };
- }
-
- @Override
- protected void sendChannelCreatedEvent() {
- channel.pipeline().fireUserEventTriggered(new ConnectEvent());
- }
- };
-
- @Test
- public void connect() throws Exception {
- SUT.connect();
- Channel channel = SUT.getChannel();
- assertThat(channel).isNotNull();
- }
-
- @Test
- public void close() throws Exception {
- SUT.close();
- }
-
- @Test
- public void isConnected() {
- SUT.isConnected();
- }
-
-}
diff --git a/plc4j/protocols/driver-bases/base/src/test/java/org/apache/plc4x/java/base/messages/DefaultPlcProprietaryRequestTest.java b/plc4j/protocols/driver-bases/base/src/test/java/org/apache/plc4x/java/base/messages/DefaultPlcProprietaryRequestTest.java
deleted file mode 100644
index f0203ea..0000000
--- a/plc4j/protocols/driver-bases/base/src/test/java/org/apache/plc4x/java/base/messages/DefaultPlcProprietaryRequestTest.java
+++ /dev/null
@@ -1,48 +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.base.messages;
-
-import org.apache.plc4x.java.api.exceptions.PlcRuntimeException;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-
-import static org.hamcrest.core.IsEqual.equalTo;
-import static org.junit.Assert.assertThat;
-import static org.junit.jupiter.api.Assertions.assertThrows;
-
-class DefaultPlcProprietaryRequestTest {
-
- private DefaultPlcProprietaryRequest<String> SUT;
-
- @BeforeEach
- void setUp() {
- SUT = new DefaultPlcProprietaryRequest<>("foo");
- }
-
- @Test
- void execute() {
- assertThrows(PlcRuntimeException.class, () -> SUT.execute());
- }
-
- @Test
- void getProprietaryRequest() {
- assertThat(SUT.getProprietaryRequest(), equalTo("foo"));
- }
-}
\ No newline at end of file
diff --git a/plc4j/protocols/driver-bases/base/src/test/java/org/apache/plc4x/java/base/messages/DefaultPlcProprietaryResponseTest.java b/plc4j/protocols/driver-bases/base/src/test/java/org/apache/plc4x/java/base/messages/DefaultPlcProprietaryResponseTest.java
deleted file mode 100644
index 5517e3a..0000000
--- a/plc4j/protocols/driver-bases/base/src/test/java/org/apache/plc4x/java/base/messages/DefaultPlcProprietaryResponseTest.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-package org.apache.plc4x.java.base.messages;
-
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-
-import static org.hamcrest.core.IsEqual.equalTo;
-import static org.junit.Assert.assertThat;
-import static org.mockito.Mockito.mock;
-
-class DefaultPlcProprietaryResponseTest {
-
- private InternalPlcProprietaryRequest request;
- private DefaultPlcProprietaryResponse<String> SUT;
-
- @BeforeEach
- void setUp() {
- request = mock(InternalPlcProprietaryRequest.class);
- SUT = new DefaultPlcProprietaryResponse<>(request, "foo");
- }
-
- @Test
- void getResponse() {
- assertThat(SUT.getResponse(), equalTo("foo"));
- }
-
- @Test
- void getRequest() {
- assertThat(SUT.getRequest(), equalTo(request));
- }
-
-}
\ No newline at end of file
diff --git a/plc4j/protocols/driver-bases/base/src/test/java/org/apache/plc4x/java/base/messages/DefaultPlcReadRequestTest.java b/plc4j/protocols/driver-bases/base/src/test/java/org/apache/plc4x/java/base/messages/DefaultPlcReadRequestTest.java
deleted file mode 100644
index 5bb1f30..0000000
--- a/plc4j/protocols/driver-bases/base/src/test/java/org/apache/plc4x/java/base/messages/DefaultPlcReadRequestTest.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-package org.apache.plc4x.java.base.messages;
-
-import org.apache.commons.lang3.tuple.Pair;
-import org.apache.plc4x.java.api.exceptions.PlcRuntimeException;
-import org.apache.plc4x.java.api.messages.PlcReadRequest;
-import org.apache.plc4x.java.api.model.PlcField;
-import org.apache.plc4x.java.base.connection.PlcFieldHandler;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-
-import java.util.Collections;
-import java.util.LinkedHashMap;
-import java.util.LinkedHashSet;
-import java.util.List;
-
-import static org.hamcrest.core.IsEqual.equalTo;
-import static org.hamcrest.core.IsNull.notNullValue;
-import static org.junit.Assert.assertThat;
-import static org.junit.jupiter.api.Assertions.assertThrows;
-import static org.mockito.ArgumentMatchers.anyString;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-class DefaultPlcReadRequestTest {
-
- private PlcReader reader;
- private PlcField fooField;
- private DefaultPlcReadRequest SUT;
-
- @BeforeEach
- void setUp() {
- reader = mock(PlcReader.class);
- fooField = mock(PlcField.class);
- SUT = new DefaultPlcReadRequest(reader, new LinkedHashMap<>(Collections.singletonMap("foo", fooField)));
- }
-
- @Test
- void execute() {
- SUT.execute();
- }
-
- @Test
- void getNumberOfFields() {
- assertThat(SUT.getNumberOfFields(), equalTo(1));
- }
-
- @Test
- void getFieldNames() {
- LinkedHashSet<String> fieldNames = SUT.getFieldNames();
- assertThat(fieldNames.size(), equalTo(1));
- assertThat(fieldNames.iterator().next(), equalTo("foo"));
- }
-
- @Test
- void getField() {
- PlcField foo = SUT.getField("foo");
- assertThat(foo, notNullValue());
- }
-
- @Test
- void getFields() {
- List<PlcField> fields = SUT.getFields();
- assertThat(fields, notNullValue());
- assertThat(fields.size(), equalTo(1));
- PlcField field = fields.iterator().next();
- assertThat(field, equalTo(fooField));
- }
-
- @Test
- void getNamedFields() {
- List<Pair<String, PlcField>> namedFields = SUT.getNamedFields();
- assertThat(namedFields, notNullValue());
- assertThat(namedFields.size(), equalTo(1));
- Pair<String, PlcField> entry = namedFields.iterator().next();
- assertThat(entry.getKey(), equalTo("foo"));
- assertThat(entry.getValue(), equalTo(fooField));
- }
-
- @Test
- void getReader() {
- assertThat(SUT.getReader(), equalTo(reader));
- }
-
- @Test
- void builder() {
- PlcFieldHandler fieldHandler = mock(PlcFieldHandler.class);
- when(fieldHandler.createField(anyString())).thenReturn(mock(PlcField.class));
- DefaultPlcReadRequest.Builder builder = new DefaultPlcReadRequest.Builder(reader, fieldHandler);
- builder.addItem("foo", "bar");
- assertThrows(PlcRuntimeException.class, () -> builder.addItem("foo", "bar"));
- PlcReadRequest readRequest = builder.build();
- assertThat(readRequest, notNullValue());
- assertThat(readRequest.getNumberOfFields(), equalTo(1));
- assertThat(readRequest.getField("foo"), notNullValue());
- }
-
-}
\ No newline at end of file
diff --git a/plc4j/protocols/driver-bases/base/src/test/java/org/apache/plc4x/java/base/messages/DefaultPlcReadResponseTest.java b/plc4j/protocols/driver-bases/base/src/test/java/org/apache/plc4x/java/base/messages/DefaultPlcReadResponseTest.java
deleted file mode 100644
index 223390e..0000000
--- a/plc4j/protocols/driver-bases/base/src/test/java/org/apache/plc4x/java/base/messages/DefaultPlcReadResponseTest.java
+++ /dev/null
@@ -1,120 +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.base.messages;
-
-import org.apache.commons.lang3.tuple.ImmutablePair;
-import org.apache.commons.lang3.tuple.Pair;
-import org.apache.plc4x.java.api.exceptions.PlcInvalidFieldException;
-import org.apache.plc4x.java.api.exceptions.PlcRuntimeException;
-import org.apache.plc4x.java.api.model.PlcField;
-import org.apache.plc4x.java.api.types.PlcResponseCode;
-import org.apache.plc4x.java.base.messages.items.BaseDefaultFieldItem;
-import org.apache.plc4x.java.base.messages.items.DefaultByteArrayFieldItem;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.ExtendWith;
-import org.mockito.Mock;
-import org.mockito.junit.jupiter.MockitoExtension;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-
-import static org.hamcrest.core.IsEqual.equalTo;
-import static org.hamcrest.core.IsNull.notNullValue;
-import static org.junit.Assert.assertThat;
-import static org.junit.jupiter.api.Assertions.assertThrows;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-@ExtendWith(MockitoExtension.class)
-class DefaultPlcReadResponseTest {
-
- @Mock
- private InternalPlcReadRequest request;
- private DefaultPlcReadResponse SUT;
-
- @BeforeEach
- void setUp() {
- Byte[] data = new Byte[] {(byte) 0x42, (byte) 0x23};
- Map<String, Pair<PlcResponseCode, BaseDefaultFieldItem>> fields = new HashMap<>();
- fields.put("foo", new ImmutablePair<>(PlcResponseCode.OK, new DefaultByteArrayFieldItem(data)));
- fields.put("bar", new ImmutablePair<>(PlcResponseCode.NOT_FOUND, new DefaultByteArrayFieldItem(data)));
- SUT = new DefaultPlcReadResponse(request, fields);
- }
-
- @Test
- void getRequest() {
- assertThat(SUT.getRequest(), equalTo(request));
- }
-
- @Test
- void getField() {
- when(request.getField("foo")).thenReturn(mock(PlcField.class));
- PlcField field = SUT.getField("foo");
- assertThat(field, notNullValue());
- }
-
- @Test
- void getResponseCodeForNonexistentField() {
- assertThrows(PlcInvalidFieldException.class, () -> SUT.getResponseCode("hurz"));
- }
-
- @Test
- void isValidByteArray() {
- boolean valid = SUT.isValidByteArray("foo");
- assertThat(valid, equalTo(true));
- }
-
- @Test
- void checkInvalidField() {
- assertThrows(PlcInvalidFieldException.class, () -> SUT.isValidByteArray("hurz"));
- }
-
- @Test
- void checkNonOkResponseCode() {
- assertThrows(PlcRuntimeException.class, () -> SUT.isValidByteArray("bar"));
- }
-
- @Test
- void isValidByteArrayWithIndex() {
- boolean valid = SUT.isValidByteArray("foo", 0);
- assertThat(valid, equalTo(true));
- }
-
- @Test
- void getByteArray() {
- Byte[] data = SUT.getByteArray("foo");
- assertThat(data, notNullValue());
- }
-
- @Test
- void getByteArrayWithIndex() {
- Byte[] data = SUT.getByteArray("foo", 0);
- assertThat(data, notNullValue());
- }
-
- @Test
- void getAllByteArrays() {
- Collection<Byte[]> byteArrays = SUT.getAllByteArrays("foo");
- assertThat(byteArrays, notNullValue());
- }
-
-}
\ No newline at end of file
diff --git a/plc4j/protocols/driver-bases/base/src/test/java/org/apache/plc4x/java/base/messages/DefaultPlcSubscriptionEventTest.java b/plc4j/protocols/driver-bases/base/src/test/java/org/apache/plc4x/java/base/messages/DefaultPlcSubscriptionEventTest.java
deleted file mode 100644
index e244247..0000000
--- a/plc4j/protocols/driver-bases/base/src/test/java/org/apache/plc4x/java/base/messages/DefaultPlcSubscriptionEventTest.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-package org.apache.plc4x.java.base.messages;
-
-import org.apache.commons.lang3.tuple.ImmutablePair;
-import org.apache.commons.lang3.tuple.Pair;
-import org.apache.plc4x.java.api.types.PlcResponseCode;
-import org.apache.plc4x.java.base.messages.items.BaseDefaultFieldItem;
-import org.apache.plc4x.java.base.messages.items.DefaultByteFieldItem;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-
-import java.time.Instant;
-import java.util.HashMap;
-import java.util.Map;
-
-import static org.hamcrest.core.IsEqual.equalTo;
-import static org.hamcrest.core.IsNull.notNullValue;
-import static org.junit.Assert.assertThat;
-import static org.junit.jupiter.api.Assertions.assertThrows;
-
-class DefaultPlcSubscriptionEventTest {
-
- private DefaultPlcSubscriptionEvent SUT;
-
- @BeforeEach
- void setUp() {
- Map<String, Pair<PlcResponseCode, BaseDefaultFieldItem>> fields = new HashMap<>();
- fields.put("foo", new ImmutablePair<>(PlcResponseCode.OK, new DefaultByteFieldItem((byte) 0x42)));
- SUT = new DefaultPlcSubscriptionEvent(Instant.now(), fields);
- }
-
- @Test
- void getFieldNames() {
- assertThat(SUT.getFieldNames(), notNullValue());
- assertThat(SUT.getFieldNames().size(), equalTo(1));
- assertThat(SUT.getFieldNames().iterator().next(), equalTo("foo"));
- }
-
- @Test
- void getField() {
- assertThrows(UnsupportedOperationException.class, () -> SUT.getField("foo"));
- }
-
- @Test
- void getTimestamp() {
- Instant timestamp = SUT.getTimestamp();
- assertThat(timestamp, notNullValue());
- }
-
-}
\ No newline at end of file
diff --git a/plc4j/protocols/driver-bases/base/src/test/java/org/apache/plc4x/java/base/messages/DefaultPlcSubscriptionRequestTest.java b/plc4j/protocols/driver-bases/base/src/test/java/org/apache/plc4x/java/base/messages/DefaultPlcSubscriptionRequestTest.java
deleted file mode 100644
index 484c33e..0000000
--- a/plc4j/protocols/driver-bases/base/src/test/java/org/apache/plc4x/java/base/messages/DefaultPlcSubscriptionRequestTest.java
+++ /dev/null
@@ -1,157 +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.base.messages;
-
-import org.apache.commons.lang3.tuple.Pair;
-import org.apache.plc4x.java.api.exceptions.PlcRuntimeException;
-import org.apache.plc4x.java.api.messages.PlcSubscriptionRequest;
-import org.apache.plc4x.java.api.model.PlcField;
-import org.apache.plc4x.java.base.connection.PlcFieldHandler;
-import org.apache.plc4x.java.base.model.SubscriptionPlcField;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-
-import java.time.Duration;
-import java.time.temporal.ChronoUnit;
-import java.util.Collections;
-import java.util.LinkedHashMap;
-import java.util.LinkedHashSet;
-import java.util.List;
-
-import static org.hamcrest.core.IsEqual.equalTo;
-import static org.hamcrest.core.IsNull.notNullValue;
-import static org.hamcrest.core.IsNull.nullValue;
-import static org.junit.Assert.assertThat;
-import static org.junit.jupiter.api.Assertions.assertThrows;
-import static org.mockito.ArgumentMatchers.anyString;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-class DefaultPlcSubscriptionRequestTest {
-
- private PlcSubscriber subscriber;
- private PlcField fooField;
- private SubscriptionPlcField fooSubscriptionField;
- private DefaultPlcSubscriptionRequest SUT;
-
- @BeforeEach
- void setUp() {
- subscriber = mock(PlcSubscriber.class);
- fooField = mock(PlcField.class);
- fooSubscriptionField = mock(SubscriptionPlcField.class);
- when(fooSubscriptionField.getPlcField()).thenReturn(fooField);
- SUT = new DefaultPlcSubscriptionRequest(
- subscriber, new LinkedHashMap<>(Collections.singletonMap("foo", fooSubscriptionField)));
- }
-
- @Test
- void execute() {
- SUT.execute();
- }
-
- @Test
- void getNumberOfFields() {
- assertThat(SUT.getNumberOfFields(), equalTo(1));
- }
-
- @Test
- void getFieldNames() {
- LinkedHashSet<String> fieldNames = SUT.getFieldNames();
- assertThat(fieldNames.size(), equalTo(1));
- assertThat(fieldNames.iterator().next(), equalTo("foo"));
- }
-
- @Test
- void getField() {
- PlcField foo = SUT.getField("foo");
- assertThat(foo, notNullValue());
- PlcField bar = SUT.getField("bar");
- assertThat(bar, nullValue());
- }
-
- @Test
- void getFields() {
- List<PlcField> fields = SUT.getFields();
- assertThat(fields, notNullValue());
- assertThat(fields.size(), equalTo(1));
- PlcField field = fields.iterator().next();
- assertThat(field, equalTo(fooField));
- }
-
- @Test
- void getSubscriptionFields() {
- List<SubscriptionPlcField> fields = SUT.getSubscriptionFields();
- assertThat(fields, notNullValue());
- assertThat(fields.size(), equalTo(1));
- SubscriptionPlcField field = fields.iterator().next();
- assertThat(field, equalTo(fooSubscriptionField));
- }
-
- @Test
- void getSubscriptionPlcFieldMap() {
- LinkedHashMap<String, SubscriptionPlcField> map = SUT.getSubscriptionPlcFieldMap();
- assertThat(map, notNullValue());
- assertThat(map.size(), equalTo(1));
- assertThat(map.get("foo"), equalTo(fooSubscriptionField));
- }
-
- @Test
- void getNamedFields() {
- List<Pair<String, PlcField>> namedFields = SUT.getNamedFields();
- assertThat(namedFields, notNullValue());
- assertThat(namedFields.size(), equalTo(1));
- Pair<String, PlcField> entry = namedFields.iterator().next();
- assertThat(entry.getKey(), equalTo("foo"));
- assertThat(entry.getValue(), equalTo(fooField));
- }
-
- @Test
- void getNamedSubscriptionFields() {
- List<Pair<String, SubscriptionPlcField>> namedFields = SUT.getNamedSubscriptionFields();
- assertThat(namedFields, notNullValue());
- assertThat(namedFields.size(), equalTo(1));
- Pair<String, SubscriptionPlcField> entry = namedFields.iterator().next();
- assertThat(entry.getKey(), equalTo("foo"));
- assertThat(entry.getValue(), equalTo(fooSubscriptionField));
- }
-
- @Test
- void getSubscriber() {
- assertThat(SUT.getSubscriber(), equalTo(subscriber));
- }
-
- @Test
- void builder() {
- PlcFieldHandler fieldHandler = mock(PlcFieldHandler.class);
- when(fieldHandler.createField(anyString())).thenReturn(mock(PlcField.class));
- DefaultPlcSubscriptionRequest.Builder builder = new DefaultPlcSubscriptionRequest.Builder(subscriber, fieldHandler);
- builder.addChangeOfStateField("state", "bar");
- builder.addCyclicField("cyclic", "bar", Duration.of(3, ChronoUnit.SECONDS));
- builder.addEventField("event", "bar");
- assertThrows(PlcRuntimeException.class, () -> builder.addEventField("event", "bar"));
- PlcSubscriptionRequest subscriptionRequest = builder.build();
- assertThat(subscriptionRequest, notNullValue());
- assertThat(subscriptionRequest.getNumberOfFields(), equalTo(3));
- assertThat(subscriptionRequest.getField("state"), notNullValue());
- assertThat(subscriptionRequest.getField("cyclic"), notNullValue());
- assertThat(subscriptionRequest.getField("event"), notNullValue());
- }
-
-}
\ No newline at end of file
diff --git a/plc4j/protocols/driver-bases/base/src/test/java/org/apache/plc4x/java/base/messages/DefaultPlcSubscriptionResponseTest.java b/plc4j/protocols/driver-bases/base/src/test/java/org/apache/plc4x/java/base/messages/DefaultPlcSubscriptionResponseTest.java
deleted file mode 100644
index 7916bda..0000000
--- a/plc4j/protocols/driver-bases/base/src/test/java/org/apache/plc4x/java/base/messages/DefaultPlcSubscriptionResponseTest.java
+++ /dev/null
@@ -1,124 +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.base.messages;
-
-import org.apache.commons.lang3.tuple.ImmutablePair;
-import org.apache.commons.lang3.tuple.Pair;
-import org.apache.plc4x.java.api.exceptions.PlcNotImplementedException;
-import org.apache.plc4x.java.api.exceptions.PlcRuntimeException;
-import org.apache.plc4x.java.api.messages.PlcSubscriptionRequest;
-import org.apache.plc4x.java.api.model.PlcSubscriptionHandle;
-import org.apache.plc4x.java.api.types.PlcResponseCode;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-
-import static org.hamcrest.core.IsEqual.equalTo;
-import static org.hamcrest.core.IsNull.notNullValue;
-import static org.hamcrest.core.IsNull.nullValue;
-import static org.junit.Assert.assertThat;
-import static org.junit.Assert.fail;
-import static org.junit.jupiter.api.Assertions.assertThrows;
-import static org.mockito.Mockito.mock;
-
-class DefaultPlcSubscriptionResponseTest {
-
- private InternalPlcSubscriptionRequest mockRequest;
- private PlcSubscriptionHandle mockSubscriptionHandle;
- private Map<String, Pair<PlcResponseCode, PlcSubscriptionHandle>> mockValues;
- private DefaultPlcSubscriptionResponse SUT;
-
- @BeforeEach
- @SuppressWarnings("unchecked")
- void setUp() {
- mockRequest = mock(InternalPlcSubscriptionRequest.class);
- mockSubscriptionHandle = mock(PlcSubscriptionHandle.class);
- mockValues = new HashMap<>();
- mockValues.put("foo", new ImmutablePair(PlcResponseCode.OK, mockSubscriptionHandle));
- mockValues.put("bar", new ImmutablePair(PlcResponseCode.NOT_FOUND, mock(PlcSubscriptionHandle.class)));
- SUT = new DefaultPlcSubscriptionResponse(mockRequest, mockValues);
- }
-
- @Test
- void getSubscriptionHandle() {
- PlcSubscriptionHandle foo = SUT.getSubscriptionHandle("foo");
- assertThat(foo, equalTo(mockSubscriptionHandle));
- assertThrows(PlcRuntimeException.class, () -> SUT.getSubscriptionHandle("bar"));
- assertThat(SUT.getSubscriptionHandle("hurz"), nullValue());
- }
-
- @Test
- void getFieldNames() {
- Collection<String> fieldNames = SUT.getFieldNames();
- assertThat(fieldNames, notNullValue());
- assertThat(fieldNames.size(), equalTo(2));
- for (String fieldName : fieldNames) {
- if(!"foo".equals(fieldName) && !"bar".equals(fieldName)) {
- fail();
- }
- }
- }
-
- @Test
- void getField() {
- assertThrows(PlcNotImplementedException.class, () -> SUT.getField("foo"));
- }
-
- @Test
- void getResponseCode() {
- PlcResponseCode responseCode = SUT.getResponseCode("foo");
- assertThat(responseCode, notNullValue());
- assertThat(responseCode, equalTo(PlcResponseCode.OK));
-
- responseCode = SUT.getResponseCode("hurz");
- assertThat(responseCode, nullValue());
- }
-
- @Test
- void getRequest() {
- PlcSubscriptionRequest request = SUT.getRequest();
- assertThat(request, equalTo(mockRequest));
- }
-
- @Test
- void getSubscriptionHandles() {
- Collection<PlcSubscriptionHandle> subscriptionHandles = SUT.getSubscriptionHandles();
- assertThat(subscriptionHandles, notNullValue());
- assertThat(subscriptionHandles.size(), equalTo(2));
- boolean found = false;
- for (PlcSubscriptionHandle subscriptionHandle : subscriptionHandles) {
- if(subscriptionHandle.equals(mockSubscriptionHandle)) {
- found = true;
- }
- }
- assertThat(found, equalTo(true));
- }
-
- @Test
- void getValues() {
- Map<String, Pair<PlcResponseCode, PlcSubscriptionHandle>> values = SUT.getValues();
- assertThat(values, notNullValue());
- assertThat(values, equalTo(mockValues));
- }
-
-}
\ No newline at end of file
diff --git a/plc4j/protocols/driver-bases/base/src/test/java/org/apache/plc4x/java/base/messages/DefaultPlcUnsubscriptionRequestTest.java b/plc4j/protocols/driver-bases/base/src/test/java/org/apache/plc4x/java/base/messages/DefaultPlcUnsubscriptionRequestTest.java
deleted file mode 100644
index e9883da..0000000
--- a/plc4j/protocols/driver-bases/base/src/test/java/org/apache/plc4x/java/base/messages/DefaultPlcUnsubscriptionRequestTest.java
+++ /dev/null
@@ -1,91 +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.base.messages;
-
-import org.apache.plc4x.java.api.messages.PlcUnsubscriptionRequest;
-import org.apache.plc4x.java.base.model.InternalPlcSubscriptionHandle;
-import org.junit.Assert;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.ExtendWith;
-import org.mockito.Mock;
-import org.mockito.junit.jupiter.MockitoExtension;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.core.IsEqual.equalTo;
-import static org.hamcrest.core.IsNull.notNullValue;
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.Mockito.*;
-
-@ExtendWith(MockitoExtension.class)
-class DefaultPlcUnsubscriptionRequestTest {
-
- @Mock
- private PlcSubscriber subscriber;
- @Mock
- private InternalPlcSubscriptionHandle subscriptionHandle;
- private DefaultPlcUnsubscriptionRequest SUT;
-
- @BeforeEach
- void setUp() {
- SUT = new DefaultPlcUnsubscriptionRequest(subscriber, Collections.singletonList(subscriptionHandle));
- }
-
- @Test
- void execute() {
- SUT.execute();
- verify(subscriber, times(1)).unsubscribe(any());
- }
-
- @Test
- void getInternalPlcSubscriptionHandles() {
- Collection<? extends InternalPlcSubscriptionHandle> handles = SUT.getInternalPlcSubscriptionHandles();
- assertThat(handles, notNullValue());
- assertThat(handles.size(), equalTo(1));
- assertThat(handles.iterator().next(), equalTo(subscriptionHandle));
- }
-
- @Test
- void builder() {
- DefaultPlcUnsubscriptionRequest.Builder builder = new DefaultPlcUnsubscriptionRequest.Builder(subscriber);
- builder.addHandles(subscriptionHandle);
- PlcUnsubscriptionRequest unsubscriptionRequest = builder.build();
- Assert.assertThat(unsubscriptionRequest, notNullValue());
-
- InternalPlcSubscriptionHandle secondHandle = mock(InternalPlcSubscriptionHandle.class);
- InternalPlcSubscriptionHandle thirdHandle = mock(InternalPlcSubscriptionHandle.class);
-
- builder = new DefaultPlcUnsubscriptionRequest.Builder(subscriber);
- builder.addHandles(subscriptionHandle, secondHandle, thirdHandle);
- unsubscriptionRequest = builder.build();
- Assert.assertThat(unsubscriptionRequest, notNullValue());
-
- builder = new DefaultPlcUnsubscriptionRequest.Builder(subscriber);
- builder.addHandles(Arrays.asList(subscriptionHandle, secondHandle, thirdHandle));
- unsubscriptionRequest = builder.build();
- Assert.assertThat(unsubscriptionRequest, notNullValue());
- }
-
-
-}
\ No newline at end of file
diff --git a/plc4j/protocols/driver-bases/base/src/test/java/org/apache/plc4x/java/base/messages/DefaultPlcUnsubscriptionResponseTest.java b/plc4j/protocols/driver-bases/base/src/test/java/org/apache/plc4x/java/base/messages/DefaultPlcUnsubscriptionResponseTest.java
deleted file mode 100644
index 8e68148..0000000
--- a/plc4j/protocols/driver-bases/base/src/test/java/org/apache/plc4x/java/base/messages/DefaultPlcUnsubscriptionResponseTest.java
+++ /dev/null
@@ -1,48 +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.base.messages;
-
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.ExtendWith;
-import org.mockito.Mock;
-import org.mockito.junit.jupiter.MockitoExtension;
-
-import static org.hamcrest.core.IsEqual.equalTo;
-import static org.junit.Assert.assertThat;
-
-@ExtendWith(MockitoExtension.class)
-class DefaultPlcUnsubscriptionResponseTest {
-
- @Mock
- private InternalPlcUnsubscriptionRequest request;
- private DefaultPlcUnsubscriptionResponse SUT;
-
- @BeforeEach
- void setUp() {
- SUT = new DefaultPlcUnsubscriptionResponse(request);
- }
-
- @Test
- void getRequest() {
- assertThat(SUT.getRequest(), equalTo(request));
- }
-
-}
\ No newline at end of file
diff --git a/plc4j/protocols/driver-bases/base/src/test/java/org/apache/plc4x/java/base/messages/DefaultPlcWriteRequestTest.java b/plc4j/protocols/driver-bases/base/src/test/java/org/apache/plc4x/java/base/messages/DefaultPlcWriteRequestTest.java
deleted file mode 100644
index cdf7c7f..0000000
--- a/plc4j/protocols/driver-bases/base/src/test/java/org/apache/plc4x/java/base/messages/DefaultPlcWriteRequestTest.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-package org.apache.plc4x.java.base.messages;
-
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-
-class DefaultPlcWriteRequestTest {
-
- @BeforeEach
- void setUp() {
- }
-
- @Test
- void execute() {
- }
-
- @Test
- void getNumberOfFields() {
- }
-
- @Test
- void getFieldNames() {
- }
-
- @Test
- void getField() {
- }
-
- @Test
- void getFields() {
- }
-
- @Test
- void getFieldItem() {
- }
-
- @Test
- void getFieldItems() {
- }
-
- @Test
- void getNamedFields() {
- }
-
- @Test
- void getNamedFieldTriples() {
- }
-
- @Test
- void getNumberOfValues() {
- }
-}
\ No newline at end of file
diff --git a/plc4j/protocols/driver-bases/base/src/test/java/org/apache/plc4x/java/base/messages/DefaultPlcWriteResponseTest.java b/plc4j/protocols/driver-bases/base/src/test/java/org/apache/plc4x/java/base/messages/DefaultPlcWriteResponseTest.java
deleted file mode 100644
index 3776c9c..0000000
--- a/plc4j/protocols/driver-bases/base/src/test/java/org/apache/plc4x/java/base/messages/DefaultPlcWriteResponseTest.java
+++ /dev/null
@@ -1,91 +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.base.messages;
-
-import org.apache.plc4x.java.api.model.PlcField;
-import org.apache.plc4x.java.api.types.PlcResponseCode;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.ExtendWith;
-import org.mockito.Mock;
-import org.mockito.junit.jupiter.MockitoExtension;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.LinkedHashSet;
-import java.util.Map;
-
-import static org.hamcrest.core.IsEqual.equalTo;
-import static org.hamcrest.core.IsNull.notNullValue;
-import static org.junit.Assert.assertThat;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-@ExtendWith(MockitoExtension.class)
-class DefaultPlcWriteResponseTest {
-
- @Mock
- private InternalPlcWriteRequest request;
- private DefaultPlcWriteResponse SUT;
-
- @BeforeEach
- void setUp() {
- SUT = new DefaultPlcWriteResponse(request, Collections.singletonMap("foo", PlcResponseCode.OK));
- }
-
- @Test
- void getValues() {
- Map<String, PlcResponseCode> values = SUT.getValues();
- assertThat(values, notNullValue());
- assertThat(values.size(), equalTo(1));
- assertThat(values.keySet().iterator().next(), equalTo("foo"));
- assertThat(values.values().iterator().next(), equalTo(PlcResponseCode.OK));
- }
-
- @Test
- void getRequest() {
- InternalPlcWriteRequest actRequest = SUT.getRequest();
- assertThat(actRequest, equalTo(request));
- }
-
- @Test
- void getFieldNames() {
- when(request.getFieldNames()).thenReturn(new LinkedHashSet<>(Collections.singletonList("foo")));
- Collection<String> fieldNames = SUT.getFieldNames();
- assertThat(fieldNames, notNullValue());
- assertThat(fieldNames.size(), equalTo(1));
- assertThat(fieldNames.iterator().next(), equalTo("foo"));
- }
-
- @Test
- void getField() {
- when(request.getField("foo")).thenReturn(mock(PlcField.class));
- PlcField field = SUT.getField("foo");
- assertThat(field, notNullValue());
- }
-
- @Test
- void getResponseCode() {
- PlcResponseCode responseCode = SUT.getResponseCode("foo");
- assertThat(responseCode, notNullValue());
- assertThat(responseCode, equalTo(PlcResponseCode.OK));
- }
-
-}
\ No newline at end of file
diff --git a/plc4j/protocols/driver-bases/base/src/test/java/org/apache/plc4x/java/base/messages/PlcRawMessageTest.java b/plc4j/protocols/driver-bases/base/src/test/java/org/apache/plc4x/java/base/messages/PlcRawMessageTest.java
deleted file mode 100644
index d9f3635..0000000
--- a/plc4j/protocols/driver-bases/base/src/test/java/org/apache/plc4x/java/base/messages/PlcRawMessageTest.java
+++ /dev/null
@@ -1,57 +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.base.messages;
-
-import io.netty.buffer.ByteBuf;
-import io.netty.buffer.Unpooled;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.ExtendWith;
-import org.mockito.junit.jupiter.MockitoExtension;
-
-import static org.hamcrest.core.IsEqual.equalTo;
-import static org.hamcrest.core.IsNull.nullValue;
-import static org.junit.Assert.assertThat;
-
-@ExtendWith(MockitoExtension.class)
-class PlcRawMessageTest {
-
- private ByteBuf rawData;
- private PlcRawMessage SUT;
-
- @BeforeEach
- void setUp() {
- rawData = Unpooled.wrappedBuffer("foo".getBytes());
- SUT = new PlcRawMessage(rawData);
- }
-
- @Test
- void getUserData() {
- ByteBuf userData = SUT.getUserData();
- assertThat(userData, equalTo(rawData));
- }
-
- @Test
- void getParent() {
- PlcProtocolMessage parent = SUT.getParent();
- assertThat(parent, nullValue());
- }
-
-}
\ No newline at end of file
diff --git a/plc4j/protocols/driver-bases/base/src/test/java/org/apache/plc4x/java/base/messages/PlcRequestContainerTest.java b/plc4j/protocols/driver-bases/base/src/test/java/org/apache/plc4x/java/base/messages/PlcRequestContainerTest.java
deleted file mode 100644
index 019d018..0000000
--- a/plc4j/protocols/driver-bases/base/src/test/java/org/apache/plc4x/java/base/messages/PlcRequestContainerTest.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.base.messages;
-
-import org.apache.plc4x.java.api.messages.PlcRequest;
-import org.hamcrest.core.IsEqual;
-import org.junit.Before;
-import org.junit.Test;
-
-import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.TimeUnit;
-
-import static org.junit.Assert.*;
-import static org.mockito.Mockito.mock;
-
-@SuppressWarnings("unchecked")
-public class PlcRequestContainerTest {
-
- private PlcRequestContainer<InternalPlcRequest, InternalPlcResponse> SUT;
-
- private InternalPlcResponse plcResponse;
- private InternalPlcRequest plcRequest;
- private CompletableFuture<InternalPlcResponse> future;
-
- @Before
- public void setUp() {
- plcResponse = mock(InternalPlcResponse.class);
- plcRequest = mock(InternalPlcRequest.class);
- future = CompletableFuture.completedFuture(plcResponse);
- SUT = new PlcRequestContainer<>(plcRequest, future);
- }
-
- @Test
- public void getRequest() {
- PlcRequest request = SUT.getRequest();
- assertNotNull(request);
- }
-
- @Test
- public void getResponseFuture() throws Exception {
- CompletableFuture<InternalPlcResponse> responseFuture = SUT.getResponseFuture();
- assertNotNull(responseFuture);
- assertNotNull(responseFuture.get(1, TimeUnit.NANOSECONDS));
- }
-
- @Test
- public void getParent() {
- PlcProtocolMessage parent = SUT.getParent();
- assertNull(parent);
- }
-
- @Test
- public void equalsAndHashCode() {
- PlcRequestContainer<InternalPlcRequest, InternalPlcResponse> other = new PlcRequestContainer<>(plcRequest, future);
- assertThat(SUT.hashCode(), IsEqual.equalTo(other.hashCode()));
- assertThat(SUT.equals(other), IsEqual.equalTo(true));
- assertThat(SUT.equals(new Object()), IsEqual.equalTo(false));
- assertEquals(SUT, SUT);
- }
-
- @Test
- public void testToString() {
- SUT.toString();
- }
-
-}
\ No newline at end of file
diff --git a/plc4j/protocols/driver-bases/base/src/test/java/org/apache/plc4x/java/base/messages/items/DefaultLongFieldItemTest.java b/plc4j/protocols/driver-bases/base/src/test/java/org/apache/plc4x/java/base/messages/items/DefaultLongFieldItemTest.java
deleted file mode 100644
index efa6bd7..0000000
--- a/plc4j/protocols/driver-bases/base/src/test/java/org/apache/plc4x/java/base/messages/items/DefaultLongFieldItemTest.java
+++ /dev/null
@@ -1,114 +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.base.messages.items;
-
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-
-class DefaultLongFieldItemTest {
-
- DefaultLongFieldItem SUT;
-
- @BeforeEach
- void setUp() {
- SUT = new DefaultLongFieldItem(0L);
- }
-
- @AfterEach
- void tearDown() {
- }
-
- @Test
- void getObject() {
- }
-
- @Test
- void isValidBoolean() {
- }
-
- @Test
- void getBoolean() {
- }
-
- @Test
- void isValidByte() {
- }
-
- @Test
- void getByte() {
- }
-
- @Test
- void isValidShort() {
- }
-
- @Test
- void getShort() {
- }
-
- @Test
- void isValidInteger() {
- }
-
- @Test
- void getInteger() {
- }
-
- @Test
- void isValidBigInteger() {
- }
-
- @Test
- void getBigInteger() {
- }
-
- @Test
- void isValidLong() {
- }
-
- @Test
- void getLong() {
- }
-
- @Test
- void isValidFloat() {
- }
-
- @Test
- void getFloat() {
- }
-
- @Test
- void isValidDouble() {
- }
-
- @Test
- void getDouble() {
- }
-
- @Test
- void isValidBigDecimal() {
- }
-
- @Test
- void getBigDecimal() {
- }
-}
\ No newline at end of file
diff --git a/plc4j/protocols/driver-bases/base/src/test/java/org/apache/plc4x/java/base/model/DefaultPlcConsumerRegistrationTest.java b/plc4j/protocols/driver-bases/base/src/test/java/org/apache/plc4x/java/base/model/DefaultPlcConsumerRegistrationTest.java
deleted file mode 100644
index 29696fa..0000000
--- a/plc4j/protocols/driver-bases/base/src/test/java/org/apache/plc4x/java/base/model/DefaultPlcConsumerRegistrationTest.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.base.model;
-
-import nl.jqno.equalsverifier.EqualsVerifier;
-import org.apache.plc4x.java.api.messages.PlcSubscriptionEvent;
-import org.apache.plc4x.java.base.messages.PlcSubscriber;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.ExtendWith;
-import org.mockito.Mock;
-import org.mockito.junit.jupiter.MockitoExtension;
-
-import java.util.Collection;
-import java.util.function.Consumer;
-
-import static org.hamcrest.core.IsEqual.equalTo;
-import static org.hamcrest.core.IsNull.notNullValue;
-import static org.junit.Assert.assertThat;
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-
-@ExtendWith(MockitoExtension.class)
-class DefaultPlcConsumerRegistrationTest {
-
- @Mock
- private PlcSubscriber subscriber;
- @Mock
- private Consumer<PlcSubscriptionEvent> consumer;
- @Mock
- private InternalPlcSubscriptionHandle subscriptionHandle;
- private DefaultPlcConsumerRegistration SUT;
-
- @BeforeEach
- void setUp() {
- SUT = new DefaultPlcConsumerRegistration(subscriber, consumer, subscriptionHandle);
- }
-
- @Test
- void getConsumerHash() {
- int consumerHash = SUT.getConsumerHash();
- assertThat(consumerHash, equalTo(consumer.hashCode()));
- }
-
- @Test
- void getAssociatedHandles() {
- Collection<InternalPlcSubscriptionHandle> associatedHandles = SUT.getAssociatedHandles();
- assertThat(associatedHandles, notNullValue());
- assertThat(associatedHandles.size(), equalTo(1));
- assertThat(associatedHandles.iterator().next(), equalTo(subscriptionHandle));
- }
-
- @Test
- public void unregister() {
- SUT.unregister();
- verify(subscriber, times(1)).unregister(any());
- }
-
- @Test
- public void testToString() {
- String s = SUT.toString();
- assertThat(s, notNullValue());
- }
-
- @Test
- void equals() {
- EqualsVerifier.forClass(DefaultPlcConsumerRegistration.class).verify();
- }
-
-}
\ No newline at end of file
diff --git a/plc4j/protocols/driver-bases/base/src/test/java/org/apache/plc4x/java/base/model/DefaultPlcSubscriptionHandleTest.java b/plc4j/protocols/driver-bases/base/src/test/java/org/apache/plc4x/java/base/model/DefaultPlcSubscriptionHandleTest.java
deleted file mode 100644
index 0d04b7f..0000000
--- a/plc4j/protocols/driver-bases/base/src/test/java/org/apache/plc4x/java/base/model/DefaultPlcSubscriptionHandleTest.java
+++ /dev/null
@@ -1,73 +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.base.model;
-
-import nl.jqno.equalsverifier.EqualsVerifier;
-import nl.jqno.equalsverifier.Warning;
-import org.apache.plc4x.java.api.messages.PlcSubscriptionEvent;
-import org.apache.plc4x.java.base.messages.PlcSubscriber;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.ExtendWith;
-import org.mockito.Mock;
-import org.mockito.junit.jupiter.MockitoExtension;
-
-import java.util.Collections;
-import java.util.function.Consumer;
-
-import static org.hamcrest.core.IsNull.notNullValue;
-import static org.junit.Assert.assertThat;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-
-@ExtendWith(MockitoExtension.class)
-class DefaultPlcSubscriptionHandleTest {
-
- @Mock
- private PlcSubscriber subscriber;
- @Mock
- private Consumer<PlcSubscriptionEvent> consumer;
- private DefaultPlcSubscriptionHandle SUT;
-
- @BeforeEach
- void setUp() {
- SUT = new DefaultPlcSubscriptionHandle(subscriber);
- }
-
- @Test
- void register() {
- SUT.register(consumer);
- verify(subscriber, times(1)).register(consumer, Collections.singletonList(SUT));
- }
-
- @Test
- public void testToString() {
- String s = SUT.toString();
- assertThat(s, notNullValue());
- }
-
- @Test
- void equals() {
- EqualsVerifier.forClass(DefaultPlcSubscriptionHandle.class).usingGetClass()
- .suppress(Warning.STRICT_INHERITANCE).suppress(Warning.IDENTICAL_COPY)
- .suppress(Warning.ALL_FIELDS_SHOULD_BE_USED).verify();
- }
-
-}
\ No newline at end of file
diff --git a/plc4j/protocols/driver-bases/base/src/test/java/org/apache/plc4x/java/base/model/SubscriptionPlcFieldTest.java b/plc4j/protocols/driver-bases/base/src/test/java/org/apache/plc4x/java/base/model/SubscriptionPlcFieldTest.java
deleted file mode 100644
index d5fc38b..0000000
--- a/plc4j/protocols/driver-bases/base/src/test/java/org/apache/plc4x/java/base/model/SubscriptionPlcFieldTest.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-package org.apache.plc4x.java.base.model;
-
-import org.apache.plc4x.java.api.model.PlcField;
-import org.apache.plc4x.java.api.types.PlcSubscriptionType;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.ExtendWith;
-import org.mockito.Mock;
-import org.mockito.junit.jupiter.MockitoExtension;
-
-import java.time.Duration;
-import java.time.temporal.ChronoUnit;
-import java.util.Optional;
-
-import static org.hamcrest.core.IsEqual.equalTo;
-import static org.junit.Assert.assertThat;
-
-@ExtendWith(MockitoExtension.class)
-class SubscriptionPlcFieldTest {
-
- @Mock
- private PlcField field;
- private SubscriptionPlcField SUT;
-
- @BeforeEach
- void setUp() {
- SUT = new SubscriptionPlcField(PlcSubscriptionType.CYCLIC, field, Duration.of(1, ChronoUnit.SECONDS));
- }
-
- @Test
- void getPlcSubscriptionType() {
- PlcSubscriptionType plcSubscriptionType = SUT.getPlcSubscriptionType();
- assertThat(plcSubscriptionType, equalTo(PlcSubscriptionType.CYCLIC));
- }
-
- @Test
- void getPlcField() {
- PlcField plcField = SUT.getPlcField();
- assertThat(plcField, equalTo(field));
- }
-
- @Test
- void getDuration() {
- Optional<Duration> durationOptional = SUT.getDuration();
- assertThat(durationOptional.isPresent(), equalTo(true));
- assertThat(durationOptional.get(), equalTo(Duration.of(1, ChronoUnit.SECONDS)));
- }
-
-}
\ No newline at end of file
diff --git a/plc4j/protocols/driver-bases/base/src/test/java/org/apache/plc4x/java/base/protocol/SingleItemToSingleRequestProtocolTest.java b/plc4j/protocols/driver-bases/base/src/test/java/org/apache/plc4x/java/base/protocol/SingleItemToSingleRequestProtocolTest.java
deleted file mode 100644
index cd1216c..0000000
--- a/plc4j/protocols/driver-bases/base/src/test/java/org/apache/plc4x/java/base/protocol/SingleItemToSingleRequestProtocolTest.java
+++ /dev/null
@@ -1,729 +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.base.protocol;
-
-import io.netty.channel.ChannelHandlerContext;
-import io.netty.channel.ChannelPromise;
-import io.netty.channel.PendingWriteQueue;
-import io.netty.util.HashedWheelTimer;
-import org.apache.commons.lang3.reflect.FieldUtils;
-import org.apache.commons.lang3.tuple.Pair;
-import org.apache.plc4x.java.api.messages.PlcFieldRequest;
-import org.apache.plc4x.java.api.model.PlcField;
-import org.apache.plc4x.java.api.model.PlcSubscriptionHandle;
-import org.apache.plc4x.java.api.types.PlcResponseCode;
-import org.apache.plc4x.java.base.messages.*;
-import org.apache.plc4x.java.base.messages.items.BaseDefaultFieldItem;
-import org.apache.plc4x.java.base.model.InternalPlcSubscriptionHandle;
-import org.apache.plc4x.java.base.model.SubscriptionPlcField;
-import org.assertj.core.api.WithAssertions;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Nested;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.ExtendWith;
-import org.mockito.Answers;
-import org.mockito.ArgumentCaptor;
-import org.mockito.Captor;
-import org.mockito.Mock;
-import org.mockito.junit.jupiter.MockitoExtension;
-
-import java.util.*;
-import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.TimeUnit;
-import java.util.stream.Collectors;
-import java.util.stream.IntStream;
-
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.Mockito.*;
-
-@ExtendWith(MockitoExtension.class)
-class SingleItemToSingleRequestProtocolTest implements WithAssertions {
-
- SingleItemToSingleRequestProtocol SUT;
-
- @Mock(answer = Answers.RETURNS_DEEP_STUBS)
- ChannelHandlerContext channelHandlerContext;
-
- @Mock(answer = Answers.RETURNS_DEEP_STUBS)
- ChannelPromise channelPromise;
-
- @Mock
- CompletableFuture<InternalPlcResponse> responseCompletableFuture;
-
- @Mock
- PlcReader mockReader;
- @Mock
- PlcWriter mockWriter;
- @Mock
- PlcSubscriber mockSubscriber;
-
- @BeforeEach
- void setUp() throws Exception {
- SUT = new SingleItemToSingleRequestProtocol(
- mockReader,
- mockWriter,
- mockSubscriber,
- new HashedWheelTimer(),
- TimeUnit.SECONDS.toMillis(1),
- new SingleItemToSingleRequestProtocol.SplitConfig(),
- false
- );
- SUT.channelRegistered(channelHandlerContext);
- when(channelHandlerContext.executor().inEventLoop()).thenReturn(true);
- }
-
- @AfterEach
- void tearDown() throws Exception {
- SUT.channelUnregistered(channelHandlerContext);
- }
-
- @Nested
- class Misc {
- @Test
- void channelRegistered() throws Exception {
- SUT.channelRegistered(channelHandlerContext);
- assertThat(SUT.getStatistics()).containsOnly(
- entry("queue", 0),
- entry("sentButUnacknowledgedSubContainer", 0),
- entry("correlationToParentContainer", 0),
- entry("containerCorrelationIdMap", 0),
- entry("responsesToBeDelivered", 0),
- entry("correlationIdGenerator", 0),
- entry("deliveredItems", 0L),
- entry("erroredItems", 0L),
- entry("erroredContainers", 0L),
- entry("deliveredContainers", 0L)
- );
- }
-
- @Test
- void channelUnregistered() throws Exception {
- SUT.channelUnregistered(channelHandlerContext);
- assertThat(SUT.getStatistics()).containsOnly(
- entry("queue", 0),
- entry("sentButUnacknowledgedSubContainer", 0),
- entry("correlationToParentContainer", 0),
- entry("containerCorrelationIdMap", 0),
- entry("responsesToBeDelivered", 0),
- entry("correlationIdGenerator", 0),
- entry("deliveredItems", 0L),
- entry("erroredItems", 0L),
- entry("deliveredContainers", 0L),
- entry("erroredContainers", 0L)
- );
- }
-
- @Test
- void channelInactive() throws Exception {
- SUT.channelInactive(channelHandlerContext);
- assertThat(SUT.getStatistics()).containsOnly(
- entry("queue", 0),
- entry("sentButUnacknowledgedSubContainer", 0),
- entry("correlationToParentContainer", 0),
- entry("containerCorrelationIdMap", 0),
- entry("responsesToBeDelivered", 0),
- entry("correlationIdGenerator", 0),
- entry("deliveredItems", 0L),
- entry("erroredItems", 0L),
- entry("deliveredContainers", 0L),
- entry("erroredContainers", 0L)
- );
- }
- }
-
- @Nested
- class SplitConfig {
-
- @Nested
- class SplitOn {
- @BeforeEach
- void setUp() throws Exception {
- // We setup the SUT with a special configuration
- SUT = new SingleItemToSingleRequestProtocol(
- mockReader,
- mockWriter,
- mockSubscriber,
- new HashedWheelTimer(),
- TimeUnit.SECONDS.toMillis(1),
- SingleItemToSingleRequestProtocol.SplitConfig.builder()
- .dontSplitRead()
- .dontSplitWrite()
- .dontSplitSubscribe()
- .dontSplitUnsubscribe()
- .build(),
- false
- );
- SUT.channelRegistered(channelHandlerContext);
- when(channelHandlerContext.executor().inEventLoop()).thenReturn(true);
- }
-
- @Test
- void read() throws Exception {
- // Given
- // we have a simple read
- PlcRequestContainer<?, ?> msg = new PlcRequestContainer<>(TestDefaultPlcReadRequest.build(mockReader), responseCompletableFuture);
- // When
- // we write this
- SUT.write(channelHandlerContext, msg, channelPromise);
- // then
- // we should invoke this only one time
- verify(channelHandlerContext, times(1)).write(eq(msg), any());
- }
-
- @Test
- void write() throws Exception {
- // Given
- // we have a simple write
- PlcRequestContainer<?, ?> msg = new PlcRequestContainer<>(TestDefaultPlcWriteRequest.build(mockWriter), responseCompletableFuture);
- // When
- // we write this
- SUT.write(channelHandlerContext, msg, channelPromise);
- // then
- // we should invoke this only one time
- verify(channelHandlerContext, times(1)).write(eq(msg), any());
- }
-
- @Test
- void subscribe() throws Exception {
- // Given
- // we have a simple subscribe
- PlcRequestContainer<?, ?> msg = new PlcRequestContainer<>(TestDefaultPlcSubscriptionRequest.build(mockSubscriber), responseCompletableFuture);
- // When
- // we write this
- SUT.write(channelHandlerContext, msg, channelPromise);
- // then
- // we should invoke this only one time
- verify(channelHandlerContext, times(1)).write(eq(msg), any());
- }
-
- @Test
- void unsubsribe() throws Exception {
- // Given
- // we have a simple unsubscribe
- PlcRequestContainer<?, ?> msg = new PlcRequestContainer<>(TestDefaultPlcUnsubscriptionRequest.build(mockSubscriber), responseCompletableFuture);
- // When
- // we write this
- SUT.write(channelHandlerContext, msg, channelPromise);
- // then
- // we should invoke this only one time
- verify(channelHandlerContext, times(1)).write(eq(msg), any());
- }
- }
-
- @Nested
- class SplitOff {
- @BeforeEach
- void setUp() throws Exception {
- // We setup the SUT with a special configuration
- SUT = new SingleItemToSingleRequestProtocol(
- mockReader,
- mockWriter,
- mockSubscriber,
- new HashedWheelTimer(),
- TimeUnit.SECONDS.toMillis(1),
- SingleItemToSingleRequestProtocol.SplitConfig.builder()
- .splitRead()
- .splitWrite()
- .splitSubscribe()
- .splitUnsubscribe()
- .build(),
- false
- );
- SUT.channelRegistered(channelHandlerContext);
- when(channelHandlerContext.executor().inEventLoop()).thenReturn(true);
- }
-
- @Test
- void read() throws Exception {
- // Given
- // we have a simple read
- PlcRequestContainer<?, ?> msg = new PlcRequestContainer<>(TestDefaultPlcReadRequest.build(mockReader), responseCompletableFuture);
- // When
- // we write this
- SUT.write(channelHandlerContext, msg, channelPromise);
- // then
- // we should invoke this only one time
- verify(channelHandlerContext, times(5)).write(any(), any());
- }
-
- @Test
- void write() throws Exception {
- // Given
- // we have a simple write
- PlcRequestContainer<?, ?> msg = new PlcRequestContainer<>(TestDefaultPlcWriteRequest.build(mockWriter), responseCompletableFuture);
- // When
- // we write this
- SUT.write(channelHandlerContext, msg, channelPromise);
- // then
- // we should invoke this only one time
- verify(channelHandlerContext, times(5)).write(any(), any());
- }
-
- @Test
- void subscribe() throws Exception {
- // Given
- // we have a simple subscribe
- PlcRequestContainer<?, ?> msg = new PlcRequestContainer<>(TestDefaultPlcSubscriptionRequest.build(mockSubscriber), responseCompletableFuture);
- // When
- // we write this
- SUT.write(channelHandlerContext, msg, channelPromise);
- // then
- // we should invoke this only one time
- verify(channelHandlerContext, times(3)).write(any(), any());
- }
-
- @Test
- void unsubsribe() throws Exception {
- // Given
- // we have a simple unsubscribe
- PlcRequestContainer<?, ?> msg = new PlcRequestContainer<>(TestDefaultPlcUnsubscriptionRequest.build(mockSubscriber), responseCompletableFuture);
- // When
- // we write this
- SUT.write(channelHandlerContext, msg, channelPromise);
- // then
- // we should invoke this only one time
- verify(channelHandlerContext, times(3)).write(any(), any());
- }
- }
-
-
- }
-
- @Nested
- class Roundtrip {
- @Nested
- class Read {
- @Captor
- ArgumentCaptor<PlcRequestContainer> plcRequestContainerArgumentCaptor;
-
- @Test
- void simpleRead() throws Exception {
- // Given
- // we have a simple read
- PlcRequestContainer<?, ?> msg = new PlcRequestContainer<>(TestDefaultPlcReadRequest.build(mockReader), responseCompletableFuture);
- // When
- // we write this
- SUT.write(channelHandlerContext, msg, channelPromise);
- // And
- // and we simulate that all get responded
- verify(channelHandlerContext, times(5)).write(plcRequestContainerArgumentCaptor.capture(), any());
- List<PlcRequestContainer> capturedDownstreamContainers = plcRequestContainerArgumentCaptor.getAllValues();
- capturedDownstreamContainers.forEach(this::produceReadResponse);
- // Then
- // our complete container should complete normally
- verify(responseCompletableFuture).complete(any());
- // And we should have no memory leak
- assertThat(SUT.getStatistics()).containsOnly(
- entry("queue", 0),
- entry("sentButUnacknowledgedSubContainer", 0),
- entry("correlationToParentContainer", 0),
- entry("containerCorrelationIdMap", 0),
- entry("responsesToBeDelivered", 0),
- entry("correlationIdGenerator", 5),
- entry("erroredItems", 0L),
- entry("deliveredItems", 5L),
- entry("deliveredContainers", 1L),
- entry("erroredContainers", 0L)
- );
- }
-
- @Test
- void partialRead() throws Exception {
- // Given
- // we have a simple read
- PlcRequestContainer<?, ?> msg = new PlcRequestContainer<>(TestDefaultPlcReadRequest.build(mockReader), responseCompletableFuture);
- // When
- // we write this
- SUT.write(channelHandlerContext, msg, channelPromise);
- // And
- // and we simulate that some one responded
- verify(channelHandlerContext, times(5)).write(plcRequestContainerArgumentCaptor.capture(), any());
- List<PlcRequestContainer> capturedDownstreamContainers = plcRequestContainerArgumentCaptor.getAllValues();
- capturedDownstreamContainers.stream().findFirst().map(this::produceReadResponse);
- // Then
- // We create SUT with 1 seconds timeout
- TimeUnit.SECONDS.sleep(2);
- // our complete container should complete normally
- verify(responseCompletableFuture).completeExceptionally(any());
- // And we should have no memory leak
- assertThat(SUT.getStatistics()).containsOnly(
- entry("queue", 0),
- entry("sentButUnacknowledgedSubContainer", 0),
- entry("correlationToParentContainer", 0),
- entry("containerCorrelationIdMap", 0),
- entry("responsesToBeDelivered", 0),
- entry("correlationIdGenerator", 5),
- entry("deliveredItems", 1L),
- entry("erroredItems", 4L),
- entry("deliveredContainers", 0L),
- entry("erroredContainers", 1L)
- );
- }
-
- @Test
- void partialReadOneErrored() throws Exception {
- // Given
- // we have a simple read
- PlcRequestContainer<?, ?> msg = new PlcRequestContainer<>(TestDefaultPlcReadRequest.build(mockReader), responseCompletableFuture);
- // When
- // we write this
- SUT.write(channelHandlerContext, msg, channelPromise);
- // And
- // and we simulate that some one responded
- verify(channelHandlerContext, times(5)).write(plcRequestContainerArgumentCaptor.capture(), any());
- List<PlcRequestContainer> capturedDownstreamContainers = plcRequestContainerArgumentCaptor.getAllValues();
- capturedDownstreamContainers.stream()
- .findFirst()
- .map(plcRequestContainer ->
- plcRequestContainer
- .getResponseFuture()
- .completeExceptionally(new RuntimeException("ErrorOccurred"))
- );
- // Then
- // We create SUT with 1 seconds timeout
- TimeUnit.SECONDS.sleep(2);
- // our complete container should complete normally
- verify(responseCompletableFuture).completeExceptionally(any());
- // And we should have no memory leak
- assertThat(SUT.getStatistics()).containsOnly(
- entry("queue", 0),
- entry("sentButUnacknowledgedSubContainer", 0),
- entry("correlationToParentContainer", 0),
- entry("containerCorrelationIdMap", 0),
- entry("responsesToBeDelivered", 0),
- entry("correlationIdGenerator", 5),
- entry("deliveredItems", 0L),
- entry("erroredItems", 1L),
- entry("deliveredContainers", 0L),
- entry("erroredContainers", 1L)
- );
- }
-
- @Test
- void noRead() throws Exception {
- // Given
- // we have a simple read
- PlcRequestContainer<?, ?> msg = new PlcRequestContainer<>(TestDefaultPlcReadRequest.build(mockReader), responseCompletableFuture);
- // When
- // we write this
- SUT.write(channelHandlerContext, msg, channelPromise);
- // And
- // and we simulate that some one responded
- verify(channelHandlerContext, times(5)).write(any(), any());
- // Then
- // We create SUT with 1 seconds timeout
- TimeUnit.SECONDS.sleep(2);
- // our complete container should complete normally
- verify(responseCompletableFuture).completeExceptionally(any());
- // And we should have no memory leak
- assertThat(SUT.getStatistics()).containsOnly(
- entry("queue", 0),
- entry("sentButUnacknowledgedSubContainer", 0),
- entry("correlationToParentContainer", 0),
- entry("containerCorrelationIdMap", 0),
- entry("responsesToBeDelivered", 0),
- entry("correlationIdGenerator", 5),
- entry("deliveredItems", 0L),
- entry("erroredItems", 5L),
- entry("deliveredContainers", 0L),
- entry("erroredContainers", 1L)
- );
- }
-
- @SuppressWarnings("unchecked")
- private Void produceReadResponse(PlcRequestContainer plcRequestContainer) {
- InternalPlcReadRequest request = (InternalPlcReadRequest) plcRequestContainer.getRequest();
- // TODO: we need a response for every item
- String fieldName = request.getFieldNames().iterator().next();
- CompletableFuture responseFuture = plcRequestContainer.getResponseFuture();
- HashMap<String, Pair<PlcResponseCode, BaseDefaultFieldItem>> responseFields = new HashMap<>();
- responseFields.put(fieldName, Pair.of(PlcResponseCode.OK, mock(BaseDefaultFieldItem.class)));
- responseFuture.complete(new DefaultPlcReadResponse(request, responseFields));
- return null;
- }
- }
-
- @Nested
- class Write {
- // TODO: implement me
- }
-
- @Nested
- class Subscribe {
- @Captor
- ArgumentCaptor<PlcRequestContainer> plcRequestContainerArgumentCaptor;
-
- @Test
- void simpleSubscribe() throws Exception {
- // Given
- // we have a simple read
- PlcRequestContainer<?, ?> msg = new PlcRequestContainer<>(TestDefaultPlcSubscriptionRequest.build(mockSubscriber), responseCompletableFuture);
- // When
- // we write this
- SUT.write(channelHandlerContext, msg, channelPromise);
- // And
- // and we simulate that all get responded
- verify(channelHandlerContext, times(3)).write(plcRequestContainerArgumentCaptor.capture(), any());
- List<PlcRequestContainer> capturedDownstreamContainers = plcRequestContainerArgumentCaptor.getAllValues();
- capturedDownstreamContainers.forEach(this::produceSubscriptionResponse);
- // Then
- // our complete container should complete normally
- verify(responseCompletableFuture).complete(any());
- // And we should have no memory leak
- assertThat(SUT.getStatistics()).containsOnly(
- entry("queue", 0),
- entry("sentButUnacknowledgedSubContainer", 0),
- entry("correlationToParentContainer", 0),
- entry("containerCorrelationIdMap", 0),
- entry("responsesToBeDelivered", 0),
- entry("correlationIdGenerator", 3),
- entry("erroredItems", 0L),
- entry("deliveredItems", 3L),
- entry("deliveredContainers", 1L),
- entry("erroredContainers", 0L)
- );
- }
-
- @Test
- void simpleUnsubscribe() throws Exception {
- // Given
- // we have a simple read
- PlcRequestContainer<?, ?> msg = new PlcRequestContainer<>(TestDefaultPlcUnsubscriptionRequest.build(mockSubscriber), responseCompletableFuture);
- // When
- // we write this
- SUT.write(channelHandlerContext, msg, channelPromise);
- // And
- // and we simulate that all get responded
- verify(channelHandlerContext, times(3)).write(plcRequestContainerArgumentCaptor.capture(), any());
- List<PlcRequestContainer> capturedDownstreamContainers = plcRequestContainerArgumentCaptor.getAllValues();
- capturedDownstreamContainers.forEach(this::produceUnsubscriptionResponse);
- // Then
- // our complete container should complete normally
- verify(responseCompletableFuture).complete(any());
- // And we should have no memory leak
- assertThat(SUT.getStatistics()).containsOnly(
- entry("queue", 0),
- entry("sentButUnacknowledgedSubContainer", 0),
- entry("correlationToParentContainer", 0),
- entry("containerCorrelationIdMap", 0),
- entry("responsesToBeDelivered", 0),
- entry("correlationIdGenerator", 3),
- entry("erroredItems", 0L),
- entry("deliveredItems", 3L),
- entry("deliveredContainers", 1L),
- entry("erroredContainers", 0L)
- );
- }
-
- @SuppressWarnings("unchecked")
- private Void produceSubscriptionResponse(PlcRequestContainer plcRequestContainer) {
- InternalPlcSubscriptionRequest request = (InternalPlcSubscriptionRequest) plcRequestContainer.getRequest();
- // TODO: we need a response for every item
- String fieldName = request.getFieldNames().iterator().next();
- CompletableFuture responseFuture = plcRequestContainer.getResponseFuture();
- HashMap<String, Pair<PlcResponseCode, PlcSubscriptionHandle>> responseFields = new HashMap<>();
- responseFields.put(fieldName, Pair.of(PlcResponseCode.OK, mock(PlcSubscriptionHandle.class)));
- responseFuture.complete(new DefaultPlcSubscriptionResponse(request, responseFields));
- return null;
- }
-
- @SuppressWarnings("unchecked")
- private Void produceUnsubscriptionResponse(PlcRequestContainer plcRequestContainer) {
- InternalPlcUnsubscriptionRequest request = (InternalPlcUnsubscriptionRequest) plcRequestContainer.getRequest();
- // TODO: we need a response for every item
- InternalPlcSubscriptionHandle internalPlcSubscriptionHandle = request.getInternalPlcSubscriptionHandles().iterator().next();
- // TODO: handles ignored for now.
- CompletableFuture responseFuture = plcRequestContainer.getResponseFuture();
- responseFuture.complete(new DefaultPlcUnsubscriptionResponse(request));
- return null;
- }
- }
- }
-
- @Nested
- class Decoding {
- @Test
- void tryFinish() {
- SUT.tryFinish(1, null, new CompletableFuture<>());
- // TODO: add Assertions.
- }
-
- @Test
- void errored() {
- SUT.errored(1, mock(Throwable.class), new CompletableFuture<>());
- // TODO: add Assertions.
- }
- }
-
- @Nested
- class Encoding {
-
- @Captor
- ArgumentCaptor<PlcRequestContainer> plcRequestContainerArgumentCaptor;
-
- @Test
- void empty() throws Exception {
- // Given
- Object msg = null;
- // When
- SUT.write(channelHandlerContext, msg, channelPromise);
- // Then
- verify(channelHandlerContext, times(1)).write(null, channelPromise);
- }
-
- @Test
- void read() throws Exception {
- // Given
- PlcRequestContainer<?, ?> msg = new PlcRequestContainer<>(TestDefaultPlcReadRequest.build(mockReader), responseCompletableFuture);
- // When
- SUT.write(channelHandlerContext, msg, channelPromise);
- // Then
- verify(channelHandlerContext, times(5)).write(plcRequestContainerArgumentCaptor.capture(), any());
- List<PlcRequestContainer> capturedValues = plcRequestContainerArgumentCaptor.getAllValues();
- // We check if every request as exactly one field
- assertThat(capturedValues)
- .allMatch(plcRequestContainer -> plcRequestContainer.getRequest() instanceof SingleItemToSingleRequestProtocol.CorrelatedPlcReadRequest)
- .allMatch(plcRequestContainer -> ((SingleItemToSingleRequestProtocol.CorrelatedPlcReadRequest) plcRequestContainer.getRequest()).getNumberOfFields() == 1);
- // In sum we should see all fields
- List<String> fieldNamesList = capturedValues.stream()
- .map(PlcRequestContainer::getRequest)
- .map(PlcFieldRequest.class::cast)
- .map(PlcFieldRequest::getFieldNames)
- .flatMap(Collection::stream)
- .collect(Collectors.toList());
- // There should be no duplications
- assertThat(fieldNamesList).hasSize(5);
- assertThat(fieldNamesList).containsExactly(
- "readField1",
- "readField2",
- "readField3",
- "readField4",
- "readField5"
- );
- }
-
- @Test
- void write() throws Exception {
- // Given
- PlcRequestContainer<?, ?> msg = new PlcRequestContainer<>(TestDefaultPlcWriteRequest.build(mockWriter), responseCompletableFuture);
- // When
- SUT.write(channelHandlerContext, msg, channelPromise);
- // Then
- verify(channelHandlerContext, times(5)).write(plcRequestContainerArgumentCaptor.capture(), any());
- List<PlcRequestContainer> capturedValues = plcRequestContainerArgumentCaptor.getAllValues();
- // We check if every request as exactly one field
- assertThat(capturedValues)
- .allMatch(plcRequestContainer -> plcRequestContainer.getRequest() instanceof SingleItemToSingleRequestProtocol.CorrelatedPlcWriteRequest)
- .allMatch(plcRequestContainer -> ((SingleItemToSingleRequestProtocol.CorrelatedPlcWriteRequest) plcRequestContainer.getRequest()).getNumberOfFields() == 1);
- // In sum we should see all fields
- List<String> fieldNamesList = capturedValues.stream()
- .map(PlcRequestContainer::getRequest)
- .map(PlcFieldRequest.class::cast)
- .map(PlcFieldRequest::getFieldNames)
- .flatMap(Collection::stream)
- .collect(Collectors.toList());
- // There should be no duplications
- assertThat(fieldNamesList).hasSize(5);
- assertThat(fieldNamesList).containsExactly(
- "writeField1",
- "writeField2",
- "writeField3",
- "writeField4",
- "writeField5"
- );
- }
-
- @Test
- void subscribe() {
- // TODO: implement once available
- }
-
- @Test
- void unsubcribe() {
- // TODO: implement once available
- }
-
- @Test
- void trySendingMessages() throws Exception {
- PendingWriteQueue queue = (PendingWriteQueue) FieldUtils.getField(SUT.getClass(), "queue", true).get(SUT);
- assertThat(queue.size()).isLessThanOrEqualTo(0);
- queue.add(mock(PlcRequestContainer.class), channelPromise);
- assertThat(queue.size()).isGreaterThan(0);
- SUT.trySendingMessages(channelHandlerContext);
- assertThat(queue.size()).isLessThanOrEqualTo(0);
- }
- }
-
- private static class TestDefaultPlcReadRequest extends DefaultPlcReadRequest {
- private TestDefaultPlcReadRequest(PlcReader reader, LinkedHashMap<String, PlcField> fields) {
- super(reader, fields);
- }
-
- private static TestDefaultPlcReadRequest build(PlcReader reader) {
- LinkedHashMap<String, PlcField> fields = new LinkedHashMap<>();
- IntStream.rangeClosed(1, 5).forEach(i -> fields.put("readField" + i, mock(PlcField.class)));
- return new TestDefaultPlcReadRequest(reader, fields);
- }
- }
-
- private static class TestDefaultPlcWriteRequest extends DefaultPlcWriteRequest {
-
- private TestDefaultPlcWriteRequest(PlcWriter writer, LinkedHashMap<String, Pair<PlcField, BaseDefaultFieldItem>> fields) {
- super(writer, fields);
- }
-
- private static TestDefaultPlcWriteRequest build(PlcWriter writer) {
- LinkedHashMap<String, Pair<PlcField, BaseDefaultFieldItem>> fields = new LinkedHashMap<>();
- IntStream.rangeClosed(1, 5).forEach(i -> fields.put("writeField" + i, Pair.of(mock(PlcField.class), mock(BaseDefaultFieldItem.class))));
- return new TestDefaultPlcWriteRequest(writer, fields);
- }
- }
-
- private static class TestDefaultPlcSubscriptionRequest extends DefaultPlcSubscriptionRequest {
-
- private TestDefaultPlcSubscriptionRequest(PlcSubscriber subscriber, LinkedHashMap<String, SubscriptionPlcField> fields) {
- super(subscriber, fields);
- }
-
- private static TestDefaultPlcSubscriptionRequest build(PlcSubscriber subscriber) {
- LinkedHashMap<String, SubscriptionPlcField> fields = new LinkedHashMap<>();
- fields.put("sub1", mock(SubscriptionPlcField.class));
- fields.put("sub2", mock(SubscriptionPlcField.class));
- fields.put("sub3", mock(SubscriptionPlcField.class));
- return new TestDefaultPlcSubscriptionRequest(subscriber, fields);
- }
- }
-
- private static class TestDefaultPlcUnsubscriptionRequest extends DefaultPlcUnsubscriptionRequest {
-
- private TestDefaultPlcUnsubscriptionRequest(PlcSubscriber subscriber, Collection<? extends InternalPlcSubscriptionHandle> internalPlcSubscriptionHandles) {
- super(subscriber, internalPlcSubscriptionHandles);
- }
-
- private static TestDefaultPlcUnsubscriptionRequest build(PlcSubscriber subscriber) {
- List<InternalPlcSubscriptionHandle> internalPlcSubscriptionHandles = new LinkedList<>();
- internalPlcSubscriptionHandles.add(mock(InternalPlcSubscriptionHandle.class));
- internalPlcSubscriptionHandles.add(mock(InternalPlcSubscriptionHandle.class));
- internalPlcSubscriptionHandles.add(mock(InternalPlcSubscriptionHandle.class));
- return new TestDefaultPlcUnsubscriptionRequest(subscriber, internalPlcSubscriptionHandles);
- }
- }
-}
\ No newline at end of file
diff --git a/plc4j/protocols/driver-bases/base/src/test/resources/META-INF/services/com.athaydes.spockframework.report.IReportCreator.properties b/plc4j/protocols/driver-bases/base/src/test/resources/META-INF/services/com.athaydes.spockframework.report.IReportCreator.properties
deleted file mode 100644
index 0759363..0000000
--- a/plc4j/protocols/driver-bases/base/src/test/resources/META-INF/services/com.athaydes.spockframework.report.IReportCreator.properties
+++ /dev/null
@@ -1,66 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-# Name of the implementation class(es) of report creator(s) to enable (separate multiple entries with commas)
-# Currently supported classes are:
-# 1. com.athaydes.spockframework.report.internal.HtmlReportCreator
-# 2. com.athaydes.spockframework.report.template.TemplateReportCreator
-com.athaydes.spockframework.report.IReportCreator=com.athaydes.spockframework.report.internal.HtmlReportCreator
-
-# Set properties of the report creator
-# For the HtmlReportCreator, the only properties available are
-# (the location of the css files is relative to the classpath):
-com.athaydes.spockframework.report.internal.HtmlReportCreator.featureReportCss=spock-feature-report.css
-com.athaydes.spockframework.report.internal.HtmlReportCreator.summaryReportCss=spock-summary-report.css
-com.athaydes.spockframework.report.internal.HtmlReportCreator.printThrowableStackTrace=false
-com.athaydes.spockframework.report.internal.HtmlReportCreator.inlineCss=true
-com.athaydes.spockframework.report.internal.HtmlReportCreator.enabled=true
-# options are: "class_name_and_title", "class_name", "title"
-com.athaydes.spockframework.report.internal.HtmlReportCreator.specSummaryNameOption=class_name_and_title
-
-# exclude Specs Table of Contents
-com.athaydes.spockframework.report.internal.HtmlReportCreator.excludeToc=false
-
-# Output directory (where the spock reports will be created) - relative to working directory
-com.athaydes.spockframework.report.outputDir=target/spock-reports
-
-# Output directory where to store the aggregated JSON report (used to support parallel builds)
-com.athaydes.spockframework.report.aggregatedJsonReportDir=
-
-# If set to true, hides blocks which do not have any description
-com.athaydes.spockframework.report.hideEmptyBlocks=false
-
-# Set the name of the project under test so it can be displayed in the report
-com.athaydes.spockframework.report.projectName=
-
-# Set the version of the project under test so it can be displayed in the report
-com.athaydes.spockframework.report.projectVersion=Unknown
-
-# Show the source code for each block
-com.athaydes.spockframework.report.showCodeBlocks=false
-
-# Set the root location of the Spock test source code (only used if showCodeBlocks is 'true')
-com.athaydes.spockframework.report.testSourceRoots=src/test/groovy
-
-# Set properties specific to the TemplateReportCreator
-com.athaydes.spockframework.report.template.TemplateReportCreator.specTemplateFile=/templateReportCreator/spec-template.md
-com.athaydes.spockframework.report.template.TemplateReportCreator.reportFileExtension=md
-com.athaydes.spockframework.report.template.TemplateReportCreator.summaryTemplateFile=/templateReportCreator/summary-template.md
-com.athaydes.spockframework.report.template.TemplateReportCreator.summaryFileName=summary.md
-com.athaydes.spockframework.report.template.TemplateReportCreator.enabled=true
\ No newline at end of file
diff --git a/plc4j/protocols/driver-bases/pom.xml b/plc4j/protocols/driver-bases/pom.xml
index e35ee47..140d753 100644
--- a/plc4j/protocols/driver-bases/pom.xml
+++ b/plc4j/protocols/driver-bases/pom.xml
@@ -34,7 +34,6 @@
<description>Collection of base-types for implementing different types of drivers.</description>
<modules>
- <module>base</module>
<module>pcap-socket</module>
<module>raw-socket</module>
<module>serial</module>
diff --git a/plc4j/protocols/driver-bases/test/src/main/java/org/apache/plc4x/java/mock/PlcMockConnection.java b/plc4j/protocols/driver-bases/test/src/main/java/org/apache/plc4x/java/mock/PlcMockConnection.java
index 3ef1cab..14b091b 100644
--- a/plc4j/protocols/driver-bases/test/src/main/java/org/apache/plc4x/java/mock/PlcMockConnection.java
+++ b/plc4j/protocols/driver-bases/test/src/main/java/org/apache/plc4x/java/mock/PlcMockConnection.java
@@ -27,7 +27,17 @@ import org.apache.plc4x.java.api.metadata.PlcConnectionMetadata;
import org.apache.plc4x.java.api.model.PlcConsumerRegistration;
import org.apache.plc4x.java.api.model.PlcSubscriptionHandle;
import org.apache.plc4x.java.api.types.PlcResponseCode;
-import org.apache.plc4x.java.base.messages.*;
+import org.apache.plc4x.java.base.messages.DefaultPlcReadRequest;
+import org.apache.plc4x.java.base.messages.DefaultPlcReadResponse;
+import org.apache.plc4x.java.base.messages.DefaultPlcSubscriptionRequest;
+import org.apache.plc4x.java.base.messages.DefaultPlcSubscriptionResponse;
+import org.apache.plc4x.java.base.messages.DefaultPlcUnsubscriptionRequest;
+import org.apache.plc4x.java.base.messages.DefaultPlcUnsubscriptionResponse;
+import org.apache.plc4x.java.base.messages.DefaultPlcWriteRequest;
+import org.apache.plc4x.java.base.messages.DefaultPlcWriteResponse;
+import org.apache.plc4x.java.base.messages.PlcReader;
+import org.apache.plc4x.java.base.messages.PlcSubscriber;
+import org.apache.plc4x.java.base.messages.PlcWriter;
import org.apache.plc4x.java.base.messages.items.BaseDefaultFieldItem;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/plc4j/protocols/driver-bases/test/src/main/java/org/apache/plc4x/java/mock/PlcMockDriver.java b/plc4j/protocols/driver-bases/test/src/main/java/org/apache/plc4x/java/mock/PlcMockDriver.java
index 3476794..8eba242 100644
--- a/plc4j/protocols/driver-bases/test/src/main/java/org/apache/plc4x/java/mock/PlcMockDriver.java
+++ b/plc4j/protocols/driver-bases/test/src/main/java/org/apache/plc4x/java/mock/PlcMockDriver.java
@@ -18,7 +18,7 @@ under the License.
*/
package org.apache.plc4x.java.mock;
-import org.apache.plc4x.java.spi.PlcDriver;
+import org.apache.plc4x.java.api.PlcDriver;
import org.apache.plc4x.java.api.authentication.PlcAuthentication;
import org.apache.plc4x.java.api.PlcConnection;
import org.apache.plc4x.java.api.exceptions.PlcConnectionException;
diff --git a/plc4j/protocols/driver-bases/test/src/main/resources/META-INF/services/org.apache.plc4x.java.spi.PlcDriver b/plc4j/protocols/driver-bases/test/src/main/resources/META-INF/services/org.apache.plc4x.java.api.PlcDriver
similarity index 100%
rename from plc4j/protocols/driver-bases/test/src/main/resources/META-INF/services/org.apache.plc4x.java.spi.PlcDriver
rename to plc4j/protocols/driver-bases/test/src/main/resources/META-INF/services/org.apache.plc4x.java.api.PlcDriver
diff --git a/plc4j/protocols/ethernet-ip/src/main/java/org/apache/plc4x/java/ethernetip/netty/Plc4XEtherNetIpProtocol.java b/plc4j/protocols/ethernet-ip/src/main/java/org/apache/plc4x/java/ethernetip/netty/Plc4XEtherNetIpProtocol.java
index 1dea06e..6f6afd7 100644
--- a/plc4j/protocols/ethernet-ip/src/main/java/org/apache/plc4x/java/ethernetip/netty/Plc4XEtherNetIpProtocol.java
+++ b/plc4j/protocols/ethernet-ip/src/main/java/org/apache/plc4x/java/ethernetip/netty/Plc4XEtherNetIpProtocol.java
@@ -39,7 +39,6 @@ import org.apache.plc4x.java.api.model.PlcField;
import org.apache.plc4x.java.api.types.PlcResponseCode;
import org.apache.plc4x.java.base.events.ConnectEvent;
import org.apache.plc4x.java.base.events.ConnectedEvent;
-import org.apache.plc4x.java.base.messages.*;
import org.apache.plc4x.java.base.messages.items.BaseDefaultFieldItem;
import org.apache.plc4x.java.base.messages.items.DefaultLongFieldItem;
import org.apache.plc4x.java.ethernetip.model.EtherNetIpField;
diff --git a/plc4j/protocols/modbus/src/main/java/org/apache/plc4x/java/modbus/netty/Plc4XModbusProtocol.java b/plc4j/protocols/modbus/src/main/java/org/apache/plc4x/java/modbus/netty/Plc4XModbusProtocol.java
index 12be747..ac0951d 100644
--- a/plc4j/protocols/modbus/src/main/java/org/apache/plc4x/java/modbus/netty/Plc4XModbusProtocol.java
+++ b/plc4j/protocols/modbus/src/main/java/org/apache/plc4x/java/modbus/netty/Plc4XModbusProtocol.java
@@ -37,7 +37,6 @@ import org.apache.plc4x.java.api.messages.PlcReadRequest;
import org.apache.plc4x.java.api.messages.PlcRequest;
import org.apache.plc4x.java.api.messages.PlcWriteRequest;
import org.apache.plc4x.java.api.types.PlcResponseCode;
-import org.apache.plc4x.java.base.messages.*;
import org.apache.plc4x.java.base.messages.items.BaseDefaultFieldItem;
import org.apache.plc4x.java.base.messages.items.DefaultBooleanFieldItem;
import org.apache.plc4x.java.modbus.messages.items.DefaultModbusByteArrayFieldItem;
diff --git a/plc4j/protocols/modbus/src/test/java/org/apache/plc4x/java/modbus/netty/Plc4XModbusProtocolTest.java b/plc4j/protocols/modbus/src/test/java/org/apache/plc4x/java/modbus/netty/Plc4XModbusProtocolTest.java
index a746a23..10d245b 100644
--- a/plc4j/protocols/modbus/src/test/java/org/apache/plc4x/java/modbus/netty/Plc4XModbusProtocolTest.java
+++ b/plc4j/protocols/modbus/src/test/java/org/apache/plc4x/java/modbus/netty/Plc4XModbusProtocolTest.java
@@ -27,7 +27,6 @@ import io.netty.buffer.Unpooled;
import org.apache.commons.lang3.RandomStringUtils;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.plc4x.java.api.messages.PlcResponse;
-import org.apache.plc4x.java.base.messages.*;
import org.apache.plc4x.java.mock.protocol.Plc4XSupportedDataTypes;
import org.apache.plc4x.java.modbus.util.ModbusPlcFieldHandler;
import org.junit.Before;
diff --git a/plc4j/protocols/pom.xml b/plc4j/protocols/pom.xml
index dba3d6a..9a0832e 100644
--- a/plc4j/protocols/pom.xml
+++ b/plc4j/protocols/pom.xml
@@ -34,17 +34,16 @@
<description>Wrapper project for all PLC4J protocol implementations.</description>
<modules>
- <module>driver-bases</module>
+<!-- <module>driver-bases</module>-->
- <module>ads</module>
- <module>delta-v</module>
- <module>ethernet-ip</module>
- <module>iso-on-tcp</module>
- <module>iso-tp</module>
- <module>modbus</module>
- <module>s7</module>
-
- <module>benchmarks</module>
+<!-- <module>ads</module>-->
+<!-- <module>delta-v</module>-->
+<!-- <module>ethernet-ip</module>-->
+<!-- <module>iso-on-tcp</module>-->
+<!-- <module>iso-tp</module>-->
+<!-- <module>modbus</module>-->
+<!-- <module>s7</module>-->
+<!-- <module>benchmarks</module>-->
</modules>
<build>
diff --git a/plc4j/protocols/s7/src/main/java/org/apache/plc4x/java/s7/netty/Plc4XS7Protocol.java b/plc4j/protocols/s7/src/main/java/org/apache/plc4x/java/s7/netty/Plc4XS7Protocol.java
index 859db9f..7d60d00 100644
--- a/plc4j/protocols/s7/src/main/java/org/apache/plc4x/java/s7/netty/Plc4XS7Protocol.java
+++ b/plc4j/protocols/s7/src/main/java/org/apache/plc4x/java/s7/netty/Plc4XS7Protocol.java
@@ -33,8 +33,6 @@ import org.apache.plc4x.java.api.messages.PlcWriteRequest;
import org.apache.plc4x.java.api.model.PlcField;
import org.apache.plc4x.java.api.types.PlcResponseCode;
import org.apache.plc4x.java.base.events.ConnectedEvent;
-import org.apache.plc4x.java.base.messages.*;
-import org.apache.plc4x.java.base.messages.items.*;
import org.apache.plc4x.java.s7.model.S7Field;
import org.apache.plc4x.java.s7.netty.events.S7ConnectedEvent;
import org.apache.plc4x.java.s7.netty.model.messages.S7Message;
diff --git a/plc4j/protocols/s7/src/main/java/org/apache/plc4x/java/s7/netty/util/S7PlcFieldHandler.java b/plc4j/protocols/s7/src/main/java/org/apache/plc4x/java/s7/netty/util/S7PlcFieldHandler.java
index dd65567..64b2ee2 100644
--- a/plc4j/protocols/s7/src/main/java/org/apache/plc4x/java/s7/netty/util/S7PlcFieldHandler.java
+++ b/plc4j/protocols/s7/src/main/java/org/apache/plc4x/java/s7/netty/util/S7PlcFieldHandler.java
@@ -22,7 +22,6 @@ import org.apache.plc4x.java.api.exceptions.PlcInvalidFieldException;
import org.apache.plc4x.java.api.exceptions.PlcRuntimeException;
import org.apache.plc4x.java.api.model.PlcField;
import org.apache.plc4x.java.base.connection.DefaultPlcFieldHandler;
-import org.apache.plc4x.java.base.messages.items.*;
import org.apache.plc4x.java.s7.model.S7Field;
import java.lang.reflect.InvocationTargetException;
diff --git a/plc4j/protocols/s7/src/test/groovy/org/apache/plc4x/java/s7/netty/Plc4XS7ProtocolSpec.groovy b/plc4j/protocols/s7/src/test/groovy/org/apache/plc4x/java/s7/netty/Plc4XS7ProtocolSpec.groovy
index b6b5a7f..ceb00c6 100644
--- a/plc4j/protocols/s7/src/test/groovy/org/apache/plc4x/java/s7/netty/Plc4XS7ProtocolSpec.groovy
+++ b/plc4j/protocols/s7/src/test/groovy/org/apache/plc4x/java/s7/netty/Plc4XS7ProtocolSpec.groovy
@@ -30,7 +30,6 @@ import org.apache.plc4x.java.api.messages.PlcReadResponse
import org.apache.plc4x.java.api.messages.PlcResponse
import org.apache.plc4x.java.api.messages.PlcWriteRequest
import org.apache.plc4x.java.api.types.PlcResponseCode
-import org.apache.plc4x.java.base.messages.*
import org.apache.plc4x.java.s7.netty.model.messages.S7Message
import org.apache.plc4x.java.s7.netty.model.messages.S7RequestMessage
import org.apache.plc4x.java.s7.netty.model.messages.S7ResponseMessage
diff --git a/plc4j/protocols/s7/src/test/java/org/apache/plc4x/java/s7/netty/Plc4XS7ProtocolTest.java b/plc4j/protocols/s7/src/test/java/org/apache/plc4x/java/s7/netty/Plc4XS7ProtocolTest.java
index b2d4111..fe926bb 100644
--- a/plc4j/protocols/s7/src/test/java/org/apache/plc4x/java/s7/netty/Plc4XS7ProtocolTest.java
+++ b/plc4j/protocols/s7/src/test/java/org/apache/plc4x/java/s7/netty/Plc4XS7ProtocolTest.java
@@ -28,7 +28,6 @@ import org.apache.plc4x.java.api.exceptions.PlcProtocolException;
import org.apache.plc4x.java.api.messages.PlcReadRequest;
import org.apache.plc4x.java.api.messages.PlcWriteRequest;
import org.apache.plc4x.java.api.model.PlcField;
-import org.apache.plc4x.java.base.messages.*;
import org.apache.plc4x.java.s7.netty.model.messages.S7Message;
import org.apache.plc4x.java.s7.netty.model.messages.S7RequestMessage;
import org.apache.plc4x.java.s7.netty.model.params.VarParameter;
diff --git a/plc4j/protocols/s7/src/test/java/org/apache/plc4x/java/s7/netty/util/S7PlcFieldHandlerTest.java b/plc4j/protocols/s7/src/test/java/org/apache/plc4x/java/s7/netty/util/S7PlcFieldHandlerTest.java
index 589ebf2..3072990 100644
--- a/plc4j/protocols/s7/src/test/java/org/apache/plc4x/java/s7/netty/util/S7PlcFieldHandlerTest.java
+++ b/plc4j/protocols/s7/src/test/java/org/apache/plc4x/java/s7/netty/util/S7PlcFieldHandlerTest.java
@@ -20,7 +20,6 @@ package org.apache.plc4x.java.s7.netty.util;
import org.apache.plc4x.java.api.exceptions.PlcRuntimeException;
import org.apache.plc4x.java.api.model.PlcField;
-import org.apache.plc4x.java.base.messages.items.*;
import org.apache.plc4x.java.s7.netty.model.types.TransportSize;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.params.ParameterizedTest;
diff --git a/plc4j/spi/pom.xml b/plc4j/spi/pom.xml
new file mode 100644
index 0000000..a907254
--- /dev/null
+++ b/plc4j/spi/pom.xml
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <artifactId>plc4j</artifactId>
+ <groupId>org.apache.plc4x</groupId>
+ <version>0.6.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>plc4j-spi</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>io.netty</groupId>
+ <artifactId>netty-transport</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.netty</groupId>
+ <artifactId>netty-codec</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.plc4x</groupId>
+ <artifactId>plc4j-api</artifactId>
+ <version>0.6.0-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ </dependency>
+ </dependencies>
+
+
+</project>
\ No newline at end of file
diff --git a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/ConversationContext.java
similarity index 94%
copy from sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
copy to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/ConversationContext.java
index cfded02..973d9a3 100644
--- a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/ConversationContext.java
@@ -17,7 +17,7 @@
* under the License.
*/
-package org.apache.plc4x.java.s7.readwrite.protocol;
+package org.apache.plc4x.java.spi;
public interface ConversationContext<T> {
diff --git a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/Plc4xNettyWrapper.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/Plc4xNettyWrapper.java
similarity index 82%
rename from sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/Plc4xNettyWrapper.java
rename to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/Plc4xNettyWrapper.java
index 6f27f58..e9e60e2 100644
--- a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/Plc4xNettyWrapper.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/Plc4xNettyWrapper.java
@@ -17,14 +17,13 @@
* under the License.
*/
-package org.apache.plc4x.java.s7.readwrite.protocol;
+package org.apache.plc4x.java.spi;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToMessageCodec;
-import org.apache.plc4x.java.base.events.ConnectEvent;
-import org.apache.plc4x.java.base.events.ConnectedEvent;
-import org.apache.plc4x.java.base.messages.PlcRequestContainer;
-import org.apache.plc4x.java.s7.readwrite.events.IsoTPConnectedEvent;
+import org.apache.plc4x.java.spi.events.ConnectEvent;
+import org.apache.plc4x.java.spi.events.ConnectedEvent;
+import org.apache.plc4x.java.spi.messages.PlcRequestContainer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -56,14 +55,6 @@ public class Plc4xNettyWrapper<T> extends MessageToMessageCodec<T, PlcRequestCon
protocolBase.decode(new DefaultConversationContext<>(channelHandlerContext), t);
}
- /**
- * If the S7 protocol layer is used over Iso TP, then after receiving a {@link IsoTPConnectedEvent} the
- * corresponding S7 setup communication message has to be sent in order to negotiate the S7 protocol layer.
- *
- * @param ctx the current protocol layers context
- * @param evt the event
- * @throws Exception throws an exception if something goes wrong internally
- */
@Override
public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception {
// If the connection has just been established, start setting up the connection
diff --git a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/Plc4xProtocolBase.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/Plc4xProtocolBase.java
similarity index 92%
copy from sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/Plc4xProtocolBase.java
copy to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/Plc4xProtocolBase.java
index c8d5eb8..6f46d8b 100644
--- a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/Plc4xProtocolBase.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/Plc4xProtocolBase.java
@@ -17,9 +17,9 @@
* under the License.
*/
-package org.apache.plc4x.java.s7.readwrite.protocol;
+package org.apache.plc4x.java.spi;
-import org.apache.plc4x.java.base.messages.PlcRequestContainer;
+import org.apache.plc4x.java.spi.messages.PlcRequestContainer;
public abstract class Plc4xProtocolBase<T> {
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/PlcByteToMessageCodec.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/PlcByteToMessageCodec.java
similarity index 61%
rename from plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/PlcByteToMessageCodec.java
rename to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/PlcByteToMessageCodec.java
index a97ef2c..7c905d7 100644
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/PlcByteToMessageCodec.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/PlcByteToMessageCodec.java
@@ -1,22 +1,22 @@
/*
- 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.
+ * 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.base;
+package org.apache.plc4x.java.spi;
import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelHandlerContext;
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/PlcMessageToMessageCodec.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/PlcMessageToMessageCodec.java
similarity index 63%
rename from plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/PlcMessageToMessageCodec.java
rename to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/PlcMessageToMessageCodec.java
index ef7ff86..beb8d7c 100644
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/PlcMessageToMessageCodec.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/PlcMessageToMessageCodec.java
@@ -1,22 +1,22 @@
/*
-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.base;
+ * 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.spi;
import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelHandlerContext;
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/connection/AbstractPlcConnection.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/connection/AbstractPlcConnection.java
similarity index 76%
rename from plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/connection/AbstractPlcConnection.java
rename to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/connection/AbstractPlcConnection.java
index 9f862d7..9c0a89a 100644
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/connection/AbstractPlcConnection.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/connection/AbstractPlcConnection.java
@@ -1,22 +1,22 @@
/*
-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.base.connection;
+ * 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.spi.connection;
import org.apache.plc4x.java.api.PlcConnection;
import org.apache.plc4x.java.api.exceptions.PlcUnsupportedOperationException;
@@ -25,7 +25,7 @@ import org.apache.plc4x.java.api.messages.PlcSubscriptionRequest;
import org.apache.plc4x.java.api.messages.PlcUnsubscriptionRequest;
import org.apache.plc4x.java.api.messages.PlcWriteRequest;
import org.apache.plc4x.java.api.metadata.PlcConnectionMetadata;
-import org.apache.plc4x.java.base.messages.InternalPlcMessage;
+import org.apache.plc4x.java.spi.messages.InternalPlcMessage;
import java.util.Objects;
import java.util.concurrent.CompletableFuture;
diff --git a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/connection/ChannelFactory.java
similarity index 66%
copy from sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
copy to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/connection/ChannelFactory.java
index cfded02..e266b7c 100644
--- a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/connection/ChannelFactory.java
@@ -16,13 +16,18 @@
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.plc4x.java.spi.connection;
-package org.apache.plc4x.java.s7.readwrite.protocol;
+import io.netty.channel.Channel;
+import io.netty.channel.ChannelHandler;
+import org.apache.plc4x.java.api.exceptions.PlcConnectionException;
+import org.apache.plc4x.java.api.exceptions.PlcException;
-public interface ConversationContext<T> {
+public interface ChannelFactory {
- void sendToWire(T msg);
+ Channel createChannel(ChannelHandler channelHandler)
+ throws PlcConnectionException;
- void fireConnected();
+ void ping() throws PlcException;
}
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/connection/DefaultPlcFieldHandler.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/connection/DefaultPlcFieldHandler.java
similarity index 75%
rename from plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/connection/DefaultPlcFieldHandler.java
rename to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/connection/DefaultPlcFieldHandler.java
index 6b90bab..0fb23dd 100644
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/connection/DefaultPlcFieldHandler.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/connection/DefaultPlcFieldHandler.java
@@ -1,27 +1,27 @@
/*
- 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.
+ * 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.base.connection;
+package org.apache.plc4x.java.spi.connection;
import org.apache.plc4x.java.api.exceptions.PlcRuntimeException;
import org.apache.plc4x.java.api.model.PlcField;
-import org.apache.plc4x.java.base.messages.items.BaseDefaultFieldItem;
+import org.apache.plc4x.java.spi.messages.items.BaseDefaultFieldItem;
/**
* Base Implementation of {@link PlcFieldHandler} which throws a {@link PlcRuntimeException} for all
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/connection/NettyPlcConnection.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/connection/NettyPlcConnection.java
similarity index 82%
rename from plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/connection/NettyPlcConnection.java
rename to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/connection/NettyPlcConnection.java
index 3ccd294..4a481f0 100644
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/connection/NettyPlcConnection.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/connection/NettyPlcConnection.java
@@ -1,22 +1,22 @@
/*
-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.base.connection;
+ * 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.spi.connection;
import io.netty.channel.Channel;
import io.netty.channel.ChannelHandler;
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/connection/PlcFieldHandler.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/connection/PlcFieldHandler.java
similarity index 60%
rename from plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/connection/PlcFieldHandler.java
rename to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/connection/PlcFieldHandler.java
index 146e685..87e104e 100644
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/connection/PlcFieldHandler.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/connection/PlcFieldHandler.java
@@ -1,26 +1,26 @@
/*
-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.base.connection;
+ * 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.spi.connection;
import org.apache.plc4x.java.api.exceptions.PlcInvalidFieldException;
import org.apache.plc4x.java.api.model.PlcField;
-import org.apache.plc4x.java.base.messages.items.BaseDefaultFieldItem;
+import org.apache.plc4x.java.spi.messages.items.BaseDefaultFieldItem;
/**
* Field Handler which handles the parsing of string to {@link PlcField} and the encoding of retrieved plc values.
diff --git a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/events/ConnectEvent.java
similarity index 84%
copy from sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
copy to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/events/ConnectEvent.java
index cfded02..aa1f4c4 100644
--- a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/events/ConnectEvent.java
@@ -16,13 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.plc4x.java.spi.events;
-package org.apache.plc4x.java.s7.readwrite.protocol;
-
-public interface ConversationContext<T> {
-
- void sendToWire(T msg);
-
- void fireConnected();
-
+public class ConnectEvent {
}
diff --git a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/events/ConnectedEvent.java
similarity index 84%
copy from sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
copy to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/events/ConnectedEvent.java
index cfded02..3730790 100644
--- a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/events/ConnectedEvent.java
@@ -16,13 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.plc4x.java.spi.events;
-package org.apache.plc4x.java.s7.readwrite.protocol;
-
-public interface ConversationContext<T> {
-
- void sendToWire(T msg);
-
- void fireConnected();
-
+public class ConnectedEvent {
}
diff --git a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/events/DisconnectEvent.java
similarity index 66%
copy from sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
copy to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/events/DisconnectEvent.java
index cfded02..71d3e5e 100644
--- a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/events/DisconnectEvent.java
@@ -16,13 +16,24 @@
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.plc4x.java.spi.events;
-package org.apache.plc4x.java.s7.readwrite.protocol;
+import java.util.concurrent.CompletableFuture;
-public interface ConversationContext<T> {
+public class DisconnectEvent {
- void sendToWire(T msg);
+ private final CompletableFuture<Void> future;
- void fireConnected();
+ public DisconnectEvent() {
+ this.future = null;
+ }
+
+ public DisconnectEvent(CompletableFuture<Void> future) {
+ this.future = future;
+ }
+
+ public CompletableFuture<Void> getFuture() {
+ return future;
+ }
}
diff --git a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/events/DisconnectedEvent.java
similarity index 84%
copy from sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
copy to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/events/DisconnectedEvent.java
index cfded02..96ee481 100644
--- a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/events/DisconnectedEvent.java
@@ -16,13 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.plc4x.java.spi.events;
-package org.apache.plc4x.java.s7.readwrite.protocol;
-
-public interface ConversationContext<T> {
-
- void sendToWire(T msg);
-
- void fireConnected();
-
+public class DisconnectedEvent {
}
diff --git a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/Plc4xProtocolBase.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/DefaultPlcProprietaryRequest.java
similarity index 53%
copy from sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/Plc4xProtocolBase.java
copy to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/DefaultPlcProprietaryRequest.java
index c8d5eb8..926d854 100644
--- a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/Plc4xProtocolBase.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/DefaultPlcProprietaryRequest.java
@@ -16,29 +16,28 @@
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.plc4x.java.spi.messages;
-package org.apache.plc4x.java.s7.readwrite.protocol;
+import org.apache.plc4x.java.api.exceptions.PlcRuntimeException;
+import org.apache.plc4x.java.api.messages.PlcResponse;
-import org.apache.plc4x.java.base.messages.PlcRequestContainer;
+import java.util.concurrent.CompletableFuture;
-public abstract class Plc4xProtocolBase<T> {
+public class DefaultPlcProprietaryRequest<REQUEST> implements InternalPlcProprietaryRequest<REQUEST> {
- protected final Plc4xNettyWrapper<T> context;
-
- public Plc4xProtocolBase(Class<T> clazz) {
- // TODO create here?
- this.context = new Plc4xNettyWrapper<T>(this, clazz);
+ @Override
+ public CompletableFuture<PlcResponse> execute() {
+ throw new PlcRuntimeException("not supported"); // TODO: figure out what to do with this
}
- public Plc4xNettyWrapper<T> getContext() {
- return context;
- }
+ private REQUEST proprietaryRequest;
- public void onConnect(ConversationContext<T> context) {
- // Intentionally do nothing here
+ public DefaultPlcProprietaryRequest(REQUEST proprietaryRequest) {
+ this.proprietaryRequest = proprietaryRequest;
}
- protected abstract void encode(ConversationContext<T> context, PlcRequestContainer msg) throws Exception;
-
- protected abstract void decode(ConversationContext<T> context, T msg) throws Exception;
+ @Override
+ public REQUEST getProprietaryRequest() {
+ return proprietaryRequest;
+ }
}
diff --git a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/Plc4xProtocolBase.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/DefaultPlcProprietaryResponse.java
similarity index 53%
copy from sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/Plc4xProtocolBase.java
copy to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/DefaultPlcProprietaryResponse.java
index c8d5eb8..8bd1e55 100644
--- a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/Plc4xProtocolBase.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/DefaultPlcProprietaryResponse.java
@@ -16,29 +16,27 @@
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.plc4x.java.spi.messages;
-package org.apache.plc4x.java.s7.readwrite.protocol;
+public class DefaultPlcProprietaryResponse<RESPONSE> implements InternalPlcProprietaryResponse<RESPONSE> {
-import org.apache.plc4x.java.base.messages.PlcRequestContainer;
+ private final InternalPlcProprietaryRequest plcProprietaryRequest;
-public abstract class Plc4xProtocolBase<T> {
+ private final RESPONSE proprietaryResponse;
- protected final Plc4xNettyWrapper<T> context;
-
- public Plc4xProtocolBase(Class<T> clazz) {
- // TODO create here?
- this.context = new Plc4xNettyWrapper<T>(this, clazz);
+ public DefaultPlcProprietaryResponse(InternalPlcProprietaryRequest plcProprietaryRequest, RESPONSE proprietaryResponse) {
+ this.plcProprietaryRequest = plcProprietaryRequest;
+ this.proprietaryResponse = proprietaryResponse;
}
- public Plc4xNettyWrapper<T> getContext() {
- return context;
+ @Override
+ public RESPONSE getResponse() {
+ return proprietaryResponse;
}
- public void onConnect(ConversationContext<T> context) {
- // Intentionally do nothing here
+ @Override
+ public InternalPlcProprietaryRequest getRequest() {
+ return plcProprietaryRequest;
}
- protected abstract void encode(ConversationContext<T> context, PlcRequestContainer msg) throws Exception;
-
- protected abstract void decode(ConversationContext<T> context, T msg) throws Exception;
}
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/DefaultPlcReadRequest.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/DefaultPlcReadRequest.java
similarity index 72%
rename from plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/DefaultPlcReadRequest.java
rename to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/DefaultPlcReadRequest.java
index 063f105..d099dae 100644
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/DefaultPlcReadRequest.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/DefaultPlcReadRequest.java
@@ -1,31 +1,36 @@
/*
-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.base.messages;
+ * 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.spi.messages;
import org.apache.commons.lang3.tuple.Pair;
import org.apache.plc4x.java.api.exceptions.PlcRuntimeException;
import org.apache.plc4x.java.api.messages.PlcReadRequest;
import org.apache.plc4x.java.api.messages.PlcReadResponse;
import org.apache.plc4x.java.api.model.PlcField;
-import org.apache.plc4x.java.base.connection.PlcFieldHandler;
-
-import java.util.*;
+import org.apache.plc4x.java.spi.connection.PlcFieldHandler;
+
+import java.util.LinkedHashMap;
+import java.util.LinkedHashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
import java.util.concurrent.CompletableFuture;
import java.util.stream.Collectors;
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/DefaultPlcReadResponse.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/DefaultPlcReadResponse.java
similarity index 95%
rename from plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/DefaultPlcReadResponse.java
rename to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/DefaultPlcReadResponse.java
index 5989b86..cb6c115 100644
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/DefaultPlcReadResponse.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/DefaultPlcReadResponse.java
@@ -1,22 +1,22 @@
/*
-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.base.messages;
+ * 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.spi.messages;
import org.apache.commons.lang3.tuple.Pair;
import org.apache.plc4x.java.api.exceptions.PlcInvalidFieldException;
@@ -26,7 +26,7 @@ import org.apache.plc4x.java.api.model.PlcField;
import org.apache.plc4x.java.api.types.PlcResponseCode;
import org.apache.plc4x.java.api.value.PlcValue;
import org.apache.plc4x.java.api.value.PlcValues;
-import org.apache.plc4x.java.base.messages.items.BaseDefaultFieldItem;
+import org.apache.plc4x.java.spi.messages.items.BaseDefaultFieldItem;
import java.math.BigDecimal;
import java.math.BigInteger;
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/DefaultPlcSubscriptionEvent.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/DefaultPlcSubscriptionEvent.java
similarity index 51%
rename from plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/DefaultPlcSubscriptionEvent.java
rename to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/DefaultPlcSubscriptionEvent.java
index 65aa489..a31bf5f 100644
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/DefaultPlcSubscriptionEvent.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/DefaultPlcSubscriptionEvent.java
@@ -1,28 +1,28 @@
/*
- 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.
+ * 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.base.messages;
+package org.apache.plc4x.java.spi.messages;
import org.apache.commons.lang3.tuple.Pair;
import org.apache.plc4x.java.api.model.PlcField;
import org.apache.plc4x.java.api.types.PlcResponseCode;
-import org.apache.plc4x.java.base.messages.items.BaseDefaultFieldItem;
+import org.apache.plc4x.java.spi.messages.items.BaseDefaultFieldItem;
import java.time.Instant;
import java.util.Collection;
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/DefaultPlcSubscriptionRequest.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/DefaultPlcSubscriptionRequest.java
similarity index 82%
rename from plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/DefaultPlcSubscriptionRequest.java
rename to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/DefaultPlcSubscriptionRequest.java
index 5fca8a8..0b0849b 100644
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/DefaultPlcSubscriptionRequest.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/DefaultPlcSubscriptionRequest.java
@@ -1,22 +1,22 @@
/*
-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.base.messages;
+ * 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.spi.messages;
import org.apache.commons.lang3.tuple.Pair;
import org.apache.plc4x.java.api.exceptions.PlcRuntimeException;
@@ -24,11 +24,16 @@ import org.apache.plc4x.java.api.messages.PlcSubscriptionRequest;
import org.apache.plc4x.java.api.messages.PlcSubscriptionResponse;
import org.apache.plc4x.java.api.model.PlcField;
import org.apache.plc4x.java.api.types.PlcSubscriptionType;
-import org.apache.plc4x.java.base.connection.PlcFieldHandler;
-import org.apache.plc4x.java.base.model.SubscriptionPlcField;
+import org.apache.plc4x.java.spi.connection.PlcFieldHandler;
+import org.apache.plc4x.java.spi.model.SubscriptionPlcField;
import java.time.Duration;
-import java.util.*;
+import java.util.LinkedHashMap;
+import java.util.LinkedHashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
import java.util.concurrent.CompletableFuture;
import java.util.stream.Collectors;
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/DefaultPlcSubscriptionResponse.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/DefaultPlcSubscriptionResponse.java
similarity index 73%
rename from plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/DefaultPlcSubscriptionResponse.java
rename to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/DefaultPlcSubscriptionResponse.java
index a9ad3cf..bc0870b 100644
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/DefaultPlcSubscriptionResponse.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/DefaultPlcSubscriptionResponse.java
@@ -1,22 +1,22 @@
/*
- 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.
+ * 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.base.messages;
+package org.apache.plc4x.java.spi.messages;
import org.apache.commons.lang3.tuple.Pair;
import org.apache.plc4x.java.api.exceptions.PlcNotImplementedException;
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/DefaultPlcUnsubscriptionRequest.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/DefaultPlcUnsubscriptionRequest.java
similarity index 75%
rename from plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/DefaultPlcUnsubscriptionRequest.java
rename to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/DefaultPlcUnsubscriptionRequest.java
index 95856fa..582a672 100644
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/DefaultPlcUnsubscriptionRequest.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/DefaultPlcUnsubscriptionRequest.java
@@ -1,27 +1,27 @@
/*
- 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.
+ * 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.base.messages;
+package org.apache.plc4x.java.spi.messages;
import org.apache.plc4x.java.api.messages.PlcUnsubscriptionRequest;
import org.apache.plc4x.java.api.messages.PlcUnsubscriptionResponse;
import org.apache.plc4x.java.api.model.PlcSubscriptionHandle;
-import org.apache.plc4x.java.base.model.InternalPlcSubscriptionHandle;
+import org.apache.plc4x.java.spi.model.InternalPlcSubscriptionHandle;
import java.util.ArrayList;
import java.util.Arrays;
diff --git a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/DefaultPlcUnsubscriptionResponse.java
similarity index 62%
copy from sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
copy to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/DefaultPlcUnsubscriptionResponse.java
index cfded02..c475318 100644
--- a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/DefaultPlcUnsubscriptionResponse.java
@@ -16,13 +16,21 @@
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.plc4x.java.spi.messages;
-package org.apache.plc4x.java.s7.readwrite.protocol;
+import org.apache.plc4x.java.api.messages.PlcUnsubscriptionRequest;
-public interface ConversationContext<T> {
+public class DefaultPlcUnsubscriptionResponse implements InternalPlcUnsubscriptionResponse {
- void sendToWire(T msg);
+ private final InternalPlcUnsubscriptionRequest request;
- void fireConnected();
+ public DefaultPlcUnsubscriptionResponse(InternalPlcUnsubscriptionRequest request) {
+ this.request = request;
+ }
+
+ @Override
+ public PlcUnsubscriptionRequest getRequest() {
+ return request;
+ }
}
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/DefaultPlcWriteRequest.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/DefaultPlcWriteRequest.java
similarity index 89%
rename from plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/DefaultPlcWriteRequest.java
rename to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/DefaultPlcWriteRequest.java
index 641bc7e..34c2c37 100644
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/DefaultPlcWriteRequest.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/DefaultPlcWriteRequest.java
@@ -1,22 +1,22 @@
/*
-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.base.messages;
+ * 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.spi.messages;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.commons.lang3.tuple.Pair;
@@ -25,15 +25,22 @@ import org.apache.plc4x.java.api.exceptions.PlcRuntimeException;
import org.apache.plc4x.java.api.messages.PlcWriteRequest;
import org.apache.plc4x.java.api.messages.PlcWriteResponse;
import org.apache.plc4x.java.api.model.PlcField;
-import org.apache.plc4x.java.base.connection.PlcFieldHandler;
-import org.apache.plc4x.java.base.messages.items.BaseDefaultFieldItem;
+import org.apache.plc4x.java.spi.connection.PlcFieldHandler;
+import org.apache.plc4x.java.spi.messages.items.BaseDefaultFieldItem;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
-import java.util.*;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.LinkedHashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.TreeMap;
import java.util.concurrent.CompletableFuture;
import java.util.function.BiFunction;
import java.util.stream.Collectors;
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/DefaultPlcWriteResponse.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/DefaultPlcWriteResponse.java
similarity index 55%
rename from plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/DefaultPlcWriteResponse.java
rename to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/DefaultPlcWriteResponse.java
index a004f0f..6527e4b 100644
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/DefaultPlcWriteResponse.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/DefaultPlcWriteResponse.java
@@ -1,22 +1,22 @@
/*
-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.base.messages;
+ * 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.spi.messages;
import org.apache.plc4x.java.api.model.PlcField;
import org.apache.plc4x.java.api.types.PlcResponseCode;
diff --git a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/InternalPlcFieldRequest.java
similarity index 69%
copy from sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
copy to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/InternalPlcFieldRequest.java
index cfded02..6c542e7 100644
--- a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/InternalPlcFieldRequest.java
@@ -16,13 +16,16 @@
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.plc4x.java.spi.messages;
-package org.apache.plc4x.java.s7.readwrite.protocol;
+import org.apache.commons.lang3.tuple.Pair;
+import org.apache.plc4x.java.api.messages.PlcFieldRequest;
+import org.apache.plc4x.java.api.model.PlcField;
-public interface ConversationContext<T> {
+import java.util.List;
- void sendToWire(T msg);
+public interface InternalPlcFieldRequest extends PlcFieldRequest, InternalPlcRequest {
- void fireConnected();
+ List<Pair<String, PlcField>> getNamedFields();
}
diff --git a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/InternalPlcFieldResponse.java
similarity index 82%
copy from sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
copy to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/InternalPlcFieldResponse.java
index cfded02..ac8397d 100644
--- a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/InternalPlcFieldResponse.java
@@ -16,13 +16,11 @@
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.plc4x.java.spi.messages;
-package org.apache.plc4x.java.s7.readwrite.protocol;
+import org.apache.plc4x.java.api.messages.PlcFieldResponse;
-public interface ConversationContext<T> {
+public interface InternalPlcFieldResponse extends PlcFieldResponse {
- void sendToWire(T msg);
-
- void fireConnected();
}
diff --git a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/InternalPlcMessage.java
similarity index 84%
copy from sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
copy to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/InternalPlcMessage.java
index cfded02..99cb32b 100644
--- a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/InternalPlcMessage.java
@@ -17,12 +17,7 @@
* under the License.
*/
-package org.apache.plc4x.java.s7.readwrite.protocol;
-
-public interface ConversationContext<T> {
-
- void sendToWire(T msg);
-
- void fireConnected();
+package org.apache.plc4x.java.spi.messages;
+public interface InternalPlcMessage {
}
diff --git a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/InternalPlcProprietaryRequest.java
similarity index 83%
copy from sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
copy to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/InternalPlcProprietaryRequest.java
index cfded02..075548e 100644
--- a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/InternalPlcProprietaryRequest.java
@@ -16,13 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.plc4x.java.spi.messages;
-package org.apache.plc4x.java.s7.readwrite.protocol;
-
-public interface ConversationContext<T> {
-
- void sendToWire(T msg);
-
- void fireConnected();
-
+public interface InternalPlcProprietaryRequest<REQUEST> extends PlcProprietaryRequest<REQUEST>, InternalPlcRequest {
}
diff --git a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/InternalPlcProprietaryResponse.java
similarity index 82%
copy from sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
copy to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/InternalPlcProprietaryResponse.java
index cfded02..d74f5f5 100644
--- a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/InternalPlcProprietaryResponse.java
@@ -16,13 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.plc4x.java.spi.messages;
-package org.apache.plc4x.java.s7.readwrite.protocol;
-
-public interface ConversationContext<T> {
-
- void sendToWire(T msg);
-
- void fireConnected();
-
-}
+public interface InternalPlcProprietaryResponse<RESPONSE> extends PlcProprietaryResponse<RESPONSE>, InternalPlcResponse {
+}
\ No newline at end of file
diff --git a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/InternalPlcReadRequest.java
similarity index 79%
copy from sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
copy to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/InternalPlcReadRequest.java
index cfded02..4d298a9 100644
--- a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/InternalPlcReadRequest.java
@@ -16,13 +16,11 @@
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.plc4x.java.spi.messages;
-package org.apache.plc4x.java.s7.readwrite.protocol;
+import org.apache.plc4x.java.api.messages.PlcReadRequest;
-public interface ConversationContext<T> {
-
- void sendToWire(T msg);
-
- void fireConnected();
+public interface InternalPlcReadRequest extends PlcReadRequest, InternalPlcFieldRequest, InternalPlcRequest {
}
+
diff --git a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/InternalPlcReadResponse.java
similarity index 64%
copy from sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
copy to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/InternalPlcReadResponse.java
index cfded02..5756573 100644
--- a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/InternalPlcReadResponse.java
@@ -16,13 +16,16 @@
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.plc4x.java.spi.messages;
-package org.apache.plc4x.java.s7.readwrite.protocol;
+import org.apache.commons.lang3.tuple.Pair;
+import org.apache.plc4x.java.api.messages.PlcReadResponse;
+import org.apache.plc4x.java.api.types.PlcResponseCode;
+import org.apache.plc4x.java.spi.messages.items.BaseDefaultFieldItem;
-public interface ConversationContext<T> {
+import java.util.Map;
- void sendToWire(T msg);
-
- void fireConnected();
+public interface InternalPlcReadResponse extends PlcReadResponse, InternalPlcResponse {
+ Map<String, Pair<PlcResponseCode, BaseDefaultFieldItem>> getValues();
}
diff --git a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/InternalPlcRequest.java
similarity index 82%
copy from sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
copy to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/InternalPlcRequest.java
index cfded02..0387f01 100644
--- a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/InternalPlcRequest.java
@@ -16,13 +16,9 @@
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.plc4x.java.spi.messages;
-package org.apache.plc4x.java.s7.readwrite.protocol;
-
-public interface ConversationContext<T> {
-
- void sendToWire(T msg);
-
- void fireConnected();
+import org.apache.plc4x.java.api.messages.PlcRequest;
+public interface InternalPlcRequest extends PlcRequest, InternalPlcMessage {
}
diff --git a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/InternalPlcResponse.java
similarity index 83%
copy from sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
copy to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/InternalPlcResponse.java
index cfded02..b5b047c 100644
--- a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/InternalPlcResponse.java
@@ -16,13 +16,10 @@
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.plc4x.java.spi.messages;
-package org.apache.plc4x.java.s7.readwrite.protocol;
+import org.apache.plc4x.java.api.messages.PlcResponse;
-public interface ConversationContext<T> {
-
- void sendToWire(T msg);
-
- void fireConnected();
+public interface InternalPlcResponse extends PlcResponse {
}
diff --git a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/InternalPlcSubscriptionEvent.java
similarity index 81%
copy from sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
copy to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/InternalPlcSubscriptionEvent.java
index cfded02..6c7f32c 100644
--- a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/InternalPlcSubscriptionEvent.java
@@ -16,13 +16,10 @@
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.plc4x.java.spi.messages;
-package org.apache.plc4x.java.s7.readwrite.protocol;
+import org.apache.plc4x.java.api.messages.PlcSubscriptionEvent;
-public interface ConversationContext<T> {
-
- void sendToWire(T msg);
-
- void fireConnected();
+public interface InternalPlcSubscriptionEvent extends PlcSubscriptionEvent {
}
diff --git a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/InternalPlcSubscriptionRequest.java
similarity index 58%
copy from sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
copy to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/InternalPlcSubscriptionRequest.java
index cfded02..4435047 100644
--- a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/InternalPlcSubscriptionRequest.java
@@ -16,13 +16,21 @@
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.plc4x.java.spi.messages;
-package org.apache.plc4x.java.s7.readwrite.protocol;
+import org.apache.commons.lang3.tuple.Pair;
+import org.apache.plc4x.java.api.messages.PlcSubscriptionRequest;
+import org.apache.plc4x.java.spi.model.SubscriptionPlcField;
-public interface ConversationContext<T> {
+import java.util.LinkedHashMap;
+import java.util.List;
- void sendToWire(T msg);
+public interface InternalPlcSubscriptionRequest extends PlcSubscriptionRequest, InternalPlcFieldRequest {
- void fireConnected();
+ List<SubscriptionPlcField> getSubscriptionFields();
+
+ LinkedHashMap<String, SubscriptionPlcField> getSubscriptionPlcFieldMap();
+
+ List<Pair<String, SubscriptionPlcField>> getNamedSubscriptionFields();
}
diff --git a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/InternalPlcSubscriptionResponse.java
similarity index 63%
copy from sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
copy to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/InternalPlcSubscriptionResponse.java
index cfded02..ecb900b 100644
--- a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/InternalPlcSubscriptionResponse.java
@@ -16,13 +16,15 @@
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.plc4x.java.spi.messages;
-package org.apache.plc4x.java.s7.readwrite.protocol;
+import org.apache.commons.lang3.tuple.Pair;
+import org.apache.plc4x.java.api.messages.PlcSubscriptionResponse;
+import org.apache.plc4x.java.api.model.PlcSubscriptionHandle;
+import org.apache.plc4x.java.api.types.PlcResponseCode;
-public interface ConversationContext<T> {
-
- void sendToWire(T msg);
-
- void fireConnected();
+import java.util.Map;
+public interface InternalPlcSubscriptionResponse extends PlcSubscriptionResponse, InternalPlcResponse {
+ Map<String, Pair<PlcResponseCode, PlcSubscriptionHandle>> getValues();
}
diff --git a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/InternalPlcUnsubscriptionRequest.java
similarity index 66%
copy from sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
copy to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/InternalPlcUnsubscriptionRequest.java
index cfded02..6e5c394 100644
--- a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/InternalPlcUnsubscriptionRequest.java
@@ -16,13 +16,14 @@
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.plc4x.java.spi.messages;
-package org.apache.plc4x.java.s7.readwrite.protocol;
+import org.apache.plc4x.java.api.messages.PlcUnsubscriptionRequest;
+import org.apache.plc4x.java.spi.model.InternalPlcSubscriptionHandle;
-public interface ConversationContext<T> {
+import java.util.Collection;
- void sendToWire(T msg);
-
- void fireConnected();
+public interface InternalPlcUnsubscriptionRequest extends PlcUnsubscriptionRequest, InternalPlcRequest {
+ Collection<? extends InternalPlcSubscriptionHandle> getInternalPlcSubscriptionHandles();
}
diff --git a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/InternalPlcUnsubscriptionResponse.java
similarity index 78%
copy from sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
copy to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/InternalPlcUnsubscriptionResponse.java
index cfded02..66165d5 100644
--- a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/InternalPlcUnsubscriptionResponse.java
@@ -16,13 +16,10 @@
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.plc4x.java.spi.messages;
-package org.apache.plc4x.java.s7.readwrite.protocol;
+import org.apache.plc4x.java.api.messages.PlcUnsubscriptionResponse;
-public interface ConversationContext<T> {
-
- void sendToWire(T msg);
-
- void fireConnected();
+public interface InternalPlcUnsubscriptionResponse extends PlcUnsubscriptionResponse, InternalPlcResponse {
}
diff --git a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/InternalPlcWriteRequest.java
similarity index 59%
copy from sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
copy to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/InternalPlcWriteRequest.java
index cfded02..0a5bb2e 100644
--- a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/InternalPlcWriteRequest.java
@@ -16,13 +16,21 @@
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.plc4x.java.spi.messages;
-package org.apache.plc4x.java.s7.readwrite.protocol;
+import org.apache.commons.lang3.tuple.Triple;
+import org.apache.plc4x.java.api.messages.PlcWriteRequest;
+import org.apache.plc4x.java.api.model.PlcField;
+import org.apache.plc4x.java.spi.messages.items.BaseDefaultFieldItem;
-public interface ConversationContext<T> {
+import java.util.List;
- void sendToWire(T msg);
+public interface InternalPlcWriteRequest extends PlcWriteRequest, InternalPlcRequest {
- void fireConnected();
+ BaseDefaultFieldItem getFieldItem(String name);
+
+ List<BaseDefaultFieldItem> getFieldItems();
+
+ List<Triple<String, PlcField, BaseDefaultFieldItem>> getNamedFieldTriples();
}
diff --git a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/InternalPlcWriteResponse.java
similarity index 71%
copy from sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
copy to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/InternalPlcWriteResponse.java
index cfded02..fa99153 100644
--- a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/InternalPlcWriteResponse.java
@@ -16,13 +16,13 @@
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.plc4x.java.spi.messages;
-package org.apache.plc4x.java.s7.readwrite.protocol;
+import org.apache.plc4x.java.api.messages.PlcWriteResponse;
+import org.apache.plc4x.java.api.types.PlcResponseCode;
-public interface ConversationContext<T> {
-
- void sendToWire(T msg);
-
- void fireConnected();
+import java.util.Map;
+public interface InternalPlcWriteResponse extends PlcWriteResponse, InternalPlcResponse {
+ Map<String, PlcResponseCode> getValues();
}
diff --git a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/PlcProprietaryRequest.java
similarity index 79%
copy from sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
copy to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/PlcProprietaryRequest.java
index cfded02..96eaa73 100644
--- a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/PlcProprietaryRequest.java
@@ -16,13 +16,10 @@
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.plc4x.java.spi.messages;
-package org.apache.plc4x.java.s7.readwrite.protocol;
-
-public interface ConversationContext<T> {
-
- void sendToWire(T msg);
-
- void fireConnected();
+import org.apache.plc4x.java.api.messages.PlcRequest;
+public interface PlcProprietaryRequest<REQUEST> extends PlcRequest {
+ REQUEST getProprietaryRequest();
}
diff --git a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/PlcProprietaryResponse.java
similarity index 81%
copy from sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
copy to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/PlcProprietaryResponse.java
index cfded02..2ec84ac 100644
--- a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/PlcProprietaryResponse.java
@@ -16,13 +16,10 @@
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.plc4x.java.spi.messages;
-package org.apache.plc4x.java.s7.readwrite.protocol;
-
-public interface ConversationContext<T> {
-
- void sendToWire(T msg);
-
- void fireConnected();
+import org.apache.plc4x.java.api.messages.PlcResponse;
+public interface PlcProprietaryResponse<T> extends PlcResponse {
+ T getResponse();
}
diff --git a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/PlcProprietarySender.java
similarity index 77%
copy from sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
copy to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/PlcProprietarySender.java
index cfded02..8adc0e0 100644
--- a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/PlcProprietarySender.java
@@ -16,13 +16,10 @@
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.plc4x.java.spi.messages;
-package org.apache.plc4x.java.s7.readwrite.protocol;
-
-public interface ConversationContext<T> {
-
- void sendToWire(T msg);
-
- void fireConnected();
+import java.util.concurrent.CompletableFuture;
+public interface PlcProprietarySender {
+ <T> CompletableFuture<PlcProprietaryResponse<T>> send(PlcProprietaryRequest proprietaryRequest);
}
diff --git a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/PlcProtocolMessage.java
similarity index 84%
copy from sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
copy to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/PlcProtocolMessage.java
index cfded02..9a819dd 100644
--- a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/PlcProtocolMessage.java
@@ -16,13 +16,10 @@
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.plc4x.java.spi.messages;
-package org.apache.plc4x.java.s7.readwrite.protocol;
+public interface PlcProtocolMessage {
-public interface ConversationContext<T> {
-
- void sendToWire(T msg);
-
- void fireConnected();
+ PlcProtocolMessage getParent();
}
diff --git a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/PlcRawMessage.java
similarity index 57%
copy from sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
copy to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/PlcRawMessage.java
index cfded02..bd3bf1c 100644
--- a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/PlcRawMessage.java
@@ -16,13 +16,31 @@
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.plc4x.java.spi.messages;
-package org.apache.plc4x.java.s7.readwrite.protocol;
+import io.netty.buffer.ByteBuf;
-public interface ConversationContext<T> {
+public class PlcRawMessage implements PlcProtocolMessage {
- void sendToWire(T msg);
+ private final ByteBuf userData;
+ private final PlcProtocolMessage parent;
- void fireConnected();
+ public PlcRawMessage(ByteBuf userData) {
+ this(userData, null);
+ }
+
+ public PlcRawMessage(ByteBuf userData, PlcProtocolMessage parent) {
+ this.userData = userData;
+ this.parent = parent;
+ }
+
+ public ByteBuf getUserData() {
+ return userData;
+ }
+
+ @Override
+ public PlcProtocolMessage getParent() {
+ return parent;
+ }
}
diff --git a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/PlcReader.java
similarity index 54%
copy from sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
copy to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/PlcReader.java
index cfded02..2753f14 100644
--- a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/PlcReader.java
@@ -16,13 +16,25 @@
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.plc4x.java.spi.messages;
-package org.apache.plc4x.java.s7.readwrite.protocol;
+import org.apache.plc4x.java.api.messages.PlcReadRequest;
+import org.apache.plc4x.java.api.messages.PlcReadResponse;
-public interface ConversationContext<T> {
+import java.util.concurrent.CompletableFuture;
+import java.util.function.Consumer;
- void sendToWire(T msg);
+/**
+ * Interface implemented by all PlcConnections that are able to read from remote resources.
+ */
+public interface PlcReader {
- void fireConnected();
+ /**
+ * Reads a requested value from a PLC.
+ *
+ * @param readRequest object describing the type and location of the value.
+ * @return a {@link CompletableFuture} giving async access to the returned value.
+ */
+ CompletableFuture<PlcReadResponse> read(PlcReadRequest readRequest);
}
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/PlcRequestContainer.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/PlcRequestContainer.java
similarity index 67%
rename from plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/PlcRequestContainer.java
rename to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/PlcRequestContainer.java
index f378678..481ca1c 100644
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/PlcRequestContainer.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/PlcRequestContainer.java
@@ -1,22 +1,22 @@
/*
- 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.
+ * 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.base.messages;
+package org.apache.plc4x.java.spi.messages;
import java.util.Objects;
import java.util.concurrent.CompletableFuture;
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/PlcSubscriber.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/PlcSubscriber.java
similarity index 66%
rename from plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/PlcSubscriber.java
rename to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/PlcSubscriber.java
index 8d7eedb..da8aead 100644
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/PlcSubscriber.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/PlcSubscriber.java
@@ -1,22 +1,22 @@
/*
- 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.
+ * 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.base.messages;
+package org.apache.plc4x.java.spi.messages;
import org.apache.plc4x.java.api.messages.*;
import org.apache.plc4x.java.api.model.PlcConsumerRegistration;
diff --git a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/PlcWriter.java
similarity index 53%
copy from sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
copy to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/PlcWriter.java
index cfded02..2bd28b6 100644
--- a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/PlcWriter.java
@@ -16,13 +16,25 @@
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.plc4x.java.spi.messages;
-package org.apache.plc4x.java.s7.readwrite.protocol;
+import org.apache.plc4x.java.api.messages.PlcWriteRequest;
+import org.apache.plc4x.java.api.messages.PlcWriteResponse;
-public interface ConversationContext<T> {
+import java.util.concurrent.CompletableFuture;
+import java.util.function.Consumer;
- void sendToWire(T msg);
+/**
+ * Interface implemented by all PlcConnections that are able to write to remote resources.
+ */
+public interface PlcWriter {
- void fireConnected();
+ /**
+ * Writes a given value to a PLC.
+ *
+ * @param writeRequest object describing the type, location and value that whould be written.
+ * @return a {@link CompletableFuture} giving async access to the response of the write operation.
+ */
+ CompletableFuture<PlcWriteResponse> write(PlcWriteRequest writeRequest);
}
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/items/BaseDefaultFieldItem.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/items/BaseDefaultFieldItem.java
similarity index 83%
rename from plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/items/BaseDefaultFieldItem.java
rename to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/items/BaseDefaultFieldItem.java
index 4abcda5..a078246 100644
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/items/BaseDefaultFieldItem.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/items/BaseDefaultFieldItem.java
@@ -1,22 +1,22 @@
/*
-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.base.messages.items;
+ * 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.spi.messages.items;
import org.apache.plc4x.java.api.exceptions.PlcFieldRangeException;
import org.apache.plc4x.java.api.exceptions.PlcIncompatibleDatatypeException;
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/items/DefaultBigDecimalFieldItem.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/items/DefaultBigDecimalFieldItem.java
similarity index 84%
rename from plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/items/DefaultBigDecimalFieldItem.java
rename to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/items/DefaultBigDecimalFieldItem.java
index c78bd05..78cf35d 100644
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/items/DefaultBigDecimalFieldItem.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/items/DefaultBigDecimalFieldItem.java
@@ -1,22 +1,22 @@
/*
-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.base.messages.items;
+ * 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.spi.messages.items;
import org.apache.plc4x.java.api.exceptions.PlcIncompatibleDatatypeException;
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/items/DefaultBigIntegerFieldItem.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/items/DefaultBigIntegerFieldItem.java
similarity index 84%
rename from plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/items/DefaultBigIntegerFieldItem.java
rename to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/items/DefaultBigIntegerFieldItem.java
index 9810d0e..603255c 100644
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/items/DefaultBigIntegerFieldItem.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/items/DefaultBigIntegerFieldItem.java
@@ -1,22 +1,22 @@
/*
-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.base.messages.items;
+ * 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.spi.messages.items;
import org.apache.plc4x.java.api.exceptions.PlcIncompatibleDatatypeException;
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/items/DefaultBooleanFieldItem.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/items/DefaultBooleanFieldItem.java
similarity index 84%
rename from plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/items/DefaultBooleanFieldItem.java
rename to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/items/DefaultBooleanFieldItem.java
index e32133d..b63be6b 100644
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/items/DefaultBooleanFieldItem.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/items/DefaultBooleanFieldItem.java
@@ -1,22 +1,22 @@
/*
-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.base.messages.items;
+ * 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.spi.messages.items;
import org.apache.plc4x.java.api.exceptions.PlcIncompatibleDatatypeException;
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/items/DefaultByteArrayFieldItem.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/items/DefaultByteArrayFieldItem.java
similarity index 55%
rename from plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/items/DefaultByteArrayFieldItem.java
rename to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/items/DefaultByteArrayFieldItem.java
index 6d35b0b..551b7b1 100644
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/items/DefaultByteArrayFieldItem.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/items/DefaultByteArrayFieldItem.java
@@ -1,22 +1,22 @@
/*
-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.base.messages.items;
+ * 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.spi.messages.items;
import org.apache.plc4x.java.api.exceptions.PlcIncompatibleDatatypeException;
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/items/DefaultByteFieldItem.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/items/DefaultByteFieldItem.java
similarity index 79%
rename from plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/items/DefaultByteFieldItem.java
rename to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/items/DefaultByteFieldItem.java
index 6e00e83..70f18c1 100644
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/items/DefaultByteFieldItem.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/items/DefaultByteFieldItem.java
@@ -1,22 +1,22 @@
/*
-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.base.messages.items;
+ * 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.spi.messages.items;
import org.apache.plc4x.java.api.exceptions.PlcIncompatibleDatatypeException;
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/items/DefaultDoubleFieldItem.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/items/DefaultDoubleFieldItem.java
similarity index 81%
rename from plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/items/DefaultDoubleFieldItem.java
rename to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/items/DefaultDoubleFieldItem.java
index a3fe810..be5f891 100644
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/items/DefaultDoubleFieldItem.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/items/DefaultDoubleFieldItem.java
@@ -1,22 +1,22 @@
/*
-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.base.messages.items;
+ * 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.spi.messages.items;
import org.apache.plc4x.java.api.exceptions.PlcIncompatibleDatatypeException;
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/items/DefaultFloatFieldItem.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/items/DefaultFloatFieldItem.java
similarity index 81%
rename from plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/items/DefaultFloatFieldItem.java
rename to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/items/DefaultFloatFieldItem.java
index 5e1f2b5..0611c52 100644
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/items/DefaultFloatFieldItem.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/items/DefaultFloatFieldItem.java
@@ -1,22 +1,22 @@
/*
-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.base.messages.items;
+ * 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.spi.messages.items;
import org.apache.plc4x.java.api.exceptions.PlcIncompatibleDatatypeException;
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/items/DefaultIntegerFieldItem.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/items/DefaultIntegerFieldItem.java
similarity index 80%
rename from plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/items/DefaultIntegerFieldItem.java
rename to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/items/DefaultIntegerFieldItem.java
index f998a7b..a18ca25 100644
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/items/DefaultIntegerFieldItem.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/items/DefaultIntegerFieldItem.java
@@ -1,22 +1,22 @@
/*
-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.base.messages.items;
+ * 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.spi.messages.items;
import org.apache.plc4x.java.api.exceptions.PlcIncompatibleDatatypeException;
diff --git a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/Plc4xProtocolBase.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/items/DefaultLocalDateFieldItem.java
similarity index 53%
copy from sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/Plc4xProtocolBase.java
copy to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/items/DefaultLocalDateFieldItem.java
index c8d5eb8..2d1dcf7 100644
--- a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/Plc4xProtocolBase.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/items/DefaultLocalDateFieldItem.java
@@ -16,29 +16,35 @@
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.plc4x.java.spi.messages.items;
-package org.apache.plc4x.java.s7.readwrite.protocol;
+import org.apache.plc4x.java.api.exceptions.PlcIncompatibleDatatypeException;
-import org.apache.plc4x.java.base.messages.PlcRequestContainer;
+import java.time.LocalDate;
-public abstract class Plc4xProtocolBase<T> {
+public class DefaultLocalDateFieldItem extends BaseDefaultFieldItem<LocalDate> {
- protected final Plc4xNettyWrapper<T> context;
-
- public Plc4xProtocolBase(Class<T> clazz) {
- // TODO create here?
- this.context = new Plc4xNettyWrapper<T>(this, clazz);
+ public DefaultLocalDateFieldItem(LocalDate... values) {
+ super(values);
}
- public Plc4xNettyWrapper<T> getContext() {
- return context;
+ @Override
+ public Object getObject(int index) {
+ return getValue(index);
}
- public void onConnect(ConversationContext<T> context) {
- // Intentionally do nothing here
+ @Override
+ public boolean isValidDate(int index) {
+ return getValue(index) != null;
}
- protected abstract void encode(ConversationContext<T> context, PlcRequestContainer msg) throws Exception;
+ @Override
+ public LocalDate getDate(int index) {
+ if (!isValidDate(index)) {
+ throw new PlcIncompatibleDatatypeException(LocalDate.class, index);
+ }
+ return getValue(index);
+ }
- protected abstract void decode(ConversationContext<T> context, T msg) throws Exception;
}
+
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/items/DefaultLocalDateTimeFieldItem.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/items/DefaultLocalDateTimeFieldItem.java
similarity index 63%
rename from plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/items/DefaultLocalDateTimeFieldItem.java
rename to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/items/DefaultLocalDateTimeFieldItem.java
index 39eee66..35f9576 100644
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/items/DefaultLocalDateTimeFieldItem.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/items/DefaultLocalDateTimeFieldItem.java
@@ -1,22 +1,22 @@
/*
-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.base.messages.items;
+ * 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.spi.messages.items;
import org.apache.plc4x.java.api.exceptions.PlcIncompatibleDatatypeException;
diff --git a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/Plc4xProtocolBase.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/items/DefaultLocalTimeFieldItem.java
similarity index 53%
rename from sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/Plc4xProtocolBase.java
rename to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/items/DefaultLocalTimeFieldItem.java
index c8d5eb8..4083702 100644
--- a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/Plc4xProtocolBase.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/items/DefaultLocalTimeFieldItem.java
@@ -16,29 +16,35 @@
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.plc4x.java.spi.messages.items;
-package org.apache.plc4x.java.s7.readwrite.protocol;
+import org.apache.plc4x.java.api.exceptions.PlcIncompatibleDatatypeException;
-import org.apache.plc4x.java.base.messages.PlcRequestContainer;
+import java.time.LocalTime;
-public abstract class Plc4xProtocolBase<T> {
+public class DefaultLocalTimeFieldItem extends BaseDefaultFieldItem<LocalTime> {
- protected final Plc4xNettyWrapper<T> context;
-
- public Plc4xProtocolBase(Class<T> clazz) {
- // TODO create here?
- this.context = new Plc4xNettyWrapper<T>(this, clazz);
+ public DefaultLocalTimeFieldItem(LocalTime... values) {
+ super(values);
}
- public Plc4xNettyWrapper<T> getContext() {
- return context;
+ @Override
+ public Object getObject(int index) {
+ return getValue(index);
}
- public void onConnect(ConversationContext<T> context) {
- // Intentionally do nothing here
+ @Override
+ public boolean isValidTime(int index) {
+ return getValue(index) != null;
}
- protected abstract void encode(ConversationContext<T> context, PlcRequestContainer msg) throws Exception;
+ @Override
+ public LocalTime getTime(int index) {
+ if (!isValidTime(index)) {
+ throw new PlcIncompatibleDatatypeException(LocalTime.class, index);
+ }
+ return getValue(index);
+ }
- protected abstract void decode(ConversationContext<T> context, T msg) throws Exception;
}
+
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/items/DefaultLongFieldItem.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/items/DefaultLongFieldItem.java
similarity index 80%
rename from plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/items/DefaultLongFieldItem.java
rename to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/items/DefaultLongFieldItem.java
index 67ada38..cb1ec43 100644
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/items/DefaultLongFieldItem.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/items/DefaultLongFieldItem.java
@@ -1,22 +1,22 @@
/*
-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.base.messages.items;
+ * 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.spi.messages.items;
import org.apache.plc4x.java.api.exceptions.PlcIncompatibleDatatypeException;
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/items/DefaultShortFieldItem.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/items/DefaultShortFieldItem.java
similarity index 80%
rename from plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/items/DefaultShortFieldItem.java
rename to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/items/DefaultShortFieldItem.java
index 87ed5a6..584f6a8 100644
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/messages/items/DefaultShortFieldItem.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/items/DefaultShortFieldItem.java
@@ -1,22 +1,22 @@
/*
-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.base.messages.items;
+ * 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.spi.messages.items;
import org.apache.plc4x.java.api.exceptions.PlcIncompatibleDatatypeException;
diff --git a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/items/DefaultStringFieldItem.java
similarity index 53%
copy from sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
copy to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/items/DefaultStringFieldItem.java
index cfded02..6e15df4 100644
--- a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/messages/items/DefaultStringFieldItem.java
@@ -16,13 +16,33 @@
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.plc4x.java.spi.messages.items;
-package org.apache.plc4x.java.s7.readwrite.protocol;
+import org.apache.plc4x.java.api.exceptions.PlcIncompatibleDatatypeException;
-public interface ConversationContext<T> {
+public class DefaultStringFieldItem extends BaseDefaultFieldItem<String> {
- void sendToWire(T msg);
+ public DefaultStringFieldItem(String... values) {
+ super(values);
+ }
- void fireConnected();
+ @Override
+ public Object getObject(int index) {
+ return getValue(index);
+ }
+
+ @Override
+ public boolean isValidString(int index) {
+ return getValue(index) != null;
+ }
+
+ @Override
+ public String getString(int index) {
+ if (!isValidString(index)) {
+ throw new PlcIncompatibleDatatypeException(String.class, index);
+ }
+ return getValue(index);
+ }
}
+
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/model/DefaultPlcConsumerRegistration.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/model/DefaultPlcConsumerRegistration.java
similarity index 67%
rename from plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/model/DefaultPlcConsumerRegistration.java
rename to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/model/DefaultPlcConsumerRegistration.java
index dfcef84..bcf7830 100644
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/model/DefaultPlcConsumerRegistration.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/model/DefaultPlcConsumerRegistration.java
@@ -1,25 +1,25 @@
/*
- 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.
+ * 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.base.model;
+package org.apache.plc4x.java.spi.model;
import org.apache.plc4x.java.api.messages.PlcSubscriptionEvent;
-import org.apache.plc4x.java.base.messages.PlcSubscriber;
+import org.apache.plc4x.java.spi.messages.PlcSubscriber;
import java.util.Arrays;
import java.util.Collection;
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/model/DefaultPlcSubscriptionHandle.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/model/DefaultPlcSubscriptionHandle.java
similarity index 58%
rename from plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/model/DefaultPlcSubscriptionHandle.java
rename to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/model/DefaultPlcSubscriptionHandle.java
index 0d7d01f..9d4a01b 100644
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/model/DefaultPlcSubscriptionHandle.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/model/DefaultPlcSubscriptionHandle.java
@@ -1,27 +1,27 @@
/*
- 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.
+ * 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.base.model;
+package org.apache.plc4x.java.spi.model;
import org.apache.plc4x.java.api.messages.PlcSubscriptionEvent;
import org.apache.plc4x.java.api.model.PlcConsumerRegistration;
-import org.apache.plc4x.java.base.messages.PlcSubscriber;
+import org.apache.plc4x.java.spi.messages.PlcSubscriber;
import java.util.Collections;
import java.util.function.Consumer;
diff --git a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/model/InternalPlcConsumerRegistration.java
similarity index 66%
copy from sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
copy to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/model/InternalPlcConsumerRegistration.java
index cfded02..34cb0ef 100644
--- a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/model/InternalPlcConsumerRegistration.java
@@ -16,13 +16,17 @@
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.plc4x.java.spi.model;
-package org.apache.plc4x.java.s7.readwrite.protocol;
+import org.apache.plc4x.java.api.model.PlcConsumerRegistration;
+import org.apache.plc4x.java.spi.messages.InternalPlcMessage;
-public interface ConversationContext<T> {
+import java.util.Collection;
- void sendToWire(T msg);
+public interface InternalPlcConsumerRegistration extends PlcConsumerRegistration, InternalPlcMessage {
- void fireConnected();
+ int getConsumerHash();
+
+ Collection<? extends InternalPlcSubscriptionHandle> getAssociatedHandles();
}
diff --git a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/model/InternalPlcSubscriptionHandle.java
similarity index 75%
rename from sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
rename to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/model/InternalPlcSubscriptionHandle.java
index cfded02..33d4dd0 100644
--- a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/ConversationContext.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/model/InternalPlcSubscriptionHandle.java
@@ -16,13 +16,10 @@
* specific language governing permissions and limitations
* under the License.
*/
+package org.apache.plc4x.java.spi.model;
-package org.apache.plc4x.java.s7.readwrite.protocol;
-
-public interface ConversationContext<T> {
-
- void sendToWire(T msg);
-
- void fireConnected();
+import org.apache.plc4x.java.api.model.PlcSubscriptionHandle;
+import org.apache.plc4x.java.spi.messages.InternalPlcMessage;
+public interface InternalPlcSubscriptionHandle extends PlcSubscriptionHandle, InternalPlcMessage {
}
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/model/SubscriptionPlcField.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/model/SubscriptionPlcField.java
similarity index 52%
rename from plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/model/SubscriptionPlcField.java
rename to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/model/SubscriptionPlcField.java
index e68e4c8..2116064 100644
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/model/SubscriptionPlcField.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/model/SubscriptionPlcField.java
@@ -1,22 +1,22 @@
/*
- 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.
+ * 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.base.model;
+package org.apache.plc4x.java.spi.model;
import org.apache.plc4x.java.api.model.PlcField;
import org.apache.plc4x.java.api.types.PlcSubscriptionType;
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/protocol/SingleItemToSingleRequestProtocol.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/protocol/SingleItemToSingleRequestProtocol.java
similarity index 92%
rename from plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/protocol/SingleItemToSingleRequestProtocol.java
rename to plc4j/spi/src/main/java/org/apache/plc4x/java/spi/protocol/SingleItemToSingleRequestProtocol.java
index 3481544..e49d537 100644
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/protocol/SingleItemToSingleRequestProtocol.java
+++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/protocol/SingleItemToSingleRequestProtocol.java
@@ -1,22 +1,22 @@
/*
- 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.
+ * 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.base.protocol;
+package org.apache.plc4x.java.spi.protocol;
import io.netty.channel.*;
import io.netty.util.Timeout;
@@ -30,10 +30,31 @@ import org.apache.plc4x.java.api.exceptions.PlcTimeoutException;
import org.apache.plc4x.java.api.model.PlcField;
import org.apache.plc4x.java.api.model.PlcSubscriptionHandle;
import org.apache.plc4x.java.api.types.PlcResponseCode;
-import org.apache.plc4x.java.base.messages.*;
-import org.apache.plc4x.java.base.messages.items.BaseDefaultFieldItem;
-import org.apache.plc4x.java.base.model.InternalPlcSubscriptionHandle;
-import org.apache.plc4x.java.base.model.SubscriptionPlcField;
+import org.apache.plc4x.java.spi.messages.DefaultPlcReadRequest;
+import org.apache.plc4x.java.spi.messages.DefaultPlcReadResponse;
+import org.apache.plc4x.java.spi.messages.DefaultPlcSubscriptionRequest;
+import org.apache.plc4x.java.spi.messages.DefaultPlcSubscriptionResponse;
+import org.apache.plc4x.java.spi.messages.DefaultPlcUnsubscriptionRequest;
+import org.apache.plc4x.java.spi.messages.DefaultPlcUnsubscriptionResponse;
+import org.apache.plc4x.java.spi.messages.DefaultPlcWriteRequest;
+import org.apache.plc4x.java.spi.messages.DefaultPlcWriteResponse;
+import org.apache.plc4x.java.spi.messages.InternalPlcFieldRequest;
+import org.apache.plc4x.java.spi.messages.InternalPlcReadRequest;
+import org.apache.plc4x.java.spi.messages.InternalPlcReadResponse;
+import org.apache.plc4x.java.spi.messages.InternalPlcRequest;
+import org.apache.plc4x.java.spi.messages.InternalPlcResponse;
+import org.apache.plc4x.java.spi.messages.InternalPlcSubscriptionRequest;
+import org.apache.plc4x.java.spi.messages.InternalPlcSubscriptionResponse;
+import org.apache.plc4x.java.spi.messages.InternalPlcUnsubscriptionRequest;
+import org.apache.plc4x.java.spi.messages.InternalPlcWriteRequest;
+import org.apache.plc4x.java.spi.messages.InternalPlcWriteResponse;
+import org.apache.plc4x.java.spi.messages.PlcReader;
+import org.apache.plc4x.java.spi.messages.PlcRequestContainer;
+import org.apache.plc4x.java.spi.messages.PlcSubscriber;
+import org.apache.plc4x.java.spi.messages.PlcWriter;
+import org.apache.plc4x.java.spi.messages.items.BaseDefaultFieldItem;
+import org.apache.plc4x.java.spi.model.InternalPlcSubscriptionHandle;
+import org.apache.plc4x.java.spi.model.SubscriptionPlcField;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/plc4j/utils/connection-pool/src/test/java/org/apache/plc4x/java/utils/connectionpool/PooledDummyDriver.java b/plc4j/utils/connection-pool/src/test/java/org/apache/plc4x/java/utils/connectionpool/PooledDummyDriver.java
index 336379d..fd6962d 100644
--- a/plc4j/utils/connection-pool/src/test/java/org/apache/plc4x/java/utils/connectionpool/PooledDummyDriver.java
+++ b/plc4j/utils/connection-pool/src/test/java/org/apache/plc4x/java/utils/connectionpool/PooledDummyDriver.java
@@ -20,7 +20,7 @@ package org.apache.plc4x.java.utils.connectionpool;
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.spi.PlcDriver;
+import org.apache.plc4x.java.api.PlcDriver;
import static org.mockito.Mockito.RETURNS_DEEP_STUBS;
import static org.mockito.Mockito.mock;
diff --git a/plc4j/utils/connection-pool/src/test/java/org/apache/plc4x/java/utils/connectionpool/PooledPlcDriverManagerTest.java b/plc4j/utils/connection-pool/src/test/java/org/apache/plc4x/java/utils/connectionpool/PooledPlcDriverManagerTest.java
index 5103012..a400ee8 100644
--- a/plc4j/utils/connection-pool/src/test/java/org/apache/plc4x/java/utils/connectionpool/PooledPlcDriverManagerTest.java
+++ b/plc4j/utils/connection-pool/src/test/java/org/apache/plc4x/java/utils/connectionpool/PooledPlcDriverManagerTest.java
@@ -30,7 +30,7 @@ import org.apache.plc4x.java.api.messages.PlcSubscriptionRequest;
import org.apache.plc4x.java.api.messages.PlcUnsubscriptionRequest;
import org.apache.plc4x.java.api.messages.PlcWriteRequest;
import org.apache.plc4x.java.api.metadata.PlcConnectionMetadata;
-import org.apache.plc4x.java.spi.PlcDriver;
+import org.apache.plc4x.java.api.PlcDriver;
import org.assertj.core.api.WithAssertions;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
diff --git a/plc4j/utils/connection-pool/src/test/resources/META-INF/services/org.apache.plc4x.java.spi.PlcDriver b/plc4j/utils/connection-pool/src/test/resources/META-INF/services/org.apache.plc4x.java.api.PlcDriver
similarity index 100%
rename from plc4j/utils/connection-pool/src/test/resources/META-INF/services/org.apache.plc4x.java.spi.PlcDriver
rename to plc4j/utils/connection-pool/src/test/resources/META-INF/services/org.apache.plc4x.java.api.PlcDriver
diff --git a/plc4j/utils/driver-base-java/pom.xml b/plc4j/utils/driver-base-java/pom.xml
index 2adef47..1212f2c 100644
--- a/plc4j/utils/driver-base-java/pom.xml
+++ b/plc4j/utils/driver-base-java/pom.xml
@@ -37,6 +37,20 @@
<groupId>com.github.jinahya</groupId>
<artifactId>bit-io</artifactId>
</dependency>
+ <dependency>
+ <groupId>io.netty</groupId>
+ <artifactId>netty-transport</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.plc4x</groupId>
+ <artifactId>plc4j-spi</artifactId>
+ <version>0.6.0-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>commons-codec</groupId>
+ <artifactId>commons-codec</artifactId>
+ </dependency>
</dependencies>
</project>
\ No newline at end of file
diff --git a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/GeneratedDriverByteToMessageCodec.java b/plc4j/utils/driver-base-java/src/main/java/org/apache/plc4x/java/spi/GeneratedDriverByteToMessageCodec.java
similarity index 73%
rename from plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/GeneratedDriverByteToMessageCodec.java
rename to plc4j/utils/driver-base-java/src/main/java/org/apache/plc4x/java/spi/GeneratedDriverByteToMessageCodec.java
index ba45b59..7282609 100644
--- a/plc4j/protocols/driver-bases/base/src/main/java/org/apache/plc4x/java/base/GeneratedDriverByteToMessageCodec.java
+++ b/plc4j/utils/driver-base-java/src/main/java/org/apache/plc4x/java/spi/GeneratedDriverByteToMessageCodec.java
@@ -1,22 +1,22 @@
/*
-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.base;
+ * 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.spi;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
diff --git a/plc4j/utils/opm/src/test/java/org/apache/plc4x/java/opm/PlcEntityManagerComplexTest.java b/plc4j/utils/opm/src/test/java/org/apache/plc4x/java/opm/PlcEntityManagerComplexTest.java
index 1a310e1..7562fb4 100644
--- a/plc4j/utils/opm/src/test/java/org/apache/plc4x/java/opm/PlcEntityManagerComplexTest.java
+++ b/plc4j/utils/opm/src/test/java/org/apache/plc4x/java/opm/PlcEntityManagerComplexTest.java
@@ -28,8 +28,6 @@ import org.apache.plc4x.java.api.exceptions.PlcInvalidFieldException;
import org.apache.plc4x.java.api.metadata.PlcConnectionMetadata;
import org.apache.plc4x.java.api.types.PlcResponseCode;
import org.apache.plc4x.java.base.connection.PlcFieldHandler;
-import org.apache.plc4x.java.base.messages.*;
-import org.apache.plc4x.java.base.messages.items.*;
import org.assertj.core.api.WithAssertions;
import org.junit.Assert;
import org.junit.jupiter.api.Test;
diff --git a/plc4j/utils/scraper/src/main/java/org/apache/plc4x/java/scraper/triggeredscraper/TriggeredScraperImpl.java b/plc4j/utils/scraper/src/main/java/org/apache/plc4x/java/scraper/triggeredscraper/TriggeredScraperImpl.java
index 7120369..6ee4bb5 100644
--- a/plc4j/utils/scraper/src/main/java/org/apache/plc4x/java/scraper/triggeredscraper/TriggeredScraperImpl.java
+++ b/plc4j/utils/scraper/src/main/java/org/apache/plc4x/java/scraper/triggeredscraper/TriggeredScraperImpl.java
@@ -37,13 +37,12 @@ import org.apache.plc4x.java.scraper.exception.ScraperException;
import org.apache.plc4x.java.scraper.config.triggeredscraper.ScraperConfigurationTriggeredImpl;
import org.apache.plc4x.java.scraper.triggeredscraper.triggerhandler.collector.TriggerCollector;
import org.apache.plc4x.java.scraper.util.PercentageAboveThreshold;
-import org.apache.plc4x.java.spi.PlcDriver;
+import org.apache.plc4x.java.api.PlcDriver;
import org.apache.plc4x.java.utils.connectionpool.PooledPlcDriverManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.management.*;
-import java.lang.management.ManagementFactory;
import java.util.List;
import java.util.Locale;
import java.util.Map;
diff --git a/sandbox/test-java-amsads-driver/src/main/java/org/apache/plc4x/java/amsads/AMSADSPlcDriver.java b/sandbox/test-java-amsads-driver/src/main/java/org/apache/plc4x/java/amsads/AMSADSPlcDriver.java
index b8d0d3a..a9325b3 100644
--- a/sandbox/test-java-amsads-driver/src/main/java/org/apache/plc4x/java/amsads/AMSADSPlcDriver.java
+++ b/sandbox/test-java-amsads-driver/src/main/java/org/apache/plc4x/java/amsads/AMSADSPlcDriver.java
@@ -25,7 +25,7 @@ import org.apache.plc4x.java.amsads.readwrite.AmsNetId;
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.spi.PlcDriver;
+import org.apache.plc4x.java.api.PlcDriver;
import java.net.InetAddress;
import java.net.UnknownHostException;
diff --git a/sandbox/test-java-amsads-driver/src/main/java/org/apache/plc4x/java/amsads/connection/AdsAbstractPlcConnection.java b/sandbox/test-java-amsads-driver/src/main/java/org/apache/plc4x/java/amsads/connection/AdsAbstractPlcConnection.java
index 0974bf2..f9e835e 100644
--- a/sandbox/test-java-amsads-driver/src/main/java/org/apache/plc4x/java/amsads/connection/AdsAbstractPlcConnection.java
+++ b/sandbox/test-java-amsads-driver/src/main/java/org/apache/plc4x/java/amsads/connection/AdsAbstractPlcConnection.java
@@ -30,7 +30,6 @@ import org.apache.plc4x.java.api.exceptions.PlcRuntimeException;
import org.apache.plc4x.java.api.messages.*;
import org.apache.plc4x.java.base.connection.ChannelFactory;
import org.apache.plc4x.java.base.connection.NettyPlcConnection;
-import org.apache.plc4x.java.base.messages.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/sandbox/test-java-amsads-driver/src/main/java/org/apache/plc4x/java/amsads/connection/AdsTcpPlcConnection.java b/sandbox/test-java-amsads-driver/src/main/java/org/apache/plc4x/java/amsads/connection/AdsTcpPlcConnection.java
index 008999a..b8db110 100644
--- a/sandbox/test-java-amsads-driver/src/main/java/org/apache/plc4x/java/amsads/connection/AdsTcpPlcConnection.java
+++ b/sandbox/test-java-amsads-driver/src/main/java/org/apache/plc4x/java/amsads/connection/AdsTcpPlcConnection.java
@@ -36,7 +36,6 @@ import org.apache.plc4x.java.api.model.PlcConsumerRegistration;
import org.apache.plc4x.java.api.model.PlcField;
import org.apache.plc4x.java.api.model.PlcSubscriptionHandle;
import org.apache.plc4x.java.api.types.PlcResponseCode;
-import org.apache.plc4x.java.base.messages.*;
import org.apache.plc4x.java.base.messages.items.BaseDefaultFieldItem;
import org.apache.plc4x.java.base.model.DefaultPlcConsumerRegistration;
import org.apache.plc4x.java.base.model.InternalPlcConsumerRegistration;
diff --git a/sandbox/test-java-amsads-driver/src/main/java/org/apache/plc4x/java/amsads/model/AdsPlcFieldHandler.java b/sandbox/test-java-amsads-driver/src/main/java/org/apache/plc4x/java/amsads/model/AdsPlcFieldHandler.java
index 6c8e060..bfe2ec5 100644
--- a/sandbox/test-java-amsads-driver/src/main/java/org/apache/plc4x/java/amsads/model/AdsPlcFieldHandler.java
+++ b/sandbox/test-java-amsads-driver/src/main/java/org/apache/plc4x/java/amsads/model/AdsPlcFieldHandler.java
@@ -22,7 +22,6 @@ import org.apache.plc4x.java.api.exceptions.PlcInvalidFieldException;
import org.apache.plc4x.java.api.exceptions.PlcRuntimeException;
import org.apache.plc4x.java.api.model.PlcField;
import org.apache.plc4x.java.base.connection.DefaultPlcFieldHandler;
-import org.apache.plc4x.java.base.messages.items.*;
import java.math.BigDecimal;
import java.math.BigInteger;
diff --git a/sandbox/test-java-amsads-driver/src/main/java/org/apache/plc4x/java/amsads/protocol/Plc4x2AdsProtocol.java b/sandbox/test-java-amsads-driver/src/main/java/org/apache/plc4x/java/amsads/protocol/Plc4x2AdsProtocol.java
index 3c2331b..8757648 100644
--- a/sandbox/test-java-amsads-driver/src/main/java/org/apache/plc4x/java/amsads/protocol/Plc4x2AdsProtocol.java
+++ b/sandbox/test-java-amsads-driver/src/main/java/org/apache/plc4x/java/amsads/protocol/Plc4x2AdsProtocol.java
@@ -37,7 +37,6 @@ import org.apache.plc4x.java.api.messages.PlcRequest;
import org.apache.plc4x.java.api.messages.PlcWriteRequest;
import org.apache.plc4x.java.api.model.PlcField;
import org.apache.plc4x.java.api.types.PlcResponseCode;
-import org.apache.plc4x.java.base.messages.*;
import org.apache.plc4x.java.base.messages.items.BaseDefaultFieldItem;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/sandbox/test-java-amsads-driver/src/main/java/org/apache/plc4x/java/amsads/protocol/util/LittleEndianDecoder.java b/sandbox/test-java-amsads-driver/src/main/java/org/apache/plc4x/java/amsads/protocol/util/LittleEndianDecoder.java
index a530ca2..71a99e2 100644
--- a/sandbox/test-java-amsads-driver/src/main/java/org/apache/plc4x/java/amsads/protocol/util/LittleEndianDecoder.java
+++ b/sandbox/test-java-amsads-driver/src/main/java/org/apache/plc4x/java/amsads/protocol/util/LittleEndianDecoder.java
@@ -24,7 +24,6 @@ import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.NotImplementedException;
import org.apache.plc4x.java.amsads.model.AdsDataType;
import org.apache.plc4x.java.api.exceptions.PlcUnsupportedDataTypeException;
-import org.apache.plc4x.java.base.messages.items.*;
import java.io.ByteArrayOutputStream;
import java.math.BigInteger;
diff --git a/sandbox/test-java-amsads-driver/src/main/resources/META-INF/services/org.apache.plc4x.java.spi.PlcDriver b/sandbox/test-java-amsads-driver/src/main/resources/META-INF/services/org.apache.plc4x.java.api.PlcDriver
similarity index 100%
rename from sandbox/test-java-amsads-driver/src/main/resources/META-INF/services/org.apache.plc4x.java.spi.PlcDriver
rename to sandbox/test-java-amsads-driver/src/main/resources/META-INF/services/org.apache.plc4x.java.api.PlcDriver
diff --git a/sandbox/test-java-bacnetip-driver/src/main/java/org/apache/plc4x/java/bacnetip/PassiveBacNetIpDriver.java b/sandbox/test-java-bacnetip-driver/src/main/java/org/apache/plc4x/java/bacnetip/PassiveBacNetIpDriver.java
index 028972c..5feaf85 100644
--- a/sandbox/test-java-bacnetip-driver/src/main/java/org/apache/plc4x/java/bacnetip/PassiveBacNetIpDriver.java
+++ b/sandbox/test-java-bacnetip-driver/src/main/java/org/apache/plc4x/java/bacnetip/PassiveBacNetIpDriver.java
@@ -23,7 +23,7 @@ import org.apache.plc4x.java.api.authentication.PlcAuthentication;
import org.apache.plc4x.java.api.exceptions.PlcConnectionException;
import org.apache.plc4x.java.bacnetip.connection.PassiveBacNetIpPlcConnection;
import org.apache.plc4x.java.bacnetip.protocol.HelloWorldProtocol;
-import org.apache.plc4x.java.spi.PlcDriver;
+import org.apache.plc4x.java.api.PlcDriver;
import org.apache.plc4x.java.utils.rawsockets.netty.RawSocketIpAddress;
import java.util.regex.Matcher;
diff --git a/sandbox/test-java-bacnetip-driver/src/main/java/org/apache/plc4x/java/bacnetip/connection/PassiveBacNetIpPlcConnection.java b/sandbox/test-java-bacnetip-driver/src/main/java/org/apache/plc4x/java/bacnetip/connection/PassiveBacNetIpPlcConnection.java
index 38d8f93..3c7ab5c 100644
--- a/sandbox/test-java-bacnetip-driver/src/main/java/org/apache/plc4x/java/bacnetip/connection/PassiveBacNetIpPlcConnection.java
+++ b/sandbox/test-java-bacnetip-driver/src/main/java/org/apache/plc4x/java/bacnetip/connection/PassiveBacNetIpPlcConnection.java
@@ -25,13 +25,11 @@ import org.apache.plc4x.java.api.messages.PlcReadResponse;
import org.apache.plc4x.java.api.model.PlcField;
import org.apache.plc4x.java.bacnetip.model.BacNetIpField;
import org.apache.plc4x.java.bacnetip.protocol.BacNetIpProtocol;
-import org.apache.plc4x.java.bacnetip.protocol.HelloWorldProtocol;
import org.apache.plc4x.java.base.connection.ChannelFactory;
import org.apache.plc4x.java.base.connection.NettyPlcConnection;
import org.apache.plc4x.java.base.connection.RawSocketChannelFactory;
import org.apache.plc4x.java.base.events.ConnectEvent;
import org.apache.plc4x.java.base.events.ConnectedEvent;
-import org.apache.plc4x.java.base.messages.*;
import org.apache.plc4x.java.utils.rawsockets.netty.RawSocketAddress;
import org.apache.plc4x.java.utils.rawsockets.netty.RawSocketIpAddress;
import org.apache.plc4x.java.utils.rawsockets.netty.UdpIpPacketHandler;
diff --git a/sandbox/test-java-bacnetip-driver/src/main/resources/META-INF/services/org.apache.plc4x.java.spi.PlcDriver b/sandbox/test-java-bacnetip-driver/src/main/resources/META-INF/services/org.apache.plc4x.java.api.PlcDriver
similarity index 100%
rename from sandbox/test-java-bacnetip-driver/src/main/resources/META-INF/services/org.apache.plc4x.java.spi.PlcDriver
rename to sandbox/test-java-bacnetip-driver/src/main/resources/META-INF/services/org.apache.plc4x.java.api.PlcDriver
diff --git a/sandbox/test-java-df1-driver/src/main/java/org/apache/plc4x/java/df1/DF1PlcDriver.java b/sandbox/test-java-df1-driver/src/main/java/org/apache/plc4x/java/df1/DF1PlcDriver.java
index c21b538..4018624 100644
--- a/sandbox/test-java-df1-driver/src/main/java/org/apache/plc4x/java/df1/DF1PlcDriver.java
+++ b/sandbox/test-java-df1-driver/src/main/java/org/apache/plc4x/java/df1/DF1PlcDriver.java
@@ -23,7 +23,7 @@ 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.df1.connection.SerialDf1Connection;
-import org.apache.plc4x.java.spi.PlcDriver;
+import org.apache.plc4x.java.api.PlcDriver;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
diff --git a/sandbox/test-java-df1-driver/src/main/java/org/apache/plc4x/java/df1/connection/SerialDf1Connection.java b/sandbox/test-java-df1-driver/src/main/java/org/apache/plc4x/java/df1/connection/SerialDf1Connection.java
index 6b738de..a883278 100644
--- a/sandbox/test-java-df1-driver/src/main/java/org/apache/plc4x/java/df1/connection/SerialDf1Connection.java
+++ b/sandbox/test-java-df1-driver/src/main/java/org/apache/plc4x/java/df1/connection/SerialDf1Connection.java
@@ -27,7 +27,6 @@ import org.apache.plc4x.java.api.messages.PlcWriteResponse;
import org.apache.plc4x.java.base.connection.ChannelFactory;
import org.apache.plc4x.java.serial.connection.connection.SerialChannelFactory;
import org.apache.plc4x.java.base.events.ConnectedEvent;
-import org.apache.plc4x.java.base.messages.*;
import org.apache.plc4x.java.df1.protocol.Df1Protocol;
import org.apache.plc4x.java.df1.protocol.Plc4XDf1Protocol;
import org.apache.plc4x.java.df1.util.Df1FieldHandler;
diff --git a/sandbox/test-java-df1-driver/src/main/resources/META-INF/services/org.apache.plc4x.java.spi.PlcDriver b/sandbox/test-java-df1-driver/src/main/resources/META-INF/services/org.apache.plc4x.java.api.PlcDriver
similarity index 100%
rename from sandbox/test-java-df1-driver/src/main/resources/META-INF/services/org.apache.plc4x.java.spi.PlcDriver
rename to sandbox/test-java-df1-driver/src/main/resources/META-INF/services/org.apache.plc4x.java.api.PlcDriver
diff --git a/sandbox/test-java-knxnetip-driver-passive/src/main/java/org/apache/plc4x/java/passive/knxnetip/PassiveKnxNetIpDriver.java b/sandbox/test-java-knxnetip-driver-passive/src/main/java/org/apache/plc4x/java/passive/knxnetip/PassiveKnxNetIpDriver.java
index 28225f9..7e85822 100644
--- a/sandbox/test-java-knxnetip-driver-passive/src/main/java/org/apache/plc4x/java/passive/knxnetip/PassiveKnxNetIpDriver.java
+++ b/sandbox/test-java-knxnetip-driver-passive/src/main/java/org/apache/plc4x/java/passive/knxnetip/PassiveKnxNetIpDriver.java
@@ -23,7 +23,7 @@ import org.apache.plc4x.java.api.authentication.PlcAuthentication;
import org.apache.plc4x.java.api.exceptions.PlcConnectionException;
import org.apache.plc4x.java.passive.knxnetip.connection.PassiveKnxNetIpPlcConnection;
import org.apache.plc4x.java.passive.knxnetip.protocol.HelloWorldProtocol;
-import org.apache.plc4x.java.spi.PlcDriver;
+import org.apache.plc4x.java.api.PlcDriver;
import org.apache.plc4x.java.utils.rawsockets.netty.RawSocketIpAddress;
import java.util.regex.Matcher;
diff --git a/sandbox/test-java-knxnetip-driver-passive/src/main/java/org/apache/plc4x/java/passive/knxnetip/connection/PassiveKnxNetIpPlcConnection.java b/sandbox/test-java-knxnetip-driver-passive/src/main/java/org/apache/plc4x/java/passive/knxnetip/connection/PassiveKnxNetIpPlcConnection.java
index cca1a3c..11f87cd 100644
--- a/sandbox/test-java-knxnetip-driver-passive/src/main/java/org/apache/plc4x/java/passive/knxnetip/connection/PassiveKnxNetIpPlcConnection.java
+++ b/sandbox/test-java-knxnetip-driver-passive/src/main/java/org/apache/plc4x/java/passive/knxnetip/connection/PassiveKnxNetIpPlcConnection.java
@@ -27,7 +27,6 @@ import org.apache.plc4x.java.base.connection.ChannelFactory;
import org.apache.plc4x.java.base.connection.NettyPlcConnection;
import org.apache.plc4x.java.base.connection.RawSocketChannelFactory;
import org.apache.plc4x.java.base.events.ConnectedEvent;
-import org.apache.plc4x.java.base.messages.*;
import org.apache.plc4x.java.passive.knxnetip.model.KnxNetIpField;
import org.apache.plc4x.java.passive.knxnetip.protocol.KnxNetIpProtocol;
import org.apache.plc4x.java.utils.rawsockets.netty.RawSocketAddress;
diff --git a/sandbox/test-java-knxnetip-driver-passive/src/main/resources/META-INF/services/org.apache.plc4x.java.spi.PlcDriver b/sandbox/test-java-knxnetip-driver-passive/src/main/resources/META-INF/services/org.apache.plc4x.java.api.PlcDriver
similarity index 100%
rename from sandbox/test-java-knxnetip-driver-passive/src/main/resources/META-INF/services/org.apache.plc4x.java.spi.PlcDriver
rename to sandbox/test-java-knxnetip-driver-passive/src/main/resources/META-INF/services/org.apache.plc4x.java.api.PlcDriver
diff --git a/sandbox/test-java-knxnetip-driver/src/main/java/org/apache/plc4x/java/knxnetip/KnxNetIpDriver.java b/sandbox/test-java-knxnetip-driver/src/main/java/org/apache/plc4x/java/knxnetip/KnxNetIpDriver.java
index ff90d1a..476d8d7 100644
--- a/sandbox/test-java-knxnetip-driver/src/main/java/org/apache/plc4x/java/knxnetip/KnxNetIpDriver.java
+++ b/sandbox/test-java-knxnetip-driver/src/main/java/org/apache/plc4x/java/knxnetip/KnxNetIpDriver.java
@@ -23,7 +23,7 @@ import org.apache.plc4x.java.api.authentication.PlcAuthentication;
import org.apache.plc4x.java.api.exceptions.PlcConnectionException;
import org.apache.plc4x.java.knxnetip.connection.KnxNetIpConnection;
import org.apache.plc4x.java.knxnetip.protocol.KnxNetIpPlc4xProtocol;
-import org.apache.plc4x.java.spi.PlcDriver;
+import org.apache.plc4x.java.api.PlcDriver;
import java.net.InetAddress;
import java.util.regex.Matcher;
diff --git a/sandbox/test-java-knxnetip-driver/src/main/java/org/apache/plc4x/java/knxnetip/connection/KnxNetIpConnection.java b/sandbox/test-java-knxnetip-driver/src/main/java/org/apache/plc4x/java/knxnetip/connection/KnxNetIpConnection.java
index f0bbd4b..7d52485 100644
--- a/sandbox/test-java-knxnetip-driver/src/main/java/org/apache/plc4x/java/knxnetip/connection/KnxNetIpConnection.java
+++ b/sandbox/test-java-knxnetip-driver/src/main/java/org/apache/plc4x/java/knxnetip/connection/KnxNetIpConnection.java
@@ -30,7 +30,6 @@ import org.apache.plc4x.java.base.connection.protocol.DatagramUnpackingHandler;
import org.apache.plc4x.java.base.events.ConnectEvent;
import org.apache.plc4x.java.base.events.ConnectedEvent;
import org.apache.plc4x.java.base.events.DisconnectEvent;
-import org.apache.plc4x.java.base.messages.*;
import org.apache.plc4x.java.knxnetip.model.KnxNetIpField;
import org.apache.plc4x.java.knxnetip.protocol.KnxNetIpProtocolLogic;
import org.apache.plc4x.java.knxnetip.protocol.KnxNetIpProtocolPackets;
diff --git a/sandbox/test-java-knxnetip-driver/src/main/resources/META-INF/services/org.apache.plc4x.java.spi.PlcDriver b/sandbox/test-java-knxnetip-driver/src/main/resources/META-INF/services/org.apache.plc4x.java.api.PlcDriver
similarity index 100%
rename from sandbox/test-java-knxnetip-driver/src/main/resources/META-INF/services/org.apache.plc4x.java.spi.PlcDriver
rename to sandbox/test-java-knxnetip-driver/src/main/resources/META-INF/services/org.apache.plc4x.java.api.PlcDriver
diff --git a/sandbox/test-java-s7-driver-passive/src/main/java/org/apache/plc4x/javapassive/s7/PassiveS7PlcDriver.java b/sandbox/test-java-s7-driver-passive/src/main/java/org/apache/plc4x/javapassive/s7/PassiveS7PlcDriver.java
index 1c08af0..581c996 100644
--- a/sandbox/test-java-s7-driver-passive/src/main/java/org/apache/plc4x/javapassive/s7/PassiveS7PlcDriver.java
+++ b/sandbox/test-java-s7-driver-passive/src/main/java/org/apache/plc4x/javapassive/s7/PassiveS7PlcDriver.java
@@ -23,7 +23,7 @@ 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.api.messages.PlcReadRequest;
-import org.apache.plc4x.java.spi.PlcDriver;
+import org.apache.plc4x.java.api.PlcDriver;
import org.apache.plc4x.java.utils.rawsockets.netty.RawSocketIpAddress;
import org.apache.plc4x.javapassive.s7.connection.PassiveS7PlcConnection;
diff --git a/sandbox/test-java-s7-driver-passive/src/main/resources/META-INF/services/org.apache.plc4x.java.spi.PlcDriver b/sandbox/test-java-s7-driver-passive/src/main/resources/META-INF/services/org.apache.plc4x.java.api.PlcDriver
similarity index 100%
rename from sandbox/test-java-s7-driver-passive/src/main/resources/META-INF/services/org.apache.plc4x.java.spi.PlcDriver
rename to sandbox/test-java-s7-driver-passive/src/main/resources/META-INF/services/org.apache.plc4x.java.api.PlcDriver
diff --git a/sandbox/test-java-s7-driver/pom.xml b/sandbox/test-java-s7-driver/pom.xml
index 880f753..a8cc62f 100644
--- a/sandbox/test-java-s7-driver/pom.xml
+++ b/sandbox/test-java-s7-driver/pom.xml
@@ -108,6 +108,12 @@
<!-- Scope is 'provided' as this way it's not shipped with the driver -->
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.plc4x</groupId>
+ <artifactId>plc4j-spi</artifactId>
+ <version>0.6.0-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
</dependencies>
</project>
diff --git a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/S7Driver.java b/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/S7Driver.java
index 6daf337..1d578a0 100644
--- a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/S7Driver.java
+++ b/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/S7Driver.java
@@ -22,7 +22,7 @@ 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.s7.readwrite.connection.S7Connection;
-import org.apache.plc4x.java.spi.PlcDriver;
+import org.apache.plc4x.java.api.PlcDriver;
import org.osgi.service.component.annotations.Component;
import java.net.InetAddress;
diff --git a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/connection/S7Connection.java b/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/connection/S7Connection.java
index 2061a38..5d38aab 100644
--- a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/connection/S7Connection.java
+++ b/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/connection/S7Connection.java
@@ -24,14 +24,11 @@ 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.base.connection.ChannelFactory;
-import org.apache.plc4x.java.base.connection.NettyPlcConnection;
-import org.apache.plc4x.java.base.events.ConnectEvent;
-import org.apache.plc4x.java.base.events.ConnectedEvent;
-import org.apache.plc4x.java.base.messages.*;
+import org.apache.plc4x.java.spi.connection.ChannelFactory;
+import org.apache.plc4x.java.spi.connection.NettyPlcConnection;
+import org.apache.plc4x.java.spi.events.ConnectEvent;
+import org.apache.plc4x.java.spi.events.ConnectedEvent;
import org.apache.plc4x.java.s7.readwrite.TPKTPacket;
-import org.apache.plc4x.java.s7.readwrite.protocol.Plc4xProtocolBase;
-import org.apache.plc4x.java.s7.readwrite.protocol.Plc4xNettyWrapper;
import org.apache.plc4x.java.s7.readwrite.protocol.Plc4xS7Protocol;
import org.apache.plc4x.java.s7.readwrite.protocol.S7Protocol;
import org.apache.plc4x.java.s7.readwrite.types.COTPTpduSize;
@@ -39,6 +36,17 @@ import org.apache.plc4x.java.s7.readwrite.types.DeviceGroup;
import org.apache.plc4x.java.s7.readwrite.types.S7ControllerType;
import org.apache.plc4x.java.s7.readwrite.utils.S7PlcFieldHandler;
import org.apache.plc4x.java.s7.readwrite.utils.S7TsapIdEncoder;
+import org.apache.plc4x.java.spi.Plc4xNettyWrapper;
+import org.apache.plc4x.java.spi.Plc4xProtocolBase;
+import org.apache.plc4x.java.spi.messages.DefaultPlcReadRequest;
+import org.apache.plc4x.java.spi.messages.DefaultPlcWriteRequest;
+import org.apache.plc4x.java.spi.messages.InternalPlcReadRequest;
+import org.apache.plc4x.java.spi.messages.InternalPlcReadResponse;
+import org.apache.plc4x.java.spi.messages.InternalPlcWriteRequest;
+import org.apache.plc4x.java.spi.messages.InternalPlcWriteResponse;
+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.tcp.connection.TcpSocketChannelFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/Plc4xS7Protocol.java b/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/Plc4xS7Protocol.java
index cd805e6..93e3b9a 100644
--- a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/Plc4xS7Protocol.java
+++ b/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/Plc4xS7Protocol.java
@@ -20,7 +20,6 @@ package org.apache.plc4x.java.s7.readwrite.protocol;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
-import io.netty.channel.ChannelHandlerContext;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.commons.lang3.tuple.Pair;
import org.apache.plc4x.java.api.exceptions.PlcProtocolException;
@@ -28,14 +27,28 @@ import org.apache.plc4x.java.api.exceptions.PlcRuntimeException;
import org.apache.plc4x.java.api.messages.PlcResponse;
import org.apache.plc4x.java.api.model.PlcField;
import org.apache.plc4x.java.api.types.PlcResponseCode;
-import org.apache.plc4x.java.base.events.ConnectEvent;
-import org.apache.plc4x.java.base.events.ConnectedEvent;
-import org.apache.plc4x.java.base.messages.*;
-import org.apache.plc4x.java.base.messages.items.*;
import org.apache.plc4x.java.s7.readwrite.*;
-import org.apache.plc4x.java.s7.readwrite.events.IsoTPConnectedEvent;
import org.apache.plc4x.java.s7.readwrite.types.*;
import org.apache.plc4x.java.s7.readwrite.utils.S7Field;
+import org.apache.plc4x.java.spi.ConversationContext;
+import org.apache.plc4x.java.spi.Plc4xProtocolBase;
+import org.apache.plc4x.java.spi.messages.DefaultPlcReadRequest;
+import org.apache.plc4x.java.spi.messages.DefaultPlcReadResponse;
+import org.apache.plc4x.java.spi.messages.InternalPlcReadRequest;
+import org.apache.plc4x.java.spi.messages.PlcRequestContainer;
+import org.apache.plc4x.java.spi.messages.items.BaseDefaultFieldItem;
+import org.apache.plc4x.java.spi.messages.items.DefaultBigIntegerFieldItem;
+import org.apache.plc4x.java.spi.messages.items.DefaultBooleanFieldItem;
+import org.apache.plc4x.java.spi.messages.items.DefaultByteFieldItem;
+import org.apache.plc4x.java.spi.messages.items.DefaultDoubleFieldItem;
+import org.apache.plc4x.java.spi.messages.items.DefaultFloatFieldItem;
+import org.apache.plc4x.java.spi.messages.items.DefaultIntegerFieldItem;
+import org.apache.plc4x.java.spi.messages.items.DefaultLocalDateFieldItem;
+import org.apache.plc4x.java.spi.messages.items.DefaultLocalDateTimeFieldItem;
+import org.apache.plc4x.java.spi.messages.items.DefaultLocalTimeFieldItem;
+import org.apache.plc4x.java.spi.messages.items.DefaultLongFieldItem;
+import org.apache.plc4x.java.spi.messages.items.DefaultShortFieldItem;
+import org.apache.plc4x.java.spi.messages.items.DefaultStringFieldItem;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -48,7 +61,6 @@ import java.time.LocalTime;
import java.time.temporal.ChronoUnit;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
-import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
diff --git a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/S7Protocol.java b/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/S7Protocol.java
index edb34e8..c98aaad 100644
--- a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/S7Protocol.java
+++ b/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/S7Protocol.java
@@ -19,7 +19,7 @@ under the License.
package org.apache.plc4x.java.s7.readwrite.protocol;
import io.netty.buffer.ByteBuf;
-import org.apache.plc4x.java.base.GeneratedDriverByteToMessageCodec;
+import org.apache.plc4x.java.spi.GeneratedDriverByteToMessageCodec;
import org.apache.plc4x.java.s7.readwrite.*;
import org.apache.plc4x.java.s7.readwrite.io.TPKTPacketIO;
import org.apache.plc4x.java.utils.MessageIO;
diff --git a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/utils/S7PlcFieldHandler.java b/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/utils/S7PlcFieldHandler.java
index 0e8f658..a2cfd80 100644
--- a/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/utils/S7PlcFieldHandler.java
+++ b/sandbox/test-java-s7-driver/src/main/java/org/apache/plc4x/java/s7/readwrite/utils/S7PlcFieldHandler.java
@@ -21,8 +21,18 @@ package org.apache.plc4x.java.s7.readwrite.utils;
import org.apache.plc4x.java.api.exceptions.PlcInvalidFieldException;
import org.apache.plc4x.java.api.exceptions.PlcRuntimeException;
import org.apache.plc4x.java.api.model.PlcField;
-import org.apache.plc4x.java.base.connection.DefaultPlcFieldHandler;
-import org.apache.plc4x.java.base.messages.items.*;
+import org.apache.plc4x.java.spi.connection.DefaultPlcFieldHandler;
+import org.apache.plc4x.java.spi.messages.items.BaseDefaultFieldItem;
+import org.apache.plc4x.java.spi.messages.items.DefaultBigIntegerFieldItem;
+import org.apache.plc4x.java.spi.messages.items.DefaultBooleanFieldItem;
+import org.apache.plc4x.java.spi.messages.items.DefaultByteFieldItem;
+import org.apache.plc4x.java.spi.messages.items.DefaultDoubleFieldItem;
+import org.apache.plc4x.java.spi.messages.items.DefaultFloatFieldItem;
+import org.apache.plc4x.java.spi.messages.items.DefaultIntegerFieldItem;
+import org.apache.plc4x.java.spi.messages.items.DefaultLocalDateTimeFieldItem;
+import org.apache.plc4x.java.spi.messages.items.DefaultLongFieldItem;
+import org.apache.plc4x.java.spi.messages.items.DefaultShortFieldItem;
+import org.apache.plc4x.java.spi.messages.items.DefaultStringFieldItem;
import java.lang.reflect.InvocationTargetException;
import java.math.BigInteger;
diff --git a/sandbox/test-java-s7-driver/src/main/resources/META-INF/services/org.apache.plc4x.java.spi.PlcDriver b/sandbox/test-java-s7-driver/src/main/resources/META-INF/services/org.apache.plc4x.java.api.PlcDriver
similarity index 100%
rename from sandbox/test-java-s7-driver/src/main/resources/META-INF/services/org.apache.plc4x.java.spi.PlcDriver
rename to sandbox/test-java-s7-driver/src/main/resources/META-INF/services/org.apache.plc4x.java.api.PlcDriver