You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by kd...@apache.org on 2018/09/18 15:21:22 UTC

nifi-registry git commit: NIFIREG-199 - Adding interfaces to represent configurable components and extension components

Repository: nifi-registry
Updated Branches:
  refs/heads/master 1cff92488 -> 8b54876ec


NIFIREG-199 - Adding interfaces to represent configurable components and extension components

This closes #140.

Signed-off-by: Kevin Doran <kd...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/nifi-registry/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi-registry/commit/8b54876e
Tree: http://git-wip-us.apache.org/repos/asf/nifi-registry/tree/8b54876e
Diff: http://git-wip-us.apache.org/repos/asf/nifi-registry/diff/8b54876e

Branch: refs/heads/master
Commit: 8b54876ec888c00fd595217ef0ab79a84146d12c
Parents: 1cff924
Author: Bryan Bende <bb...@apache.org>
Authored: Tue Sep 18 09:53:40 2018 -0400
Committer: Kevin Doran <kd...@apache.org>
Committed: Tue Sep 18 11:21:09 2018 -0400

----------------------------------------------------------------------
 .../flow/VersionedConfigurableComponent.java    | 34 ++++++++++++++++++++
 .../flow/VersionedControllerService.java        | 11 ++++++-
 .../flow/VersionedExtensionComponent.java       | 32 ++++++++++++++++++
 .../nifi/registry/flow/VersionedProcessor.java  | 12 +++++--
 4 files changed, 86 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/nifi-registry/blob/8b54876e/nifi-registry-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedConfigurableComponent.java
----------------------------------------------------------------------
diff --git a/nifi-registry-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedConfigurableComponent.java b/nifi-registry-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedConfigurableComponent.java
new file mode 100644
index 0000000..3201c5f
--- /dev/null
+++ b/nifi-registry-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedConfigurableComponent.java
@@ -0,0 +1,34 @@
+/*
+ * 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.registry.flow;
+
+import java.util.Map;
+
+/**
+ * A component that has property descriptors and can be configured with values for those properties.
+ */
+public interface VersionedConfigurableComponent {
+
+    Map<String,VersionedPropertyDescriptor> getPropertyDescriptors();
+
+    void setPropertyDescriptors(Map<String,VersionedPropertyDescriptor> propertyDescriptors);
+
+    Map<String,String> getProperties();
+
+    void setProperties(Map<String,String> properties);
+
+}

http://git-wip-us.apache.org/repos/asf/nifi-registry/blob/8b54876e/nifi-registry-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedControllerService.java
----------------------------------------------------------------------
diff --git a/nifi-registry-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedControllerService.java b/nifi-registry-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedControllerService.java
index 586b1b9..7b14ac2 100644
--- a/nifi-registry-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedControllerService.java
+++ b/nifi-registry-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedControllerService.java
@@ -22,7 +22,8 @@ import java.util.Map;
 
 import io.swagger.annotations.ApiModelProperty;
 
-public class VersionedControllerService extends VersionedComponent {
+public class VersionedControllerService extends VersionedComponent
+        implements VersionedConfigurableComponent, VersionedExtensionComponent {
 
     private String type;
     private Bundle bundle;
@@ -33,20 +34,24 @@ public class VersionedControllerService extends VersionedComponent {
     private String annotationData;
 
 
+    @Override
     @ApiModelProperty(value = "The type of the controller service.")
     public String getType() {
         return type;
     }
 
+    @Override
     public void setType(String type) {
         this.type = type;
     }
 
+    @Override
     @ApiModelProperty(value = "The details of the artifact that bundled this processor type.")
     public Bundle getBundle() {
         return bundle;
     }
 
+    @Override
     public void setBundle(Bundle bundle) {
         this.bundle = bundle;
     }
@@ -60,20 +65,24 @@ public class VersionedControllerService extends VersionedComponent {
         this.controllerServiceApis = controllerServiceApis;
     }
 
+    @Override
     @ApiModelProperty(value = "The properties of the controller service.")
     public Map<String, String> getProperties() {
         return properties;
     }
 
+    @Override
     public void setProperties(Map<String, String> properties) {
         this.properties = properties;
     }
 
+    @Override
     @ApiModelProperty("The property descriptors for the processor.")
     public Map<String, VersionedPropertyDescriptor> getPropertyDescriptors() {
         return propertyDescriptors;
     }
 
+    @Override
     public void setPropertyDescriptors(Map<String, VersionedPropertyDescriptor> propertyDescriptors) {
         this.propertyDescriptors = propertyDescriptors;
     }

http://git-wip-us.apache.org/repos/asf/nifi-registry/blob/8b54876e/nifi-registry-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedExtensionComponent.java
----------------------------------------------------------------------
diff --git a/nifi-registry-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedExtensionComponent.java b/nifi-registry-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedExtensionComponent.java
new file mode 100644
index 0000000..e1d514c
--- /dev/null
+++ b/nifi-registry-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedExtensionComponent.java
@@ -0,0 +1,32 @@
+/*
+ * 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.registry.flow;
+
+/**
+ * A component that is an extension and has a type and bundle.
+ */
+public interface VersionedExtensionComponent {
+
+    Bundle getBundle();
+
+    void setBundle(Bundle bundle);
+
+    String getType();
+
+    void setType(String type);
+
+}

http://git-wip-us.apache.org/repos/asf/nifi-registry/blob/8b54876e/nifi-registry-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedProcessor.java
----------------------------------------------------------------------
diff --git a/nifi-registry-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedProcessor.java b/nifi-registry-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedProcessor.java
index 3063066..aef6dcc 100644
--- a/nifi-registry-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedProcessor.java
+++ b/nifi-registry-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedProcessor.java
@@ -22,7 +22,8 @@ import java.util.Set;
 
 import io.swagger.annotations.ApiModelProperty;
 
-public class VersionedProcessor extends VersionedComponent {
+public class VersionedProcessor extends VersionedComponent
+        implements VersionedConfigurableComponent, VersionedExtensionComponent {
 
     private Bundle bundle;
     private Map<String, String> style;
@@ -61,11 +62,13 @@ public class VersionedProcessor extends VersionedComponent {
         this.schedulingStrategy = schedulingStrategy;
     }
 
+    @Override
     @ApiModelProperty("The type of Processor")
     public String getType() {
         return type;
     }
 
+    @Override
     public void setType(final String type) {
         this.type = type;
     }
@@ -115,21 +118,24 @@ public class VersionedProcessor extends VersionedComponent {
         this.concurrentlySchedulableTaskCount = concurrentlySchedulableTaskCount;
     }
 
-
+    @Override
     @ApiModelProperty("The properties for the processor. Properties whose value is not set will only contain the property name.")
     public Map<String, String> getProperties() {
         return properties;
     }
 
+    @Override
     public void setProperties(Map<String, String> properties) {
         this.properties = properties;
     }
 
+    @Override
     @ApiModelProperty("The property descriptors for the processor.")
     public Map<String, VersionedPropertyDescriptor> getPropertyDescriptors() {
         return propertyDescriptors;
     }
 
+    @Override
     public void setPropertyDescriptors(Map<String, VersionedPropertyDescriptor> propertyDescriptors) {
         this.propertyDescriptors = propertyDescriptors;
     }
@@ -164,11 +170,13 @@ public class VersionedProcessor extends VersionedComponent {
         this.runDurationMillis = runDurationMillis;
     }
 
+    @Override
     @ApiModelProperty("Information about the bundle from which the component came")
     public Bundle getBundle() {
         return bundle;
     }
 
+    @Override
     public void setBundle(Bundle bundle) {
         this.bundle = bundle;
     }