You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by cd...@apache.org on 2018/09/06 20:45:44 UTC
[incubator-plc4x] branch feature/api-redesign-chris-c updated: -
Continued work on the edgent integration testsuite - Cleaned up unneeded
dependencies in the hello-plc4x project - Fixed JavaDoc comments to no
longer break the site generation
This is an automated email from the ASF dual-hosted git repository.
cdutz pushed a commit to branch feature/api-redesign-chris-c
in repository https://gitbox.apache.org/repos/asf/incubator-plc4x.git
The following commit(s) were added to refs/heads/feature/api-redesign-chris-c by this push:
new 4be6686 - Continued work on the edgent integration testsuite - Cleaned up unneeded dependencies in the hello-plc4x project - Fixed JavaDoc comments to no longer break the site generation
4be6686 is described below
commit 4be6686d5596972e3921f294ac84c3782e991069
Author: Christofer Dutz <ch...@c-ware.de>
AuthorDate: Thu Sep 6 22:45:40 2018 +0200
- Continued work on the edgent integration testsuite
- Cleaned up unneeded dependencies in the hello-plc4x project
- Fixed JavaDoc comments to no longer break the site generation
---
examples/hello-plc4x/pom.xml | 42 ----------------------
.../apache/plc4x/edgent/mock/MockConnection.java | 8 ++---
.../org/apache/plc4x/edgent/mock/MockField.java | 11 ++++++
.../apache/plc4x/edgent/mock/MockFieldItem.java | 4 +++
.../plc4x/java/api/connection/PlcSubscriber.java | 2 +-
.../plc4x/java/api/messages/PlcFieldResponse.java | 2 +-
.../plc4x/java/api/messages/PlcResponse.java | 2 +-
.../java/api/messages/PlcSubscriptionRequest.java | 6 ++--
.../api/messages/PlcUnsubscriptionRequest.java | 2 +-
.../api/messages/PlcUnsubscriptionResponse.java | 2 +-
10 files changed, 27 insertions(+), 54 deletions(-)
diff --git a/examples/hello-plc4x/pom.xml b/examples/hello-plc4x/pom.xml
index 44619da..11c779f 100644
--- a/examples/hello-plc4x/pom.xml
+++ b/examples/hello-plc4x/pom.xml
@@ -48,40 +48,6 @@
<version>0.0.1-SNAPSHOT</version>
</dependency>
- <dependency>
- <groupId>org.apache.plc4x</groupId>
- <artifactId>apache-edgent</artifactId>
- <version>0.0.1-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.edgent</groupId>
- <artifactId>edgent-api-function</artifactId>
- <version>1.2.0</version>
- </dependency>
- <dependency>
- <groupId>org.apache.edgent</groupId>
- <artifactId>edgent-api-topology</artifactId>
- <version>1.2.0</version>
- </dependency>
- <dependency>
- <groupId>org.apache.edgent</groupId>
- <artifactId>edgent-providers-direct</artifactId>
- <version>1.2.0</version>
- </dependency>
-
- <!-- Elasticsearch dependencies -->
- <dependency>
- <groupId>org.elasticsearch</groupId>
- <artifactId>elasticsearch</artifactId>
- <version>6.2.4</version>
- </dependency>
- <dependency>
- <groupId>org.elasticsearch.plugin</groupId>
- <artifactId>transport-netty4-client</artifactId>
- <version>6.2.4</version>
- </dependency>
-
<!-- Required driver implementation -->
<dependency>
<groupId>org.apache.plc4x</groupId>
@@ -115,14 +81,6 @@
<usedDependency>org.apache.plc4x:plc4j-protocol-s7</usedDependency>
<usedDependency>org.slf4j:log4j-over-slf4j</usedDependency>
</usedDependencies>
- <ignoredDependencies combine.children="append">
- <ignoredDependency>org.apache.edgent:edgent-providers-direct:jar</ignoredDependency>
- <ignoredDependency>org.elasticsearch:elasticsearch:jar</ignoredDependency>
- <ignoredDependency>org.apache.edgent:edgent-api-function:jar</ignoredDependency>
- <ignoredDependency>org.elasticsearch.plugin:transport-netty4-client:jar</ignoredDependency>
- <ignoredDependency>org.apache.plc4x:apache-edgent:jar:0.0.1-SNAPSHOT</ignoredDependency>
- <ignoredDependency>org.apache.edgent:edgent-api-topology:jar</ignoredDependency>
- </ignoredDependencies>
</configuration>
</plugin>
</plugins>
diff --git a/integrations/apache-edgent/src/test/java/org/apache/plc4x/edgent/mock/MockConnection.java b/integrations/apache-edgent/src/test/java/org/apache/plc4x/edgent/mock/MockConnection.java
index f7a4887..54754cd 100644
--- a/integrations/apache-edgent/src/test/java/org/apache/plc4x/edgent/mock/MockConnection.java
+++ b/integrations/apache-edgent/src/test/java/org/apache/plc4x/edgent/mock/MockConnection.java
@@ -42,7 +42,7 @@ public class MockConnection extends org.apache.plc4x.java.base.connection.MockCo
private final String url;
private final PlcAuthentication authentication;
- private final Map<PlcField, FieldItem<Long>> dataValueMap = new HashMap<>();
+ private final Map<PlcField, FieldItem<?>> dataValueMap = new HashMap<>();
private long curReadCnt;
private int readExceptionTriggerCount;
private String readExceptionMsg;
@@ -116,15 +116,15 @@ public class MockConnection extends org.apache.plc4x.java.base.connection.MockCo
return CompletableFuture.completedFuture(response);
}
- public void setFieldItem(PlcField field, FieldItem<Long> fieldItem) {
+ public void setFieldItem(PlcField field, FieldItem<?> fieldItem) {
dataValueMap.put(field, fieldItem);
}
- public FieldItem<Long> getFieldItem(PlcField field) {
+ public FieldItem<?> getFieldItem(PlcField field) {
return dataValueMap.get(field);
}
- public Map<PlcField, FieldItem<Long>> getAllFieldItems() {
+ public Map<PlcField, FieldItem<?>> getAllFieldItems() {
return dataValueMap;
}
diff --git a/integrations/apache-edgent/src/test/java/org/apache/plc4x/edgent/mock/MockField.java b/integrations/apache-edgent/src/test/java/org/apache/plc4x/edgent/mock/MockField.java
index a029c25..16dc965 100644
--- a/integrations/apache-edgent/src/test/java/org/apache/plc4x/edgent/mock/MockField.java
+++ b/integrations/apache-edgent/src/test/java/org/apache/plc4x/edgent/mock/MockField.java
@@ -23,15 +23,26 @@ import org.apache.plc4x.java.api.model.PlcField;
public class MockField implements PlcField {
private final String address;
+ private final MockFieldItem fieldItem;
public MockField(String address) {
this.address = address;
+ this.fieldItem = null;
+ }
+
+ public MockField(String address, MockFieldItem fieldItem) {
+ this.address = address;
+ this.fieldItem = fieldItem;
}
public String getAddress() {
return address;
}
+ public MockFieldItem getFieldItem() {
+ return fieldItem;
+ }
+
@Override
public String toString() {
return "mock field: " + address;
diff --git a/integrations/apache-edgent/src/test/java/org/apache/plc4x/edgent/mock/MockFieldItem.java b/integrations/apache-edgent/src/test/java/org/apache/plc4x/edgent/mock/MockFieldItem.java
index 26def02..debe835 100644
--- a/integrations/apache-edgent/src/test/java/org/apache/plc4x/edgent/mock/MockFieldItem.java
+++ b/integrations/apache-edgent/src/test/java/org/apache/plc4x/edgent/mock/MockFieldItem.java
@@ -27,4 +27,8 @@ public class MockFieldItem extends FieldItem<Object> {
super(values);
}
+ public Object getObject(int index) {
+ return getValue(index);
+ }
+
}
diff --git a/plc4j/api/src/main/java/org/apache/plc4x/java/api/connection/PlcSubscriber.java b/plc4j/api/src/main/java/org/apache/plc4x/java/api/connection/PlcSubscriber.java
index d621db0..818bc07 100644
--- a/plc4j/api/src/main/java/org/apache/plc4x/java/api/connection/PlcSubscriber.java
+++ b/plc4j/api/src/main/java/org/apache/plc4x/java/api/connection/PlcSubscriber.java
@@ -49,7 +49,7 @@ public interface PlcSubscriber {
CompletableFuture<PlcUnsubscriptionResponse> unsubscribe(PlcUnsubscriptionRequest unsubscriptionRequest);
/**
- * Convenience method to subscribe a {@link Consumer<PlcSubscriptionEvent>} to all fields of the subscription.
+ * Convenience method to subscribe a {@link Consumer} to all fields of the subscription.
*
* @param subscriptionRequest subscription request
* @param consumer consumer for all {@link PlcSubscriptionEvent}s
diff --git a/plc4j/api/src/main/java/org/apache/plc4x/java/api/messages/PlcFieldResponse.java b/plc4j/api/src/main/java/org/apache/plc4x/java/api/messages/PlcFieldResponse.java
index b4fc2e0..768eb58 100644
--- a/plc4j/api/src/main/java/org/apache/plc4x/java/api/messages/PlcFieldResponse.java
+++ b/plc4j/api/src/main/java/org/apache/plc4x/java/api/messages/PlcFieldResponse.java
@@ -26,7 +26,7 @@ import java.util.Collection;
/**
* Base type for all response messages sent as response for a prior request
* from a plc to the plc4x system.
- * @param <REQUEST_TYPE>
+ * @param <REQUEST_TYPE> the type of the matching request.
*/
public interface PlcFieldResponse<REQUEST_TYPE extends PlcFieldRequest> extends PlcResponse<REQUEST_TYPE> {
diff --git a/plc4j/api/src/main/java/org/apache/plc4x/java/api/messages/PlcResponse.java b/plc4j/api/src/main/java/org/apache/plc4x/java/api/messages/PlcResponse.java
index ea64e47..0781762 100644
--- a/plc4j/api/src/main/java/org/apache/plc4x/java/api/messages/PlcResponse.java
+++ b/plc4j/api/src/main/java/org/apache/plc4x/java/api/messages/PlcResponse.java
@@ -21,7 +21,7 @@ package org.apache.plc4x.java.api.messages;
/**
* Base type for all response messages sent as response for a prior request
* from a plc to the plc4x system.
- * @param <REQUEST_TYPE>
+ * @param <REQUEST_TYPE> the type of the matching request.
*/
public interface PlcResponse<REQUEST_TYPE extends PlcRequest> extends PlcMessage {
diff --git a/plc4j/api/src/main/java/org/apache/plc4x/java/api/messages/PlcSubscriptionRequest.java b/plc4j/api/src/main/java/org/apache/plc4x/java/api/messages/PlcSubscriptionRequest.java
index f88137f..77a124c 100644
--- a/plc4j/api/src/main/java/org/apache/plc4x/java/api/messages/PlcSubscriptionRequest.java
+++ b/plc4j/api/src/main/java/org/apache/plc4x/java/api/messages/PlcSubscriptionRequest.java
@@ -31,7 +31,7 @@ public interface PlcSubscriptionRequest extends PlcFieldRequest {
* @param name alias of the field.
* @param fieldQuery field query string for accessing the field.
* @param pollingInterval interval, in which the field should be polled.
- * @return
+ * @return builder.
*/
PlcSubscriptionRequest.Builder addCyclicField(String name, String fieldQuery, Duration pollingInterval);
@@ -41,7 +41,7 @@ public interface PlcSubscriptionRequest extends PlcFieldRequest {
*
* @param name alias of the field.
* @param fieldQuery field query string for accessing the field.
- * @return
+ * @return builder.
*/
PlcSubscriptionRequest.Builder addChangeOfStateField(String name, String fieldQuery);
@@ -53,7 +53,7 @@ public interface PlcSubscriptionRequest extends PlcFieldRequest {
*
* @param name alias of the field.
* @param fieldQuery field query string for accessing the field.
- * @return
+ * @return builder.
*/
PlcSubscriptionRequest.Builder addEventField(String name, String fieldQuery);
}
diff --git a/plc4j/api/src/main/java/org/apache/plc4x/java/api/messages/PlcUnsubscriptionRequest.java b/plc4j/api/src/main/java/org/apache/plc4x/java/api/messages/PlcUnsubscriptionRequest.java
index 57a69b6..ba5e065 100644
--- a/plc4j/api/src/main/java/org/apache/plc4x/java/api/messages/PlcUnsubscriptionRequest.java
+++ b/plc4j/api/src/main/java/org/apache/plc4x/java/api/messages/PlcUnsubscriptionRequest.java
@@ -28,7 +28,7 @@ public interface PlcUnsubscriptionRequest extends PlcFieldRequest {
*
* @param name alias of the field.
* @param handle subscription handle containing information about the subscription.
- * @return
+ * @return builder.
*/
PlcUnsubscriptionRequest.Builder addField(String name, PlcSubscriptionHandle handle);
}
diff --git a/plc4j/api/src/main/java/org/apache/plc4x/java/api/messages/PlcUnsubscriptionResponse.java b/plc4j/api/src/main/java/org/apache/plc4x/java/api/messages/PlcUnsubscriptionResponse.java
index 754f66f..9764f8d 100644
--- a/plc4j/api/src/main/java/org/apache/plc4x/java/api/messages/PlcUnsubscriptionResponse.java
+++ b/plc4j/api/src/main/java/org/apache/plc4x/java/api/messages/PlcUnsubscriptionResponse.java
@@ -26,7 +26,7 @@ public interface PlcUnsubscriptionResponse extends PlcFieldResponse<PlcUnsubscri
* created subscription.
*
* @param name alias of the field.
- * @return
+ * @return builder.
*/
PlcReadRequest.Builder addField(String name);
}