[GitHub] chrisdutz commented on a change in pull request #14: WIP: Api Refactoring
chrisdutz commented on a change in pull request #14: WIP: Api Refactoring URL: https://github.com/apache/incubator-plc4x/pull/14#discussion_r215170934 ## File path: plc4j/api/src/main/java/org/apache/plc4x/java/api/messages/PlcFieldRequest.java ## @@ -20,11 +20,13 @@ Licensed to the Apache Software Foundation (ASF) under one import org.apache.plc4x.java.api.model.PlcField; -import java.util.Collection; +import java.util.LinkedHashSet; public interface PlcFieldRequest extends PlcRequest { -Collection getFieldNames(); +int getNumFields(); + +LinkedHashSet getFieldNames(); Review comment: Because that is the most generic container that is: - A Map (We need to map names to obects) - Preserves the order (might be obsolete now ... have to re-check) This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] chrisdutz commented on a change in pull request #14: WIP: Api Refactoring
chrisdutz commented on a change in pull request #14: WIP: Api Refactoring URL: https://github.com/apache/incubator-plc4x/pull/14#discussion_r213981663 ## File path: plc4j/api/src/main/java/org/apache/plc4x/java/api/messages/PlcFieldResponse.java ## @@ -0,0 +1,42 @@ +/* +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.api.messages; + +import org.apache.plc4x.java.api.model.PlcField; +import org.apache.plc4x.java.api.types.PlcResponseCode; + +import java.util.Collection; +import java.util.Map; + +/** + * Base type for all response messages sent as response for a prior request + * from a plc to the plc4x system. + * @param + */ +public interface PlcFieldResponse extends PlcResponse { + +Map getFields(); + +Collection getFieldNames(); Review comment: Well yes and no ... this hasn't been finalized, but the order of the items it important and Set isn't ordered but Collection isn't either, so I'll have to change that to something else anyway. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] chrisdutz commented on a change in pull request #14: WIP: Api Refactoring
chrisdutz commented on a change in pull request #14: WIP: Api Refactoring URL: https://github.com/apache/incubator-plc4x/pull/14#discussion_r213981675 ## File path: plc4j/api/src/test/java/org/apache/plc4x/java/api/connection/PlcReaderTest.java ## @@ -38,24 +36,24 @@ Licensed to the Apache Software Foundation (ASF) under one public class PlcReaderTest { -@Test +/*@Test Review comment: Well the API is currently just interfaces ... how do you test them? ... and that's why there's a WIP in the Pull-Request as I will probably move these to driver-base where the real datatypes will be. I commented them out so I can compile the parts I have migrated and don't have to fetch them from the history when re-adding them somewhere else. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] chrisdutz commented on a change in pull request #14: WIP: Api Refactoring
chrisdutz commented on a change in pull request #14: WIP: Api Refactoring URL: https://github.com/apache/incubator-plc4x/pull/14#discussion_r213981646 ## File path: plc4j/api/src/main/java/org/apache/plc4x/java/api/messages/PlcFieldRequest.java ## @@ -0,0 +1,31 @@ +/* +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.api.messages; + +import org.apache.plc4x.java.api.model.PlcField; + +import java.util.Collection; + +public interface PlcFieldRequest extends PlcRequest { + +Collection getFieldNames(); Review comment: Well yes and no ... this hasn't been finalized, but the order of the items it important and Set isn't ordered but Collection isn't either, so I'll have to change that to something else anyway. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] chrisdutz commented on a change in pull request #14: WIP: Api Refactoring
chrisdutz commented on a change in pull request #14: WIP: Api Refactoring URL: https://github.com/apache/incubator-plc4x/pull/14#discussion_r213980628 ## File path: plc4j/api/src/main/java/org/apache/plc4x/java/api/connection/PlcProprietarySender.java ## @@ -1,41 +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.api.connection; - -import org.apache.plc4x.java.api.messages.PlcProprietaryRequest; -import org.apache.plc4x.java.api.messages.PlcProprietaryResponse; - -import java.util.concurrent.CompletableFuture; - -/** - * Interface implemented by all PlcConnections that are able to send custom commands to resources. - */ -@FunctionalInterface -public interface PlcProprietarySender { Review comment: This is for now ... I am in the process of updating the existing drivers and would re-add it as soon as I come to the ads driver. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services