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/ProcessGroupStatusDTO.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/ProcessGroupStatusDTO.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/ProcessGroupStatusDTO.java index ff7eecc..d9286e7 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/ProcessGroupStatusDTO.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/ProcessGroupStatusDTO.java @@ -14,75 +14,24 @@ * 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.ArrayList; -import java.util.Collection; -import java.util.Date; import java.util.List; import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; - -import org.apache.nifi.web.api.dto.util.TimeAdapter; import com.wordnik.swagger.annotations.ApiModelProperty; -/** - * The status for a process group in this NiFi. - */ @XmlType(name = "processGroupStatus") -public class ProcessGroupStatusDTO extends StatusDTO implements Cloneable { - +public class ProcessGroupStatusDTO implements Cloneable { private String id; private String name; - private Collection<ConnectionStatusDTO> connectionStatus; - private Collection<ProcessorStatusDTO> processorStatus; - private Collection<ProcessGroupStatusDTO> processGroupStatus; - private Collection<RemoteProcessGroupStatusDTO> remoteProcessGroupStatus; - private Collection<PortStatusDTO> inputPortStatus; - private Collection<PortStatusDTO> outputPortStatus; - - private Integer flowFilesIn = 0; - private Long bytesIn = 0L; - private String input; - - private Integer flowFilesQueued = 0; - private Long bytesQueued = 0L; - private String queued; - private String queuedCount; - private String queuedSize; - - private Long bytesRead = 0L; - private String read; - private Long bytesWritten = 0L; - private String written; - - private Integer flowFilesOut = 0; - private Long bytesOut = 0L; - private String output; - - private Integer flowFilesTransferred = 0; - private Long bytesTransferred = 0L; - private String transferred; - - private Long bytesReceived = 0L; - private Integer flowFilesReceived = 0; - private String received; - private Long bytesSent = 0L; - private Integer flowFilesSent = 0; - private String sent; + private ProcessGroupStatusSnapshotDTO aggregateStatus; + private List<NodeProcessGroupStatusSnapshotDTO> nodeStatuses; - private Integer activeThreadCount = 0; - private Date statsLastRefreshed; - - /** - * The id for the process group. - * - * @return The id for the process group - */ - @ApiModelProperty("The id of the process group.") + @ApiModelProperty("The ID of the Process Group") public String getId() { return id; } @@ -91,10 +40,7 @@ public class ProcessGroupStatusDTO extends StatusDTO implements Cloneable { this.id = id; } - /** - * @return name of this process group - */ - @ApiModelProperty("The name of this process group.") + @ApiModelProperty("The name of the PRocess Group") public String getName() { return name; } @@ -103,457 +49,22 @@ public class ProcessGroupStatusDTO extends StatusDTO implements Cloneable { this.name = name; } - /** - * @return active thread count for this process group - */ - @ApiModelProperty("The active thread count for this process group.") - public Integer getActiveThreadCount() { - return activeThreadCount; - } - - public void setActiveThreadCount(Integer activeThreadCount) { - this.activeThreadCount = activeThreadCount; - } - - /** - * The status of all connections in this process group. - * - * @return The status of all connections - */ - @ApiModelProperty("The status of all conenctions in the process group.") - public Collection<ConnectionStatusDTO> getConnectionStatus() { - return connectionStatus; - } - - public void setConnectionStatus(Collection<ConnectionStatusDTO> connectionStatus) { - this.connectionStatus = connectionStatus; - } - - /** - * The status of all process groups in this process group. - * - * @return The status of all process groups - */ - @ApiModelProperty("The status of all process groups in the process group.") - public Collection<ProcessGroupStatusDTO> getProcessGroupStatus() { - return processGroupStatus; - } - - public void setProcessGroupStatus(Collection<ProcessGroupStatusDTO> processGroupStatus) { - this.processGroupStatus = processGroupStatus; - } - - /** - * The status of all remote process groups in this process group. - * - * @return The status of all remote process groups - */ - @ApiModelProperty("The status of all remote process groups in the process group.") - public Collection<RemoteProcessGroupStatusDTO> getRemoteProcessGroupStatus() { - return remoteProcessGroupStatus; - } - - public void setRemoteProcessGroupStatus(final Collection<RemoteProcessGroupStatusDTO> remoteProcessGroupStatus) { - this.remoteProcessGroupStatus = remoteProcessGroupStatus; - } - - /** - * The status of all processors in this process group. - * - * @return The status of all processors - */ - @ApiModelProperty("The status of all processors in the process group.") - public Collection<ProcessorStatusDTO> getProcessorStatus() { - return processorStatus; - } - - public void setProcessorStatus(Collection<ProcessorStatusDTO> processorStatus) { - this.processorStatus = processorStatus; - } - - /** - * The status of all input ports in this process group. - * - * @return The status of all input ports - */ - @ApiModelProperty("The status of all input ports in the process group.") - public Collection<PortStatusDTO> getInputPortStatus() { - return inputPortStatus; - } - - public void setInputPortStatus(Collection<PortStatusDTO> inputPortStatus) { - this.inputPortStatus = inputPortStatus; - } - - /** - * The status of all output ports in this process group. - * - * @return The status of all output ports - */ - @ApiModelProperty("The status of all output ports in the process group.") - public Collection<PortStatusDTO> getOutputPortStatus() { - return outputPortStatus; - } - - public void setOutputPortStatus(Collection<PortStatusDTO> outputPortStatus) { - this.outputPortStatus = outputPortStatus; - } - - /** - * The output stats for this process group. - * - * @return The output stats - */ - @ApiModelProperty("The output count/size for the process group in the last 5 minutes.") - public String getOutput() { - return output; - } - - /** - * The transferred stats for this process group. This represents the count/size of flowfiles transferred to/from queues. - * - * @return The transferred status for this process group - */ - @ApiModelProperty("The count/size transferred to/frome queues in the process group in the last 5 minutes.") - public String getTransferred() { - return transferred; - } - - /** - * The received stats for this process group. This represents the count/size of flowfiles received. - * - * @return The received stats for this process group - */ - @ApiModelProperty("The count/size sent to the process group in the last 5 minutes.") - public String getReceived() { - return received; - } - - - /** - * The sent stats for this process group. This represents the count/size of flowfiles sent. - * - * @return The sent stats for this process group - */ - @ApiModelProperty("The count/size sent from this process group in the last 5 minutes.") - public String getSent() { - return sent; - } - - - /** - * The queued count for this process group. - * - * @return The queued count for this process group - */ - @ApiModelProperty("The count that is queued for the process group.") - public String getQueuedCount() { - return queuedCount; - } - - - /** - * The queued size for this process group. - * - * @return The queued size for this process group - */ - @ApiModelProperty("The size that is queued for the process group.") - public String getQueuedSize() { - return queuedSize; - } - - - /** - * The queued stats for this process group. - * - * @return The queued stats - */ - @ApiModelProperty("The count/size that is queued in the the process group.") - public String getQueued() { - return queued; - } - - - /** - * The read stats for this process group. - * - * @return The read stats - */ - @ApiModelProperty("The number of bytes read in the last 5 minutes.") - public String getRead() { - return read; - } - - - /** - * The written stats for this process group. - * - * @return The written stats - */ - @ApiModelProperty("The number of bytes written in the last 5 minutes.") - public String getWritten() { - return written; - } - - - /** - * The input stats for this process group. - * - * @return The input stats - */ - @ApiModelProperty("The input count/size for the process group in the last 5 minutes (pretty printed).") - public String getInput() { - return input; - } - - - @ApiModelProperty("The number of FlowFiles that have come into this ProcessGroup in the last 5 minutes") - public Integer getFlowFilesIn() { - return flowFilesIn; - } - - public void setFlowFilesIn(Integer flowFilesIn) { - this.flowFilesIn = flowFilesIn; - } - - @ApiModelProperty("The number of bytes that have come into this ProcessGroup in the last 5 minutes") - public Long getBytesIn() { - return bytesIn; - } - - public void setBytesIn(Long bytesIn) { - this.bytesIn = bytesIn; - } - - @ApiModelProperty("The number of FlowFiles that are queued up in this ProcessGroup right now") - public Integer getFlowFilesQueued() { - return flowFilesQueued; - } - - public void setFlowFilesQueued(Integer flowFilesQueued) { - this.flowFilesQueued = flowFilesQueued; - } - - @ApiModelProperty("The number of bytes that are queued up in this ProcessGroup right now") - public Long getBytesQueued() { - return bytesQueued; - } - - public void setBytesQueued(Long bytesQueued) { - this.bytesQueued = bytesQueued; - } - - @ApiModelProperty("The number of bytes read by components in this ProcessGroup in the last 5 minutes") - public Long getBytesRead() { - return bytesRead; - } - - public void setBytesRead(Long bytesRead) { - this.bytesRead = bytesRead; - } - - @ApiModelProperty("The number of bytes written by components in this ProcessGroup in the last 5 minutes") - public Long getBytesWritten() { - return bytesWritten; - } - - public void setBytesWritten(Long bytesWritten) { - this.bytesWritten = bytesWritten; - } - - @ApiModelProperty("The number of FlowFiles transferred out of this ProcessGroup in the last 5 minutes") - public Integer getFlowFilesOut() { - return flowFilesOut; - } - - public void setFlowFilesOut(Integer flowFilesOut) { - this.flowFilesOut = flowFilesOut; - } - - @ApiModelProperty("The number of bytes transferred out of this ProcessGroup in the last 5 minutes") - public Long getBytesOut() { - return bytesOut; - } - - public void setBytesOut(Long bytesOut) { - this.bytesOut = bytesOut; - } - - @ApiModelProperty("The number of FlowFiles transferred in this ProcessGroup in the last 5 minutes") - public Integer getFlowFilesTransferred() { - return flowFilesTransferred; - } - - public void setFlowFilesTransferred(Integer flowFilesTransferred) { - this.flowFilesTransferred = flowFilesTransferred; - } - - @ApiModelProperty("The number of bytes transferred in this ProcessGroup in the last 5 minutes") - public Long getBytesTransferred() { - return bytesTransferred; - } - - public void setBytesTransferred(Long bytesTransferred) { - this.bytesTransferred = bytesTransferred; - } - - @ApiModelProperty("The number of bytes received from external sources by components within this ProcessGroup in the last 5 minutes") - public Long getBytesReceived() { - return bytesReceived; - } - - public void setBytesReceived(Long bytesReceived) { - this.bytesReceived = bytesReceived; - } - - @ApiModelProperty("The number of bytes sent to an external sink by components within this ProcessGroup in the last 5 minutes") - public Long getBytesSent() { - return bytesSent; - } - - public void setBytesSent(Long bytesSent) { - this.bytesSent = bytesSent; - } - - @ApiModelProperty("The number of FlowFiles sent to an external sink by components within this ProcessGroup in the last 5 minutes") - public Integer getFlowFilesSent() { - return flowFilesSent; - } - - public void setFlowFilesSent(Integer flowFilesSent) { - this.flowFilesSent = flowFilesSent; + @ApiModelProperty("The aggregate status of all nodes in the cluster") + public ProcessGroupStatusSnapshotDTO getAggregateStatus() { + return aggregateStatus; } - @ApiModelProperty("The number of FlowFiles received from external sources by components within this ProcessGroup in the last 5 minutes") - public Integer getFlowFilesReceived() { - return flowFilesReceived; + public void setAggregateStatus(ProcessGroupStatusSnapshotDTO aggregateStatus) { + this.aggregateStatus = aggregateStatus; } - public void setFlowFilesReceived(Integer flowFilesReceived) { - this.flowFilesReceived = flowFilesReceived; + @ApiModelProperty("The status reported by each node in the cluster. If the NiFi instance is a standalone instance, rather than " + + "a clustered instance, this value may be null.") + public List<NodeProcessGroupStatusSnapshotDTO> getNodeStatuses() { + return nodeStatuses; } - /** - * When the status for this process group was calculated. - * - * @return The the status was calculated - */ - @XmlJavaTypeAdapter(TimeAdapter.class) - @ApiModelProperty( - value = "The time the status for the process group was last refreshed." - ) - public Date getStatsLastRefreshed() { - return statsLastRefreshed; - } - - public void setStatsLastRefreshed(Date statsLastRefreshed) { - this.statsLastRefreshed = statsLastRefreshed; - } - - - public void setInput(String input) { - this.input = input; - } - - public void setQueued(String queued) { - this.queued = queued; - } - - public void setQueuedCount(String queuedCount) { - this.queuedCount = queuedCount; - } - - public void setQueuedSize(String queuedSize) { - this.queuedSize = queuedSize; - } - - public void setRead(String read) { - this.read = read; - } - - public void setWritten(String written) { - this.written = written; - } - - public void setOutput(String output) { - this.output = output; - } - - public void setTransferred(String transferred) { - this.transferred = transferred; - } - - public void setReceived(String received) { - this.received = received; - } - - public void setSent(String sent) { - this.sent = sent; - } - - @Override - public ProcessGroupStatusDTO clone() { - final ProcessGroupStatusDTO other = new ProcessGroupStatusDTO(); - other.setId(getId()); - other.setName(getName()); - - other.setBytesIn(getBytesIn()); - other.setFlowFilesIn(getFlowFilesIn()); - other.setInput(getInput()); - - other.setBytesQueued(getBytesQueued()); - other.setFlowFilesQueued(getFlowFilesQueued()); - other.setQueued(getQueued()); - other.setQueuedCount(getQueuedCount()); - other.setQueuedSize(getQueuedSize()); - - other.setBytesRead(getBytesRead()); - other.setRead(getRead()); - other.setBytesWritten(getBytesWritten()); - other.setWritten(getWritten()); - - other.setBytesOut(getBytesOut()); - other.setFlowFilesOut(getFlowFilesOut()); - other.setOutput(getOutput()); - - other.setBytesTransferred(getBytesTransferred()); - other.setFlowFilesTransferred(getFlowFilesTransferred()); - other.setTransferred(getTransferred()); - - other.setBytesReceived(getBytesReceived()); - other.setFlowFilesReceived(getFlowFilesReceived()); - other.setReceived(getReceived()); - other.setBytesSent(getBytesSent()); - other.setFlowFilesSent(getFlowFilesSent()); - other.setSent(getSent()); - - other.setActiveThreadCount(getActiveThreadCount()); - other.setStatsLastRefreshed(getStatsLastRefreshed()); - - other.setConnectionStatus(copy(getConnectionStatus())); - other.setProcessorStatus(copy(getProcessorStatus())); - other.setRemoteProcessGroupStatus(copy(getRemoteProcessGroupStatus())); - other.setInputPortStatus(copy(getInputPortStatus())); - other.setOutputPortStatus(copy(getOutputPortStatus())); - - if (processGroupStatus != null) { - final List<ProcessGroupStatusDTO> childGroups = new ArrayList<>(); - for (final ProcessGroupStatusDTO procGroupStatus : processGroupStatus) { - childGroups.add(procGroupStatus.clone()); - } - other.setProcessGroupStatus(childGroups); - } - - other.setBulletins(cloneBulletins()); - - return other; - } - - private <T> Collection<T> copy(final Collection<T> original) { - if (original == null) { - return null; - } - - return new ArrayList<T>(original); + public void setNodeStatuses(List<NodeProcessGroupStatusSnapshotDTO> 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/ProcessGroupStatusSnapshotDTO.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/ProcessGroupStatusSnapshotDTO.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/ProcessGroupStatusSnapshotDTO.java new file mode 100644 index 0000000..cb7efdf --- /dev/null +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/ProcessGroupStatusSnapshotDTO.java @@ -0,0 +1,557 @@ +/* + * 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 java.util.ArrayList; +import java.util.Collection; +import java.util.Date; +import java.util.List; + +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; + +import org.apache.nifi.web.api.dto.util.TimeAdapter; + +import com.wordnik.swagger.annotations.ApiModelProperty; + +/** + * The status for a process group in this NiFi. + */ +@XmlType(name = "processGroupStatusSnapshot") +public class ProcessGroupStatusSnapshotDTO implements Cloneable { + + private String id; + private String name; + private Collection<ConnectionStatusSnapshotDTO> connectionStatus; + private Collection<ProcessorStatusSnapshotDTO> processorStatus; + private Collection<ProcessGroupStatusSnapshotDTO> processGroupStatus; + private Collection<RemoteProcessGroupStatusSnapshotDTO> remoteProcessGroupStatus; + private Collection<PortStatusSnapshotDTO> inputPortStatus; + private Collection<PortStatusSnapshotDTO> outputPortStatus; + + private Integer flowFilesIn = 0; + private Long bytesIn = 0L; + private String input; + + private Integer flowFilesQueued = 0; + private Long bytesQueued = 0L; + private String queued; + private String queuedCount; + private String queuedSize; + + private Long bytesRead = 0L; + private String read; + private Long bytesWritten = 0L; + private String written; + + private Integer flowFilesOut = 0; + private Long bytesOut = 0L; + private String output; + + private Integer flowFilesTransferred = 0; + private Long bytesTransferred = 0L; + private String transferred; + + private Long bytesReceived = 0L; + private Integer flowFilesReceived = 0; + private String received; + + private Long bytesSent = 0L; + private Integer flowFilesSent = 0; + private String sent; + + private Integer activeThreadCount = 0; + private Date statsLastRefreshed; + + /** + * The id for the process group. + * + * @return The id for the process group + */ + @ApiModelProperty("The id of the process group.") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + /** + * @return name of this process group + */ + @ApiModelProperty("The name of this process group.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * @return active thread count for this process group + */ + @ApiModelProperty("The active thread count for this process group.") + public Integer getActiveThreadCount() { + return activeThreadCount; + } + + public void setActiveThreadCount(Integer activeThreadCount) { + this.activeThreadCount = activeThreadCount; + } + + /** + * The status of all connections in this process group. + * + * @return The status of all connections + */ + @ApiModelProperty("The status of all conenctions in the process group.") + public Collection<ConnectionStatusSnapshotDTO> getConnectionStatusSnapshots() { + return connectionStatus; + } + + public void setConnectionStatusSnapshots(Collection<ConnectionStatusSnapshotDTO> connectionStatus) { + this.connectionStatus = connectionStatus; + } + + /** + * The status of all process groups in this process group. + * + * @return The status of all process groups + */ + @ApiModelProperty("The status of all process groups in the process group.") + public Collection<ProcessGroupStatusSnapshotDTO> getProcessGroupStatusSnapshots() { + return processGroupStatus; + } + + public void setProcessGroupStatusSnapshots(Collection<ProcessGroupStatusSnapshotDTO> processGroupStatus) { + this.processGroupStatus = processGroupStatus; + } + + /** + * The status of all remote process groups in this process group. + * + * @return The status of all remote process groups + */ + @ApiModelProperty("The status of all remote process groups in the process group.") + public Collection<RemoteProcessGroupStatusSnapshotDTO> getRemoteProcessGroupStatusSnapshots() { + return remoteProcessGroupStatus; + } + + public void setRemoteProcessGroupStatusSnapshots(final Collection<RemoteProcessGroupStatusSnapshotDTO> remoteProcessGroupStatus) { + this.remoteProcessGroupStatus = remoteProcessGroupStatus; + } + + /** + * The status of all processors in this process group. + * + * @return The status of all processors + */ + @ApiModelProperty("The status of all processors in the process group.") + public Collection<ProcessorStatusSnapshotDTO> getProcessorStatusSnapshots() { + return processorStatus; + } + + public void setProcessorStatusSnapshots(Collection<ProcessorStatusSnapshotDTO> processorStatus) { + this.processorStatus = processorStatus; + } + + /** + * The status of all input ports in this process group. + * + * @return The status of all input ports + */ + @ApiModelProperty("The status of all input ports in the process group.") + public Collection<PortStatusSnapshotDTO> getInputPortStatusSnapshots() { + return inputPortStatus; + } + + public void setInputPortStatusSnapshots(Collection<PortStatusSnapshotDTO> inputPortStatus) { + this.inputPortStatus = inputPortStatus; + } + + /** + * The status of all output ports in this process group. + * + * @return The status of all output ports + */ + @ApiModelProperty("The status of all output ports in the process group.") + public Collection<PortStatusSnapshotDTO> getOutputPortStatusSnapshots() { + return outputPortStatus; + } + + public void setOutputPortStatusSnapshots(Collection<PortStatusSnapshotDTO> outputPortStatus) { + this.outputPortStatus = outputPortStatus; + } + + /** + * The output stats for this process group. + * + * @return The output stats + */ + @ApiModelProperty("The output count/size for the process group in the last 5 minutes.") + public String getOutput() { + return output; + } + + /** + * The transferred stats for this process group. This represents the count/size of flowfiles transferred to/from queues. + * + * @return The transferred status for this process group + */ + @ApiModelProperty("The count/size transferred to/frome queues in the process group in the last 5 minutes.") + public String getTransferred() { + return transferred; + } + + /** + * The received stats for this process group. This represents the count/size of flowfiles received. + * + * @return The received stats for this process group + */ + @ApiModelProperty("The count/size sent to the process group in the last 5 minutes.") + public String getReceived() { + return received; + } + + + /** + * The sent stats for this process group. This represents the count/size of flowfiles sent. + * + * @return The sent stats for this process group + */ + @ApiModelProperty("The count/size sent from this process group in the last 5 minutes.") + public String getSent() { + return sent; + } + + + /** + * The queued count for this process group. + * + * @return The queued count for this process group + */ + @ApiModelProperty("The count that is queued for the process group.") + public String getQueuedCount() { + return queuedCount; + } + + + /** + * The queued size for this process group. + * + * @return The queued size for this process group + */ + @ApiModelProperty("The size that is queued for the process group.") + public String getQueuedSize() { + return queuedSize; + } + + + /** + * The queued stats for this process group. + * + * @return The queued stats + */ + @ApiModelProperty("The count/size that is queued in the the process group.") + public String getQueued() { + return queued; + } + + + /** + * The read stats for this process group. + * + * @return The read stats + */ + @ApiModelProperty("The number of bytes read in the last 5 minutes.") + public String getRead() { + return read; + } + + + /** + * The written stats for this process group. + * + * @return The written stats + */ + @ApiModelProperty("The number of bytes written in the last 5 minutes.") + public String getWritten() { + return written; + } + + + /** + * The input stats for this process group. + * + * @return The input stats + */ + @ApiModelProperty("The input count/size for the process group in the last 5 minutes (pretty printed).") + public String getInput() { + return input; + } + + + @ApiModelProperty("The number of FlowFiles that have come into this ProcessGroup in the last 5 minutes") + public Integer getFlowFilesIn() { + return flowFilesIn; + } + + public void setFlowFilesIn(Integer flowFilesIn) { + this.flowFilesIn = flowFilesIn; + } + + @ApiModelProperty("The number of bytes that have come into this ProcessGroup in the last 5 minutes") + public Long getBytesIn() { + return bytesIn; + } + + public void setBytesIn(Long bytesIn) { + this.bytesIn = bytesIn; + } + + @ApiModelProperty("The number of FlowFiles that are queued up in this ProcessGroup right now") + public Integer getFlowFilesQueued() { + return flowFilesQueued; + } + + public void setFlowFilesQueued(Integer flowFilesQueued) { + this.flowFilesQueued = flowFilesQueued; + } + + @ApiModelProperty("The number of bytes that are queued up in this ProcessGroup right now") + public Long getBytesQueued() { + return bytesQueued; + } + + public void setBytesQueued(Long bytesQueued) { + this.bytesQueued = bytesQueued; + } + + @ApiModelProperty("The number of bytes read by components in this ProcessGroup in the last 5 minutes") + public Long getBytesRead() { + return bytesRead; + } + + public void setBytesRead(Long bytesRead) { + this.bytesRead = bytesRead; + } + + @ApiModelProperty("The number of bytes written by components in this ProcessGroup in the last 5 minutes") + public Long getBytesWritten() { + return bytesWritten; + } + + public void setBytesWritten(Long bytesWritten) { + this.bytesWritten = bytesWritten; + } + + @ApiModelProperty("The number of FlowFiles transferred out of this ProcessGroup in the last 5 minutes") + public Integer getFlowFilesOut() { + return flowFilesOut; + } + + public void setFlowFilesOut(Integer flowFilesOut) { + this.flowFilesOut = flowFilesOut; + } + + @ApiModelProperty("The number of bytes transferred out of this ProcessGroup in the last 5 minutes") + public Long getBytesOut() { + return bytesOut; + } + + public void setBytesOut(Long bytesOut) { + this.bytesOut = bytesOut; + } + + @ApiModelProperty("The number of FlowFiles transferred in this ProcessGroup in the last 5 minutes") + public Integer getFlowFilesTransferred() { + return flowFilesTransferred; + } + + public void setFlowFilesTransferred(Integer flowFilesTransferred) { + this.flowFilesTransferred = flowFilesTransferred; + } + + @ApiModelProperty("The number of bytes transferred in this ProcessGroup in the last 5 minutes") + public Long getBytesTransferred() { + return bytesTransferred; + } + + public void setBytesTransferred(Long bytesTransferred) { + this.bytesTransferred = bytesTransferred; + } + + @ApiModelProperty("The number of bytes received from external sources by components within this ProcessGroup in the last 5 minutes") + public Long getBytesReceived() { + return bytesReceived; + } + + public void setBytesReceived(Long bytesReceived) { + this.bytesReceived = bytesReceived; + } + + @ApiModelProperty("The number of bytes sent to an external sink by components within this ProcessGroup in the last 5 minutes") + public Long getBytesSent() { + return bytesSent; + } + + public void setBytesSent(Long bytesSent) { + this.bytesSent = bytesSent; + } + + @ApiModelProperty("The number of FlowFiles sent to an external sink by components within this ProcessGroup in the last 5 minutes") + public Integer getFlowFilesSent() { + return flowFilesSent; + } + + public void setFlowFilesSent(Integer flowFilesSent) { + this.flowFilesSent = flowFilesSent; + } + + @ApiModelProperty("The number of FlowFiles received from external sources by components within this ProcessGroup in the last 5 minutes") + public Integer getFlowFilesReceived() { + return flowFilesReceived; + } + + public void setFlowFilesReceived(Integer flowFilesReceived) { + this.flowFilesReceived = flowFilesReceived; + } + + /** + * When the status for this process group was calculated. + * + * @return The the status was calculated + */ + @XmlJavaTypeAdapter(TimeAdapter.class) + @ApiModelProperty( + value = "The time the status for the process group was last refreshed." + ) + public Date getStatsLastRefreshed() { + return statsLastRefreshed; + } + + public void setStatsLastRefreshed(Date statsLastRefreshed) { + this.statsLastRefreshed = statsLastRefreshed; + } + + + public void setInput(String input) { + this.input = input; + } + + public void setQueued(String queued) { + this.queued = queued; + } + + public void setQueuedCount(String queuedCount) { + this.queuedCount = queuedCount; + } + + public void setQueuedSize(String queuedSize) { + this.queuedSize = queuedSize; + } + + public void setRead(String read) { + this.read = read; + } + + public void setWritten(String written) { + this.written = written; + } + + public void setOutput(String output) { + this.output = output; + } + + public void setTransferred(String transferred) { + this.transferred = transferred; + } + + public void setReceived(String received) { + this.received = received; + } + + public void setSent(String sent) { + this.sent = sent; + } + + @Override + public ProcessGroupStatusSnapshotDTO clone() { + final ProcessGroupStatusSnapshotDTO other = new ProcessGroupStatusSnapshotDTO(); + other.setId(getId()); + other.setName(getName()); + + other.setBytesIn(getBytesIn()); + other.setFlowFilesIn(getFlowFilesIn()); + other.setInput(getInput()); + + other.setBytesQueued(getBytesQueued()); + other.setFlowFilesQueued(getFlowFilesQueued()); + other.setQueued(getQueued()); + other.setQueuedCount(getQueuedCount()); + other.setQueuedSize(getQueuedSize()); + + other.setBytesRead(getBytesRead()); + other.setRead(getRead()); + other.setBytesWritten(getBytesWritten()); + other.setWritten(getWritten()); + + other.setBytesOut(getBytesOut()); + other.setFlowFilesOut(getFlowFilesOut()); + other.setOutput(getOutput()); + + other.setBytesTransferred(getBytesTransferred()); + other.setFlowFilesTransferred(getFlowFilesTransferred()); + other.setTransferred(getTransferred()); + + other.setBytesReceived(getBytesReceived()); + other.setFlowFilesReceived(getFlowFilesReceived()); + other.setReceived(getReceived()); + other.setBytesSent(getBytesSent()); + other.setFlowFilesSent(getFlowFilesSent()); + other.setSent(getSent()); + + other.setActiveThreadCount(getActiveThreadCount()); + other.setStatsLastRefreshed(getStatsLastRefreshed()); + + other.setConnectionStatusSnapshots(copy(getConnectionStatusSnapshots())); + other.setProcessorStatusSnapshots(copy(getProcessorStatusSnapshots())); + other.setRemoteProcessGroupStatusSnapshots(copy(getRemoteProcessGroupStatusSnapshots())); + other.setInputPortStatusSnapshots(copy(getInputPortStatusSnapshots())); + other.setOutputPortStatusSnapshots(copy(getOutputPortStatusSnapshots())); + + if (processGroupStatus != null) { + final List<ProcessGroupStatusSnapshotDTO> childGroups = new ArrayList<>(); + for (final ProcessGroupStatusSnapshotDTO procGroupStatus : processGroupStatus) { + childGroups.add(procGroupStatus.clone()); + } + other.setProcessGroupStatusSnapshots(childGroups); + } + + return other; + } + + private <T> Collection<T> copy(final Collection<T> original) { + if (original == null) { + return null; + } + + return new ArrayList<T>(original); + } +} 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/ProcessorStatusDTO.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/ProcessorStatusDTO.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/ProcessorStatusDTO.java index f1b26db..1829f73 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/ProcessorStatusDTO.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/ProcessorStatusDTO.java @@ -14,8 +14,13 @@ * 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.ArrayList; +import java.util.Date; +import java.util.List; + import javax.xml.bind.annotation.XmlType; import com.wordnik.swagger.annotations.ApiModelProperty; @@ -24,277 +29,107 @@ import com.wordnik.swagger.annotations.ApiModelProperty; * DTO for serializing the status of a processor. */ @XmlType(name = "processorStatus") -public class ProcessorStatusDTO extends StatusDTO implements Cloneable { - - private String id; +public class ProcessorStatusDTO implements Cloneable { private String groupId; - private String name; - private String type; - private String runStatus; - - private Long bytesRead = 0L; - private Long bytesWritten = 0L; - private String read; - private String written; - - private Integer flowFilesIn = 0; - private Long bytesIn = 0L; - private String input; - - private Integer flowFilesOut = 0; - private Long bytesOut = 0L; - private String output; - - private Integer taskCount = 0; - private Long taskDurationNanos = 0L; - private String tasks; - private String tasksDuration; - private Integer activeThreadCount = 0; - - /* getters / setters */ - /** - * @return The processor id - */ - @ApiModelProperty("The id of the processor.") - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - /** - * @return The processor name - */ - @ApiModelProperty("The name of the prcessor.") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - /** - * @return The processor type - */ - @ApiModelProperty("The type of the processor.") - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - /** - * @return run status of this processor - */ - @ApiModelProperty( - value = "The state of the processor.", - allowableValues = "RUNNING, STOPPED, DISABLED, INVALID" - ) - 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 number of bytes read - */ - @ApiModelProperty("The number of bytes read in the last 5 minutes.") - public String getRead() { - return read; - } + private String id; + private String processorName; + private String processorType; + private String processorRunStatus; + private Date statsLastRefreshed; - public void setRead(String read) { - this.read = read; - } + private ProcessorStatusSnapshotDTO aggregateStatus; + private List<NodeProcessorStatusSnapshotDTO> nodeStatuses; - /** - * @return number of bytes written - */ - @ApiModelProperty("The number of bytes written in the last 5 minutes.") - public String getWritten() { - return written; - } - - public void setWritten(String written) { - this.written = written; - } - - /** - * @return the ID of the Process Group to which this processor belongs. - */ - @ApiModelProperty("The id of the parent process group to which the processor belongs.") + @ApiModelProperty("The unique ID of the process group that the Processor belongs to") public String getGroupId() { return groupId; } - public void setGroupId(final String groupId) { + public void setGroupId(String groupId) { this.groupId = groupId; } - /** - * @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; - } - - /** - * @return number of threads currently running for this Processor - */ - @ApiModelProperty("The number of threads currently executing in the processor.") - public Integer getActiveThreadCount() { - return activeThreadCount; - } - - public void setActiveThreadCount(Integer threadCount) { - this.activeThreadCount = threadCount; - } - - /** - * @return number of task this connectable has had over the last 5 minutes - */ - @ApiModelProperty("The total number of task this connectable has completed over the last 5 minutes.") - public String getTasks() { - return tasks; - } - - public void setTasks(String tasks) { - this.tasks = tasks; - } - - /** - * @return total duration of all tasks for this connectable over the last 5 minutes - */ - @ApiModelProperty("The total duration of all tasks for this connectable over the last 5 minutes.") - public String getTasksDuration() { - return tasksDuration; - } - - public void setTasksDuration(String tasksDuration) { - this.tasksDuration = tasksDuration; - } - - @ApiModelProperty("The number of bytes read by this Processor in the last 5 mintues") - public Long getBytesRead() { - return bytesRead; - } - - public void setBytesRead(Long bytesRead) { - this.bytesRead = bytesRead; - } - - @ApiModelProperty("The number of bytes written by this Processor in the last 5 minutes") - public Long getBytesWritten() { - return bytesWritten; + @ApiModelProperty("The unique ID of the Processor") + public String getId() { + return id; } - public void setBytesWritten(Long bytesWritten) { - this.bytesWritten = bytesWritten; + public void setId(String id) { + this.id = id; } - @ApiModelProperty("The number of FlowFiles that have been accepted in the last 5 minutes") - public Integer getFlowFilesIn() { - return flowFilesIn; + @ApiModelProperty("The name of the Processor") + public String getProcessorName() { + return processorName; } - public void setFlowFilesIn(Integer flowFilesIn) { - this.flowFilesIn = flowFilesIn; + public void setProcessorName(String processorName) { + this.processorName = processorName; } - @ApiModelProperty("The size of the FlowFiles that have been accepted in the last 5 minutes") - public Long getBytesIn() { - return bytesIn; + @ApiModelProperty("The type of the Processor") + public String getProcessorType() { + return processorType; } - public void setBytesIn(Long bytesIn) { - this.bytesIn = bytesIn; + public void setProcessorType(String processorType) { + this.processorType = processorType; } - @ApiModelProperty("The number of FlowFiles transferred to a Connection in the last 5 minutes") - public Integer getFlowFilesOut() { - return flowFilesOut; + @ApiModelProperty("") + public String getProcessorRunStatus() { + return processorRunStatus; } - public void setFlowFilesOut(Integer flowFilesOut) { - this.flowFilesOut = flowFilesOut; + public void setProcessorRunStatus(String processorRunStatus) { + this.processorRunStatus = processorRunStatus; } - @ApiModelProperty("The size of the FlowFiles transferred to a Connection in the last 5 minutes") - public Long getBytesOut() { - return bytesOut; + @ApiModelProperty("The timestamp of when the stats were last refreshed") + public Date getStatsLastRefreshed() { + return statsLastRefreshed; } - public void setBytesOut(Long bytesOut) { - this.bytesOut = bytesOut; + public void setStatsLastRefreshed(Date statsLastRefreshed) { + this.statsLastRefreshed = statsLastRefreshed; } - @ApiModelProperty("The number of times this Processor has run in the last 5 minutes") - public Integer getTaskCount() { - return taskCount; + @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 ProcessorStatusSnapshotDTO getAggregateStatus() { + return aggregateStatus; } - public void setTaskCount(Integer taskCount) { - this.taskCount = taskCount; + public void setAggregateStatus(ProcessorStatusSnapshotDTO aggregateStatus) { + this.aggregateStatus = aggregateStatus; } - @ApiModelProperty("The number of nanoseconds that this Processor has spent running in the last 5 minutes") - public Long getTaskDuration() { - return taskDurationNanos; + @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<NodeProcessorStatusSnapshotDTO> getNodeStatuses() { + return nodeStatuses; } - public void setTaskDuration(Long taskNanos) { - this.taskDurationNanos = taskNanos; + public void setNodeStatuses(List<NodeProcessorStatusSnapshotDTO> nodeStatuses) { + this.nodeStatuses = nodeStatuses; } @Override public ProcessorStatusDTO clone() { final ProcessorStatusDTO other = new ProcessorStatusDTO(); - other.setId(getId()); other.setGroupId(getGroupId()); - other.setName(getName()); - other.setType(getType()); - - other.setRunStatus(getRunStatus()); - other.setBytesRead(getBytesRead()); - other.setBytesWritten(getBytesWritten()); - other.setFlowFilesIn(getFlowFilesIn()); - other.setBytesIn(getBytesIn()); - other.setFlowFilesOut(getFlowFilesOut()); - other.setBytesOut(getBytesOut()); - other.setTaskCount(getTaskCount()); - other.setTaskDuration(getTaskDuration()); - other.setActiveThreadCount(getActiveThreadCount()); - other.setInput(getInput()); - other.setOutput(getOutput()); - other.setRead(getRead()); - other.setWritten(getWritten()); - other.setTasks(getTasks()); - other.setBulletins(cloneBulletins()); + other.setId(getId()); + other.setProcessorName(getProcessorName()); + other.setProcessorRunStatus(getProcessorRunStatus()); + other.setProcessorType(getProcessorType()); + other.setStatsLastRefreshed(getStatsLastRefreshed()); + other.setAggregateStatus(getAggregateStatus().clone()); + + final List<NodeProcessorStatusSnapshotDTO> nodeStatuses = getNodeStatuses(); + final List<NodeProcessorStatusSnapshotDTO> nodeSnapshots = new ArrayList<>(nodeStatuses.size()); + for (final NodeProcessorStatusSnapshotDTO status : nodeStatuses) { + nodeSnapshots.add(status.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/ProcessorStatusSnapshotDTO.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/ProcessorStatusSnapshotDTO.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/ProcessorStatusSnapshotDTO.java new file mode 100644 index 0000000..d45425d --- /dev/null +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/ProcessorStatusSnapshotDTO.java @@ -0,0 +1,300 @@ +/* + * 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 status of a processor. + */ +@XmlType(name = "processorStatusSnapshot") +public class ProcessorStatusSnapshotDTO implements Cloneable { + + private String id; + private String groupId; + private String name; + private String type; + private String runStatus; + + private Long bytesRead = 0L; + private Long bytesWritten = 0L; + private String read; + private String written; + + private Integer flowFilesIn = 0; + private Long bytesIn = 0L; + private String input; + + private Integer flowFilesOut = 0; + private Long bytesOut = 0L; + private String output; + + private Integer taskCount = 0; + private Long taskDurationNanos = 0L; + private String tasks; + private String tasksDuration; + private Integer activeThreadCount = 0; + + /* getters / setters */ + /** + * @return The processor id + */ + @ApiModelProperty("The id of the processor.") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + /** + * @return The processor name + */ + @ApiModelProperty("The name of the prcessor.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * @return The processor type + */ + @ApiModelProperty("The type of the processor.") + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + /** + * @return run status of this processor + */ + @ApiModelProperty( + value = "The state of the processor.", + allowableValues = "RUNNING, STOPPED, DISABLED, INVALID" + ) + 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 number of bytes read + */ + @ApiModelProperty("The number of bytes read in the last 5 minutes.") + public String getRead() { + return read; + } + + public void setRead(String read) { + this.read = read; + } + + /** + * @return number of bytes written + */ + @ApiModelProperty("The number of bytes written in the last 5 minutes.") + public String getWritten() { + return written; + } + + public void setWritten(String written) { + this.written = written; + } + + /** + * @return the ID of the Process Group to which this processor belongs. + */ + @ApiModelProperty("The id of the parent process group to which the processor belongs.") + public String getGroupId() { + return groupId; + } + + public void setGroupId(final String groupId) { + this.groupId = groupId; + } + + /** + * @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; + } + + /** + * @return number of threads currently running for this Processor + */ + @ApiModelProperty("The number of threads currently executing in the processor.") + public Integer getActiveThreadCount() { + return activeThreadCount; + } + + public void setActiveThreadCount(Integer threadCount) { + this.activeThreadCount = threadCount; + } + + /** + * @return number of task this connectable has had over the last 5 minutes + */ + @ApiModelProperty("The total number of task this connectable has completed over the last 5 minutes.") + public String getTasks() { + return tasks; + } + + public void setTasks(String tasks) { + this.tasks = tasks; + } + + /** + * @return total duration of all tasks for this connectable over the last 5 minutes + */ + @ApiModelProperty("The total duration of all tasks for this connectable over the last 5 minutes.") + public String getTasksDuration() { + return tasksDuration; + } + + public void setTasksDuration(String tasksDuration) { + this.tasksDuration = tasksDuration; + } + + @ApiModelProperty("The number of bytes read by this Processor in the last 5 mintues") + public Long getBytesRead() { + return bytesRead; + } + + public void setBytesRead(Long bytesRead) { + this.bytesRead = bytesRead; + } + + @ApiModelProperty("The number of bytes written by this Processor in the last 5 minutes") + public Long getBytesWritten() { + return bytesWritten; + } + + public void setBytesWritten(Long bytesWritten) { + this.bytesWritten = bytesWritten; + } + + @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 the 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 transferred to a Connection in the last 5 minutes") + public Integer getFlowFilesOut() { + return flowFilesOut; + } + + public void setFlowFilesOut(Integer flowFilesOut) { + this.flowFilesOut = flowFilesOut; + } + + @ApiModelProperty("The size of the FlowFiles transferred to a Connection in the last 5 minutes") + public Long getBytesOut() { + return bytesOut; + } + + public void setBytesOut(Long bytesOut) { + this.bytesOut = bytesOut; + } + + @ApiModelProperty("The number of times this Processor has run in the last 5 minutes") + public Integer getTaskCount() { + return taskCount; + } + + public void setTaskCount(Integer taskCount) { + this.taskCount = taskCount; + } + + @ApiModelProperty("The number of nanoseconds that this Processor has spent running in the last 5 minutes") + public Long getTaskDuration() { + return taskDurationNanos; + } + + public void setTaskDuration(Long taskNanos) { + this.taskDurationNanos = taskNanos; + } + + @Override + public ProcessorStatusSnapshotDTO clone() { + final ProcessorStatusSnapshotDTO other = new ProcessorStatusSnapshotDTO(); + other.setId(getId()); + other.setGroupId(getGroupId()); + other.setName(getName()); + other.setType(getType()); + + other.setRunStatus(getRunStatus()); + other.setBytesRead(getBytesRead()); + other.setBytesWritten(getBytesWritten()); + other.setFlowFilesIn(getFlowFilesIn()); + other.setBytesIn(getBytesIn()); + other.setFlowFilesOut(getFlowFilesOut()); + other.setBytesOut(getBytesOut()); + other.setTaskCount(getTaskCount()); + other.setTaskDuration(getTaskDuration()); + other.setActiveThreadCount(getActiveThreadCount()); + other.setInput(getInput()); + other.setOutput(getOutput()); + other.setRead(getRead()); + other.setWritten(getWritten()); + other.setTasks(getTasks()); + + 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/RemotePortStatusDTO.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/RemotePortStatusDTO.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/RemotePortStatusDTO.java index 6778b0d..5f72cb2 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/RemotePortStatusDTO.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/RemotePortStatusDTO.java @@ -23,7 +23,7 @@ import javax.xml.bind.annotation.XmlType; * The status of a Port on a remote NiFi instance. */ @XmlType(name = "remotePortStatus") -public class RemotePortStatusDTO { +public class RemotePortStatusDTO implements Cloneable { private String id; private String connectionId; @@ -101,4 +101,12 @@ public class RemotePortStatusDTO { this.running = running; } + @Override + public RemotePortStatusDTO clone() { + try { + return (RemotePortStatusDTO) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } } 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/RemoteProcessGroupStatusDTO.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/RemoteProcessGroupStatusDTO.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/RemoteProcessGroupStatusDTO.java index e1dad2a..6038a70 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/RemoteProcessGroupStatusDTO.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/RemoteProcessGroupStatusDTO.java @@ -14,54 +14,29 @@ * 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.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlType; import com.wordnik.swagger.annotations.ApiModelProperty; -/** - * The status of a remote process group in this NiFi. - */ @XmlType(name = "remoteProcessGroupStatus") -public class RemoteProcessGroupStatusDTO extends StatusDTO implements Cloneable { - - private String id; +public class RemoteProcessGroupStatusDTO { private String groupId; + private String id; private String name; private String targetUri; private String transmissionStatus; - private Integer activeThreadCount; private List<String> authorizationIssues; - private Integer flowFilesSent = 0; - private Long bytesSent = 0L; - private String sent; - - private Integer flowFilesReceived = 0; - private Long bytesReceived = 0L; - private String received; - - /** - * @return The id for the remote process group - */ - @ApiModelProperty("The id of the remote process group.") - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } + private RemoteProcessGroupStatusSnapshotDTO aggregateStatus; + private List<NodeRemoteProcessGroupStatusSnapshotDTO> nodeStatuses; - /** - * @return id of the group this remote process group is in - */ - @ApiModelProperty("The id of the parent process group the remote process group resides in.") + @ApiModelProperty("The unique ID of the process group that the Processor belongs to") public String getGroupId() { return groupId; } @@ -70,21 +45,15 @@ public class RemoteProcessGroupStatusDTO extends StatusDTO implements Cloneable this.groupId = groupId; } - /** - * @return URI of the target system - */ - @ApiModelProperty("The URI of the target system.") - public String getTargetUri() { - return targetUri; + @ApiModelProperty("The unique ID of the Processor") + public String getId() { + return id; } - public void setTargetUri(String targetUri) { - this.targetUri = targetUri; + public void setId(String id) { + this.id = id; } - /** - * @return name of this remote process group - */ @ApiModelProperty("The name of the remote process group.") public String getName() { return name; @@ -94,9 +63,6 @@ public class RemoteProcessGroupStatusDTO extends StatusDTO implements Cloneable this.name = name; } - /** - * @return transmission status of this remote process group - */ @ApiModelProperty("The transmission status of the remote process group.") public String getTransmissionStatus() { return transmissionStatus; @@ -106,21 +72,7 @@ public class RemoteProcessGroupStatusDTO extends StatusDTO implements Cloneable this.transmissionStatus = transmissionStatus; } - /** - * @return number of active threads - */ - @ApiModelProperty("The number of active threads for the remote process group.") - public Integer getActiveThreadCount() { - return activeThreadCount; - } - - public void setActiveThreadCount(Integer activeThreadCount) { - this.activeThreadCount = activeThreadCount; - } - /** - * @return any remote authorization issues for this remote process group - */ @ApiModelProperty("Any remote authorization issues for the remote process group.") public List<String> getAuthorizationIssues() { return authorizationIssues; @@ -130,87 +82,33 @@ public class RemoteProcessGroupStatusDTO extends StatusDTO implements Cloneable this.authorizationIssues = authorizationIssues; } - /** - * @return Formatted description of the amount of data sent to this remote process group - */ - @ApiModelProperty("The count/size of the flowfiles sent to the remote process group in the last 5 minutes.") - public String getSent() { - return sent; - } - - public void setSent(String sent) { - this.sent = sent; - } - - - /** - * @return Formatted description of the amount of data received from this remote process group - */ - @ApiModelProperty("The count/size of the flowfiles received from the remote process group in the last 5 minutes.") - public String getReceived() { - return received; - } - - public void setReceived(String received) { - this.received = received; - } - - @ApiModelProperty("The number of FlowFiles sent to the remote process group in the last 5 minutes.") - public Integer getFlowFilesSent() { - return flowFilesSent; - } - - public void setFlowFilesSent(Integer flowFilesSent) { - this.flowFilesSent = flowFilesSent; - } - - @ApiModelProperty("The size of the FlowFiles sent to the remote process group in the last 5 minutes.") - public Long getBytesSent() { - return bytesSent; - } - - public void setBytesSent(Long bytesSent) { - this.bytesSent = bytesSent; + @ApiModelProperty("The URI of the target system.") + public String getTargetUri() { + return targetUri; } - @ApiModelProperty("The number of FlowFiles received from the remote process group in the last 5 minutes.") - public Integer getFlowFilesReceived() { - return flowFilesReceived; + public void setTargetUri(String targetUri) { + this.targetUri = targetUri; } - public void setFlowFilesReceived(Integer flowFilesReceived) { - this.flowFilesReceived = flowFilesReceived; + @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 RemoteProcessGroupStatusSnapshotDTO getAggregateStatus() { + return aggregateStatus; } - @ApiModelProperty("The size of the FlowFiles received from the remote process group in the last 5 minutes.") - public Long getBytesReceived() { - return bytesReceived; + public void setAggregateStatus(RemoteProcessGroupStatusSnapshotDTO aggregateStatus) { + this.aggregateStatus = aggregateStatus; } - public void setBytesReceived(Long bytesReceived) { - this.bytesReceived = bytesReceived; + @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<NodeRemoteProcessGroupStatusSnapshotDTO> getNodeStatuses() { + return nodeStatuses; } - - @Override - public RemoteProcessGroupStatusDTO clone() { - final RemoteProcessGroupStatusDTO other = new RemoteProcessGroupStatusDTO(); - other.setId(getId()); - other.setGroupId(getGroupId()); - other.setName(getName()); - other.setTargetUri(getTargetUri()); - other.setTransmissionStatus(getTransmissionStatus()); - other.setActiveThreadCount(getActiveThreadCount()); - other.setAuthorizationIssues(getAuthorizationIssues() == null ? null : new ArrayList<String>(getAuthorizationIssues())); - other.setFlowFilesSent(getFlowFilesSent()); - other.setBytesSent(getBytesSent()); - other.setFlowFilesReceived(getFlowFilesReceived()); - other.setBytesReceived(getBytesReceived()); - other.setReceived(getReceived()); - other.setSent(getSent()); - other.setBulletins(cloneBulletins()); - - return other; + public void setNodeStatuses(List<NodeRemoteProcessGroupStatusSnapshotDTO> 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/RemoteProcessGroupStatusSnapshotDTO.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/RemoteProcessGroupStatusSnapshotDTO.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/RemoteProcessGroupStatusSnapshotDTO.java new file mode 100644 index 0000000..f0f0d7e --- /dev/null +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/RemoteProcessGroupStatusSnapshotDTO.java @@ -0,0 +1,215 @@ +/* + * 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 java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.annotation.XmlType; + +import com.wordnik.swagger.annotations.ApiModelProperty; + +/** + * The status of a remote process group in this NiFi. + */ +@XmlType(name = "remoteProcessGroupStatusSnapshot") +public class RemoteProcessGroupStatusSnapshotDTO implements Cloneable { + + private String id; + private String groupId; + private String name; + private String targetUri; + private String transmissionStatus; + private Integer activeThreadCount; + + private List<String> authorizationIssues; + + private Integer flowFilesSent = 0; + private Long bytesSent = 0L; + private String sent; + + private Integer flowFilesReceived = 0; + private Long bytesReceived = 0L; + private String received; + + /** + * @return The id for the remote process group + */ + @ApiModelProperty("The id of the remote process group.") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + /** + * @return id of the group this remote process group is in + */ + @ApiModelProperty("The id of the parent process group the remote process group resides in.") + public String getGroupId() { + return groupId; + } + + public void setGroupId(String groupId) { + this.groupId = groupId; + } + + /** + * @return URI of the target system + */ + @ApiModelProperty("The URI of the target system.") + public String getTargetUri() { + return targetUri; + } + + public void setTargetUri(String targetUri) { + this.targetUri = targetUri; + } + + /** + * @return name of this remote process group + */ + @ApiModelProperty("The name of the remote process group.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * @return transmission status of this remote process group + */ + @ApiModelProperty("The transmission status of the remote process group.") + public String getTransmissionStatus() { + return transmissionStatus; + } + + public void setTransmissionStatus(String transmissionStatus) { + this.transmissionStatus = transmissionStatus; + } + + /** + * @return number of active threads + */ + @ApiModelProperty("The number of active threads for the remote process group.") + public Integer getActiveThreadCount() { + return activeThreadCount; + } + + public void setActiveThreadCount(Integer activeThreadCount) { + this.activeThreadCount = activeThreadCount; + } + + /** + * @return any remote authorization issues for this remote process group + */ + @ApiModelProperty("Any remote authorization issues for the remote process group.") + public List<String> getAuthorizationIssues() { + return authorizationIssues; + } + + public void setAuthorizationIssues(List<String> authorizationIssues) { + this.authorizationIssues = authorizationIssues; + } + + /** + * @return Formatted description of the amount of data sent to this remote process group + */ + @ApiModelProperty("The count/size of the flowfiles sent to the remote process group in the last 5 minutes.") + public String getSent() { + return sent; + } + + public void setSent(String sent) { + this.sent = sent; + } + + + /** + * @return Formatted description of the amount of data received from this remote process group + */ + @ApiModelProperty("The count/size of the flowfiles received from the remote process group in the last 5 minutes.") + public String getReceived() { + return received; + } + + public void setReceived(String received) { + this.received = received; + } + + @ApiModelProperty("The number of FlowFiles sent to the remote process group in the last 5 minutes.") + public Integer getFlowFilesSent() { + return flowFilesSent; + } + + public void setFlowFilesSent(Integer flowFilesSent) { + this.flowFilesSent = flowFilesSent; + } + + @ApiModelProperty("The size of the FlowFiles sent to the remote process group in the last 5 minutes.") + public Long getBytesSent() { + return bytesSent; + } + + public void setBytesSent(Long bytesSent) { + this.bytesSent = bytesSent; + } + + @ApiModelProperty("The number of FlowFiles received from the remote process group in the last 5 minutes.") + public Integer getFlowFilesReceived() { + return flowFilesReceived; + } + + public void setFlowFilesReceived(Integer flowFilesReceived) { + this.flowFilesReceived = flowFilesReceived; + } + + @ApiModelProperty("The size of the FlowFiles received from the remote process group in the last 5 minutes.") + public Long getBytesReceived() { + return bytesReceived; + } + + public void setBytesReceived(Long bytesReceived) { + this.bytesReceived = bytesReceived; + } + + + @Override + public RemoteProcessGroupStatusSnapshotDTO clone() { + final RemoteProcessGroupStatusSnapshotDTO other = new RemoteProcessGroupStatusSnapshotDTO(); + other.setId(getId()); + other.setGroupId(getGroupId()); + other.setName(getName()); + other.setTargetUri(getTargetUri()); + other.setTransmissionStatus(getTransmissionStatus()); + other.setActiveThreadCount(getActiveThreadCount()); + other.setAuthorizationIssues(getAuthorizationIssues() == null ? null : new ArrayList<String>(getAuthorizationIssues())); + other.setFlowFilesSent(getFlowFilesSent()); + other.setBytesSent(getBytesSent()); + other.setFlowFilesReceived(getFlowFilesReceived()); + other.setBytesReceived(getBytesReceived()); + other.setReceived(getReceived()); + other.setSent(getSent()); + + 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/StatusDTO.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/StatusDTO.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/StatusDTO.java deleted file mode 100644 index ad6d64f..0000000 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/StatusDTO.java +++ /dev/null @@ -1,57 +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 java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlType; - -import org.apache.nifi.web.api.dto.BulletinDTO; - -import com.wordnik.swagger.annotations.ApiModelProperty; - -/** - * The status of a component in this NiFi. - */ -@XmlType(name = "status") -public abstract class StatusDTO { - - private List<BulletinDTO> bulletins; - - /** - * @return Bulletins for this component - */ - @ApiModelProperty( - value = "The current bulletins for the component." - ) - public List<BulletinDTO> getBulletins() { - return bulletins; - } - - public void setBulletins(List<BulletinDTO> bulletins) { - this.bulletins = bulletins; - } - - public List<BulletinDTO> cloneBulletins() { - if (bulletins == null) { - return null; - } - - return new ArrayList<>(bulletins); - } -}
