NIFI-1563: Refactored the <Component>StatusDTO objects into <Component>StatusDTO, <Component>StatusSnapshotDTO, Node<Component>StatusSnapshotDTO objects
Project: http://git-wip-us.apache.org/repos/asf/nifi/repo Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/a901bc65 Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/a901bc65 Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/a901bc65 Branch: refs/heads/NIFI-1563 Commit: a901bc65fc1c4bed6a1dc7b9aa097ff856734022 Parents: deba41d Author: Mark Payne <[email protected]> Authored: Wed Mar 9 13:38:03 2016 -0500 Committer: Mark Payne <[email protected]> Committed: Wed Mar 9 13:38:03 2016 -0500 ---------------------------------------------------------------------- .../dto/status/ClusterConnectionStatusDTO.java | 94 ---- .../status/ClusterProcessGroupStatusDTO.java | 102 ---- .../dto/status/ClusterProcessorStatusDTO.java | 127 ----- .../ClusterRemoteProcessGroupStatusDTO.java | 94 ---- .../web/api/dto/status/ConnectionStatusDTO.java | 204 ++----- .../dto/status/ConnectionStatusSnapshotDTO.java | 279 ++++++++++ .../api/dto/status/NodeConnectionStatusDTO.java | 60 -- .../status/NodeConnectionStatusSnapshotDTO.java | 78 +++ .../dto/status/NodePortStatusSnapshotDTO.java | 77 +++ .../dto/status/NodeProcessGroupStatusDTO.java | 64 --- .../NodeProcessGroupStatusSnapshotDTO.java | 76 +++ .../api/dto/status/NodeProcessorStatusDTO.java | 60 -- .../status/NodeProcessorStatusSnapshotDTO.java | 80 +++ .../status/NodeRemotePortStatusSnapshotDTO.java | 77 +++ .../status/NodeRemoteProcessGroupStatusDTO.java | 60 -- ...NodeRemoteProcessGroupStatusSnapshotDTO.java | 77 +++ .../nifi/web/api/dto/status/PortStatusDTO.java | 134 +---- .../api/dto/status/PortStatusSnapshotDTO.java | 194 +++++++ .../api/dto/status/ProcessGroupStatusDTO.java | 523 +---------------- .../status/ProcessGroupStatusSnapshotDTO.java | 557 +++++++++++++++++++ .../web/api/dto/status/ProcessorStatusDTO.java | 293 +++------- .../dto/status/ProcessorStatusSnapshotDTO.java | 300 ++++++++++ .../web/api/dto/status/RemotePortStatusDTO.java | 10 +- .../dto/status/RemoteProcessGroupStatusDTO.java | 158 +----- .../RemoteProcessGroupStatusSnapshotDTO.java | 215 +++++++ .../nifi/web/api/dto/status/StatusDTO.java | 57 -- .../nifi/web/api/dto/status/StatusMerger.java | 135 +++-- .../entity/ClusterConnectionStatusEntity.java | 43 -- .../entity/ClusterProcessGroupStatusEntity.java | 43 -- .../entity/ClusterProcessorStatusEntity.java | 43 -- .../ClusterRemoteProcessGroupStatusEntity.java | 44 -- .../cluster/manager/impl/WebClusterManager.java | 45 +- .../org/apache/nifi/web/NiFiServiceFacade.java | 49 +- .../nifi/web/StandardNiFiServiceFacade.java | 366 ------------ .../apache/nifi/web/api/ClusterResource.java | 253 --------- .../nifi/web/api/ProcessGroupResource.java | 21 +- .../org/apache/nifi/web/api/dto/DtoFactory.java | 278 ++++----- 37 files changed, 2399 insertions(+), 2971 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/nifi/blob/a901bc65/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/ClusterConnectionStatusDTO.java ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/ClusterConnectionStatusDTO.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/ClusterConnectionStatusDTO.java deleted file mode 100644 index 34f900f..0000000 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/ClusterConnectionStatusDTO.java +++ /dev/null @@ -1,94 +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.web.api.dto.status; - -import com.wordnik.swagger.annotations.ApiModelProperty; -import java.util.Collection; -import java.util.Date; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; -import org.apache.nifi.web.api.dto.util.TimeAdapter; - -/** - * DTO for serializing the a connection's status across the cluster. - */ -@XmlType(name = "clusterConnectionStatus") -public class ClusterConnectionStatusDTO { - - private Collection<NodeConnectionStatusDTO> nodeConnectionStatus; - private Date statsLastRefreshed; - private String connectionId; - private String connectionName; - - /** - * @return time the status were last refreshed - */ - @XmlJavaTypeAdapter(TimeAdapter.class) - @ApiModelProperty( - value = "The time the status was last refreshed." - ) - public Date getStatsLastRefreshed() { - return statsLastRefreshed; - } - - public void setStatsLastRefreshed(Date statsLastRefreshed) { - this.statsLastRefreshed = statsLastRefreshed; - } - - /** - * @return connection id - */ - @ApiModelProperty( - value = "The id of the connection." - ) - public String getConnectionId() { - return connectionId; - } - - public void setConnectionId(String connectionId) { - this.connectionId = connectionId; - } - - /** - * @return connection name - */ - @ApiModelProperty( - value = "The name of the connection." - ) - public String getConnectionName() { - return connectionName; - } - - public void setConnectionName(String connectionName) { - this.connectionName = connectionName; - } - - /** - * @return The collection of node connection status DTO - */ - @ApiModelProperty( - value = "The connection status for each node." - ) - public Collection<NodeConnectionStatusDTO> getNodeConnectionStatus() { - return nodeConnectionStatus; - } - - public void setNodeConnectionStatus(Collection<NodeConnectionStatusDTO> nodeConnectionStatus) { - this.nodeConnectionStatus = nodeConnectionStatus; - } - -} http://git-wip-us.apache.org/repos/asf/nifi/blob/a901bc65/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/ClusterProcessGroupStatusDTO.java ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/ClusterProcessGroupStatusDTO.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/ClusterProcessGroupStatusDTO.java deleted file mode 100644 index 1a4ad63..0000000 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/ClusterProcessGroupStatusDTO.java +++ /dev/null @@ -1,102 +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.web.api.dto.status; - -import com.wordnik.swagger.annotations.ApiModelProperty; -import java.util.Collection; -import java.util.Date; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; -import org.apache.nifi.web.api.dto.util.TimeAdapter; - -/** - * DTO for serializing the a process group's status across the cluster. - */ -@XmlType(name = "clusterProcessGroupStatus") -public class ClusterProcessGroupStatusDTO { - - private Collection<NodeProcessGroupStatusDTO> nodeProcessGroupStatus; - private Date statsLastRefreshed; - private String processGroupId; - private String processGroupName; - - /** - * The time the status were last refreshed. - * - * @return The time the status were last refreshed - */ - @XmlJavaTypeAdapter(TimeAdapter.class) - @ApiModelProperty( - value = "The time when the stats was last refreshed." - ) - public Date getStatsLastRefreshed() { - return statsLastRefreshed; - } - - public void setStatsLastRefreshed(Date statsLastRefreshed) { - this.statsLastRefreshed = statsLastRefreshed; - } - - /** - * The process group id. - * - * @return The process group id - */ - @ApiModelProperty( - value = "The id of the process group." - ) - public String getProcessGroupId() { - return processGroupId; - } - - public void setProcessGroupId(String processGroupId) { - this.processGroupId = processGroupId; - } - - /** - * The process group name. - * - * @return The process group name - */ - @ApiModelProperty( - value = "The name of the process group." - ) - public String getProcessGroupName() { - return processGroupName; - } - - public void setProcessGroupName(String processGroupName) { - this.processGroupName = processGroupName; - } - - /** - * Collection of node process group status DTO. - * - * @return The collection of node process group status DTO - */ - @ApiModelProperty( - value = "The process groups status for each node." - ) - public Collection<NodeProcessGroupStatusDTO> getNodeProcessGroupStatus() { - return nodeProcessGroupStatus; - } - - public void setNodeProcessGroupStatus(Collection<NodeProcessGroupStatusDTO> nodeProcessGroupStatus) { - this.nodeProcessGroupStatus = nodeProcessGroupStatus; - } - -} http://git-wip-us.apache.org/repos/asf/nifi/blob/a901bc65/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/ClusterProcessorStatusDTO.java ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/ClusterProcessorStatusDTO.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/ClusterProcessorStatusDTO.java deleted file mode 100644 index faedc57..0000000 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/ClusterProcessorStatusDTO.java +++ /dev/null @@ -1,127 +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.web.api.dto.status; - -import com.wordnik.swagger.annotations.ApiModelProperty; -import java.util.Collection; -import java.util.Date; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; -import org.apache.nifi.web.api.dto.util.TimeAdapter; - -/** - * DTO for serializing the a processor's status across the cluster. - */ -@XmlType(name = "clusterProcessorStatus") -public class ClusterProcessorStatusDTO { - - private Collection<NodeProcessorStatusDTO> nodeProcessorStatus; - private Date statsLastRefreshed; - private String processorId; - private String processorName; - private String processorType; - private String processorRunStatus; - - /** - * @return time the status were last refreshed - */ - @XmlJavaTypeAdapter(TimeAdapter.class) - @ApiModelProperty( - value = "The time when the status was last refreshed." - ) - public Date getStatsLastRefreshed() { - return statsLastRefreshed; - } - - public void setStatsLastRefreshed(Date statsLastRefreshed) { - this.statsLastRefreshed = statsLastRefreshed; - } - - /** - * @return processor id - */ - @ApiModelProperty( - value = "The processor id." - ) - public String getProcessorId() { - return processorId; - } - - public void setProcessorId(String processorId) { - this.processorId = processorId; - } - - /** - * @return processor name - */ - @ApiModelProperty( - value = "The processor name." - ) - public String getProcessorName() { - return processorName; - } - - public void setProcessorName(String processorName) { - this.processorName = processorName; - } - - /** - * @return processor type - */ - @ApiModelProperty( - value = "The processor type." - ) - public String getProcessorType() { - return processorType; - } - - public void setProcessorType(String processorType) { - this.processorType = processorType; - } - - /** - * @return processor run status - */ - @ApiModelProperty( - value = "The processor state.", - allowableValues = "RUNNING, STOPPED, DISABLED, INVALID" - ) - public String getProcessorRunStatus() { - return processorRunStatus; - } - - public void setProcessorRunStatus(String runStatus) { - this.processorRunStatus = runStatus; - } - - /** - * Collection of node processor status DTO. - * - * @return The collection of node processor status DTO - */ - @ApiModelProperty( - value = "The processor status for each node." - ) - public Collection<NodeProcessorStatusDTO> getNodeProcessorStatus() { - return nodeProcessorStatus; - } - - public void setNodeProcessorStatus(Collection<NodeProcessorStatusDTO> nodeProcessorStatus) { - this.nodeProcessorStatus = nodeProcessorStatus; - } - -} http://git-wip-us.apache.org/repos/asf/nifi/blob/a901bc65/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/ClusterRemoteProcessGroupStatusDTO.java ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/ClusterRemoteProcessGroupStatusDTO.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/ClusterRemoteProcessGroupStatusDTO.java deleted file mode 100644 index 5fef96f..0000000 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/ClusterRemoteProcessGroupStatusDTO.java +++ /dev/null @@ -1,94 +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.web.api.dto.status; - -import com.wordnik.swagger.annotations.ApiModelProperty; -import java.util.Collection; -import java.util.Date; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; -import org.apache.nifi.web.api.dto.util.TimeAdapter; - -/** - * DTO for serializing the a remote process group's status across the cluster. - */ -@XmlType(name = "clusterRemoteProcessGroupStatus") -public class ClusterRemoteProcessGroupStatusDTO { - - private Collection<NodeRemoteProcessGroupStatusDTO> nodeRemoteProcessGroupStatus; - private Date statsLastRefreshed; - private String remoteProcessGroupId; - private String remoteProcessGroupName; - - /** - * @return the time the status were last refreshed - */ - @XmlJavaTypeAdapter(TimeAdapter.class) - @ApiModelProperty( - value = "The time when the remote process group status was last refreshed." - ) - public Date getStatsLastRefreshed() { - return statsLastRefreshed; - } - - public void setStatsLastRefreshed(Date statsLastRefreshed) { - this.statsLastRefreshed = statsLastRefreshed; - } - - /** - * @return remote process group status from each node in the cluster - */ - @ApiModelProperty( - value = "The remote process group status from each node in the cluster." - ) - public Collection<NodeRemoteProcessGroupStatusDTO> getNodeRemoteProcessGroupStatus() { - return nodeRemoteProcessGroupStatus; - } - - public void setNodeRemoteProcessGroupStatus(Collection<NodeRemoteProcessGroupStatusDTO> nodeRemoteProcessGroupStatus) { - this.nodeRemoteProcessGroupStatus = nodeRemoteProcessGroupStatus; - } - - /** - * @return remote process group id - */ - @ApiModelProperty( - value = "The id of the remote process group." - ) - public String getRemoteProcessGroupId() { - return remoteProcessGroupId; - } - - public void setRemoteProcessGroupId(String remoteProcessGroupId) { - this.remoteProcessGroupId = remoteProcessGroupId; - } - - /** - * @return remote process group name - */ - @ApiModelProperty( - value = "The name of the remote process group." - ) - public String getRemoteProcessGroupName() { - return remoteProcessGroupName; - } - - public void setRemoteProcessGroupName(String remoteProcessGroupName) { - this.remoteProcessGroupName = remoteProcessGroupName; - } - -} http://git-wip-us.apache.org/repos/asf/nifi/blob/a901bc65/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/ConnectionStatusDTO.java ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/ConnectionStatusDTO.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/ConnectionStatusDTO.java index 4083e1f..371dd05 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/ConnectionStatusDTO.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/ConnectionStatusDTO.java @@ -14,17 +14,18 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.nifi.web.api.dto.status; -import com.wordnik.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; + import javax.xml.bind.annotation.XmlType; -/** - * DTO for serializing the status of a connection. - */ +import com.wordnik.swagger.annotations.ApiModelProperty; + @XmlType(name = "connectionStatus") public class ConnectionStatusDTO implements Cloneable { - private String id; private String groupId; private String name; @@ -34,23 +35,10 @@ public class ConnectionStatusDTO implements Cloneable { private String destinationId; private String destinationName; - private Integer flowFilesIn = 0; - private Long bytesIn = 0L; - private String input; - private Integer flowFilesOut = 0; - private Long bytesOut = 0L; - private String output; - private Integer flowFilesQueued = 0; - private Long bytesQueued = 0L; - private String queued; - private String queuedSize; - private String queuedCount; + private ConnectionStatusSnapshotDTO aggregateSnapshot; + private List<NodeConnectionStatusSnapshotDTO> nodeStatuses; - /* getters / setters */ - /** - * @return The connection id - */ - @ApiModelProperty("The id of the connection.") + @ApiModelProperty("The ID of the connection") public String getId() { return id; } @@ -59,22 +47,16 @@ public class ConnectionStatusDTO implements Cloneable { this.id = id; } - /** - * @return the ID of the Process Group to which this connection belongs. - */ - @ApiModelProperty("The id of the process group the connection belongs to.") + @ApiModelProperty("The ID of the Process Group that the connection belongs to") public String getGroupId() { return groupId; } - public void setGroupId(final String groupId) { + public void setGroupId(String groupId) { this.groupId = groupId; } - /** - * @return name of this connection - */ - @ApiModelProperty("The name of the connection.") + @ApiModelProperty("The name of the connection") public String getName() { return name; } @@ -83,57 +65,7 @@ public class ConnectionStatusDTO implements Cloneable { this.name = name; } - /** - * @return total count of flow files that are queued - */ - @ApiModelProperty("The number of flowfiles that are queued, pretty printed.") - public String getQueuedCount() { - return queuedCount; - } - - public void setQueuedCount(String queuedCount) { - this.queuedCount = queuedCount; - } - - - /** - * @return total size of flow files that are queued - */ - @ApiModelProperty("The total size of flowfiles that are queued formatted.") - public String getQueuedSize() { - return queuedSize; - } - - - public void setInput(String input) { - this.input = input; - } - - public void setOutput(String output) { - this.output = output; - } - - public void setQueued(String queued) { - this.queued = queued; - } - - public void setQueuedSize(String queuedSize) { - this.queuedSize = queuedSize; - } - - /** - * @return The total count and size of queued flow files - */ - @ApiModelProperty("The total count and size of queued flowfiles formatted.") - public String getQueued() { - return queued; - } - - - /** - * @return id of the source of this connection - */ - @ApiModelProperty("The id of the source of the connection.") + @ApiModelProperty("The ID of the source component") public String getSourceId() { return sourceId; } @@ -142,10 +74,7 @@ public class ConnectionStatusDTO implements Cloneable { this.sourceId = sourceId; } - /** - * @return name of the source of this connection - */ - @ApiModelProperty("The name of the source of the connection.") + @ApiModelProperty("The name of the source component") public String getSourceName() { return sourceName; } @@ -154,10 +83,7 @@ public class ConnectionStatusDTO implements Cloneable { this.sourceName = sourceName; } - /** - * @return id of the destination of this connection - */ - @ApiModelProperty("The id of the destination of the connection.") + @ApiModelProperty("The ID of the destination component") public String getDestinationId() { return destinationId; } @@ -166,10 +92,7 @@ public class ConnectionStatusDTO implements Cloneable { this.destinationId = destinationId; } - /** - * @return name of the destination of this connection - */ - @ApiModelProperty("The name of the destination of the connection.") + @ApiModelProperty("The name of the destination component") public String getDestinationName() { return destinationName; } @@ -178,79 +101,24 @@ public class ConnectionStatusDTO implements Cloneable { this.destinationName = destinationName; } - /** - * @return input for this connection - */ - @ApiModelProperty("The input count/size for the connection in the last 5 minutes, pretty printed.") - public String getInput() { - return input; - } - - - /** - * @return output for this connection - */ - @ApiModelProperty("The output count/sie for the connection in the last 5 minutes, pretty printed.") - public String getOutput() { - return output; - } - - - @ApiModelProperty("The number of FlowFiles that have come into the connection in the last 5 minutes.") - public Integer getFlowFilesIn() { - return flowFilesIn; - } - - public void setFlowFilesIn(Integer flowFilesIn) { - this.flowFilesIn = flowFilesIn; - } - - @ApiModelProperty("The size of the FlowFiles that have come into the connection in the last 5 minutes.") - public Long getBytesIn() { - return bytesIn; - } - - public void setBytesIn(Long bytesIn) { - this.bytesIn = bytesIn; + @ApiModelProperty("The status snapshot that represents the aggregate stats of the cluster") + public ConnectionStatusSnapshotDTO getAggregateSnapshot() { + return aggregateSnapshot; } - @ApiModelProperty("The number of FlowFiles that have left the connection in the last 5 minutes.") - public Integer getFlowFilesOut() { - return flowFilesOut; + public void setAggregateSnapshot(ConnectionStatusSnapshotDTO aggregateSnapshot) { + this.aggregateSnapshot = aggregateSnapshot; } - public void setFlowFilesOut(Integer flowFilesOut) { - this.flowFilesOut = flowFilesOut; + @ApiModelProperty("A list of status snapshots for each node") + public List<NodeConnectionStatusSnapshotDTO> getNodeStatuses() { + return nodeStatuses; } - @ApiModelProperty("The number of bytes that have left the connection in the last 5 minutes.") - public Long getBytesOut() { - return bytesOut; + public void setNodeStatuses(List<NodeConnectionStatusSnapshotDTO> nodeStatuses) { + this.nodeStatuses = nodeStatuses; } - public void setBytesOut(Long bytesOut) { - this.bytesOut = bytesOut; - } - - @ApiModelProperty("The number of FlowFiles that are currently queued in the connection.") - public Integer getFlowFilesQueued() { - return flowFilesQueued; - } - - public void setFlowFilesQueued(Integer flowFilesQueued) { - this.flowFilesQueued = flowFilesQueued; - } - - @ApiModelProperty("The size of the FlowFiles that are currently queued in the connection.") - public Long getBytesQueued() { - return bytesQueued; - } - - public void setBytesQueued(Long bytesQueued) { - this.bytesQueued = bytesQueued; - } - - @Override public ConnectionStatusDTO clone() { final ConnectionStatusDTO other = new ConnectionStatusDTO(); @@ -261,18 +129,14 @@ public class ConnectionStatusDTO implements Cloneable { other.setName(getName()); other.setSourceId(getSourceId()); other.setSourceName(getSourceName()); - - other.setFlowFilesIn(getFlowFilesIn()); - other.setBytesIn(getBytesIn()); - other.setInput(getInput()); - other.setFlowFilesOut(getFlowFilesOut()); - other.setBytesOut(getBytesOut()); - other.setOutput(getOutput()); - other.setFlowFilesQueued(getFlowFilesQueued()); - other.setBytesQueued(getBytesQueued()); - other.setQueued(getQueued()); - other.setQueuedCount(getQueuedCount()); - other.setQueuedSize(getQueuedSize()); + other.setAggregateSnapshot(getAggregateSnapshot().clone()); + + final List<NodeConnectionStatusSnapshotDTO> nodeStatuses = getNodeStatuses(); + final List<NodeConnectionStatusSnapshotDTO> nodeStatusClones = new ArrayList<>(nodeStatuses.size()); + for (final NodeConnectionStatusSnapshotDTO nodeStatus : nodeStatuses) { + nodeStatusClones.add(nodeStatus.clone()); + } + other.setNodeStatuses(nodeStatusClones); return other; } http://git-wip-us.apache.org/repos/asf/nifi/blob/a901bc65/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/ConnectionStatusSnapshotDTO.java ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/ConnectionStatusSnapshotDTO.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/ConnectionStatusSnapshotDTO.java new file mode 100644 index 0000000..928fc71 --- /dev/null +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/ConnectionStatusSnapshotDTO.java @@ -0,0 +1,279 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.nifi.web.api.dto.status; + +import com.wordnik.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlType; + +/** + * DTO for serializing the status of a connection. + */ +@XmlType(name = "connectionStatusSnapshot") +public class ConnectionStatusSnapshotDTO implements Cloneable { + + private String id; + private String groupId; + private String name; + + private String sourceId; + private String sourceName; + private String destinationId; + private String destinationName; + + private Integer flowFilesIn = 0; + private Long bytesIn = 0L; + private String input; + private Integer flowFilesOut = 0; + private Long bytesOut = 0L; + private String output; + private Integer flowFilesQueued = 0; + private Long bytesQueued = 0L; + private String queued; + private String queuedSize; + private String queuedCount; + + /* getters / setters */ + /** + * @return The connection id + */ + @ApiModelProperty("The id of the connection.") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + /** + * @return the ID of the Process Group to which this connection belongs. + */ + @ApiModelProperty("The id of the process group the connection belongs to.") + public String getGroupId() { + return groupId; + } + + public void setGroupId(final String groupId) { + this.groupId = groupId; + } + + /** + * @return name of this connection + */ + @ApiModelProperty("The name of the connection.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * @return total count of flow files that are queued + */ + @ApiModelProperty("The number of flowfiles that are queued, pretty printed.") + public String getQueuedCount() { + return queuedCount; + } + + public void setQueuedCount(String queuedCount) { + this.queuedCount = queuedCount; + } + + + /** + * @return total size of flow files that are queued + */ + @ApiModelProperty("The total size of flowfiles that are queued formatted.") + public String getQueuedSize() { + return queuedSize; + } + + + public void setInput(String input) { + this.input = input; + } + + public void setOutput(String output) { + this.output = output; + } + + public void setQueued(String queued) { + this.queued = queued; + } + + public void setQueuedSize(String queuedSize) { + this.queuedSize = queuedSize; + } + + /** + * @return The total count and size of queued flow files + */ + @ApiModelProperty("The total count and size of queued flowfiles formatted.") + public String getQueued() { + return queued; + } + + + /** + * @return id of the source of this connection + */ + @ApiModelProperty("The id of the source of the connection.") + public String getSourceId() { + return sourceId; + } + + public void setSourceId(String sourceId) { + this.sourceId = sourceId; + } + + /** + * @return name of the source of this connection + */ + @ApiModelProperty("The name of the source of the connection.") + public String getSourceName() { + return sourceName; + } + + public void setSourceName(String sourceName) { + this.sourceName = sourceName; + } + + /** + * @return id of the destination of this connection + */ + @ApiModelProperty("The id of the destination of the connection.") + public String getDestinationId() { + return destinationId; + } + + public void setDestinationId(String destinationId) { + this.destinationId = destinationId; + } + + /** + * @return name of the destination of this connection + */ + @ApiModelProperty("The name of the destination of the connection.") + public String getDestinationName() { + return destinationName; + } + + public void setDestinationName(String destinationName) { + this.destinationName = destinationName; + } + + /** + * @return input for this connection + */ + @ApiModelProperty("The input count/size for the connection in the last 5 minutes, pretty printed.") + public String getInput() { + return input; + } + + + /** + * @return output for this connection + */ + @ApiModelProperty("The output count/sie for the connection in the last 5 minutes, pretty printed.") + public String getOutput() { + return output; + } + + + @ApiModelProperty("The number of FlowFiles that have come into the connection in the last 5 minutes.") + public Integer getFlowFilesIn() { + return flowFilesIn; + } + + public void setFlowFilesIn(Integer flowFilesIn) { + this.flowFilesIn = flowFilesIn; + } + + @ApiModelProperty("The size of the FlowFiles that have come into the connection in the last 5 minutes.") + public Long getBytesIn() { + return bytesIn; + } + + public void setBytesIn(Long bytesIn) { + this.bytesIn = bytesIn; + } + + @ApiModelProperty("The number of FlowFiles that have left the connection in the last 5 minutes.") + public Integer getFlowFilesOut() { + return flowFilesOut; + } + + public void setFlowFilesOut(Integer flowFilesOut) { + this.flowFilesOut = flowFilesOut; + } + + @ApiModelProperty("The number of bytes that have left the connection in the last 5 minutes.") + public Long getBytesOut() { + return bytesOut; + } + + public void setBytesOut(Long bytesOut) { + this.bytesOut = bytesOut; + } + + @ApiModelProperty("The number of FlowFiles that are currently queued in the connection.") + public Integer getFlowFilesQueued() { + return flowFilesQueued; + } + + public void setFlowFilesQueued(Integer flowFilesQueued) { + this.flowFilesQueued = flowFilesQueued; + } + + @ApiModelProperty("The size of the FlowFiles that are currently queued in the connection.") + public Long getBytesQueued() { + return bytesQueued; + } + + public void setBytesQueued(Long bytesQueued) { + this.bytesQueued = bytesQueued; + } + + + @Override + public ConnectionStatusSnapshotDTO clone() { + final ConnectionStatusSnapshotDTO other = new ConnectionStatusSnapshotDTO(); + other.setDestinationId(getDestinationId()); + other.setDestinationName(getDestinationName()); + other.setGroupId(getGroupId()); + other.setId(getId()); + other.setName(getName()); + other.setSourceId(getSourceId()); + other.setSourceName(getSourceName()); + + other.setFlowFilesIn(getFlowFilesIn()); + other.setBytesIn(getBytesIn()); + other.setInput(getInput()); + other.setFlowFilesOut(getFlowFilesOut()); + other.setBytesOut(getBytesOut()); + other.setOutput(getOutput()); + other.setFlowFilesQueued(getFlowFilesQueued()); + other.setBytesQueued(getBytesQueued()); + other.setQueued(getQueued()); + other.setQueuedCount(getQueuedCount()); + other.setQueuedSize(getQueuedSize()); + + return other; + } +} http://git-wip-us.apache.org/repos/asf/nifi/blob/a901bc65/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/NodeConnectionStatusDTO.java ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/NodeConnectionStatusDTO.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/NodeConnectionStatusDTO.java deleted file mode 100644 index bcc4045..0000000 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/NodeConnectionStatusDTO.java +++ /dev/null @@ -1,60 +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.web.api.dto.status; - -import com.wordnik.swagger.annotations.ApiModelProperty; -import javax.xml.bind.annotation.XmlType; -import org.apache.nifi.web.api.dto.NodeDTO; - -/** - * DTO for serializing the connection status for a particular node. - */ -@XmlType(name = "nodeConnectionStatus") -public class NodeConnectionStatusDTO { - - private NodeDTO node; - private ConnectionStatusDTO connectionStatus; - - /** - * @return the node - */ - @ApiModelProperty( - value = "The node." - ) - public NodeDTO getNode() { - return node; - } - - public void setNode(NodeDTO node) { - this.node = node; - } - - /** - * @return connection's status - */ - @ApiModelProperty( - value = "The connection status from the node." - ) - public ConnectionStatusDTO getConnectionStatus() { - return connectionStatus; - } - - public void setConnectionStatus(ConnectionStatusDTO connectionStatus) { - this.connectionStatus = connectionStatus; - } - -} http://git-wip-us.apache.org/repos/asf/nifi/blob/a901bc65/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/NodeConnectionStatusSnapshotDTO.java ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/NodeConnectionStatusSnapshotDTO.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/NodeConnectionStatusSnapshotDTO.java new file mode 100644 index 0000000..41f7433 --- /dev/null +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/NodeConnectionStatusSnapshotDTO.java @@ -0,0 +1,78 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.nifi.web.api.dto.status; + +import javax.xml.bind.annotation.XmlType; + +import com.wordnik.swagger.annotations.ApiModelProperty; + +@XmlType(name = "nodeConnectionStatusSnapshot") +public class NodeConnectionStatusSnapshotDTO implements Cloneable { + private String nodeId; + private String address; + private Integer apiPort; + + private ConnectionStatusSnapshotDTO statusSnapshot; + + @ApiModelProperty("The unique ID that identifies the node") + public String getNodeId() { + return nodeId; + } + + public void setNodeId(String nodeId) { + this.nodeId = nodeId; + } + + @ApiModelProperty("The API address of the node") + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + @ApiModelProperty("The API port used to communicate with the node") + public Integer getApiPort() { + return apiPort; + } + + public void setApiPort(Integer apiPort) { + this.apiPort = apiPort; + } + + @ApiModelProperty("The connection status snapshot from the node.") + public ConnectionStatusSnapshotDTO getStatusSnapshot() { + return statusSnapshot; + } + + public void setStatusSnapshot(ConnectionStatusSnapshotDTO statusSnapshot) { + this.statusSnapshot = statusSnapshot; + } + + @Override + public NodeConnectionStatusSnapshotDTO clone() { + final NodeConnectionStatusSnapshotDTO other = new NodeConnectionStatusSnapshotDTO(); + other.setNodeId(getNodeId()); + other.setAddress(getAddress()); + other.setApiPort(getApiPort()); + other.setStatusSnapshot(getStatusSnapshot().clone()); + return other; + } + +} http://git-wip-us.apache.org/repos/asf/nifi/blob/a901bc65/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/NodePortStatusSnapshotDTO.java ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/NodePortStatusSnapshotDTO.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/NodePortStatusSnapshotDTO.java new file mode 100644 index 0000000..a8dc1ff --- /dev/null +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/NodePortStatusSnapshotDTO.java @@ -0,0 +1,77 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.nifi.web.api.dto.status; + +import javax.xml.bind.annotation.XmlType; + +import com.wordnik.swagger.annotations.ApiModelProperty; + +@XmlType(name = "nodePortStatusSnapshot") +public class NodePortStatusSnapshotDTO implements Cloneable { + private String nodeId; + private String address; + private Integer apiPort; + + private PortStatusSnapshotDTO statusSnapshot; + + @ApiModelProperty("The unique ID that identifies the node") + public String getNodeId() { + return nodeId; + } + + public void setNodeId(String nodeId) { + this.nodeId = nodeId; + } + + @ApiModelProperty("The API address of the node") + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + @ApiModelProperty("The API port used to communicate with the node") + public Integer getApiPort() { + return apiPort; + } + + public void setApiPort(Integer apiPort) { + this.apiPort = apiPort; + } + + @ApiModelProperty("The port status snapshot from the node.") + public PortStatusSnapshotDTO getStatusSnapshot() { + return statusSnapshot; + } + + public void setStatusSnapshot(PortStatusSnapshotDTO status) { + this.statusSnapshot = status; + } + + @Override + public NodePortStatusSnapshotDTO clone() { + final NodePortStatusSnapshotDTO other = new NodePortStatusSnapshotDTO(); + other.setNodeId(getNodeId()); + other.setAddress(getAddress()); + other.setApiPort(getApiPort()); + other.setStatusSnapshot(getStatusSnapshot().clone()); + return other; + } +} http://git-wip-us.apache.org/repos/asf/nifi/blob/a901bc65/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/NodeProcessGroupStatusDTO.java ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/NodeProcessGroupStatusDTO.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/NodeProcessGroupStatusDTO.java deleted file mode 100644 index 96c59fa..0000000 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/NodeProcessGroupStatusDTO.java +++ /dev/null @@ -1,64 +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.web.api.dto.status; - -import com.wordnik.swagger.annotations.ApiModelProperty; -import javax.xml.bind.annotation.XmlType; -import org.apache.nifi.web.api.dto.NodeDTO; - -/** - * DTO for serializing the process group status for a particular node. - */ -@XmlType(name = "nodeProcessGroupStatus") -public class NodeProcessGroupStatusDTO { - - private NodeDTO node; - private ProcessGroupStatusDTO processGroupStatus; - - /** - * The node. - * - * @return The node DTO - */ - @ApiModelProperty( - value = "The node." - ) - public NodeDTO getNode() { - return node; - } - - public void setNode(NodeDTO node) { - this.node = node; - } - - /** - * The process group's status. - * - * @return The process group status - */ - @ApiModelProperty( - value = "The process group status from the node." - ) - public ProcessGroupStatusDTO getProcessGroupStatus() { - return processGroupStatus; - } - - public void setProcessGroupStatus(ProcessGroupStatusDTO processGroupStatus) { - this.processGroupStatus = processGroupStatus; - } - -} http://git-wip-us.apache.org/repos/asf/nifi/blob/a901bc65/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/NodeProcessGroupStatusSnapshotDTO.java ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/NodeProcessGroupStatusSnapshotDTO.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/NodeProcessGroupStatusSnapshotDTO.java new file mode 100644 index 0000000..854b077 --- /dev/null +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/NodeProcessGroupStatusSnapshotDTO.java @@ -0,0 +1,76 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.nifi.web.api.dto.status; + +import com.wordnik.swagger.annotations.ApiModelProperty; + +public class NodeProcessGroupStatusSnapshotDTO implements Cloneable { + + private String nodeId; + private String address; + private Integer apiPort; + + private ProcessGroupStatusSnapshotDTO statusSnapshot; + + @ApiModelProperty("The unique ID that identifies the node") + public String getNodeId() { + return nodeId; + } + + public void setNodeId(String nodeId) { + this.nodeId = nodeId; + } + + @ApiModelProperty("The API address of the node") + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + @ApiModelProperty("The API port used to communicate with the node") + public Integer getApiPort() { + return apiPort; + } + + public void setApiPort(Integer apiPort) { + this.apiPort = apiPort; + } + + @ApiModelProperty("The process group status snapshot from the node.") + public ProcessGroupStatusSnapshotDTO getStatusSnapshot() { + return statusSnapshot; + } + + public void setStatusSnapshot(ProcessGroupStatusSnapshotDTO statusSnapshot) { + this.statusSnapshot = statusSnapshot; + } + + @Override + public NodeProcessGroupStatusSnapshotDTO clone() { + final NodeProcessGroupStatusSnapshotDTO other = new NodeProcessGroupStatusSnapshotDTO(); + other.setNodeId(getNodeId()); + other.setAddress(getAddress()); + other.setApiPort(getApiPort()); + other.setStatusSnapshot(getStatusSnapshot().clone()); + return other; + } + +} http://git-wip-us.apache.org/repos/asf/nifi/blob/a901bc65/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/NodeProcessorStatusDTO.java ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/NodeProcessorStatusDTO.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/NodeProcessorStatusDTO.java deleted file mode 100644 index 8c8f604..0000000 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/NodeProcessorStatusDTO.java +++ /dev/null @@ -1,60 +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.web.api.dto.status; - -import com.wordnik.swagger.annotations.ApiModelProperty; -import javax.xml.bind.annotation.XmlType; -import org.apache.nifi.web.api.dto.NodeDTO; - -/** - * DTO for serializing the processor status for a particular node. - */ -@XmlType(name = "nodeProcessorStatus") -public class NodeProcessorStatusDTO { - - private NodeDTO node; - private ProcessorStatusDTO processorStatus; - - /** - * @return the node - */ - @ApiModelProperty( - value = "The node." - ) - public NodeDTO getNode() { - return node; - } - - public void setNode(NodeDTO node) { - this.node = node; - } - - /** - * @return processor's status - */ - @ApiModelProperty( - value = "The processor status from the node." - ) - public ProcessorStatusDTO getProcessorStatus() { - return processorStatus; - } - - public void setProcessorStatus(ProcessorStatusDTO processorStatus) { - this.processorStatus = processorStatus; - } - -} http://git-wip-us.apache.org/repos/asf/nifi/blob/a901bc65/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/NodeProcessorStatusSnapshotDTO.java ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/NodeProcessorStatusSnapshotDTO.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/NodeProcessorStatusSnapshotDTO.java new file mode 100644 index 0000000..5ea4697 --- /dev/null +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/NodeProcessorStatusSnapshotDTO.java @@ -0,0 +1,80 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.nifi.web.api.dto.status; + +import javax.xml.bind.annotation.XmlType; + +import com.wordnik.swagger.annotations.ApiModelProperty; + +/** + * DTO for serializing the processor status for a particular node. + */ +@XmlType(name = "nodeProcessorStatusSnapshot") +public class NodeProcessorStatusSnapshotDTO implements Cloneable { + + private String nodeId; + private String address; + private Integer apiPort; + + private ProcessorStatusSnapshotDTO statusSnapshot; + + @ApiModelProperty("The unique ID that identifies the node") + public String getNodeId() { + return nodeId; + } + + public void setNodeId(String nodeId) { + this.nodeId = nodeId; + } + + @ApiModelProperty("The API address of the node") + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + @ApiModelProperty("The API port used to communicate with the node") + public Integer getApiPort() { + return apiPort; + } + + public void setApiPort(Integer apiPort) { + this.apiPort = apiPort; + } + + @ApiModelProperty("The processor status snapshot from the node.") + public ProcessorStatusSnapshotDTO getStatusSnapshot() { + return statusSnapshot; + } + + public void setStatusSnapshot(ProcessorStatusSnapshotDTO processorStatusSnapshot) { + this.statusSnapshot = processorStatusSnapshot; + } + + @Override + public NodeProcessorStatusSnapshotDTO clone() { + final NodeProcessorStatusSnapshotDTO other = new NodeProcessorStatusSnapshotDTO(); + other.setNodeId(getNodeId()); + other.setAddress(getAddress()); + other.setApiPort(getApiPort()); + other.setStatusSnapshot(getStatusSnapshot().clone()); + return other; + } +} http://git-wip-us.apache.org/repos/asf/nifi/blob/a901bc65/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/NodeRemotePortStatusSnapshotDTO.java ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/NodeRemotePortStatusSnapshotDTO.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/NodeRemotePortStatusSnapshotDTO.java new file mode 100644 index 0000000..3cd93bc --- /dev/null +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/NodeRemotePortStatusSnapshotDTO.java @@ -0,0 +1,77 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.nifi.web.api.dto.status; + +import javax.xml.bind.annotation.XmlType; + +import com.wordnik.swagger.annotations.ApiModelProperty; + +@XmlType(name = "nodeRemotePortStatusSnapshot") +public class NodeRemotePortStatusSnapshotDTO implements Cloneable { + private String nodeId; + private String address; + private Integer apiPort; + + private RemotePortStatusDTO statusSnapshot; + + @ApiModelProperty("The unique ID that identifies the node") + public String getNodeId() { + return nodeId; + } + + public void setNodeId(String nodeId) { + this.nodeId = nodeId; + } + + @ApiModelProperty("The API address of the node") + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + @ApiModelProperty("The API port used to communicate with the node") + public Integer getApiPort() { + return apiPort; + } + + public void setApiPort(Integer apiPort) { + this.apiPort = apiPort; + } + + @ApiModelProperty("The remote port status snapshot from the node.") + public RemotePortStatusDTO getStatusSnapshot() { + return statusSnapshot; + } + + public void setStatusSnapshot(RemotePortStatusDTO statusSnapshot) { + this.statusSnapshot = statusSnapshot; + } + + @Override + public NodeRemotePortStatusSnapshotDTO clone() { + final NodeRemotePortStatusSnapshotDTO other = new NodeRemotePortStatusSnapshotDTO(); + other.setNodeId(getNodeId()); + other.setAddress(getAddress()); + other.setApiPort(getApiPort()); + other.setStatusSnapshot(getStatusSnapshot().clone()); + return other; + } +} http://git-wip-us.apache.org/repos/asf/nifi/blob/a901bc65/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/NodeRemoteProcessGroupStatusDTO.java ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/NodeRemoteProcessGroupStatusDTO.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/NodeRemoteProcessGroupStatusDTO.java deleted file mode 100644 index 512b4c2..0000000 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/NodeRemoteProcessGroupStatusDTO.java +++ /dev/null @@ -1,60 +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.web.api.dto.status; - -import com.wordnik.swagger.annotations.ApiModelProperty; -import javax.xml.bind.annotation.XmlType; -import org.apache.nifi.web.api.dto.NodeDTO; - -/** - * DTO for serializing the remote process group status for a particular node. - */ -@XmlType(name = "nodeRemoteProcessGroupStatus") -public class NodeRemoteProcessGroupStatusDTO { - - private NodeDTO node; - private RemoteProcessGroupStatusDTO remoteProcessGroupStatus; - - /** - * @return the node - */ - @ApiModelProperty( - value = "The node." - ) - public NodeDTO getNode() { - return node; - } - - public void setNode(NodeDTO node) { - this.node = node; - } - - /** - * @return remote process group's status - */ - @ApiModelProperty( - value = "The remote process group status from the node." - ) - public RemoteProcessGroupStatusDTO getRemoteProcessGroupStatus() { - return remoteProcessGroupStatus; - } - - public void setRemoteProcessGroupStatus(RemoteProcessGroupStatusDTO remoteProcessGroupStatus) { - this.remoteProcessGroupStatus = remoteProcessGroupStatus; - } - -} http://git-wip-us.apache.org/repos/asf/nifi/blob/a901bc65/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/NodeRemoteProcessGroupStatusSnapshotDTO.java ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/NodeRemoteProcessGroupStatusSnapshotDTO.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/NodeRemoteProcessGroupStatusSnapshotDTO.java new file mode 100644 index 0000000..57658f2 --- /dev/null +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/NodeRemoteProcessGroupStatusSnapshotDTO.java @@ -0,0 +1,77 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.nifi.web.api.dto.status; + +import javax.xml.bind.annotation.XmlType; + +import com.wordnik.swagger.annotations.ApiModelProperty; + +@XmlType(name = "nodeRemoteProcessGroupStatusSnapshot") +public class NodeRemoteProcessGroupStatusSnapshotDTO implements Cloneable { + private String nodeId; + private String address; + private Integer apiPort; + + private RemoteProcessGroupStatusSnapshotDTO statusSnapshot; + + @ApiModelProperty("The unique ID that identifies the node") + public String getNodeId() { + return nodeId; + } + + public void setNodeId(String nodeId) { + this.nodeId = nodeId; + } + + @ApiModelProperty("The API address of the node") + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + @ApiModelProperty("The API port used to communicate with the node") + public Integer getApiPort() { + return apiPort; + } + + public void setApiPort(Integer apiPort) { + this.apiPort = apiPort; + } + + @ApiModelProperty("The remote process group status snapshot from the node.") + public RemoteProcessGroupStatusSnapshotDTO getStatusSnapshot() { + return statusSnapshot; + } + + public void setStatusSnapshot(RemoteProcessGroupStatusSnapshotDTO statusSnapshot) { + this.statusSnapshot = statusSnapshot; + } + + @Override + public NodeRemoteProcessGroupStatusSnapshotDTO clone() { + final NodeRemoteProcessGroupStatusSnapshotDTO other = new NodeRemoteProcessGroupStatusSnapshotDTO(); + other.setNodeId(getNodeId()); + other.setAddress(getAddress()); + other.setApiPort(getApiPort()); + other.setStatusSnapshot(getStatusSnapshot().clone()); + return other; + } +} http://git-wip-us.apache.org/repos/asf/nifi/blob/a901bc65/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/PortStatusDTO.java ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/PortStatusDTO.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/PortStatusDTO.java index 6a2a972..4fc9c60 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/PortStatusDTO.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/PortStatusDTO.java @@ -14,36 +14,26 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.nifi.web.api.dto.status; +import java.util.List; + import javax.xml.bind.annotation.XmlType; import com.wordnik.swagger.annotations.ApiModelProperty; -/** - * The status for a port in this NiFi. - */ @XmlType(name = "portStatus") -public class PortStatusDTO extends StatusDTO implements Cloneable { - +public class PortStatusDTO { private String id; private String groupId; private String name; - - private Integer activeThreadCount = 0; - private Integer flowFilesIn = 0; - private Long bytesIn = 0L; - private String input; - private Integer flowFilesOut = 0; - private Long bytesOut = 0L; - private String output; - private Boolean transmitting; private String runStatus; - /** - * @return whether this port has incoming or outgoing connections to a remote NiFi - */ + private PortStatusSnapshotDTO aggregateStatus; + private List<NodePortStatusSnapshotDTO> nodeStatuses; + @ApiModelProperty("Whether the port has incoming or outgoing connections to a remote NiFi.") public Boolean isTransmitting() { return transmitting; @@ -53,21 +43,7 @@ public class PortStatusDTO extends StatusDTO implements Cloneable { this.transmitting = transmitting; } - /** - * @return the active thread count for this port - */ - @ApiModelProperty("The active thread count for the port.") - public Integer getActiveThreadCount() { - return activeThreadCount; - } - - public void setActiveThreadCount(Integer activeThreadCount) { - this.activeThreadCount = activeThreadCount; - } - /** - * @return id of this port - */ @ApiModelProperty("The id of the port.") public String getId() { return id; @@ -77,9 +53,7 @@ public class PortStatusDTO extends StatusDTO implements Cloneable { this.id = id; } - /** - * @return id of the group this port resides in - */ + @ApiModelProperty("The id of the parent process group of the port.") public String getGroupId() { return groupId; @@ -89,9 +63,7 @@ public class PortStatusDTO extends StatusDTO implements Cloneable { this.groupId = groupId; } - /** - * @return name of this port - */ + @ApiModelProperty("The name of the port.") public String getName() { return name; @@ -101,9 +73,7 @@ public class PortStatusDTO extends StatusDTO implements Cloneable { this.name = name; } - /** - * @return run status of this port - */ + @ApiModelProperty("The run status of the port.") public String getRunStatus() { return runStatus; @@ -113,83 +83,23 @@ public class PortStatusDTO extends StatusDTO implements Cloneable { this.runStatus = runStatus; } - /** - * @return The total count and size of flow files that have been accepted in the last five minutes - */ - @ApiModelProperty("The count/size of flowfiles that have been accepted in the last 5 minutes.") - public String getInput() { - return input; - } - - public void setInput(String input) { - this.input = input; - } - - /** - * @return The total count and size of flow files that have been processed in the last five minutes - */ - @ApiModelProperty("The count/size of flowfiles that have been processed in the last 5 minutes.") - public String getOutput() { - return output; - } - - public void setOutput(String output) { - this.output = output; - } - - @ApiModelProperty("The number of FlowFiles that have been accepted in the last 5 minutes.") - public Integer getFlowFilesIn() { - return flowFilesIn; - } - - public void setFlowFilesIn(Integer flowFilesIn) { - this.flowFilesIn = flowFilesIn; - } - - @ApiModelProperty("The size of hte FlowFiles that have been accepted in the last 5 minutes.") - public Long getBytesIn() { - return bytesIn; - } - - public void setBytesIn(Long bytesIn) { - this.bytesIn = bytesIn; - } - - @ApiModelProperty("The number of FlowFiles that have been processed in the last 5 minutes.") - public Integer getFlowFilesOut() { - return flowFilesOut; - } - - public void setFlowFilesOut(Integer flowFilesOut) { - this.flowFilesOut = flowFilesOut; + @ApiModelProperty("A status snapshot that represents the aggregate stats of all nodes in the cluster. If the NiFi instance is " + + "a standalone instance, rather than a cluster, this represents the stats of the single instance.") + public PortStatusSnapshotDTO getAggregateStatus() { + return aggregateStatus; } - @ApiModelProperty("The number of bytes that have been processed in the last 5 minutes.") - public Long getBytesOut() { - return bytesOut; + public void setAggregateStatus(PortStatusSnapshotDTO aggregateStatus) { + this.aggregateStatus = aggregateStatus; } - public void setBytesOut(Long bytesOut) { - this.bytesOut = bytesOut; + @ApiModelProperty("A status snapshot for each node in the cluster. If the NiFi instance is a standalone instance, rather than " + + "a cluster, this may be null.") + public List<NodePortStatusSnapshotDTO> getNodeStatuses() { + return nodeStatuses; } - @Override - public PortStatusDTO clone() { - final PortStatusDTO other = new PortStatusDTO(); - other.setId(getId()); - other.setGroupId(getGroupId()); - other.setName(getName()); - other.setActiveThreadCount(getActiveThreadCount()); - other.setFlowFilesIn(getFlowFilesIn()); - other.setBytesIn(getBytesIn()); - other.setFlowFilesOut(getFlowFilesOut()); - other.setBytesOut(getBytesOut()); - other.setTransmitting(isTransmitting()); - other.setRunStatus(getRunStatus()); - other.setInput(getInput()); - other.setOutput(getOutput()); - other.setBulletins(cloneBulletins()); - - return other; + public void setNodeStatuses(List<NodePortStatusSnapshotDTO> nodeStatuses) { + this.nodeStatuses = nodeStatuses; } } http://git-wip-us.apache.org/repos/asf/nifi/blob/a901bc65/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/PortStatusSnapshotDTO.java ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/PortStatusSnapshotDTO.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/PortStatusSnapshotDTO.java new file mode 100644 index 0000000..b5f11e5 --- /dev/null +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/PortStatusSnapshotDTO.java @@ -0,0 +1,194 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.nifi.web.api.dto.status; + +import javax.xml.bind.annotation.XmlType; + +import com.wordnik.swagger.annotations.ApiModelProperty; + +/** + * The status for a port in this NiFi. + */ +@XmlType(name = "portStatusSnapshot") +public class PortStatusSnapshotDTO implements Cloneable { + + private String id; + private String groupId; + private String name; + + private Integer activeThreadCount = 0; + private Integer flowFilesIn = 0; + private Long bytesIn = 0L; + private String input; + private Integer flowFilesOut = 0; + private Long bytesOut = 0L; + private String output; + + private Boolean transmitting; + private String runStatus; + + /** + * @return whether this port has incoming or outgoing connections to a remote NiFi + */ + @ApiModelProperty("Whether the port has incoming or outgoing connections to a remote NiFi.") + public Boolean isTransmitting() { + return transmitting; + } + + public void setTransmitting(Boolean transmitting) { + this.transmitting = transmitting; + } + + /** + * @return the active thread count for this port + */ + @ApiModelProperty("The active thread count for the port.") + public Integer getActiveThreadCount() { + return activeThreadCount; + } + + public void setActiveThreadCount(Integer activeThreadCount) { + this.activeThreadCount = activeThreadCount; + } + + /** + * @return id of this port + */ + @ApiModelProperty("The id of the port.") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + /** + * @return id of the group this port resides in + */ + @ApiModelProperty("The id of the parent process group of the port.") + public String getGroupId() { + return groupId; + } + + public void setGroupId(String groupId) { + this.groupId = groupId; + } + + /** + * @return name of this port + */ + @ApiModelProperty("The name of the port.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * @return run status of this port + */ + @ApiModelProperty("The run status of the port.") + public String getRunStatus() { + return runStatus; + } + + public void setRunStatus(String runStatus) { + this.runStatus = runStatus; + } + + /** + * @return The total count and size of flow files that have been accepted in the last five minutes + */ + @ApiModelProperty("The count/size of flowfiles that have been accepted in the last 5 minutes.") + public String getInput() { + return input; + } + + public void setInput(String input) { + this.input = input; + } + + /** + * @return The total count and size of flow files that have been processed in the last five minutes + */ + @ApiModelProperty("The count/size of flowfiles that have been processed in the last 5 minutes.") + public String getOutput() { + return output; + } + + public void setOutput(String output) { + this.output = output; + } + + @ApiModelProperty("The number of FlowFiles that have been accepted in the last 5 minutes.") + public Integer getFlowFilesIn() { + return flowFilesIn; + } + + public void setFlowFilesIn(Integer flowFilesIn) { + this.flowFilesIn = flowFilesIn; + } + + @ApiModelProperty("The size of hte FlowFiles that have been accepted in the last 5 minutes.") + public Long getBytesIn() { + return bytesIn; + } + + public void setBytesIn(Long bytesIn) { + this.bytesIn = bytesIn; + } + + @ApiModelProperty("The number of FlowFiles that have been processed in the last 5 minutes.") + public Integer getFlowFilesOut() { + return flowFilesOut; + } + + public void setFlowFilesOut(Integer flowFilesOut) { + this.flowFilesOut = flowFilesOut; + } + + @ApiModelProperty("The number of bytes that have been processed in the last 5 minutes.") + public Long getBytesOut() { + return bytesOut; + } + + public void setBytesOut(Long bytesOut) { + this.bytesOut = bytesOut; + } + + @Override + public PortStatusSnapshotDTO clone() { + final PortStatusSnapshotDTO other = new PortStatusSnapshotDTO(); + other.setId(getId()); + other.setGroupId(getGroupId()); + other.setName(getName()); + other.setActiveThreadCount(getActiveThreadCount()); + other.setFlowFilesIn(getFlowFilesIn()); + other.setBytesIn(getBytesIn()); + other.setFlowFilesOut(getFlowFilesOut()); + other.setBytesOut(getBytesOut()); + other.setTransmitting(isTransmitting()); + other.setRunStatus(getRunStatus()); + other.setInput(getInput()); + other.setOutput(getOutput()); + + return other; + } +}
