You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2021/12/02 17:01:22 UTC

[GitHub] [nifi] mattyb149 opened a new pull request #5563: NIFI-9430: Create initial C2 structure, add c2-protocol-api module

mattyb149 opened a new pull request #5563:
URL: https://github.com/apache/nifi/pull/5563


   <!--
     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.
   -->
   Thank you for submitting a contribution to Apache NiFi.
   
   Please provide a short description of the PR here:
   
   #### Description of PR
   
   Adds a top-level "c2" module and populates the c2-protocol-api submodule with API classes. Also updated MiNiFi to use the same version of Swagger that NiFi does. Unit tests are not included as the API classes are basically beans.
   
   In order to streamline the review of the contribution we ask you
   to ensure the following steps have been taken:
   
   ### For all changes:
   - [x] Is there a JIRA ticket associated with this PR? Is it referenced 
        in the commit message?
   
   - [x] Does your PR title start with **NIFI-XXXX** where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
   
   - [x] Has your PR been rebased against the latest commit within the target branch (typically `main`)?
   
   - [x] Is your initial contribution a single, squashed commit? _Additional commits in response to PR reviewer feedback should be made on this branch and pushed to allow change tracking. Do not `squash` or use `--force` when pushing to allow for clean monitoring of changes._
   
   ### For code changes:
   - [ ] Have you ensured that the full suite of tests is executed via `mvn -Pcontrib-check clean install` at the root `nifi` folder?
   - [ ] Have you written or updated unit tests to verify your changes?
   - [x] Have you verified that the full build is successful on JDK 8?
   - [ ] Have you verified that the full build is successful on JDK 11?
   - [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)?
   - [ ] If applicable, have you updated the `LICENSE` file, including the main `LICENSE` file under `nifi-assembly`?
   - [ ] If applicable, have you updated the `NOTICE` file, including the main `NOTICE` file found under `nifi-assembly`?
   - [ ] If adding new Properties, have you added `.displayName` in addition to .name (programmatic access) for each of the new properties?
   
   ### For documentation related changes:
   - [ ] Have you ensured that format looks appropriate for the output in which it is rendered?
   
   ### Note:
   Please ensure that once the PR is submitted, you check GitHub Actions CI for build issues and submit an update to your PR as soon as possible.
   


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi] mattyb149 commented on a change in pull request #5563: NIFI-9430: Create initial C2 structure, add c2-protocol-api module

Posted by GitBox <gi...@apache.org>.
mattyb149 commented on a change in pull request #5563:
URL: https://github.com/apache/nifi/pull/5563#discussion_r764161218



##########
File path: c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/AgentInfo.java
##########
@@ -0,0 +1,88 @@
+/*
+ * Apache NiFi - MiNiFi
+ * Copyright 2014-2018 The Apache Software Foundation
+ *
+ * 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.c2.protocol.api;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import javax.validation.constraints.NotBlank;
+
+@ApiModel
+public class AgentInfo implements Serializable {
+    private static final long serialVersionUID = -8812289319080770084L;

Review comment:
       I'm not sure if `Serializable` _needs_ to be used, I saw an example and did a copy-paste. Does swagger need it? If not then maybe they can be removed




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi] mattyb149 commented on a change in pull request #5563: NIFI-9430: Create initial C2 structure, add c2-protocol-api module

Posted by GitBox <gi...@apache.org>.
mattyb149 commented on a change in pull request #5563:
URL: https://github.com/apache/nifi/pull/5563#discussion_r764175514



##########
File path: c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/C2Heartbeat.java
##########
@@ -0,0 +1,160 @@
+/*
+ * Apache NiFi - MiNiFi
+ * Copyright 2014-2018 The Apache Software Foundation
+ *
+ * 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.c2.protocol.api;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import javax.xml.bind.annotation.XmlTransient;
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+
+/**
+ * TODO add Builder interface
+ */
+@ApiModel
+public class C2Heartbeat implements Serializable {
+    private static final long serialVersionUID = -1168790962754919591L;
+
+    // Internal, not part of REST API
+    private String identifier;
+    private Long created;

Review comment:
       I think only because we know it will be serialized since it's part of the protocol. If using date/time classes is more readable/maintainable, I can use those instead.




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi] mattyb149 commented on pull request #5563: NIFI-9430: Create initial C2 structure, add c2-protocol-api module

Posted by GitBox <gi...@apache.org>.
mattyb149 commented on pull request #5563:
URL: https://github.com/apache/nifi/pull/5563#issuecomment-984933687


   Yeah that makes more sense, let's divide it up by functionality, maybe an agent one too and a single common one they both inherit from? Then users of the libraries can decide which dependencies they need without including classes they don't want.


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi] exceptionfactory commented on a change in pull request #5563: NIFI-9430: Create initial C2 structure, add c2-protocol-api module

Posted by GitBox <gi...@apache.org>.
exceptionfactory commented on a change in pull request #5563:
URL: https://github.com/apache/nifi/pull/5563#discussion_r761977895



