markap14 commented on a change in pull request #4846:
URL: https://github.com/apache/nifi/pull/4846#discussion_r586001406



##########
File path: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/entity/ProcessGroupUploadEntity.java
##########
@@ -0,0 +1,111 @@
+/*
+ * 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.nifi.web.api.entity;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import org.apache.nifi.registry.flow.VersionedFlowSnapshot;
+
+/**
+ * A serialized representation of this class can be placed in the entity body 
of a request or response to or from the API. This particular entity holds a 
reference to a ProcessGroupUploadDTO.
+ */
+@XmlRootElement(name = "processGroupUploadEntity")
+public class ProcessGroupUploadEntity extends Entity {
+    private String id;
+    private String groupName;
+    private Double positionX;
+    private Double positionY;
+    private String clientId;
+    private Boolean disconnectedNodeAcknowledged;
+    private VersionedFlowSnapshot versionedFlowSnapshot;
+
+    /**
+     * @return The group ID
+     */
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {

Review comment:
       If this is the ID of the process group, and not the ID of the Upload 
Entity, I would call this getGroupId/setGroupId.

##########
File path: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/entity/ProcessGroupUploadEntity.java
##########
@@ -0,0 +1,111 @@
+/*
+ * 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.nifi.web.api.entity;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import org.apache.nifi.registry.flow.VersionedFlowSnapshot;
+
+/**
+ * A serialized representation of this class can be placed in the entity body 
of a request or response to or from the API. This particular entity holds a 
reference to a ProcessGroupUploadDTO.
+ */
+@XmlRootElement(name = "processGroupUploadEntity")
+public class ProcessGroupUploadEntity extends Entity {
+    private String id;
+    private String groupName;
+    private Double positionX;
+    private Double positionY;
+    private String clientId;
+    private Boolean disconnectedNodeAcknowledged;
+    private VersionedFlowSnapshot versionedFlowSnapshot;
+
+    /**
+     * @return The group ID
+     */
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    /**
+     * @return The process group name
+     */
+    public String getGroupName() {
+        return groupName;
+    }
+
+    public void setGroupName(String groupName) {
+        this.groupName = groupName;
+    }
+
+    /**
+     * @return The process group X-position
+     */
+    public Double getPositionX() {
+        return positionX;
+    }
+
+    public void setPositionX(Double positionX) {
+        this.positionX = positionX;
+    }
+
+    /**
+     * @return The process group Y-position
+     */
+    public Double getPositionY() {
+        return positionY;
+    }
+
+    public void setPositionY(Double positionY) {
+        this.positionY = positionY;
+    }
+
+    /**
+     * @return The client ID
+     */
+    public String getClientId() {

Review comment:
       The Client ID is never really used on its own like this throughout the 
data model. Client ID is always part of a RevisionDTO. Recommend changing this 
to be a RevisionDTO. You can see in the ProcessGroupResource.createProcessGroup 
(or most any other createXYZ method in the *Resource classes) the pattern that 
is followed:
   ```
           if (requestProcessGroupEntity.getRevision() == null || 
(requestProcessGroupEntity.getRevision().getVersion() == null || 
requestProcessGroupEntity.getRevision().getVersion() != 0)) {
               throw new IllegalArgumentException("A revision of 0 must be 
specified when creating a new Process group.");
           }
   ```
   
   So it enforces that the revision be specified, that it have a version, and 
that the version be 0, in order to create the object. I'm personally not a huge 
fan of requiring that the field exists and be set to 0, but it's the pattern 
that is followed everywhere else, so probably best to be consistent.

##########
File path: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/entity/ProcessGroupUploadEntity.java
##########
@@ -0,0 +1,111 @@
+/*
+ * 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.nifi.web.api.entity;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import org.apache.nifi.registry.flow.VersionedFlowSnapshot;
+
+/**
+ * A serialized representation of this class can be placed in the entity body 
of a request or response to or from the API. This particular entity holds a 
reference to a ProcessGroupUploadDTO.
+ */
+@XmlRootElement(name = "processGroupUploadEntity")
+public class ProcessGroupUploadEntity extends Entity {
+    private String id;
+    private String groupName;
+    private Double positionX;
+    private Double positionY;
+    private String clientId;
+    private Boolean disconnectedNodeAcknowledged;
+    private VersionedFlowSnapshot versionedFlowSnapshot;
+
+    /**
+     * @return The group ID
+     */
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    /**
+     * @return The process group name
+     */
+    public String getGroupName() {
+        return groupName;
+    }
+
+    public void setGroupName(String groupName) {
+        this.groupName = groupName;
+    }
+
+    /**
+     * @return The process group X-position
+     */
+    public Double getPositionX() {

Review comment:
       There exists a PositionDTO that is preferable here, instead of get/set 
PositionX/PositionY.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


Reply via email to