You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by mc...@apache.org on 2017/08/22 19:50:59 UTC
[3/5] nifi-registry git commit: NIFIREG-7 Defining Provider API and
framework for loading providers - Renaming nifi-registry-flow-data-model to
nifi-registry-data-model - Implementing FileSystemFlowProvider &
FileSystemMetadataProvider - Adding unit test
http://git-wip-us.apache.org/repos/asf/nifi-registry/blob/9eb0cef0/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/BatchSize.java
----------------------------------------------------------------------
diff --git a/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/BatchSize.java b/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/BatchSize.java
deleted file mode 100644
index b0687b9..0000000
--- a/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/BatchSize.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.nifi.registry.flow;
-
-import io.swagger.annotations.ApiModelProperty;
-
-public class BatchSize {
- private Integer count;
- private String size;
- private String duration;
-
- @ApiModelProperty("Preferred number of flow files to include in a transaction.")
- public Integer getCount() {
- return count;
- }
-
- public void setCount(Integer count) {
- this.count = count;
- }
-
- @ApiModelProperty("Preferred number of bytes to include in a transaction.")
- public String getSize() {
- return size;
- }
-
- public void setSize(String size) {
- this.size = size;
- }
-
- @ApiModelProperty("Preferred amount of time that a transaction should span.")
- public String getDuration() {
- return duration;
- }
-
- public void setDuration(String duration) {
- this.duration = duration;
- }
-}
http://git-wip-us.apache.org/repos/asf/nifi-registry/blob/9eb0cef0/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/Bucket.java
----------------------------------------------------------------------
diff --git a/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/Bucket.java b/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/Bucket.java
deleted file mode 100644
index 5cc483f..0000000
--- a/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/Bucket.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.nifi.registry.flow;
-
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.UUID;
-
-@ApiModel(value = "bucket")
-public class Bucket {
-
- private String identifier;
- private String name;
- private long createdTimestamp;
- private String description;
- private Map<String, BucketObject> bucketObjectMap = new HashMap<>();
-
- @ApiModelProperty("The id of the bucket. This is set by the server at creation time.")
- public String getIdentifier() {
- return identifier;
- }
-
- public void setIdentifier(String identifier) {
- this.identifier = identifier;
- }
-
- @ApiModelProperty("The name of the bucket.")
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- @ApiModelProperty("The timestamp of when the bucket was first created. This is set by the server at creation time.")
- public long getCreatedTimestamp() {
- return createdTimestamp;
- }
-
- public void setCreatedTimestamp(long createdTimestamp) {
- this.createdTimestamp = createdTimestamp;
- }
-
- @ApiModelProperty("A description of the bucket.")
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
- /**
- * Add a new object version to this bucket.
- *
- * Note that this method has a potential side effect.
- * If a BucketObject ID is not set, a random UUID string will be set.
- *
- * @param object The object to add to this bucket.
- */
- public void addObject(BucketObject object) {
- if(object.getIdentifier() == null) {
- object.setIdentifier(UUID.randomUUID().toString());
- }
-
- this.bucketObjectMap.put(object.getIdentifier(), object);
- }
-
- protected Map<String, BucketObject> getBucketObjectMap() {
- return bucketObjectMap;
- }
-
- protected void setBucketObjectMap(Map<String, BucketObject> bucketObjectMap) {
- this.bucketObjectMap = bucketObjectMap;
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/nifi-registry/blob/9eb0cef0/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/BucketObject.java
----------------------------------------------------------------------
diff --git a/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/BucketObject.java b/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/BucketObject.java
deleted file mode 100644
index 2e2bdf4..0000000
--- a/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/BucketObject.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.nifi.registry.flow;
-
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-
-@ApiModel("bucketObject")
-public abstract class BucketObject {
-
- private String identifier;
-
- @ApiModelProperty("An ID to uniquely identify this object.")
- public String getIdentifier() {
- return identifier;
- }
-
- public void setIdentifier(String id) {
- this.identifier = id;
- }
-}
http://git-wip-us.apache.org/repos/asf/nifi-registry/blob/9eb0cef0/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/Bundle.java
----------------------------------------------------------------------
diff --git a/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/Bundle.java b/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/Bundle.java
deleted file mode 100644
index 1050ac9..0000000
--- a/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/Bundle.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.nifi.registry.flow;
-
-import java.util.Objects;
-
-import io.swagger.annotations.ApiModelProperty;
-
-public class Bundle {
- private String group;
- private String artifact;
- private String version;
-
- public Bundle() {
- }
-
- public Bundle(final String group, final String artifact, final String version) {
- this.group = group;
- this.artifact = artifact;
- this.version = version;
- }
-
- @ApiModelProperty("The group of the bundle")
- public String getGroup() {
- return group;
- }
-
- public void setGroup(String group) {
- this.group = group;
- }
-
- @ApiModelProperty("The artifact of the bundle")
- public String getArtifact() {
- return artifact;
- }
-
- public void setArtifact(String artifact) {
- this.artifact = artifact;
- }
-
- @ApiModelProperty("The version of the bundle")
- public String getVersion() {
- return version;
- }
-
- public void setVersion(String version) {
- this.version = version;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
-
- if (obj == null || getClass() != obj.getClass()) {
- return false;
- }
-
- final Bundle other = (Bundle) obj;
- return Objects.equals(group, other.group) && Objects.equals(artifact, other.artifact) && Objects.equals(version, other.version);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(group, artifact, version);
- }
-}
http://git-wip-us.apache.org/repos/asf/nifi-registry/blob/9eb0cef0/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/ComponentType.java
----------------------------------------------------------------------
diff --git a/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/ComponentType.java b/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/ComponentType.java
deleted file mode 100644
index 300c146..0000000
--- a/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/ComponentType.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.nifi.registry.flow;
-
-public enum ComponentType {
-
- CONNECTION("Connection"),
- PROCESSOR("Processor"),
- PROCESS_GROUP("Process Group"),
- REMOTE_PROCESS_GROUP("Remote Process Group"),
- INPUT_PORT("Input Port"),
- OUTPUT_PORT("Output Port"),
- REMOTE_INPUT_PORT("Remote Input Port"),
- REMOTE_OUTPUT_PORT("Remote Output Port"),
- FUNNEL("Funnel"),
- LABEL("Label"),
- CONTROLLER_SERVICE("Controller Service");
-
-
- private final String typeName;
-
- private ComponentType(final String typeName) {
- this.typeName = typeName;
- }
-
- public String getTypeName() {
- return typeName;
- }
-
- @Override
- public String toString() {
- return typeName;
- }
-}
http://git-wip-us.apache.org/repos/asf/nifi-registry/blob/9eb0cef0/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/ConnectableComponent.java
----------------------------------------------------------------------
diff --git a/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/ConnectableComponent.java b/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/ConnectableComponent.java
deleted file mode 100644
index abd34bf..0000000
--- a/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/ConnectableComponent.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.nifi.registry.flow;
-
-import io.swagger.annotations.ApiModelProperty;
-
-public class ConnectableComponent {
- private String id;
- private ConnectableComponentType type;
- private String groupId;
- private String name;
- private String comments;
-
- @ApiModelProperty(value = "The id of the connectable component.", required = true)
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- @ApiModelProperty(value = "The type of component the connectable is.", required = true)
- public ConnectableComponentType getType() {
- return type;
- }
-
- public void setType(ConnectableComponentType type) {
- this.type = type;
- }
-
- @ApiModelProperty(value = "The id of the group that the connectable component resides in", required = true)
- public String getGroupId() {
- return groupId;
- }
-
- public void setGroupId(String groupId) {
- this.groupId = groupId;
- }
-
- @ApiModelProperty("The name of the connectable component")
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- @ApiModelProperty("The comments for the connectable component.")
- public String getComments() {
- return comments;
- }
-
- public void setComments(String comments) {
- this.comments = comments;
- }
-}
http://git-wip-us.apache.org/repos/asf/nifi-registry/blob/9eb0cef0/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/ConnectableComponentType.java
----------------------------------------------------------------------
diff --git a/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/ConnectableComponentType.java b/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/ConnectableComponentType.java
deleted file mode 100644
index 1b73cac..0000000
--- a/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/ConnectableComponentType.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.nifi.registry.flow;
-
-public enum ConnectableComponentType {
- PROCESSOR,
- REMOTE_INPUT_PORT,
- REMOTE_OUTPUT_PORT,
- INPUT_PORT,
- OUTPUT_PORT,
- FUNNEL;
-}
http://git-wip-us.apache.org/repos/asf/nifi-registry/blob/9eb0cef0/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/ControllerServiceAPI.java
----------------------------------------------------------------------
diff --git a/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/ControllerServiceAPI.java b/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/ControllerServiceAPI.java
deleted file mode 100644
index b46e87a..0000000
--- a/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/ControllerServiceAPI.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.nifi.registry.flow;
-
-import java.util.Objects;
-
-import io.swagger.annotations.ApiModelProperty;
-
-public class ControllerServiceAPI {
- private String type;
- private Bundle bundle;
-
- @ApiModelProperty("The fully qualified name of the service interface.")
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- @ApiModelProperty("The details of the artifact that bundled this service interface.")
- public Bundle getBundle() {
- return bundle;
- }
-
- public void setBundle(Bundle bundle) {
- this.bundle = bundle;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
-
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
-
- final ControllerServiceAPI other = (ControllerServiceAPI) o;
- return Objects.equals(type, other.type) && Objects.equals(bundle, other.bundle);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(type, bundle);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/nifi-registry/blob/9eb0cef0/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/PortType.java
----------------------------------------------------------------------
diff --git a/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/PortType.java b/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/PortType.java
deleted file mode 100644
index 6a32c11..0000000
--- a/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/PortType.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.nifi.registry.flow;
-
-public enum PortType {
- INPUT_PORT,
- OUTPUT_PORT;
-}
http://git-wip-us.apache.org/repos/asf/nifi-registry/blob/9eb0cef0/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/Position.java
----------------------------------------------------------------------
diff --git a/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/Position.java b/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/Position.java
deleted file mode 100644
index 0cbb12c..0000000
--- a/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/Position.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.nifi.registry.flow;
-
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-
-@ApiModel("The position of a component on the graph")
-public class Position {
- private double x;
- private double y;
-
- public Position() {
- }
-
- public Position(double x, double y) {
- this.x = x;
- this.y = y;
- }
-
- @ApiModelProperty("The x coordinate.")
- public double getX() {
- return x;
- }
-
- public void setX(double x) {
- this.x = x;
- }
-
- @ApiModelProperty("The y coordinate.")
- public double getY() {
- return y;
- }
-
- public void setY(double y) {
- this.y = y;
- }
-
- @Override
- public String toString() {
- return "[x=" + x + ", y=" + y + "]";
- }
-}
http://git-wip-us.apache.org/repos/asf/nifi-registry/blob/9eb0cef0/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/SiteToSiteTransportProtocol.java
----------------------------------------------------------------------
diff --git a/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/SiteToSiteTransportProtocol.java b/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/SiteToSiteTransportProtocol.java
deleted file mode 100644
index 9f94c1a..0000000
--- a/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/SiteToSiteTransportProtocol.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.nifi.registry.flow;
-
-public enum SiteToSiteTransportProtocol {
- RAW,
- HTTP;
-}
http://git-wip-us.apache.org/repos/asf/nifi-registry/blob/9eb0cef0/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedComponent.java
----------------------------------------------------------------------
diff --git a/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedComponent.java b/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedComponent.java
deleted file mode 100644
index bef9557..0000000
--- a/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedComponent.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.nifi.registry.flow;
-
-import io.swagger.annotations.ApiModelProperty;
-
-
-public abstract class VersionedComponent {
-
- private String identifier;
- private String name;
- private String comments;
- private Position position;
-
- @ApiModelProperty("The component's unique identifier")
- public String getIdentifier() {
- return identifier;
- }
-
- public void setIdentifier(String identifier) {
- this.identifier = identifier;
- }
-
- @ApiModelProperty("The component's name")
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- @ApiModelProperty("The component's position on the graph")
- public Position getPosition() {
- return position;
- }
-
- public void setPosition(Position position) {
- this.position = position;
- }
-
- @ApiModelProperty("The user-supplied comments for the component")
- public String getComments() {
- return comments;
- }
-
- public void setComments(String comments) {
- this.comments = comments;
- }
-
- public abstract ComponentType getComponentType();
-}
http://git-wip-us.apache.org/repos/asf/nifi-registry/blob/9eb0cef0/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedConnection.java
----------------------------------------------------------------------
diff --git a/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedConnection.java b/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedConnection.java
deleted file mode 100644
index 59740e9..0000000
--- a/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedConnection.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.nifi.registry.flow;
-
-import java.util.List;
-import java.util.Set;
-
-import io.swagger.annotations.ApiModelProperty;
-
-public class VersionedConnection extends VersionedComponent {
- private ConnectableComponent source;
- private ConnectableComponent destination;
- private Integer labelIndex;
- private Long zIndex;
- private Set<String> selectedRelationships;
-
- private Long backPressureObjectThreshold;
- private String backPressureDataSizeThreshold;
- private String flowFileExpiration;
- private List<String> prioritizers;
- private List<Position> bends;
-
- @ApiModelProperty("The source of the connection.")
- public ConnectableComponent getSource() {
- return source;
- }
-
- public void setSource(ConnectableComponent source) {
- this.source = source;
- }
-
- @ApiModelProperty("The destination of the connection.")
- public ConnectableComponent getDestination() {
- return destination;
- }
-
- public void setDestination(ConnectableComponent destination) {
- this.destination = destination;
- }
-
- @ApiModelProperty("The bend points on the connection.")
- public List<Position> getBends() {
- return bends;
- }
-
- public void setBends(List<Position> bends) {
- this.bends = bends;
- }
-
- @ApiModelProperty("The index of the bend point where to place the connection label.")
- public Integer getLabelIndex() {
- return labelIndex;
- }
-
- public void setLabelIndex(Integer labelIndex) {
- this.labelIndex = labelIndex;
- }
-
- @ApiModelProperty("The z index of the connection.")
- public Long getzIndex() {
- return zIndex;
- }
-
- public void setzIndex(Long zIndex) {
- this.zIndex = zIndex;
- }
-
- @ApiModelProperty("The selected relationship that comprise the connection.")
- public Set<String> getSelectedRelationships() {
- return selectedRelationships;
- }
-
- public void setSelectedRelationships(Set<String> relationships) {
- this.selectedRelationships = relationships;
- }
-
-
- @ApiModelProperty("The object count threshold for determining when back pressure is applied. Updating this value is a passive change in the sense that it won't impact whether existing files "
- + "over the limit are affected but it does help feeder processors to stop pushing too much into this work queue.")
- public Long getBackPressureObjectThreshold() {
- return backPressureObjectThreshold;
- }
-
- public void setBackPressureObjectThreshold(Long backPressureObjectThreshold) {
- this.backPressureObjectThreshold = backPressureObjectThreshold;
- }
-
-
- @ApiModelProperty("The object data size threshold for determining when back pressure is applied. Updating this value is a passive change in the sense that it won't impact whether existing "
- + "files over the limit are affected but it does help feeder processors to stop pushing too much into this work queue.")
- public String getBackPressureDataSizeThreshold() {
- return backPressureDataSizeThreshold;
- }
-
- public void setBackPressureDataSizeThreshold(String backPressureDataSizeThreshold) {
- this.backPressureDataSizeThreshold = backPressureDataSizeThreshold;
- }
-
-
- @ApiModelProperty("The amount of time a flow file may be in the flow before it will be automatically aged out of the flow. Once a flow file reaches this age it will be terminated from "
- + "the flow the next time a processor attempts to start work on it.")
- public String getFlowFileExpiration() {
- return flowFileExpiration;
- }
-
- public void setFlowFileExpiration(String flowFileExpiration) {
- this.flowFileExpiration = flowFileExpiration;
- }
-
-
- @ApiModelProperty("The comparators used to prioritize the queue.")
- public List<String> getPrioritizers() {
- return prioritizers;
- }
-
- public void setPrioritizers(List<String> prioritizers) {
- this.prioritizers = prioritizers;
- }
-
- @Override
- public ComponentType getComponentType() {
- return ComponentType.CONNECTION;
- }
-}
http://git-wip-us.apache.org/repos/asf/nifi-registry/blob/9eb0cef0/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedControllerService.java
----------------------------------------------------------------------
diff --git a/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedControllerService.java b/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedControllerService.java
deleted file mode 100644
index 2275e73..0000000
--- a/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedControllerService.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.nifi.registry.flow;
-
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-
-import io.swagger.annotations.ApiModelProperty;
-
-public class VersionedControllerService extends VersionedComponent {
-
- private String type;
- private Bundle bundle;
- private List<ControllerServiceAPI> controllerServiceApis;
-
- private Map<String, String> properties;
- private String annotationData;
-
-
- @ApiModelProperty(value = "The type of the controller service.")
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- @ApiModelProperty(value = "The details of the artifact that bundled this processor type.")
- public Bundle getBundle() {
- return bundle;
- }
-
- public void setBundle(Bundle bundle) {
- this.bundle = bundle;
- }
-
- @ApiModelProperty(value = "Lists the APIs this Controller Service implements.")
- public List<ControllerServiceAPI> getControllerServiceApis() {
- return controllerServiceApis;
- }
-
- public void setControllerServiceApis(List<ControllerServiceAPI> controllerServiceApis) {
- this.controllerServiceApis = controllerServiceApis;
- }
-
- @ApiModelProperty(value = "The properties of the controller service.")
- public Map<String, String> getProperties() {
- return properties;
- }
-
- public void setProperties(Map<String, String> properties) {
- this.properties = properties;
- }
-
- @ApiModelProperty(value = "The annotation for the controller service. This is how the custom UI relays configuration to the controller service.")
- public String getAnnotationData() {
- return annotationData;
- }
-
- public void setAnnotationData(String annotationData) {
- this.annotationData = annotationData;
- }
-
- @Override
- public int hashCode() {
- final String id = getIdentifier();
- return 37 + 3 * ((id == null) ? 0 : id.hashCode());
- }
-
- @Override
- public boolean equals(final Object obj) {
- if (obj == null) {
- return false;
- }
- if (obj == this) {
- return true;
- }
-
- if (obj.getClass() != VersionedControllerService.class) {
- return false;
- }
-
- final VersionedControllerService other = (VersionedControllerService) obj;
- return Objects.equals(getIdentifier(), other.getIdentifier());
- }
-
- @Override
- public ComponentType getComponentType() {
- return ComponentType.CONTROLLER_SERVICE;
- }
-}
http://git-wip-us.apache.org/repos/asf/nifi-registry/blob/9eb0cef0/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedFlow.java
----------------------------------------------------------------------
diff --git a/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedFlow.java b/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedFlow.java
deleted file mode 100644
index dc3bc09..0000000
--- a/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedFlow.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.nifi.registry.flow;
-
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-
-/**
- * <p>
- * Represents a versioned flow. A versioned flow is a named flow that is expected to change
- * over time. This flow is saved to the registry with information such as its name, a description,
- * and each version of the flow.
- * </p>
- *
- * @see VersionedFlowSnapshot
- */
-@ApiModel(value = "versionedFlow")
-public class VersionedFlow extends BucketObject {
-
- private String name;
- private long createdTimestamp;
- private long modifiedTimestamp;
- private String description;
- private int currentMaxVersion = 0;
- private ArrayList<VersionedFlowSnapshot> snapshots = new ArrayList<>();
- private Map<Integer, VersionedFlowSnapshot> snapshotsByVersion = new HashMap<>(); // TODO, could use a third-party collection type that supports primitive keys.
- private Map<String, VersionedFlowSnapshot> snapshotsById = new HashMap<>();
-
- @ApiModelProperty("The name of the flow.")
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- @ApiModelProperty("The timestamp of when the flow was first created.")
- public long getCreatedTimestamp() {
- return createdTimestamp;
- }
-
- public void setCreatedTimestamp(long timestamp) {
- this.createdTimestamp = timestamp;
- }
-
- @ApiModelProperty("The timestamp of when the flow was last modified, e.g., when a new version was saved.")
- public long getModifiedTimestamp() {
- return modifiedTimestamp;
- }
-
- public void setModifiedTimestamp(long modifiedTimestamp) {
- this.modifiedTimestamp = modifiedTimestamp;
- }
-
- @ApiModelProperty("A description of the flow.")
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
- public List<VersionedFlowSnapshot> getSnapshots() {
- return snapshots;
- }
-
- public VersionedFlowSnapshot getSnapshot(String id) {
- return snapshotsById.get(id);
- }
-
- public VersionedFlowSnapshot getSnapshot(int version) {
- return snapshotsByVersion.get(Integer.valueOf(version));
- }
-
- /**
- * Add a new snapshot version to this VersionedFlow.
- *
- * Note that this method has potential side effects.
- * If a snapshot version number is not a positive integer,
- * a new version number will be set as the current max version number + 1.
- * If a snapshot ID is not set, a random UUID string will be set.
- *
- * @param snapshot The snapshot to add to this versionedFlow
- */
- public void addVersionedFlowSnapshot(VersionedFlowSnapshot snapshot) {
- if (snapshot == null) {
- return;
- }
-
- int snapshotVersion = snapshot.getVersion();
- if (snapshotVersion < 1) {
- snapshotVersion = ++currentMaxVersion;
- snapshot.setVersion(snapshotVersion);
- } else if (snapshotsById.containsKey(Integer.valueOf(snapshotVersion))) {
- throw new IllegalStateException("Unable to add snapshot to VersionedFlow with duplicate version number '" + snapshotVersion + "'.");
- } else {
- currentMaxVersion = (snapshotVersion > currentMaxVersion) ? snapshotVersion : currentMaxVersion;
- }
-
- String snapshotId = snapshot.getIdentifier();
- if (snapshot.getIdentifier() == null) {
- snapshotId = UUID.randomUUID().toString();
- snapshot.setIdentifier(snapshotId);
- }
- if (snapshotsById.containsKey(snapshotId)) {
- throw new IllegalStateException("Unable to add snapshot to VersionedFlow with duplicate ID '" + snapshotId + "'.");
- }
-
- snapshots.add(snapshot);
- snapshotsByVersion.put(Integer.valueOf(snapshotVersion), snapshot);
- snapshotsById.put(snapshotId, snapshot);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/nifi-registry/blob/9eb0cef0/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedFlowSnapshot.java
----------------------------------------------------------------------
diff --git a/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedFlowSnapshot.java b/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedFlowSnapshot.java
deleted file mode 100644
index 875a26d..0000000
--- a/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedFlowSnapshot.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.nifi.registry.flow;
-
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-
-/**
- * <p>
- * Represents a snapshot of a versioned flow. A versioned flow may change many times
- * over the course of its life. Each of these versions that is saved to the registry
- * is saved as a snapshot, representing information such as the name of the flow, the
- * version of the flow, the timestamp when it was saved, the contents of the flow, etc.
- * </p>
- */
-@ApiModel(value = "versionedFlowSnapshot")
-public class VersionedFlowSnapshot {
- private String identifier;
- private int version;
- private String name;
- private long timestamp;
- private String comments;
- private VersionedProcessGroup flowContents;
-
- @ApiModelProperty("The identifier for this snapshot of the flow")
- public String getIdentifier() {
- return identifier;
- }
-
- public void setIdentifier(String identifier) {
- this.identifier = identifier;
- }
-
- @ApiModelProperty("The version of this snapshot of the flow")
- public int getVersion() {
- return version;
- }
-
- public void setVersion(int version) {
- this.version = version;
- }
-
- @ApiModelProperty("The name of the flow")
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- @ApiModelProperty("The timestamp when the flow was saved")
- public long getTimestamp() {
- return timestamp;
- }
-
- public void setTimestamp(long timestamp) {
- this.timestamp = timestamp;
- }
-
- @ApiModelProperty("The comments provided by the user when creating the snapshot")
- public String getComments() {
- return comments;
- }
-
- public void setComments(String comments) {
- this.comments = comments;
- }
-
- @ApiModelProperty("The contents of the versioned flow")
- public VersionedProcessGroup getFlowContents() {
- return flowContents;
- }
-
- public void setFlowContents(VersionedProcessGroup flowContents) {
- this.flowContents = flowContents;
- }
-}
http://git-wip-us.apache.org/repos/asf/nifi-registry/blob/9eb0cef0/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedFunnel.java
----------------------------------------------------------------------
diff --git a/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedFunnel.java b/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedFunnel.java
deleted file mode 100644
index 871dafc..0000000
--- a/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedFunnel.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.nifi.registry.flow;
-
-public class VersionedFunnel extends VersionedComponent {
- @Override
- public ComponentType getComponentType() {
- return ComponentType.FUNNEL;
- }
-}
http://git-wip-us.apache.org/repos/asf/nifi-registry/blob/9eb0cef0/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedLabel.java
----------------------------------------------------------------------
diff --git a/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedLabel.java b/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedLabel.java
deleted file mode 100644
index e7af4de..0000000
--- a/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedLabel.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.nifi.registry.flow;
-
-import java.util.Map;
-
-import io.swagger.annotations.ApiModelProperty;
-
-public class VersionedLabel extends VersionedComponent {
- private String label;
-
- private Double width;
- private Double height;
-
- // font-size = 12px
- // background-color = #eee
- private Map<String, String> style;
-
-
- @ApiModelProperty("The text that appears in the label.")
- public String getLabel() {
- return label;
- }
-
- public void setLabel(final String label) {
- this.label = label;
- }
-
- @ApiModelProperty("The styles for this label (font-size : 12px, background-color : #eee, etc).")
- public Map<String, String> getStyle() {
- return style;
- }
-
- public void setStyle(final Map<String, String> style) {
- this.style = style;
- }
-
- @ApiModelProperty("The height of the label in pixels when at a 1:1 scale.")
- public Double getHeight() {
- return height;
- }
-
- public void setHeight(Double height) {
- this.height = height;
- }
-
- @ApiModelProperty("The width of the label in pixels when at a 1:1 scale.")
- public Double getWidth() {
- return width;
- }
-
- public void setWidth(Double width) {
- this.width = width;
- }
-
- @Override
- public ComponentType getComponentType() {
- return ComponentType.LABEL;
- }
-}
http://git-wip-us.apache.org/repos/asf/nifi-registry/blob/9eb0cef0/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedPort.java
----------------------------------------------------------------------
diff --git a/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedPort.java b/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedPort.java
deleted file mode 100644
index f24e386..0000000
--- a/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedPort.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.nifi.registry.flow;
-
-import io.swagger.annotations.ApiModelProperty;
-
-public class VersionedPort extends VersionedComponent {
- private PortType type;
- private Integer concurrentlySchedulableTaskCount;
-
- @ApiModelProperty("The number of tasks that should be concurrently scheduled for the port.")
- public Integer getConcurrentlySchedulableTaskCount() {
- return concurrentlySchedulableTaskCount;
- }
-
- public void setConcurrentlySchedulableTaskCount(Integer concurrentlySchedulableTaskCount) {
- this.concurrentlySchedulableTaskCount = concurrentlySchedulableTaskCount;
- }
-
- @ApiModelProperty("The type of port.")
- public PortType getType() {
- return type;
- }
-
- public void setType(PortType type) {
- this.type = type;
- }
-
- @Override
- public ComponentType getComponentType() {
- if (type == PortType.OUTPUT_PORT) {
- return ComponentType.OUTPUT_PORT;
- }
-
- return ComponentType.INPUT_PORT;
- }
-}
http://git-wip-us.apache.org/repos/asf/nifi-registry/blob/9eb0cef0/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedProcessGroup.java
----------------------------------------------------------------------
diff --git a/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedProcessGroup.java b/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedProcessGroup.java
deleted file mode 100644
index 9458cda..0000000
--- a/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedProcessGroup.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.nifi.registry.flow;
-
-import java.util.LinkedHashSet;
-import java.util.Set;
-
-import io.swagger.annotations.ApiModelProperty;
-
-
-public class VersionedProcessGroup extends VersionedComponent {
-
- private Set<VersionedProcessGroup> processGroups = new LinkedHashSet<>();
- private Set<VersionedRemoteProcessGroup> remoteProcessGroups = new LinkedHashSet<>();
- private Set<VersionedProcessor> processors = new LinkedHashSet<>();
- private Set<VersionedPort> inputPorts = new LinkedHashSet<>();
- private Set<VersionedPort> outputPorts = new LinkedHashSet<>();
- private Set<VersionedConnection> connections = new LinkedHashSet<>();
- private Set<VersionedLabel> labels = new LinkedHashSet<>();
- private Set<VersionedFunnel> funnels = new LinkedHashSet<>();
- private Set<VersionedControllerService> controllerServices = new LinkedHashSet<>();
-
- @ApiModelProperty("The child Process Groups")
- public Set<VersionedProcessGroup> getProcessGroups() {
- return processGroups;
- }
-
- public void setProcessGroups(Set<VersionedProcessGroup> processGroups) {
- this.processGroups = processGroups;
- }
-
- @ApiModelProperty("The Remote Process Groups")
- public Set<VersionedRemoteProcessGroup> getRemoteProcessGroups() {
- return remoteProcessGroups;
- }
-
- public void setRemoteProcessGroups(Set<VersionedRemoteProcessGroup> remoteProcessGroups) {
- this.remoteProcessGroups = remoteProcessGroups;
- }
-
- @ApiModelProperty("The Processors")
- public Set<VersionedProcessor> getProcessors() {
- return processors;
- }
-
- public void setProcessors(Set<VersionedProcessor> processors) {
- this.processors = processors;
- }
-
- @ApiModelProperty("The Input Ports")
- public Set<VersionedPort> getInputPorts() {
- return inputPorts;
- }
-
- public void setInputPorts(Set<VersionedPort> inputPorts) {
- this.inputPorts = inputPorts;
- }
-
- @ApiModelProperty("The Output Ports")
- public Set<VersionedPort> getOutputPorts() {
- return outputPorts;
- }
-
- public void setOutputPorts(Set<VersionedPort> outputPorts) {
- this.outputPorts = outputPorts;
- }
-
- @ApiModelProperty("The Connections")
- public Set<VersionedConnection> getConnections() {
- return connections;
- }
-
- public void setConnections(Set<VersionedConnection> connections) {
- this.connections = connections;
- }
-
- @ApiModelProperty("The Labels")
- public Set<VersionedLabel> getLabels() {
- return labels;
- }
-
- public void setLabels(Set<VersionedLabel> labels) {
- this.labels = labels;
- }
-
- @ApiModelProperty("The Funnels")
- public Set<VersionedFunnel> getFunnels() {
- return funnels;
- }
-
- public void setFunnels(Set<VersionedFunnel> funnels) {
- this.funnels = funnels;
- }
-
- @ApiModelProperty("The Controller Services")
- public Set<VersionedControllerService> getControllerServices() {
- return controllerServices;
- }
-
- public void setControllerServices(Set<VersionedControllerService> controllerServices) {
- this.controllerServices = controllerServices;
- }
-
- @Override
- public ComponentType getComponentType() {
- return ComponentType.PROCESS_GROUP;
- }
-}
http://git-wip-us.apache.org/repos/asf/nifi-registry/blob/9eb0cef0/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedProcessor.java
----------------------------------------------------------------------
diff --git a/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedProcessor.java b/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedProcessor.java
deleted file mode 100644
index 4678726..0000000
--- a/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedProcessor.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.nifi.registry.flow;
-
-import java.util.Map;
-import java.util.Set;
-
-import io.swagger.annotations.ApiModelProperty;
-
-public class VersionedProcessor extends VersionedComponent {
-
- private Bundle bundle;
- private Map<String, String> style;
-
- private Map<String, String> properties;
- private String annotationData;
-
- private String schedulingPeriod;
- private String schedulingStrategy;
- private String executionNode;
- private String penaltyDuration;
- private String yieldDuration;
- private String bulletinLevel;
- private Long runDurationMillis;
- private Integer concurrentlySchedulableTaskCount;
- private Set<String> autoTerminatedRelationships;
-
-
- @ApiModelProperty("The frequency with which to schedule the processor. The format of the value will depend on th value of schedulingStrategy.")
- public String getSchedulingPeriod() {
- return schedulingPeriod;
- }
-
- public void setSchedulingPeriod(String setSchedulingPeriod) {
- this.schedulingPeriod = setSchedulingPeriod;
- }
-
- @ApiModelProperty("Indcates whether the prcessor should be scheduled to run in event or timer driven mode.")
- public String getSchedulingStrategy() {
- return schedulingStrategy;
- }
-
- public void setSchedulingStrategy(String schedulingStrategy) {
- this.schedulingStrategy = schedulingStrategy;
- }
-
- @ApiModelProperty("Indicates the node where the process will execute.")
- public String getExecutionNode() {
- return executionNode;
- }
-
- public void setExecutionNode(String executionNode) {
- this.executionNode = executionNode;
- }
-
- @ApiModelProperty("The amout of time that is used when the process penalizes a flowfile.")
- public String getPenaltyDuration() {
- return penaltyDuration;
- }
-
- public void setPenaltyDuration(String penaltyDuration) {
- this.penaltyDuration = penaltyDuration;
- }
-
- @ApiModelProperty("The amount of time that must elapse before this processor is scheduled again after yielding.")
- public String getYieldDuration() {
- return yieldDuration;
- }
-
- public void setYieldDuration(String yieldDuration) {
- this.yieldDuration = yieldDuration;
- }
-
- @ApiModelProperty("The level at which the processor will report bulletins.")
- public String getBulletinLevel() {
- return bulletinLevel;
- }
-
- public void setBulletinLevel(String bulletinLevel) {
- this.bulletinLevel = bulletinLevel;
- }
-
- @ApiModelProperty("The number of tasks that should be concurrently schedule for the processor. If the processor doesn't allow parallol processing then any positive input will be ignored.")
- public Integer getConcurrentlySchedulableTaskCount() {
- return concurrentlySchedulableTaskCount;
- }
-
- public void setConcurrentlySchedulableTaskCount(Integer concurrentlySchedulableTaskCount) {
- this.concurrentlySchedulableTaskCount = concurrentlySchedulableTaskCount;
- }
-
-
- @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;
- }
-
- public void setProperties(Map<String, String> properties) {
- this.properties = properties;
- }
-
- @ApiModelProperty("The annotation data for the processor used to relay configuration between a custom UI and the procesosr.")
- public String getAnnotationData() {
- return annotationData;
- }
-
- public void setAnnotationData(String annotationData) {
- this.annotationData = annotationData;
- }
-
-
- @ApiModelProperty("The names of all relationships that cause a flow file to be terminated if the relationship is not connected elsewhere. This property differs "
- + "from the 'isAutoTerminate' property of the RelationshipDTO in that the RelationshipDTO is meant to depict the current configuration, whereas this "
- + "property can be set in a DTO when updating a Processor in order to change which Relationships should be auto-terminated.")
- public Set<String> getAutoTerminatedRelationships() {
- return autoTerminatedRelationships;
- }
-
- public void setAutoTerminatedRelationships(final Set<String> autoTerminatedRelationships) {
- this.autoTerminatedRelationships = autoTerminatedRelationships;
- }
-
- @ApiModelProperty("The run duration for the processor in milliseconds.")
- public Long getRunDurationMillis() {
- return runDurationMillis;
- }
-
- public void setRunDurationMillis(Long runDurationMillis) {
- this.runDurationMillis = runDurationMillis;
- }
-
- @ApiModelProperty("Information about the bundle from which the component came")
- public Bundle getBundle() {
- return bundle;
- }
-
- public void setBundle(Bundle bundle) {
- this.bundle = bundle;
- }
-
- @ApiModelProperty("Stylistic data for rendering in a UI")
- public Map<String, String> getStyle() {
- return style;
- }
-
- public void setStyle(Map<String, String> style) {
- this.style = style;
- }
-
- @Override
- public ComponentType getComponentType() {
- return ComponentType.PROCESSOR;
- }
-}
http://git-wip-us.apache.org/repos/asf/nifi-registry/blob/9eb0cef0/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedRemoteGroupPort.java
----------------------------------------------------------------------
diff --git a/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedRemoteGroupPort.java b/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedRemoteGroupPort.java
deleted file mode 100644
index 73b037e..0000000
--- a/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedRemoteGroupPort.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.nifi.registry.flow;
-
-import java.util.Objects;
-
-import io.swagger.annotations.ApiModelProperty;
-
-public class VersionedRemoteGroupPort extends VersionedComponent {
- private String groupId;
- private Integer concurrentlySchedulableTaskCount;
- private Boolean useCompression;
- private BatchSize batchSize;
- private ComponentType componentType;
-
- @ApiModelProperty("The number of task that may transmit flowfiles to the target port concurrently.")
- public Integer getConcurrentlySchedulableTaskCount() {
- return concurrentlySchedulableTaskCount;
- }
-
- public void setConcurrentlySchedulableTaskCount(Integer concurrentlySchedulableTaskCount) {
- this.concurrentlySchedulableTaskCount = concurrentlySchedulableTaskCount;
- }
-
- @ApiModelProperty("The id of the remote process group that the port resides in.")
- public String getGroupId() {
- return groupId;
- }
-
- public void setGroupId(String groupId) {
- this.groupId = groupId;
- }
-
-
- @ApiModelProperty("Whether the flowfiles are compressed when sent to the target port.")
- public Boolean isUseCompression() {
- return useCompression;
- }
-
- public void setUseCompression(Boolean useCompression) {
- this.useCompression = useCompression;
- }
-
- @ApiModelProperty("The batch settings for data transmission.")
- public BatchSize getBatchSize() {
- return batchSize;
- }
-
- public void setBatchSettings(BatchSize batchSize) {
- this.batchSize = batchSize;
- }
-
- @Override
- public int hashCode() {
- return 923847 + String.valueOf(getName()).hashCode();
- }
-
- @Override
- public boolean equals(final Object obj) {
- if (obj == null) {
- return false;
- }
- if (!(obj instanceof VersionedRemoteGroupPort)) {
- return false;
- }
-
- final VersionedRemoteGroupPort other = (VersionedRemoteGroupPort) obj;
- return Objects.equals(getName(), other.getName());
- }
-
- @Override
- public ComponentType getComponentType() {
- return componentType;
- }
-
- public void setComponentType(final ComponentType componentType) {
- if (componentType != ComponentType.REMOTE_INPUT_PORT && componentType != ComponentType.REMOTE_OUTPUT_PORT) {
- throw new IllegalArgumentException();
- }
-
- this.componentType = componentType;
- }
-}
http://git-wip-us.apache.org/repos/asf/nifi-registry/blob/9eb0cef0/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedRemoteProcessGroup.java
----------------------------------------------------------------------
diff --git a/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedRemoteProcessGroup.java b/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedRemoteProcessGroup.java
deleted file mode 100644
index 8417cfc..0000000
--- a/nifi-registry-flow-data-model/src/main/java/org/apache/nifi/registry/flow/VersionedRemoteProcessGroup.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.nifi.registry.flow;
-
-import java.util.Set;
-
-import io.swagger.annotations.ApiModelProperty;
-
-public class VersionedRemoteProcessGroup extends VersionedComponent {
- private String targetUri;
- private String targetUris;
- private Boolean targetSecure;
-
- private String communicationsTimeout;
- private String yieldDuration;
- private SiteToSiteTransportProtocol transportProtocol;
- private String localNetworkInterface;
- private String proxyHost;
- private Integer proxyPort;
- private String proxyUser;
-
- private Set<VersionedRemoteGroupPort> inputPorts;
- private Set<VersionedRemoteGroupPort> outputPorts;
-
-
- public void setTargetUri(final String targetUri) {
- this.targetUri = targetUri;
- }
-
-
- @ApiModelProperty("The target URI of the remote process group." +
- " If target uri is not set, but uris are set, then returns the first url in the urls." +
- " If neither target uri nor uris are set, then returns null.")
- public String getTargetUri() {
- if (targetUri == null || targetUri.length() == 0) {
- if (targetUri == null || targetUri.length() == 0) {
- if (targetUris != null && targetUris.length() > 0) {
- if (targetUris.indexOf(',') > -1) {
- targetUri = targetUris.substring(0, targetUris.indexOf(','));
- } else {
- targetUri = targetUris;
- }
- }
- }
- }
-
- return this.targetUri;
- }
-
- public void setTargetUris(String targetUris) {
- this.targetUris = targetUris;
- }
-
-
- @ApiModelProperty("The target URI of the remote process group." +
- " If target uris is not set but target uri is set," +
- " then returns a collection containing the single target uri." +
- " If neither target uris nor uris are set, then returns null.")
- public String getTargetUris() {
- if (targetUris == null || targetUris.length() == 0) {
- if (targetUris == null || targetUris.length() == 0) {
- targetUris = targetUri;
- }
- }
-
- return this.targetUris;
- }
-
-
- @ApiModelProperty("Whether the target is running securely.")
- public Boolean isTargetSecure() {
- return targetSecure;
- }
-
- public void setTargetSecure(Boolean targetSecure) {
- this.targetSecure = targetSecure;
- }
-
- @ApiModelProperty("The time period used for the timeout when communicating with the target.")
- public String getCommunicationsTimeout() {
- return communicationsTimeout;
- }
-
- public void setCommunicationsTimeout(String communicationsTimeout) {
- this.communicationsTimeout = communicationsTimeout;
- }
-
- @ApiModelProperty("When yielding, this amount of time must elapse before the remote process group is scheduled again.")
- public String getYieldDuration() {
- return yieldDuration;
- }
-
- public void setYieldDuration(String yieldDuration) {
- this.yieldDuration = yieldDuration;
- }
-
-
- public SiteToSiteTransportProtocol getTransportProtocol() {
- return transportProtocol;
- }
-
- public void setTransportProtocol(SiteToSiteTransportProtocol transportProtocol) {
- this.transportProtocol = transportProtocol;
- }
-
- @ApiModelProperty("A Set of Input Ports that can be connected to, in order to send data to the remote NiFi instance")
- public Set<VersionedRemoteGroupPort> getInputPorts() {
- return inputPorts;
- }
-
- public void setInputPorts(Set<VersionedRemoteGroupPort> inputPorts) {
- this.inputPorts = inputPorts;
- }
-
- @ApiModelProperty("A Set of Output Ports that can be connected to, in order to pull data from the remote NiFi instance")
- public Set<VersionedRemoteGroupPort> getOutputPorts() {
- return outputPorts;
- }
-
- public void setOutputPorts(Set<VersionedRemoteGroupPort> outputPorts) {
- this.outputPorts = outputPorts;
- }
-
-
- @ApiModelProperty("The local network interface to send/receive data. If not specified, any local address is used. If clustered, all nodes must have an interface with this identifier.")
- public String getLocalNetworkInterface() {
- return localNetworkInterface;
- }
-
- public void setLocalNetworkInterface(String localNetworkInterface) {
- this.localNetworkInterface = localNetworkInterface;
- }
-
- public String getProxyHost() {
- return proxyHost;
- }
-
- public void setProxyHost(String proxyHost) {
- this.proxyHost = proxyHost;
- }
-
- public Integer getProxyPort() {
- return proxyPort;
- }
-
- public void setProxyPort(Integer proxyPort) {
- this.proxyPort = proxyPort;
- }
-
- public String getProxyUser() {
- return proxyUser;
- }
-
- public void setProxyUser(String proxyUser) {
- this.proxyUser = proxyUser;
- }
-
- @Override
- public ComponentType getComponentType() {
- return ComponentType.REMOTE_PROCESS_GROUP;
- }
-}
http://git-wip-us.apache.org/repos/asf/nifi-registry/blob/9eb0cef0/nifi-registry-framework/pom.xml
----------------------------------------------------------------------
diff --git a/nifi-registry-framework/pom.xml b/nifi-registry-framework/pom.xml
new file mode 100644
index 0000000..4f36538
--- /dev/null
+++ b/nifi-registry-framework/pom.xml
@@ -0,0 +1,80 @@
+<?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">
+ <parent>
+ <groupId>org.apache.nifi.registry</groupId>
+ <artifactId>nifi-registry</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>nifi-registry-framework</artifactId>
+ <packaging>jar</packaging>
+
+ <build>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ </resource>
+ <resource>
+ <directory>src/main/xsd</directory>
+ </resource>
+ </resources>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>jaxb2-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>current</id>
+ <goals>
+ <goal>xjc</goal>
+ </goals>
+ <configuration>
+ <packageName>org.apache.nifi.registry.provider.generated</packageName>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <configuration>
+ <excludes>**/provider/generated/*.java,</excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.nifi.registry</groupId>
+ <artifactId>nifi-registry-provider-api</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.nifi.registry</groupId>
+ <artifactId>nifi-registry-properties</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.12</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
http://git-wip-us.apache.org/repos/asf/nifi-registry/blob/9eb0cef0/nifi-registry-framework/src/main/java/org/apache/nifi/registry/flow/StandardFlowSnapshotContext.java
----------------------------------------------------------------------
diff --git a/nifi-registry-framework/src/main/java/org/apache/nifi/registry/flow/StandardFlowSnapshotContext.java b/nifi-registry-framework/src/main/java/org/apache/nifi/registry/flow/StandardFlowSnapshotContext.java
new file mode 100644
index 0000000..3b29e97
--- /dev/null
+++ b/nifi-registry-framework/src/main/java/org/apache/nifi/registry/flow/StandardFlowSnapshotContext.java
@@ -0,0 +1,140 @@
+/*
+ * 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 org.apache.commons.lang3.Validate;
+
+/**
+ * Standard implementation of FlowSnapshotContext.
+ */
+public class StandardFlowSnapshotContext implements FlowSnapshotContext {
+
+ private final String bucketId;
+ private final String bucketName;
+ private final String flowId;
+ private final String flowName;
+ private final int version;
+ private final String comments;
+ private final long snapshotTimestamp;
+
+ private StandardFlowSnapshotContext(final Builder builder) {
+ this.bucketId = builder.bucketId;
+ this.bucketName = builder.bucketName;
+ this.flowId = builder.flowId;
+ this.flowName = builder.flowName;
+ this.version = builder.version;
+ this.comments = builder.comments;
+ this.snapshotTimestamp = builder.snapshotTimestamp;
+
+ Validate.notBlank(bucketId);
+ Validate.notBlank(bucketName);
+ Validate.notBlank(flowId);
+ Validate.notBlank(flowName);
+ Validate.isTrue(version > 0);
+ Validate.isTrue(snapshotTimestamp > 0);
+ }
+
+ @Override
+ public String getBucketId() {
+ return bucketId;
+ }
+
+ @Override
+ public String getBucketName() {
+ return bucketName;
+ }
+
+ @Override
+ public String getFlowId() {
+ return flowId;
+ }
+
+ @Override
+ public String getFlowName() {
+ return flowName;
+ }
+
+ @Override
+ public int getVersion() {
+ return version;
+ }
+
+ @Override
+ public String getComments() {
+ return comments;
+ }
+
+ @Override
+ public long getSnapshotTimestamp() {
+ return snapshotTimestamp;
+ }
+
+ /**
+ * Builder for creating instances of StandardFlowSnapshotContext.
+ */
+ public static class Builder {
+
+ private String bucketId;
+ private String bucketName;
+ private String flowId;
+ private String flowName;
+ private int version;
+ private String comments;
+ private long snapshotTimestamp;
+
+ public Builder bucketId(final String bucketId) {
+ this.bucketId = bucketId;
+ return this;
+ }
+
+ public Builder bucketName(final String bucketName) {
+ this.bucketName = bucketName;
+ return this;
+ }
+
+ public Builder flowId(final String flowId) {
+ this.flowId = flowId;
+ return this;
+ }
+
+ public Builder flowName(final String flowName) {
+ this.flowName = flowName;
+ return this;
+ }
+
+ public Builder version(final int version) {
+ this.version = version;
+ return this;
+ }
+
+ public Builder comments(final String comments) {
+ this.comments = comments;
+ return this;
+ }
+
+ public Builder snapshotTimestamp(final long snapshotTimestamp) {
+ this.snapshotTimestamp = snapshotTimestamp;
+ return this;
+ }
+
+ public StandardFlowSnapshotContext build() {
+ return new StandardFlowSnapshotContext(this);
+ }
+
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/nifi-registry/blob/9eb0cef0/nifi-registry-framework/src/main/java/org/apache/nifi/registry/provider/ProviderFactory.java
----------------------------------------------------------------------
diff --git a/nifi-registry-framework/src/main/java/org/apache/nifi/registry/provider/ProviderFactory.java b/nifi-registry-framework/src/main/java/org/apache/nifi/registry/provider/ProviderFactory.java
new file mode 100644
index 0000000..0e6229c
--- /dev/null
+++ b/nifi-registry-framework/src/main/java/org/apache/nifi/registry/provider/ProviderFactory.java
@@ -0,0 +1,44 @@
+/*
+ * 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.provider;
+
+import org.apache.nifi.registry.flow.FlowPersistenceProvider;
+import org.apache.nifi.registry.metadata.MetadataProvider;
+
+/**
+ * A factory for obtaining the configured providers.
+ */
+public interface ProviderFactory {
+
+ /**
+ * Initialize the factory.
+ *
+ * @throws ProviderFactoryException if an error occurs during initialization
+ */
+ void initialize() throws ProviderFactoryException;
+
+ /**
+ * @return the configured MetadataProvider
+ */
+ MetadataProvider getMetadataProvider();
+
+ /**
+ * @return the configured FlowPersistenceProvider
+ */
+ FlowPersistenceProvider getFlowPersistenceProvider();
+
+}
http://git-wip-us.apache.org/repos/asf/nifi-registry/blob/9eb0cef0/nifi-registry-framework/src/main/java/org/apache/nifi/registry/provider/ProviderFactoryException.java
----------------------------------------------------------------------
diff --git a/nifi-registry-framework/src/main/java/org/apache/nifi/registry/provider/ProviderFactoryException.java b/nifi-registry-framework/src/main/java/org/apache/nifi/registry/provider/ProviderFactoryException.java
new file mode 100644
index 0000000..3842b9e
--- /dev/null
+++ b/nifi-registry-framework/src/main/java/org/apache/nifi/registry/provider/ProviderFactoryException.java
@@ -0,0 +1,38 @@
+/*
+ * 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.provider;
+
+/**
+ * An error that occurs while initializing a ProviderFactory.
+ */
+public class ProviderFactoryException extends RuntimeException {
+
+ public ProviderFactoryException() {
+ }
+
+ public ProviderFactoryException(String message) {
+ super(message);
+ }
+
+ public ProviderFactoryException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public ProviderFactoryException(Throwable cause) {
+ super(cause);
+ }
+}