##########
File path: c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/AgentInfo.java
##########
@@ -0,0 +1,88 @@
+/*
+ * Apache NiFi - MiNiFi
+ * Copyright 2014-2018 The Apache Software Foundation
+ *
+ * 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.c2.protocol.api;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import javax.validation.constraints.NotBlank;
+
+@ApiModel
+public class AgentInfo implements Serializable {
+    private static final long serialVersionUID = -8812289319080770084L;
+
+    @NotBlank
+    private String identifier;
+    // TODO, do we also need identity. e.g., cert DN

Review comment:
       This seems like something that should be tracked elsewhere versus as a TODO.

##########
File path: c2/c2-protocol/c2-protocol-api/pom.xml
##########
@@ -0,0 +1,38 @@
+<?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>
+        <artifactId>c2-protocol</artifactId>
+        <groupId>org.apache.nifi</groupId>
+        <version>1.16.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>c2-protocol-api</artifactId>

Review comment:
       Should this be prefixed with `nifi`?
   ```suggestion
       <artifactId>nifi-c2-protocol-api</artifactId>
   ```

##########
File path: c2/pom.xml
##########
@@ -0,0 +1,49 @@
+<?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>
+        <artifactId>nifi</artifactId>
+        <groupId>org.apache.nifi</groupId>
+        <version>1.16.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>c2</artifactId>
+    <packaging>pom</packaging>
+
+    <modules>
+        <module>c2-protocol</module>
+    </modules>
+
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>org.apache.nifi</groupId>
+                <artifactId>nifi-api</artifactId>
+                <version>1.16.0-SNAPSHOT</version>
+                <scope>provided</scope>
+            </dependency>
+            <dependency>
+                <groupId>javax.validation</groupId>
+                <artifactId>validation-api</artifactId>
+                <version>2.0.1.Final</version>

Review comment:
       With the version defined at this level, it should be possible to remove the version from sub-modules.

##########
File path: c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/SystemInfo.java
##########
@@ -0,0 +1,137 @@
+/*
+ * Apache NiFi - MiNiFi
+ * Copyright 2014-2018 The Apache Software Foundation
+ *
+ * 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.c2.protocol.api;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import javax.validation.constraints.DecimalMax;
+import javax.validation.constraints.DecimalMin;
+import javax.validation.constraints.Max;
+import javax.validation.constraints.Min;
+import javax.validation.constraints.Size;
+import java.io.Serializable;
+import java.util.Objects;
+
+@ApiModel
+public class SystemInfo implements Serializable {
+    private static final long serialVersionUID = 830834593998474779L;
+
+    public static final int MACHINE_ARCH_MAX_SIZE = 100;
+    public static final int OS_MAX_SIZE = 100;
+
+    @Size(max = MACHINE_ARCH_MAX_SIZE)
+    @ApiModelProperty("Machine architecture of the device, e.g., ARM, x86")
+    private String machineArch;
+
+    @Size(max = OS_MAX_SIZE)
+    private String operatingSystem;
+
+    @Min(0)
+    @Max(Long.MAX_VALUE)
+    @ApiModelProperty(value = "Size of physical memory of the device in bytes", allowableValues = "range[0, 9223372036854775807]")
+    private Long physicalMem;
+
+    @Min(0)
+    @Max(Integer.MAX_VALUE)
+    @ApiModelProperty(
+            value = "Number of virtual cores on the device",
+            name = "vCores",
+            allowableValues = "range[0, 2147483647]")
+    private Integer vCores;

Review comment:
       As mentioned elsewhere, the allowableValues seems to imply that this cannot be null.

##########
File path: c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/AgentInfo.java
##########
@@ -0,0 +1,88 @@
+/*
+ * Apache NiFi - MiNiFi
+ * Copyright 2014-2018 The Apache Software Foundation
+ *
+ * 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.c2.protocol.api;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import javax.validation.constraints.NotBlank;
+
+@ApiModel
+public class AgentInfo implements Serializable {
+    private static final long serialVersionUID = -8812289319080770084L;

Review comment:
       Is there a particular reason that all of these model classes implement `Serializable`?  If that is desired, what do you think about setting the initial `serialVersionUID` to `1` for easier tracking and potential incrementing when the structure changes?

##########
File path: c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/C2Heartbeat.java
##########
@@ -0,0 +1,160 @@
+/*
+ * Apache NiFi - MiNiFi
+ * Copyright 2014-2018 The Apache Software Foundation
+ *
+ * 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.c2.protocol.api;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import javax.xml.bind.annotation.XmlTransient;
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+
+/**
+ * TODO add Builder interface

Review comment:
       Recommen removing this TODO and tracking as a separate task if a Builder implementation is desired.

##########
File path: c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/AgentRepositories.java
##########
@@ -0,0 +1,51 @@
+/*
+ * Apache NiFi - MiNiFi
+ * Copyright 2014-2018 The Apache Software Foundation
+ *
+ * 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.c2.protocol.api;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+
+@ApiModel
+public class AgentRepositories implements Serializable {
+    private static final long serialVersionUID = 6350263064169212602L;
+
+    private AgentRepositoryStatus flowfile;
+    private AgentRepositoryStatus provenance;

Review comment:
       Would it be worthwhile to name these properties with `status`?  Such as `provenanceStatus`?

##########
File path: c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/C2Heartbeat.java
##########
@@ -0,0 +1,160 @@
+/*
+ * Apache NiFi - MiNiFi
+ * Copyright 2014-2018 The Apache Software Foundation
+ *
+ * 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.c2.protocol.api;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import javax.xml.bind.annotation.XmlTransient;
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+
+/**
+ * TODO add Builder interface
+ */
+@ApiModel
+public class C2Heartbeat implements Serializable {
+    private static final long serialVersionUID = -1168790962754919591L;
+
+    // Internal, not part of REST API

Review comment:
       This fact seems to be implied by the hidden attribute on the ApiModelProperty annotation, is this necessary here?

##########
File path: c2/c2-protocol/pom.xml
##########
@@ -0,0 +1,34 @@
+<?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="https://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <artifactId>c2</artifactId>
+        <groupId>org.apache.nifi</groupId>
+        <version>1.16.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>c2-protocol</artifactId>

Review comment:
       Should this be prefixed with `nifi`?
   ```suggestion
       <artifactId>nifi-c2-protocol</artifactId>
   ```

##########
File path: c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/NetworkInfo.java
##########
@@ -0,0 +1,69 @@
+/*
+ * Apache NiFi - MiNiFi
+ * Copyright 2014-2018 The Apache Software Foundation
+ *
+ * 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.c2.protocol.api;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import javax.validation.constraints.Size;
+
+@ApiModel
+public class NetworkInfo implements Serializable {
+    private static final long serialVersionUID = 6574362622904811901L;
+
+    public static final int DEVICE_ID_SIZE = 200;
+    public static final int IP_ADDRESS_MAX_SIZE = 45;

Review comment:
       Is there a particular reason for making these public properties?  If they are intended to be reusable, it seems better to define them using an `enum`, although a static value would still be necessary for the annotation definition.

##########
File path: c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/AgentRepositoryStatus.java
##########
@@ -0,0 +1,112 @@
+/*
+ * Apache NiFi - MiNiFi
+ * Copyright 2014-2018 The Apache Software Foundation
+ *
+ * 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.c2.protocol.api;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import javax.validation.constraints.Max;
+import javax.validation.constraints.Min;
+import javax.xml.bind.annotation.XmlTransient;
+
+@ApiModel
+public class AgentRepositoryStatus implements Serializable {
+    private static final long serialVersionUID = 6563881979096175411L;
+
+    @Min(0)
+    @Max(Long.MAX_VALUE)
+    private Long size;
+
+    @Min(0)
+    @Max(Long.MAX_VALUE)
+    private Long sizeMax;
+
+    @Min(0)
+    @Max(Long.MAX_VALUE)
+    private Long dataSize;
+
+    @Min(0)
+    @Max(Long.MAX_VALUE)
+    private Long dataSizeMax;
+
+    @ApiModelProperty(value = "The number of items in the repository", allowableValues = "range[0, 9223372036854775807]")

Review comment:
       This seems to imply that the values will not be nullable.

##########
File path: c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/C2Heartbeat.java
##########
@@ -0,0 +1,160 @@
+/*
+ * Apache NiFi - MiNiFi
+ * Copyright 2014-2018 The Apache Software Foundation
+ *
+ * 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.c2.protocol.api;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import javax.xml.bind.annotation.XmlTransient;
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+
+/**
+ * TODO add Builder interface
+ */
+@ApiModel
+public class C2Heartbeat implements Serializable {
+    private static final long serialVersionUID = -1168790962754919591L;
+
+    // Internal, not part of REST API
+    private String identifier;
+    private Long created;

Review comment:
       Is there a reason for using `Long` as opposed to something like `Instant` or `OffsetDateTime`?

##########
File path: nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/diagnostics/bootstrap/tasks/FlowConfigurationDiagnosticTask.java
##########
@@ -52,7 +52,7 @@ public DiagnosticsDumpElement captureDump(final boolean verbose) {
         details.add("Local Input Ports: " + counts.getLocalInputPortCount());
         details.add("Local Output Ports: " + counts.getLocalOutputPortCount());
         details.add("Site-to-Site Input Ports: " + counts.getPublicInputPortCount());
-        details.add("Site-to-Site Input Ports: " + counts.getPublicOutputPortCount());
+        details.add("Site-to-Site Output Ports: " + counts.getPublicOutputPortCount());

Review comment:
       This also appears to be unrelated.

##########
File path: c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/AgentRepositoryStatus.java
##########
@@ -0,0 +1,112 @@
+/*
+ * Apache NiFi - MiNiFi
+ * Copyright 2014-2018 The Apache Software Foundation
+ *
+ * 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.c2.protocol.api;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import javax.validation.constraints.Max;
+import javax.validation.constraints.Min;
+import javax.xml.bind.annotation.XmlTransient;
+
+@ApiModel
+public class AgentRepositoryStatus implements Serializable {
+    private static final long serialVersionUID = 6563881979096175411L;
+
+    @Min(0)
+    @Max(Long.MAX_VALUE)
+    private Long size;

Review comment:
       Should these and other numeric values be nullable?  That seems to be contrary to the minimum and maximum constraints.  If they should not be nullable, then they could be changed to `long` primitives.

##########
File path: c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/AgentRepositoryStatus.java
##########
@@ -0,0 +1,112 @@
+/*
+ * Apache NiFi - MiNiFi
+ * Copyright 2014-2018 The Apache Software Foundation
+ *
+ * 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.c2.protocol.api;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import javax.validation.constraints.Max;
+import javax.validation.constraints.Min;
+import javax.xml.bind.annotation.XmlTransient;
+
+@ApiModel
+public class AgentRepositoryStatus implements Serializable {
+    private static final long serialVersionUID = 6563881979096175411L;
+
+    @Min(0)
+    @Max(Long.MAX_VALUE)
+    private Long size;
+
+    @Min(0)
+    @Max(Long.MAX_VALUE)
+    private Long sizeMax;
+
+    @Min(0)
+    @Max(Long.MAX_VALUE)
+    private Long dataSize;
+
+    @Min(0)
+    @Max(Long.MAX_VALUE)
+    private Long dataSizeMax;
+
+    @ApiModelProperty(value = "The number of items in the repository", allowableValues = "range[0, 9223372036854775807]")
+    public Long getSize() {
+        return size;
+    }
+
+    public void setSize(Long size) {
+        this.size = size;
+    }
+
+    @ApiModelProperty(value = "The maximum number of items the repository is capable of storing", allowableValues = "range[0, 9223372036854775807]")
+    public Long getSizeMax() {
+        return sizeMax;
+    }
+
+    public void setSizeMax(Long sizeMax) {
+        this.sizeMax = sizeMax;
+    }
+
+    @ApiModelProperty(value = "The data size (in Bytes) of all items in the repository", allowableValues = "range[0, 9223372036854775807]")
+    public Long getDataSize() {
+        return dataSize;
+    }
+
+    public void setDataSize(Long dataSize) {
+        this.dataSize = dataSize;
+    }
+
+    @ApiModelProperty(value = "The maximum data size (in Bytes) that the repository is capable of storing", allowableValues = "range[0, 9223372036854775807]")
+    public Long getDataSizeMax() {
+        return dataSizeMax;
+    }
+
+    public void setDataSizeMax(Long dataSizeMax) {
+        this.dataSizeMax = dataSizeMax;
+    }
+
+    /**
+     * If sizeMax is set, returns a decimal between [0, 1] indicating the ratio
+     * of size to sizeMax.
+     * <p>
+     * If size or sizeMax are null, this method return null.
+     *
+     * @return a decimal between [0, 1] representing the sizeMax utilization percentage
+     */
+    @XmlTransient

Review comment:
       This implies that these classes will be serialized using XML, is that the intent>

##########
File path: nifi-nar-bundles/nifi-extension-utils/nifi-record-utils/nifi-hadoop-record-utils/src/main/java/org/apache/nifi/processors/hadoop/AbstractPutHDFSRecord.java
##########
@@ -279,8 +279,18 @@ public void onTrigger(final ProcessContext context, final ProcessSession session
                 createDirectory(fileSystem, directoryPath, remoteOwner, remoteGroup);
 
                 // write to tempFile first and on success rename to destFile
-                final Path tempFile = new Path(directoryPath, "." + filenameValue);
-                final Path destFile = new Path(directoryPath, filenameValue);
+                final Path tempFile = new Path(directoryPath, "." + filenameValue) {

Review comment:
       This looks like an unrelated change, should it be reverted?




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi] exceptionfactory commented on a change in pull request #5563: NIFI-9430: Create initial C2 structure, add c2-protocol-api module

Posted by GitBox <gi...@apache.org>.
exceptionfactory commented on a change in pull request #5563:
URL: https://github.com/apache/nifi/pull/5563#discussion_r764175432



##########
File path: c2/c2-protocol/c2-protocol-api/pom.xml
##########
@@ -0,0 +1,38 @@
+<?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>
+        <artifactId>c2-protocol</artifactId>
+        <groupId>org.apache.nifi</groupId>
+        <version>1.16.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>c2-protocol-api</artifactId>

Review comment:
       Thanks for the reply. For clarification, this is intended to support not just MiNiFi, but be more generic across the board?  MiNiFi modules seem to be the exception when it comes to artifact name prefixing, and other components, such as nifi-commons, include the `nifi` prefix.  Although `nifi` is included in the group name, that is true across the board.  When viewing the generated JAR artifacts, the group name is not present, and in this case, having the `nifi` prefix helps indicate that this is a C2 protocol for NiFi.  If we had other examples outside of MiNiFi, but inside the repository, without the prefix, then it would seem less necessary, but as it stands, I lean more in the direction of keeping the prefix.
   
   To clarify, you are seeing that this C2 module is not necessarily specific to NiFi at all?  That may be a stronger argument for leaving it as-is, but just trying to understand the scope a bit more.




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi] bbende commented on pull request #5563: NIFI-9430: Create initial C2 structure, add c2-protocol-api module

Posted by GitBox <gi...@apache.org>.
bbende commented on pull request #5563:
URL: https://github.com/apache/nifi/pull/5563#issuecomment-991006312


   Seems like we have reached consensus here with several approvals, going to merge this, thanks @mattyb149 !!!


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi] mattyb149 commented on a change in pull request #5563: NIFI-9430: Create initial C2 structure, add c2-protocol-api module

Posted by GitBox <gi...@apache.org>.
mattyb149 commented on a change in pull request #5563:
URL: https://github.com/apache/nifi/pull/5563#discussion_r765753800



##########
File path: nifi-nar-bundles/nifi-extension-utils/nifi-record-utils/nifi-hadoop-record-utils/src/main/java/org/apache/nifi/processors/hadoop/AbstractPutHDFSRecord.java
##########
@@ -279,8 +279,18 @@ public void onTrigger(final ProcessContext context, final ProcessSession session
                 createDirectory(fileSystem, directoryPath, remoteOwner, remoteGroup);
 
                 // write to tempFile first and on success rename to destFile
-                final Path tempFile = new Path(directoryPath, "." + filenameValue);
-                final Path destFile = new Path(directoryPath, filenameValue);
+                final Path tempFile = new Path(directoryPath, "." + filenameValue) {

Review comment:
       Yes I think I had another PR's changes in mine at the same time, will check. Great catch!




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi] bbende commented on pull request #5563: NIFI-9430: Create initial C2 structure, add c2-protocol-api module

Posted by GitBox <gi...@apache.org>.
bbende commented on pull request #5563:
URL: https://github.com/apache/nifi/pull/5563#issuecomment-984997632


   Re lombok... 
   
   Just my two-cents, but I would probably lean against using it for classes that we consider API classes. I would rather us maintain control over the structure, rather than depending on code generation. 
   
   In other cases I would say I am neutral, I think it comes down to a lot of personal preference in terms of how much "magic" you like. I tend to prefer just using the IDE to generate getters/setters/equals/toString/etc, but then having the full class available like normal.
   
   Re nifi-api...
   
   I view nifi-api as the highest level API we have for the overall nifi Java ecosystem. It has the interfaces for the extensions that are run in NiFi and MiNiFi Java (Processor, ControllerService, ReportingTask), as well as the VersionedComponent data model for registry/flow definitions.
   
   Part of me almost suggested that the component/extension manifest API could become part of nifi-api since it is essentially a model that can be produced from extensions/components that implement the interfaces in nifi-api, but I didn't want to complicate it too much. So I think depending on it should be ok.


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi] mattyb149 commented on a change in pull request #5563: NIFI-9430: Create initial C2 structure, add c2-protocol-api module

Posted by GitBox <gi...@apache.org>.
mattyb149 commented on a change in pull request #5563:
URL: https://github.com/apache/nifi/pull/5563#discussion_r764160512



##########
File path: c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/AgentInfo.java
##########
@@ -0,0 +1,88 @@
+/*
+ * Apache NiFi - MiNiFi
+ * Copyright 2014-2018 The Apache Software Foundation

Review comment:
       Ok will try a sweeping removal :)




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi] szaszm commented on a change in pull request #5563: NIFI-9430: Create initial C2 structure, add c2-protocol-api module

Posted by GitBox <gi...@apache.org>.
szaszm commented on a change in pull request #5563:
URL: https://github.com/apache/nifi/pull/5563#discussion_r765903920



##########
File path: c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/AgentManifest.java
##########
@@ -0,0 +1,144 @@
+/*
+ * 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.c2.protocol.api;
+
+import org.apache.nifi.c2.protocol.component.api.BuildInfo;
+import org.apache.nifi.c2.protocol.component.api.Bundle;
+import org.apache.nifi.c2.protocol.component.api.ComponentManifest;
+import org.apache.nifi.c2.protocol.component.api.SchedulingDefaults;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import java.util.Collections;
+import java.util.List;
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+
+@ApiModel
+public class AgentManifest implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    private String identifier;
+    private String agentType;
+    private String version;
+    private BuildInfo buildInfo;
+    private List<Bundle> bundles;
+    private ComponentManifest componentManifest;

Review comment:
       I see no top level ComponentManifest in the minifi c++ AgentManifest code. The relevant code is [here](https://github.com/apache/nifi-minifi-cpp/blob/main/libminifi/include/core/state/nodes/AgentInformation.h#L614), but it may not be an easy read.




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi] bbende commented on a change in pull request #5563: NIFI-9430: Create initial C2 structure, add c2-protocol-api module

Posted by GitBox <gi...@apache.org>.
bbende commented on a change in pull request #5563:
URL: https://github.com/apache/nifi/pull/5563#discussion_r766014552



##########
File path: c2/c2-protocol/c2-protocol-component-api/src/main/java/org/apache/nifi/c2/protocol/component/api/RuntimeManifest.java
##########
@@ -0,0 +1,130 @@
+/*
+ * 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.c2.protocol.component.api;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import java.util.Collections;
+import java.util.List;
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+
+@ApiModel
+public class RuntimeManifest implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    private String identifier;
+    private String runtimeType;
+    private String version;
+    private BuildInfo buildInfo;
+    private List<Bundle> bundles;
+    private SchedulingDefaults schedulingDefaults;
+
+    @ApiModelProperty("A unique identifier for the manifest")
+    public String getIdentifier() {
+        return identifier;
+    }
+
+    public void setIdentifier(String identifier) {
+        this.identifier = identifier;
+    }
+
+    @ApiModelProperty(
+        value = "The type of the runtime binary, e.g., 'minifi-java' or 'minifi-cpp'",
+        notes = "Usually set when the runtime is built.")
+    public String getRuntimeType() {
+        return runtimeType;
+    }
+
+    public void setRuntimeType(String runtimeType) {
+        this.runtimeType = runtimeType;
+    }

Review comment:
       I think a similar case is in `AgentInfo` where it had a field of `AgentManifest`, the field name needs to remain `agentManifest` for compatibility with minifi-cpp. In this case it looks like the getter/setter is still AgentManifest, only the field is runtimeManifest, so I suppose it depends if the unmarshalling is using fields or methods.




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi] mattyb149 commented on a change in pull request #5563: NIFI-9430: Create initial C2 structure, add c2-protocol-api module

Posted by GitBox <gi...@apache.org>.
mattyb149 commented on a change in pull request #5563:
URL: https://github.com/apache/nifi/pull/5563#discussion_r765753082



##########
File path: c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/SystemInfo.java
##########
@@ -0,0 +1,137 @@
+/*
+ * Apache NiFi - MiNiFi
+ * Copyright 2014-2018 The Apache Software Foundation
+ *
+ * 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.c2.protocol.api;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import javax.validation.constraints.DecimalMax;
+import javax.validation.constraints.DecimalMin;
+import javax.validation.constraints.Max;
+import javax.validation.constraints.Min;
+import javax.validation.constraints.Size;
+import java.io.Serializable;
+import java.util.Objects;
+
+@ApiModel
+public class SystemInfo implements Serializable {
+    private static final long serialVersionUID = 830834593998474779L;
+
+    public static final int MACHINE_ARCH_MAX_SIZE = 100;
+    public static final int OS_MAX_SIZE = 100;
+
+    @Size(max = MACHINE_ARCH_MAX_SIZE)
+    @ApiModelProperty("Machine architecture of the device, e.g., ARM, x86")
+    private String machineArch;
+
+    @Size(max = OS_MAX_SIZE)
+    private String operatingSystem;
+
+    @Min(0)
+    @Max(Long.MAX_VALUE)
+    @ApiModelProperty(value = "Size of physical memory of the device in bytes", allowableValues = "range[0, 9223372036854775807]")
+    private Long physicalMem;
+
+    @Min(0)
+    @Max(Integer.MAX_VALUE)
+    @ApiModelProperty(
+            value = "Number of virtual cores on the device",
+            name = "vCores",
+            allowableValues = "range[0, 2147483647]")
+    private Integer vCores;

Review comment:
       Good catch, also leftover from JAXB annotations, will change to primitives




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi] mattyb149 commented on a change in pull request #5563: NIFI-9430: Create initial C2 structure, add c2-protocol-api module

Posted by GitBox <gi...@apache.org>.
mattyb149 commented on a change in pull request #5563:
URL: https://github.com/apache/nifi/pull/5563#discussion_r764181870



##########
File path: c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/NetworkInfo.java
##########
@@ -0,0 +1,69 @@
+/*
+ * Apache NiFi - MiNiFi
+ * Copyright 2014-2018 The Apache Software Foundation
+ *
+ * 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.c2.protocol.api;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import javax.validation.constraints.Size;
+
+@ApiModel
+public class NetworkInfo implements Serializable {
+    private static final long serialVersionUID = 6574362622904811901L;
+
+    public static final int DEVICE_ID_SIZE = 200;
+    public static final int IP_ADDRESS_MAX_SIZE = 45;

Review comment:
       Nope, just forethought in case they're needed, I can make them private for now if they're unused elsewhere.




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi] bbende commented on pull request #5563: NIFI-9430: Create initial C2 structure, add c2-protocol-api module

Posted by GitBox <gi...@apache.org>.
bbende commented on pull request #5563:
URL: https://github.com/apache/nifi/pull/5563#issuecomment-984866056


   Awesome work putting this together!
   
   What do you think of separating the package `org.apache.nifi.c2.protocol.api.extension` into it's own module like `c2-protocol-extension-api` or `c2-protocol-component-api` ?
   
   My reasoning is that the extensions package is more of a generic model for describing extensions in the NiFi eco-system and could be very useful outside of the overall c2 protocol, where as the other stuff is more specific an agent sending heartbeats as part of the protocol.


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi] kevdoran commented on a change in pull request #5563: NIFI-9430: Create initial C2 structure, add c2-protocol-api module

Posted by GitBox <gi...@apache.org>.
kevdoran commented on a change in pull request #5563:
URL: https://github.com/apache/nifi/pull/5563#discussion_r761434158



##########
File path: c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/AgentInfo.java
##########
@@ -0,0 +1,88 @@
+/*
+ * Apache NiFi - MiNiFi
+ * Copyright 2014-2018 The Apache Software Foundation

Review comment:
       AFAIK, these copyright indicators are not necessary on every file. Only the license header.




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi] mattyb149 commented on a change in pull request #5563: NIFI-9430: Create initial C2 structure, add c2-protocol-api module

Posted by GitBox <gi...@apache.org>.
mattyb149 commented on a change in pull request #5563:
URL: https://github.com/apache/nifi/pull/5563#discussion_r764202621



##########
File path: c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/AgentInfo.java
##########
@@ -0,0 +1,88 @@
+/*
+ * Apache NiFi - MiNiFi
+ * Copyright 2014-2018 The Apache Software Foundation
+ *
+ * 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.c2.protocol.api;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import javax.validation.constraints.NotBlank;
+
+@ApiModel
+public class AgentInfo implements Serializable {
+    private static final long serialVersionUID = -8812289319080770084L;

Review comment:
       I think we may want to enable a caching solution for these POJOs someday, so I'm thinking we could keep them in and set the versions to 1?




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi] exceptionfactory commented on a change in pull request #5563: NIFI-9430: Create initial C2 structure, add c2-protocol-api module

Posted by GitBox <gi...@apache.org>.
exceptionfactory commented on a change in pull request #5563:
URL: https://github.com/apache/nifi/pull/5563#discussion_r764204935



##########
File path: c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/AgentInfo.java
##########
@@ -0,0 +1,88 @@
+/*
+ * Apache NiFi - MiNiFi
+ * Copyright 2014-2018 The Apache Software Foundation
+ *
+ * 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.c2.protocol.api;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import javax.validation.constraints.NotBlank;
+
+@ApiModel
+public class AgentInfo implements Serializable {
+    private static final long serialVersionUID = -8812289319080770084L;

Review comment:
       Keeping `Serializable` and using an initial value of `1` sounds good.




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi] kevdoran commented on a change in pull request #5563: NIFI-9430: Create initial C2 structure, add c2-protocol-api module

Posted by GitBox <gi...@apache.org>.
kevdoran commented on a change in pull request #5563:
URL: https://github.com/apache/nifi/pull/5563#discussion_r765841855



##########
File path: c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/SystemInfo.java
##########
@@ -0,0 +1,137 @@
+/*
+ * Apache NiFi - MiNiFi
+ * Copyright 2014-2018 The Apache Software Foundation
+ *
+ * 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.c2.protocol.api;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import javax.validation.constraints.DecimalMax;
+import javax.validation.constraints.DecimalMin;
+import javax.validation.constraints.Max;
+import javax.validation.constraints.Min;
+import javax.validation.constraints.Size;
+import java.io.Serializable;
+import java.util.Objects;
+
+@ApiModel
+public class SystemInfo implements Serializable {
+    private static final long serialVersionUID = 830834593998474779L;
+
+    public static final int MACHINE_ARCH_MAX_SIZE = 100;
+    public static final int OS_MAX_SIZE = 100;
+
+    @Size(max = MACHINE_ARCH_MAX_SIZE)
+    @ApiModelProperty("Machine architecture of the device, e.g., ARM, x86")
+    private String machineArch;
+
+    @Size(max = OS_MAX_SIZE)
+    private String operatingSystem;
+
+    @Min(0)
+    @Max(Long.MAX_VALUE)
+    @ApiModelProperty(value = "Size of physical memory of the device in bytes", allowableValues = "range[0, 9223372036854775807]")
+    private Long physicalMem;
+
+    @Min(0)
+    @Max(Integer.MAX_VALUE)
+    @ApiModelProperty(
+            value = "Number of virtual cores on the device",
+            name = "vCores",
+            allowableValues = "range[0, 2147483647]")
+    private Integer vCores;

Review comment:
       I don't feel strongly, but I would have a slight preference to leave optional fields as nullable and update the allowable values to reflect that. In this context, `null == unknown`. Personally, I find this easier to deal with than inferring if 0 is a default value or explicitly passed by the client, when debugging, etc.




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi] exceptionfactory commented on a change in pull request #5563: NIFI-9430: Create initial C2 structure, add c2-protocol-api module

Posted by GitBox <gi...@apache.org>.
exceptionfactory commented on a change in pull request #5563:
URL: https://github.com/apache/nifi/pull/5563#discussion_r766136002



##########
File path: c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/SystemInfo.java
##########
@@ -0,0 +1,137 @@
+/*
+ * Apache NiFi - MiNiFi
+ * Copyright 2014-2018 The Apache Software Foundation
+ *
+ * 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.c2.protocol.api;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import javax.validation.constraints.DecimalMax;
+import javax.validation.constraints.DecimalMin;
+import javax.validation.constraints.Max;
+import javax.validation.constraints.Min;
+import javax.validation.constraints.Size;
+import java.io.Serializable;
+import java.util.Objects;
+
+@ApiModel
+public class SystemInfo implements Serializable {
+    private static final long serialVersionUID = 830834593998474779L;
+
+    public static final int MACHINE_ARCH_MAX_SIZE = 100;
+    public static final int OS_MAX_SIZE = 100;
+
+    @Size(max = MACHINE_ARCH_MAX_SIZE)
+    @ApiModelProperty("Machine architecture of the device, e.g., ARM, x86")
+    private String machineArch;
+
+    @Size(max = OS_MAX_SIZE)
+    private String operatingSystem;
+
+    @Min(0)
+    @Max(Long.MAX_VALUE)
+    @ApiModelProperty(value = "Size of physical memory of the device in bytes", allowableValues = "range[0, 9223372036854775807]")
+    private Long physicalMem;
+
+    @Min(0)
+    @Max(Integer.MAX_VALUE)
+    @ApiModelProperty(
+            value = "Number of virtual cores on the device",
+            name = "vCores",
+            allowableValues = "range[0, 2147483647]")
+    private Integer vCores;

Review comment:
       Leaving it a nullable type makes sense if that is the intention. If the allowable values is informational, then this is fine as it stands.




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi] mattyb149 commented on a change in pull request #5563: NIFI-9430: Create initial C2 structure, add c2-protocol-api module

Posted by GitBox <gi...@apache.org>.
mattyb149 commented on a change in pull request #5563:
URL: https://github.com/apache/nifi/pull/5563#discussion_r765927653



##########
File path: c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/AgentRepositories.java
##########
@@ -0,0 +1,51 @@
+/*
+ * Apache NiFi - MiNiFi
+ * Copyright 2014-2018 The Apache Software Foundation
+ *
+ * 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.c2.protocol.api;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+
+@ApiModel
+public class AgentRepositories implements Serializable {
+    private static final long serialVersionUID = 6350263064169212602L;
+
+    private AgentRepositoryStatus flowfile;
+    private AgentRepositoryStatus provenance;

Review comment:
       Will revert




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi] kevdoran commented on a change in pull request #5563: NIFI-9430: Create initial C2 structure, add c2-protocol-api module

Posted by GitBox <gi...@apache.org>.
kevdoran commented on a change in pull request #5563:
URL: https://github.com/apache/nifi/pull/5563#discussion_r765874031



##########
File path: c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/AgentManifest.java
##########
@@ -0,0 +1,144 @@
+/*
+ * 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.c2.protocol.api;
+
+import org.apache.nifi.c2.protocol.component.api.BuildInfo;
+import org.apache.nifi.c2.protocol.component.api.Bundle;
+import org.apache.nifi.c2.protocol.component.api.ComponentManifest;
+import org.apache.nifi.c2.protocol.component.api.SchedulingDefaults;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import java.util.Collections;
+import java.util.List;
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+
+@ApiModel
+public class AgentManifest implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    private String identifier;
+    private String agentType;
+    private String version;
+    private BuildInfo buildInfo;
+    private List<Bundle> bundles;
+    private ComponentManifest componentManifest;

Review comment:
       @arpadboda is this top level `AgentManifest.componentManifest` used by nifi-minifi-cpp today? If not (ie, all components exist under a Bundle), we could remove it from this API module




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi] mattyb149 commented on a change in pull request #5563: NIFI-9430: Create initial C2 structure, add c2-protocol-api module

Posted by GitBox <gi...@apache.org>.
mattyb149 commented on a change in pull request #5563:
URL: https://github.com/apache/nifi/pull/5563#discussion_r765883730



##########
File path: c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/SystemInfo.java
##########
@@ -0,0 +1,137 @@
+/*
+ * Apache NiFi - MiNiFi
+ * Copyright 2014-2018 The Apache Software Foundation
+ *
+ * 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.c2.protocol.api;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import javax.validation.constraints.DecimalMax;
+import javax.validation.constraints.DecimalMin;
+import javax.validation.constraints.Max;
+import javax.validation.constraints.Min;
+import javax.validation.constraints.Size;
+import java.io.Serializable;
+import java.util.Objects;
+
+@ApiModel
+public class SystemInfo implements Serializable {
+    private static final long serialVersionUID = 830834593998474779L;
+
+    public static final int MACHINE_ARCH_MAX_SIZE = 100;
+    public static final int OS_MAX_SIZE = 100;
+
+    @Size(max = MACHINE_ARCH_MAX_SIZE)
+    @ApiModelProperty("Machine architecture of the device, e.g., ARM, x86")
+    private String machineArch;
+
+    @Size(max = OS_MAX_SIZE)
+    private String operatingSystem;
+
+    @Min(0)
+    @Max(Long.MAX_VALUE)
+    @ApiModelProperty(value = "Size of physical memory of the device in bytes", allowableValues = "range[0, 9223372036854775807]")
+    private Long physicalMem;
+
+    @Min(0)
+    @Max(Integer.MAX_VALUE)
+    @ApiModelProperty(
+            value = "Number of virtual cores on the device",
+            name = "vCores",
+            allowableValues = "range[0, 2147483647]")
+    private Integer vCores;

Review comment:
       @exceptionfactory What are your thoughts on this?




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi] mattyb149 commented on a change in pull request #5563: NIFI-9430: Create initial C2 structure, add c2-protocol-api module

Posted by GitBox <gi...@apache.org>.
mattyb149 commented on a change in pull request #5563:
URL: https://github.com/apache/nifi/pull/5563#discussion_r764159872



##########
File path: c2/c2-protocol/c2-protocol-api/pom.xml
##########
@@ -0,0 +1,38 @@
+<?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>
+        <artifactId>c2-protocol</artifactId>
+        <groupId>org.apache.nifi</groupId>
+        <version>1.16.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>c2-protocol-api</artifactId>

Review comment:
       Since we have `nifi` in the group name and the C2 modules are meant to be used by NiFi but not strictly tied to it, I'd like to keep it just `c2` like we do with `minifi`, unless there are strong objections?




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi] exceptionfactory commented on a change in pull request #5563: NIFI-9430: Create initial C2 structure, add c2-protocol-api module

Posted by GitBox <gi...@apache.org>.
exceptionfactory commented on a change in pull request #5563:
URL: https://github.com/apache/nifi/pull/5563#discussion_r764162717



##########
File path: c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/AgentInfo.java
##########
@@ -0,0 +1,88 @@
+/*
+ * Apache NiFi - MiNiFi
+ * Copyright 2014-2018 The Apache Software Foundation
+ *
+ * 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.c2.protocol.api;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import javax.validation.constraints.NotBlank;
+
+@ApiModel
+public class AgentInfo implements Serializable {
+    private static final long serialVersionUID = -8812289319080770084L;

Review comment:
       Swagger does not need `Serializable`, so if it is not absolutely necessary, it seems cleaner to start without it.




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi] exceptionfactory commented on a change in pull request #5563: NIFI-9430: Create initial C2 structure, add c2-protocol-api module

Posted by GitBox <gi...@apache.org>.
exceptionfactory commented on a change in pull request #5563:
URL: https://github.com/apache/nifi/pull/5563#discussion_r766134234



##########
File path: c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/C2Heartbeat.java
##########
@@ -0,0 +1,160 @@
+/*
+ * Apache NiFi - MiNiFi
+ * Copyright 2014-2018 The Apache Software Foundation
+ *
+ * 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.c2.protocol.api;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import javax.xml.bind.annotation.XmlTransient;
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+
+/**
+ * TODO add Builder interface
+ */
+@ApiModel
+public class C2Heartbeat implements Serializable {
+    private static final long serialVersionUID = -1168790962754919591L;
+
+    // Internal, not part of REST API
+    private String identifier;
+    private Long created;

Review comment:
       Thanks for the explanation, that seems reasonable.  Using a Long will allow for up to millisecond precision, and if that aligns with other implementations, that sounds good.




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi] mattyb149 commented on a change in pull request #5563: NIFI-9430: Create initial C2 structure, add c2-protocol-api module

Posted by GitBox <gi...@apache.org>.
mattyb149 commented on a change in pull request #5563:
URL: https://github.com/apache/nifi/pull/5563#discussion_r764205345



##########
File path: c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/AgentRepositoryStatus.java
##########
@@ -0,0 +1,112 @@
+/*
+ * Apache NiFi - MiNiFi
+ * Copyright 2014-2018 The Apache Software Foundation
+ *
+ * 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.c2.protocol.api;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import javax.validation.constraints.Max;
+import javax.validation.constraints.Min;
+import javax.xml.bind.annotation.XmlTransient;
+
+@ApiModel
+public class AgentRepositoryStatus implements Serializable {
+    private static final long serialVersionUID = 6563881979096175411L;
+
+    @Min(0)
+    @Max(Long.MAX_VALUE)
+    private Long size;
+
+    @Min(0)
+    @Max(Long.MAX_VALUE)
+    private Long sizeMax;
+
+    @Min(0)
+    @Max(Long.MAX_VALUE)
+    private Long dataSize;
+
+    @Min(0)
+    @Max(Long.MAX_VALUE)
+    private Long dataSizeMax;
+
+    @ApiModelProperty(value = "The number of items in the repository", allowableValues = "range[0, 9223372036854775807]")
+    public Long getSize() {
+        return size;
+    }
+
+    public void setSize(Long size) {
+        this.size = size;
+    }
+
+    @ApiModelProperty(value = "The maximum number of items the repository is capable of storing", allowableValues = "range[0, 9223372036854775807]")
+    public Long getSizeMax() {
+        return sizeMax;
+    }
+
+    public void setSizeMax(Long sizeMax) {
+        this.sizeMax = sizeMax;
+    }
+
+    @ApiModelProperty(value = "The data size (in Bytes) of all items in the repository", allowableValues = "range[0, 9223372036854775807]")
+    public Long getDataSize() {
+        return dataSize;
+    }
+
+    public void setDataSize(Long dataSize) {
+        this.dataSize = dataSize;
+    }
+
+    @ApiModelProperty(value = "The maximum data size (in Bytes) that the repository is capable of storing", allowableValues = "range[0, 9223372036854775807]")
+    public Long getDataSizeMax() {
+        return dataSizeMax;
+    }
+
+    public void setDataSizeMax(Long dataSizeMax) {
+        this.dataSizeMax = dataSizeMax;
+    }
+
+    /**
+     * If sizeMax is set, returns a decimal between [0, 1] indicating the ratio
+     * of size to sizeMax.
+     * <p>
+     * If size or sizeMax are null, this method return null.
+     *
+     * @return a decimal between [0, 1] representing the sizeMax utilization percentage
+     */
+    @XmlTransient

Review comment:
       Serialized yes, XML optionally




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi] kevdoran commented on a change in pull request #5563: NIFI-9430: Create initial C2 structure, add c2-protocol-api module

Posted by GitBox <gi...@apache.org>.
kevdoran commented on a change in pull request #5563:
URL: https://github.com/apache/nifi/pull/5563#discussion_r765834021



##########
File path: c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/AgentRepositories.java
##########
@@ -0,0 +1,51 @@
+/*
+ * Apache NiFi - MiNiFi
+ * Copyright 2014-2018 The Apache Software Foundation
+ *
+ * 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.c2.protocol.api;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+
+@ApiModel
+public class AgentRepositories implements Serializable {
+    private static final long serialVersionUID = 6350263064169212602L;
+
+    private AgentRepositoryStatus flowfile;
+    private AgentRepositoryStatus provenance;

Review comment:
       I'd prefer not altering field names already in the nifi-minifi-cpp implementation of this protocol.




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi] bbende merged pull request #5563: NIFI-9430: Create initial C2 structure, add c2-protocol-api module

Posted by GitBox <gi...@apache.org>.
bbende merged pull request #5563:
URL: https://github.com/apache/nifi/pull/5563


   


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi] bejancsaba commented on a change in pull request #5563: NIFI-9430: Create initial C2 structure, add c2-protocol-api module

Posted by GitBox <gi...@apache.org>.
bejancsaba commented on a change in pull request #5563:
URL: https://github.com/apache/nifi/pull/5563#discussion_r761422504



##########
File path: c2/c2-protocol/c2-protocol-api/pom.xml
##########
@@ -0,0 +1,55 @@
+<?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>
+        <artifactId>c2-protocol</artifactId>
+        <groupId>org.apache.nifi</groupId>
+        <version>1.16.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>c2-protocol-api</artifactId>
+    <packaging>jar</packaging>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.nifi</groupId>
+            <artifactId>nifi-api</artifactId>

Review comment:
       Just want to make sure I understand the intention correctly. Do we want the c2-protocol-api to depend on nifi-api? @kevdoran mentioned that if needed shared classes could be extracted so both could depend on that or that was about something else?

##########
File path: c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/AgentInfo.java
##########
@@ -0,0 +1,88 @@
+/*
+ * Apache NiFi - MiNiFi
+ * Copyright 2014-2018 The Apache Software Foundation
+ *
+ * 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.c2.protocol.api;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import javax.validation.constraints.NotBlank;
+
+@ApiModel
+public class AgentInfo implements Serializable {
+    private static final long serialVersionUID = -8812289319080770084L;
+
+    @NotBlank
+    private String identifier;
+    // TODO, do we also need identity. e.g., cert DN
+    private String agentClass;
+    private AgentManifest agentManifest;
+    private AgentStatus status;
+    // private Map<String, String> configProperties;  // TODO we should add this information eventually, but we need to handle the best way to handle sharing sensitive properties.

Review comment:
       Same TODO question as above but I won't comment on all TODOs just seems not necessary for the API definition in the current state.

##########
File path: c2/pom.xml
##########
@@ -0,0 +1,49 @@
+<?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>
+        <artifactId>nifi</artifactId>
+        <groupId>org.apache.nifi</groupId>
+        <version>1.16.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>c2</artifactId>
+    <packaging>pom</packaging>
+
+    <modules>
+        <module>c2-protocol</module>
+    </modules>
+
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>org.apache.nifi</groupId>
+                <artifactId>nifi-api</artifactId>

Review comment:
       Just to confirm the approach, I thought the protocol-api won't depend on the nifi-api. I think @kevdoran mentioned that if needed shared classes could be extracted and both apis could depend on that or was that a suggestion for something else?

##########
File path: c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/OperationType.java
##########
@@ -0,0 +1,37 @@
+/*
+ * Apache NiFi - MiNiFi
+ * Copyright 2014-2018 The Apache Software Foundation
+ *
+ * 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.c2.protocol.api;
+
+public enum OperationType {

Review comment:
       We could update this to reflect the list in the design doc. What do you think? I know for the debug command the TRANSFER will be needed for sure.

##########
File path: c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/AgentStatus.java
##########
@@ -0,0 +1,76 @@
+/*
+ * Apache NiFi - MiNiFi
+ * Copyright 2014-2018 The Apache Software Foundation
+ *
+ * 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.c2.protocol.api;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import java.util.Map;
+
+/**
+ * Status of the aspects of the agent, including any agent components that are controllable by the C2 server, ie:
+ * - Repositories that can be cleared and their current state
+ */
+@ApiModel
+public class AgentStatus implements Serializable {
+    private static final long serialVersionUID = 3893024138038013841L;
+
+    private Long uptime;
+    private AgentRepositories repositories;
+    private Map<String, ComponentStatus> components;
+    private AgentResourceConsumption resourceConsumption;
+
+    @ApiModelProperty("The number of milliseconds since the agent started.")
+    public Long getUptime() {
+        return uptime;
+    }
+
+    public void setUptime(Long uptime) {
+        this.uptime = uptime;
+    }
+
+    @ApiModelProperty("Status and metrics for the agent repositories")
+    public AgentRepositories getRepositories() {
+        return repositories;
+    }
+
+    public void setRepositories(AgentRepositories repositories) {
+        this.repositories = repositories;
+    }
+
+    @ApiModelProperty("Status and for shared agent components (that is, components that exist outside the context of a specific flow).")

Review comment:
       I think the "and" is redundant

##########
File path: c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/AgentClass.java
##########
@@ -0,0 +1,79 @@
+/*
+ * Apache NiFi - MiNiFi
+ * Copyright 2014-2018 The Apache Software Foundation
+ *
+ * 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.c2.protocol.api;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import java.util.Set;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Pattern;
+import javax.validation.constraints.Size;
+
+@ApiModel
+public class AgentClass implements Serializable {
+    private static final long serialVersionUID = 6513853015430858587L;
+
+    public static final String NAME_ALLOWED_PATTERN = "^[^{}]{1,200}$";
+    public static final int DESCRIPTION_MAX_SIZE = 8000;
+
+    @NotNull
+    @Pattern(regexp = NAME_ALLOWED_PATTERN)
+    private String name;
+    @Size(max = DESCRIPTION_MAX_SIZE)
+    private String description;
+
+    // TODO add support for one-to-many class-to-manifests.

Review comment:
       Do we want to keep these TODOs in place?

##########
File path: c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/ManifestStrategy.java
##########
@@ -0,0 +1,51 @@
+/*
+ * Apache NiFi
+ * Copyright 2014-2018 The Apache Software Foundation
+ *
+ * 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.c2.protocol.api;
+
+public enum ManifestStrategy {
+    STATIC("Static",
+        "This strategy performs a static mapping of agent classes to a specific manifest id"),
+    FIRST_IN("First In",
+        "This is the default manifest resolution strategy and will bind an agent class to the first manifest reported for it."),
+    LAST_IN("Last In",

Review comment:
       Just out of curiosity is this a strategy that has a valid use case?




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi] mattyb149 commented on pull request #5563: NIFI-9430: Create initial C2 structure, add c2-protocol-api module

Posted by GitBox <gi...@apache.org>.
mattyb149 commented on pull request #5563:
URL: https://github.com/apache/nifi/pull/5563#issuecomment-988077466


   I'm going to change the base branch to main, that way we can get the API into the NiFi codebase for community developers to start working with earlier. The feature branch NIFI-9428 (once rebased) can then be used for work on the server and client and such.


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi] mattyb149 commented on a change in pull request #5563: NIFI-9430: Create initial C2 structure, add c2-protocol-api module

Posted by GitBox <gi...@apache.org>.
mattyb149 commented on a change in pull request #5563:
URL: https://github.com/apache/nifi/pull/5563#discussion_r764204510



##########
File path: c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/AgentRepositoryStatus.java
##########
@@ -0,0 +1,112 @@
+/*
+ * Apache NiFi - MiNiFi
+ * Copyright 2014-2018 The Apache Software Foundation
+ *
+ * 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.c2.protocol.api;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import javax.validation.constraints.Max;
+import javax.validation.constraints.Min;
+import javax.xml.bind.annotation.XmlTransient;
+
+@ApiModel
+public class AgentRepositoryStatus implements Serializable {
+    private static final long serialVersionUID = 6563881979096175411L;
+
+    @Min(0)
+    @Max(Long.MAX_VALUE)
+    private Long size;

Review comment:
       These are used like the Serializable interface to support caching/serialization, but if we can do it better I'm all for it.




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi] kevdoran commented on a change in pull request #5563: NIFI-9430: Create initial C2 structure, add c2-protocol-api module

Posted by GitBox <gi...@apache.org>.
kevdoran commented on a change in pull request #5563:
URL: https://github.com/apache/nifi/pull/5563#discussion_r765834651



##########
File path: c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/C2Heartbeat.java
##########
@@ -0,0 +1,160 @@
+/*
+ * Apache NiFi - MiNiFi
+ * Copyright 2014-2018 The Apache Software Foundation
+ *
+ * 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.c2.protocol.api;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import javax.xml.bind.annotation.XmlTransient;
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+
+/**
+ * TODO add Builder interface
+ */
+@ApiModel
+public class C2Heartbeat implements Serializable {
+    private static final long serialVersionUID = -1168790962754919591L;
+
+    // Internal, not part of REST API

Review comment:
       Yes, agreed can probably be removed
   




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi] exceptionfactory commented on a change in pull request #5563: NIFI-9430: Create initial C2 structure, add c2-protocol-api module

Posted by GitBox <gi...@apache.org>.
exceptionfactory commented on a change in pull request #5563:
URL: https://github.com/apache/nifi/pull/5563#discussion_r766136378



##########
File path: c2/c2-protocol/c2-protocol-component-api/src/main/java/org/apache/nifi/c2/protocol/component/api/BuildInfo.java
##########
@@ -0,0 +1,100 @@
+/*
+ * 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.c2.protocol.component.api;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+
+@ApiModel
+public class BuildInfo implements Serializable {
+    private static final long serialVersionUID = -6765534459547472548L;

Review comment:
       It looks like this was one serialVersionUID that was not set to `1`.




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi] exceptionfactory commented on a change in pull request #5563: NIFI-9430: Create initial C2 structure, add c2-protocol-api module

Posted by GitBox <gi...@apache.org>.
exceptionfactory commented on a change in pull request #5563:
URL: https://github.com/apache/nifi/pull/5563#discussion_r764206818



##########
File path: c2/c2-protocol/c2-protocol-api/pom.xml
##########
@@ -0,0 +1,38 @@
+<?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>
+        <artifactId>c2-protocol</artifactId>
+        <groupId>org.apache.nifi</groupId>
+        <version>1.16.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>c2-protocol-api</artifactId>

Review comment:
       Thanks for the additional background, I agree, that sounds good.




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi] kevdoran commented on a change in pull request #5563: NIFI-9430: Create initial C2 structure, add c2-protocol-api module

Posted by GitBox <gi...@apache.org>.
kevdoran commented on a change in pull request #5563:
URL: https://github.com/apache/nifi/pull/5563#discussion_r765874031



##########
File path: c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/AgentManifest.java
##########
@@ -0,0 +1,144 @@
+/*
+ * 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.c2.protocol.api;
+
+import org.apache.nifi.c2.protocol.component.api.BuildInfo;
+import org.apache.nifi.c2.protocol.component.api.Bundle;
+import org.apache.nifi.c2.protocol.component.api.ComponentManifest;
+import org.apache.nifi.c2.protocol.component.api.SchedulingDefaults;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import java.util.Collections;
+import java.util.List;
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+
+@ApiModel
+public class AgentManifest implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    private String identifier;
+    private String agentType;
+    private String version;
+    private BuildInfo buildInfo;
+    private List<Bundle> bundles;
+    private ComponentManifest componentManifest;

Review comment:
       @arpadboda is this top level `AgentManifest.componentManifest` used by nifi-minifi-cpp today? If not (ie, all components exist under a Bundle), we could remove this field from this Java implementation of the protocol in this new Java C2 API module




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi] kevdoran commented on a change in pull request #5563: NIFI-9430: Create initial C2 structure, add c2-protocol-api module

Posted by GitBox <gi...@apache.org>.
kevdoran commented on a change in pull request #5563:
URL: https://github.com/apache/nifi/pull/5563#discussion_r765875577



##########
File path: c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/AgentManifest.java
##########
@@ -0,0 +1,144 @@
+/*
+ * 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.c2.protocol.api;
+
+import org.apache.nifi.c2.protocol.component.api.BuildInfo;
+import org.apache.nifi.c2.protocol.component.api.Bundle;
+import org.apache.nifi.c2.protocol.component.api.ComponentManifest;
+import org.apache.nifi.c2.protocol.component.api.SchedulingDefaults;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import java.util.Collections;
+import java.util.List;
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+
+@ApiModel
+public class AgentManifest implements Serializable {

Review comment:
       Can we rename this class `RuntimeManifest` (as in "NiFi Runtime") to be more generic across nifi / nifi-stateless / minifi runtime environments, and move it to the component module?




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi] kevdoran commented on a change in pull request #5563: NIFI-9430: Create initial C2 structure, add c2-protocol-api module

Posted by GitBox <gi...@apache.org>.
kevdoran commented on a change in pull request #5563:
URL: https://github.com/apache/nifi/pull/5563#discussion_r766005534



##########
File path: c2/c2-protocol/c2-protocol-component-api/src/main/java/org/apache/nifi/c2/protocol/component/api/RuntimeManifest.java
##########
@@ -0,0 +1,130 @@
+/*
+ * 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.c2.protocol.component.api;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import java.util.Collections;
+import java.util.List;
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+
+@ApiModel
+public class RuntimeManifest implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    private String identifier;
+    private String runtimeType;
+    private String version;
+    private BuildInfo buildInfo;
+    private List<Bundle> bundles;
+    private SchedulingDefaults schedulingDefaults;
+
+    @ApiModelProperty("A unique identifier for the manifest")
+    public String getIdentifier() {
+        return identifier;
+    }
+
+    public void setIdentifier(String identifier) {
+        this.identifier = identifier;
+    }
+
+    @ApiModelProperty(
+        value = "The type of the runtime binary, e.g., 'minifi-java' or 'minifi-cpp'",
+        notes = "Usually set when the runtime is built.")
+    public String getRuntimeType() {
+        return runtimeType;
+    }
+
+    public void setRuntimeType(String runtimeType) {
+        this.runtimeType = runtimeType;
+    }

Review comment:
       `runtimeType` is indeed more accurate and consistent with renaming AgentManifest to RuntimeManifest. Unfortunately, in order to maintain compatibility with nifi-minifi-cpp, this field (or at least the getters/setters that will be used for serialization/deserialization) should stay `agentType` for now.




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi] kevdoran commented on a change in pull request #5563: NIFI-9430: Create initial C2 structure, add c2-protocol-api module

Posted by GitBox <gi...@apache.org>.
kevdoran commented on a change in pull request #5563:
URL: https://github.com/apache/nifi/pull/5563#discussion_r765911977



##########
File path: c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/AgentManifest.java
##########
@@ -0,0 +1,144 @@
+/*
+ * 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.c2.protocol.api;
+
+import org.apache.nifi.c2.protocol.component.api.BuildInfo;
+import org.apache.nifi.c2.protocol.component.api.Bundle;
+import org.apache.nifi.c2.protocol.component.api.ComponentManifest;
+import org.apache.nifi.c2.protocol.component.api.SchedulingDefaults;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import java.util.Collections;
+import java.util.List;
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+
+@ApiModel
+public class AgentManifest implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    private String identifier;
+    private String agentType;
+    private String version;
+    private BuildInfo buildInfo;
+    private List<Bundle> bundles;
+    private ComponentManifest componentManifest;

Review comment:
       @szaszm Looking through that code, I agree, this field is not used by the c++ agent. As we have no need/plan to use it in the Java agent, I would recommend removing it for now @mattyb149 




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi] exceptionfactory commented on a change in pull request #5563: NIFI-9430: Create initial C2 structure, add c2-protocol-api module

Posted by GitBox <gi...@apache.org>.
exceptionfactory commented on a change in pull request #5563:
URL: https://github.com/apache/nifi/pull/5563#discussion_r766136639



##########
File path: c2/c2-protocol/c2-protocol-component-api/src/main/java/org/apache/nifi/c2/protocol/component/api/Bundle.java
##########
@@ -0,0 +1,124 @@
+/*
+ * 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.c2.protocol.component.api;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+
+@ApiModel
+public class Bundle implements Serializable {
+    private static final long serialVersionUID = 9075160852174422394L;

Review comment:
       This also should be set to `1`.

##########
File path: c2/c2-protocol/c2-protocol-component-api/src/main/java/org/apache/nifi/c2/protocol/component/api/DefinedType.java
##########
@@ -0,0 +1,116 @@
+/*
+ * 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.c2.protocol.component.api;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+
+/**
+ * A reference to a defined type identified by bundle and fully qualified class type identifiers
+ */
+@ApiModel
+public class DefinedType implements Serializable {
+    private static final long serialVersionUID = -2964632370563990581L;

Review comment:
       Should be set to `1`.

##########
File path: c2/c2-protocol/c2-protocol-component-api/src/main/java/org/apache/nifi/c2/protocol/component/api/ControllerServiceDefinition.java
##########
@@ -0,0 +1,56 @@
+/*
+ * 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.c2.protocol.component.api;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+@ApiModel
+public class ControllerServiceDefinition extends ExtensionComponent implements ConfigurableComponentDefinition {
+    private static final long serialVersionUID = -876296212819594455L;

Review comment:
       Should be set to `1`.

##########
File path: c2/c2-protocol/c2-protocol-component-api/src/main/java/org/apache/nifi/c2/protocol/component/api/ComponentManifest.java
##########
@@ -0,0 +1,71 @@
+/*
+ * 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.c2.protocol.component.api;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import java.util.Collections;
+import java.util.List;
+
+@ApiModel
+public class ComponentManifest implements Serializable {
+    private static final long serialVersionUID = 3768758346230531253L;

Review comment:
       Should be set to `1`.

##########
File path: c2/c2-protocol/c2-protocol-component-api/src/main/java/org/apache/nifi/c2/protocol/component/api/SchedulingDefaults.java
##########
@@ -0,0 +1,91 @@
+/*
+ * 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.c2.protocol.component.api;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import org.apache.nifi.scheduling.SchedulingStrategy;
+
+import java.io.Serializable;
+
+@ApiModel
+public class SchedulingDefaults implements Serializable {
+    private static final long serialVersionUID = -8593968890120502434L;

Review comment:
       Should be set to `1`.

##########
File path: c2/c2-protocol/c2-protocol-component-api/src/main/java/org/apache/nifi/c2/protocol/component/api/ExtensionComponent.java
##########
@@ -0,0 +1,115 @@
+/*
+ * 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.c2.protocol.component.api;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+
+/**
+ * A component provided by an extension bundle
+ */
+@ApiModel
+public class ExtensionComponent extends DefinedType {
+    private static final long serialVersionUID = -3862421043918277329L;

Review comment:
       Should be set to `1`.

##########
File path: c2/c2-protocol/c2-protocol-component-api/src/main/java/org/apache/nifi/c2/protocol/component/api/PropertyAllowableValue.java
##########
@@ -0,0 +1,84 @@
+/*
+ * 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.c2.protocol.component.api;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+
+@ApiModel
+public class PropertyAllowableValue implements Serializable {
+    private static final long serialVersionUID = 3318585605254710650L;

Review comment:
       Should be set to `1`.

##########
File path: c2/c2-protocol/c2-protocol-component-api/src/main/java/org/apache/nifi/c2/protocol/component/api/Relationship.java
##########
@@ -0,0 +1,48 @@
+/*
+ * 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.c2.protocol.component.api;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+
+@ApiModel
+public class Relationship implements Serializable {
+
+    private static final long serialVersionUID = 2098349371897080033L;

Review comment:
       Should be set to `1`.

##########
File path: c2/c2-protocol/c2-protocol-component-api/src/main/java/org/apache/nifi/c2/protocol/component/api/ProcessorDefinition.java
##########
@@ -0,0 +1,88 @@
+/*
+ * 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.c2.protocol.component.api;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import org.apache.nifi.annotation.behavior.InputRequirement;
+
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+@ApiModel
+public class ProcessorDefinition extends ExtensionComponent implements ConfigurableComponentDefinition {
+    private static final long serialVersionUID = -421341248144419723L;

Review comment:
       Should be set to `1`.

##########
File path: c2/c2-protocol/c2-protocol-component-api/src/main/java/org/apache/nifi/c2/protocol/component/api/ReportingTaskDefinition.java
##########
@@ -0,0 +1,86 @@
+/*
+ * 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.c2.protocol.component.api;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+@ApiModel
+public class ReportingTaskDefinition extends ExtensionComponent implements ConfigurableComponentDefinition {
+    private static final long serialVersionUID = -6736467402450650934L;

Review comment:
       Should be set to `1`.




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi] bbende commented on a change in pull request #5563: NIFI-9430: Create initial C2 structure, add c2-protocol-api module

Posted by GitBox <gi...@apache.org>.
bbende commented on a change in pull request #5563:
URL: https://github.com/apache/nifi/pull/5563#discussion_r765839370



##########
File path: c2/c2-protocol/c2-protocol-component-api/src/main/java/org/apache/nifi/c2/protocol/component/api/ProcessorDefinition.java
##########
@@ -0,0 +1,88 @@
+/*
+ * 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.c2.protocol.component.api;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import org.apache.nifi.annotation.behavior.InputRequirement;
+
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+@ApiModel
+public class ProcessorDefinition extends ExtensionComponent implements ConfigurableComponentDefinition {
+    private static final long serialVersionUID = -421341248144419723L;
+
+    private Map<String, PropertyDescriptor> propertyDescriptors;
+    private boolean supportsDynamicProperties;
+    private InputRequirement inputRequirement;
+
+    private List<Relationship> supportedRelationships;
+    private boolean supportsDynamicRelationships;
+
+    @Override
+    @ApiModelProperty("Descriptions of configuration properties applicable to this reporting task")
+    public Map<String, PropertyDescriptor> getPropertyDescriptors() {
+        return (propertyDescriptors != null ? Collections.unmodifiableMap(propertyDescriptors) : null);
+    }
+
+    @Override
+    public void setPropertyDescriptors(LinkedHashMap<String, PropertyDescriptor> propertyDescriptors) {
+        this.propertyDescriptors = propertyDescriptors;
+    }
+
+    @Override
+    @ApiModelProperty("Whether or not this processor makes use of dynamic (user-set) properties")
+    public boolean getSupportsDynamicProperties() {
+        return supportsDynamicProperties;
+    }
+
+    @Override
+    public void setSupportsDynamicProperties(boolean supportsDynamicProperties) {
+        this.supportsDynamicProperties = supportsDynamicProperties;
+    }
+
+    @ApiModelProperty("Any input requirements this processor has")
+    public InputRequirement getInputRequirement() {

Review comment:
       InputRequirement.Requirement

##########
File path: c2/c2-protocol/c2-protocol-component-api/src/main/java/org/apache/nifi/c2/protocol/component/api/ProcessorDefinition.java
##########
@@ -0,0 +1,88 @@
+/*
+ * 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.c2.protocol.component.api;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import org.apache.nifi.annotation.behavior.InputRequirement;
+
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+@ApiModel
+public class ProcessorDefinition extends ExtensionComponent implements ConfigurableComponentDefinition {
+    private static final long serialVersionUID = -421341248144419723L;
+
+    private Map<String, PropertyDescriptor> propertyDescriptors;
+    private boolean supportsDynamicProperties;
+    private InputRequirement inputRequirement;
+
+    private List<Relationship> supportedRelationships;
+    private boolean supportsDynamicRelationships;
+
+    @Override
+    @ApiModelProperty("Descriptions of configuration properties applicable to this reporting task")
+    public Map<String, PropertyDescriptor> getPropertyDescriptors() {
+        return (propertyDescriptors != null ? Collections.unmodifiableMap(propertyDescriptors) : null);
+    }
+
+    @Override
+    public void setPropertyDescriptors(LinkedHashMap<String, PropertyDescriptor> propertyDescriptors) {
+        this.propertyDescriptors = propertyDescriptors;
+    }
+
+    @Override
+    @ApiModelProperty("Whether or not this processor makes use of dynamic (user-set) properties")
+    public boolean getSupportsDynamicProperties() {
+        return supportsDynamicProperties;
+    }
+
+    @Override
+    public void setSupportsDynamicProperties(boolean supportsDynamicProperties) {
+        this.supportsDynamicProperties = supportsDynamicProperties;
+    }
+
+    @ApiModelProperty("Any input requirements this processor has")
+    public InputRequirement getInputRequirement() {
+        return inputRequirement;
+    }
+
+    public void setInputRequirement(InputRequirement inputRequirement) {

Review comment:
       InputRequirement.Requirement

##########
File path: c2/c2-protocol/c2-protocol-component-api/src/main/java/org/apache/nifi/c2/protocol/component/api/ProcessorDefinition.java
##########
@@ -0,0 +1,88 @@
+/*
+ * 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.c2.protocol.component.api;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import org.apache.nifi.annotation.behavior.InputRequirement;
+
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+@ApiModel
+public class ProcessorDefinition extends ExtensionComponent implements ConfigurableComponentDefinition {
+    private static final long serialVersionUID = -421341248144419723L;
+
+    private Map<String, PropertyDescriptor> propertyDescriptors;
+    private boolean supportsDynamicProperties;
+    private InputRequirement inputRequirement;

Review comment:
       This should be `private InputRequirement.Requirement inputRequirement;`




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi] kevdoran commented on a change in pull request #5563: NIFI-9430: Create initial C2 structure, add c2-protocol-api module

Posted by GitBox <gi...@apache.org>.
kevdoran commented on a change in pull request #5563:
URL: https://github.com/apache/nifi/pull/5563#discussion_r765838230



##########
File path: c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/C2Heartbeat.java
##########
@@ -0,0 +1,160 @@
+/*
+ * Apache NiFi - MiNiFi
+ * Copyright 2014-2018 The Apache Software Foundation
+ *
+ * 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.c2.protocol.api;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import javax.xml.bind.annotation.XmlTransient;
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+
+/**
+ * TODO add Builder interface
+ */
+@ApiModel
+public class C2Heartbeat implements Serializable {
+    private static final long serialVersionUID = -1168790962754919591L;
+
+    // Internal, not part of REST API
+    private String identifier;
+    private Long created;

Review comment:
       I think this was just for consistency with other timestamps in the c2 protocol. We made the decision in the c++ implementation to use milliseconds since epoch for all timestamps for the wire representation. That said, the in memory model for Java can use whatever class it wants so long as the to/from JSON logic encodes/decodes to a long.




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi] mattyb149 commented on a change in pull request #5563: NIFI-9430: Create initial C2 structure, add c2-protocol-api module

Posted by GitBox <gi...@apache.org>.
mattyb149 commented on a change in pull request #5563:
URL: https://github.com/apache/nifi/pull/5563#discussion_r764201954



##########
File path: c2/c2-protocol/c2-protocol-api/pom.xml
##########
@@ -0,0 +1,38 @@
+<?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>
+        <artifactId>c2-protocol</artifactId>
+        <groupId>org.apache.nifi</groupId>
+        <version>1.16.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>c2-protocol-api</artifactId>

Review comment:
       I envision this module being used by anyone that wants a straightforward solution to C2, so I'd like to keep it not specific to NiFi and keep the name without the prefix to strengthen that point.




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org