bejancsaba commented on code in PR #6075:
URL: https://github.com/apache/nifi/pull/6075#discussion_r891074623


##########
c2/c2-client-bundle/c2-client-api/src/main/java/org/apache/nifi/c2/client/api/C2Client.java:
##########
@@ -0,0 +1,51 @@
+/*
+ * 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.client.api;
+
+import java.util.Optional;
+import org.apache.nifi.c2.protocol.api.C2Heartbeat;
+import org.apache.nifi.c2.protocol.api.C2HeartbeatResponse;
+import org.apache.nifi.c2.protocol.api.C2OperationAck;
+
+/**
+ * Defines interface methods used to implement a C2 Client. The controller can 
be application-specific but is used for such tasks as updating the flow.
+ */
+public interface C2Client {
+
+    /**
+     * Responsible for sending the C2Heartbeat to the C2 Server
+     *
+     * @param heartbeat the heartbeat to be sent
+     * @return optional response from the C2 Server if the response arrived it 
will be populated
+     */
+    Optional<C2HeartbeatResponse> publishHeartbeat(C2Heartbeat heartbeat);
+
+    /**
+     * Retrive the content of the new flow from the C2 Server
+     *
+     * @param flowUpdateUrl url where the content should be downloaded from
+     * @return the actual downloaded content. Will be null if no content can 
be downloaded
+     */
+    byte[] retrieveUpdateContent(String flowUpdateUrl);

Review Comment:
   Applied, thanks.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to