diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/ProcessGroupDTO.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/ProcessGroupDTO.java index 7faf10b769..d283510782 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/ProcessGroupDTO.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/ProcessGroupDTO.java @@ -30,7 +30,7 @@ public class ProcessGroupDTO extends ComponentDTO { private String name; private String comments; private Map variables; - private VersionControlInformationDTO versionControlInfo; + private VersionControlInformationDTO versionControlInformation; private Integer runningCount; private Integer stoppedCount; @@ -39,6 +39,12 @@ public class ProcessGroupDTO extends ComponentDTO { private Integer activeRemotePortCount; private Integer inactiveRemotePortCount; + private Integer upToDateCount; + private Integer locallyModifiedCount; + private Integer staleCount; + private Integer locallyModifiedAndStaleCount; + private Integer syncFailureCount; + private Integer inputPortCount; private Integer outputPortCount; @@ -204,6 +210,51 @@ public class ProcessGroupDTO extends ComponentDTO { this.inactiveRemotePortCount = inactiveRemotePortCount; } + @ApiModelProperty("The number of up to date versioned process groups in the process group.") + public Integer getUpToDateCount() { + return upToDateCount; + } + + public void setUpToDateCount(Integer upToDateCount) { + this.upToDateCount = upToDateCount; + } + + @ApiModelProperty("The number of locally modified versioned process groups in the process group.") + public Integer getLocallyModifiedCount() { + return locallyModifiedCount; + } + + public void setLocallyModifiedCount(Integer locallyModifiedCount) { + this.locallyModifiedCount = locallyModifiedCount; + } + + @ApiModelProperty("The number of stale versioned process groups in the process group.") + public Integer getStaleCount() { + return staleCount; + } + + public void setStaleCount(Integer staleCount) { + this.staleCount = staleCount; + } + + @ApiModelProperty("The number of locally modified and stale versioned process groups in the process group.") + public Integer getLocallyModifiedAndStaleCount() { + return locallyModifiedAndStaleCount; + } + + public void setLocallyModifiedAndStaleCount(Integer locallyModifiedAndStaleCount) { + this.locallyModifiedAndStaleCount = locallyModifiedAndStaleCount; + } + + @ApiModelProperty("The number of versioned process groups in the process group that are unable to sync to a registry.") + public Integer getSyncFailureCount() { + return syncFailureCount; + } + + public void setSyncFailureCount(Integer syncFailureCount) { + this.syncFailureCount = syncFailureCount; + } + @ApiModelProperty(value = "The variables that are configured for the Process Group. Note that this map contains only " + "those variables that are defined on this Process Group and not any variables that are defined in the parent " + "Process Group, etc. I.e., this Map will not contain all variables that are accessible by components in this " @@ -219,10 +270,10 @@ public class ProcessGroupDTO extends ComponentDTO { @ApiModelProperty("The Version Control information that indicates which Flow Registry, and where in the Flow Registry, " + "this Process Group is tracking to; or null if this Process Group is not under version control") public VersionControlInformationDTO getVersionControlInformation() { - return versionControlInfo; + return versionControlInformation; } - public void setVersionControlInformation(final VersionControlInformationDTO versionControlInfo) { - this.versionControlInfo = versionControlInfo; + public void setVersionControlInformation(final VersionControlInformationDTO versionControlInformation) { + this.versionControlInformation = versionControlInformation; } } diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/groups/ProcessGroupCounts.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/groups/ProcessGroupCounts.java index 3eb594b8f8..394e5d375a 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/groups/ProcessGroupCounts.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/groups/ProcessGroupCounts.java @@ -18,10 +18,11 @@ package org.apache.nifi.groups; public class ProcessGroupCounts { - private final int inputPortCount, outputPortCount, runningCount, stoppedCount, invalidCount, disabledCount, activeRemotePortCount, inactiveRemotePortCount; + private final int inputPortCount, outputPortCount, runningCount, stoppedCount, invalidCount, disabledCount, activeRemotePortCount, inactiveRemotePortCount, + upToDateCount, locallyModifiedCount, staleCount, locallyModifiedAndStaleCount, syncFailureCount; - public ProcessGroupCounts(final int inputPortCount, final int outputPortCount, final int runningCount, - final int stoppedCount, final int invalidCount, final int disabledCount, final int activeRemotePortCount, final int inactiveRemotePortCount) { + public ProcessGroupCounts(int inputPortCount, int outputPortCount, int runningCount, int stoppedCount, int invalidCount, int disabledCount, int activeRemotePortCount, + int inactiveRemotePortCount, int upToDateCount, int locallyModifiedCount, int staleCount, int locallyModifiedAndStaleCount, int syncFailureCount) { this.inputPortCount = inputPortCount; this.outputPortCount = outputPortCount; this.runningCount = runningCount; @@ -30,6 +31,11 @@ public class ProcessGroupCounts { this.disabledCount = disabledCount; this.activeRemotePortCount = activeRemotePortCount; this.inactiveRemotePortCount = inactiveRemotePortCount; + this.upToDateCount = upToDateCount; + this.locallyModifiedCount = locallyModifiedCount; + this.staleCount = staleCount; + this.locallyModifiedAndStaleCount = locallyModifiedAndStaleCount; + this.syncFailureCount = syncFailureCount; } public int getInputPortCount() { @@ -63,4 +69,24 @@ public class ProcessGroupCounts { public int getInactiveRemotePortCount() { return inactiveRemotePortCount; } + + public int getUpToDateCount() { + return upToDateCount; + } + + public int getLocallyModifiedCount() { + return locallyModifiedCount; + } + + public int getStaleCount() { + return staleCount; + } + + public int getLocallyModifiedAndStaleCount() { + return locallyModifiedAndStaleCount; + } + + public int getSyncFailureCount() { + return syncFailureCount; + } } diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/groups/RemoteProcessGroup.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/groups/RemoteProcessGroup.java index e4da31b894..0dd60704bc 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/groups/RemoteProcessGroup.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/groups/RemoteProcessGroup.java @@ -73,7 +73,7 @@ public interface RemoteProcessGroup extends ComponentAuthorizable, Positionable, RemoteGroupPort getOutputPort(String id); - ProcessGroupCounts getCounts(); + RemoteProcessGroupCounts getCounts(); void refreshFlowContents() throws CommunicationsException; diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/groups/RemoteProcessGroupCounts.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/groups/RemoteProcessGroupCounts.java new file mode 100644 index 0000000000..e3163f67d4 --- /dev/null +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/groups/RemoteProcessGroupCounts.java @@ -0,0 +1,36 @@ +/* + * 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.groups; + +public class RemoteProcessGroupCounts { + + private final int inputPortCount, outputPortCount; + + public RemoteProcessGroupCounts(int inputPortCount, int outputPortCount) { + this.inputPortCount = inputPortCount; + this.outputPortCount = outputPortCount; + } + + public int getInputPortCount() { + return inputPortCount; + } + + public int getOutputPortCount() { + return outputPortCount; + } + +} diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/TemplateUtils.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/TemplateUtils.java index 9583bbb041..6bfa49d67d 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/TemplateUtils.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/TemplateUtils.java @@ -127,6 +127,11 @@ public class TemplateUtils { processGroupDTO.setOutputPortCount(null); processGroupDTO.setRunningCount(null); processGroupDTO.setStoppedCount(null); + processGroupDTO.setUpToDateCount(null); + processGroupDTO.setLocallyModifiedCount(null); + processGroupDTO.setStaleCount(null); + processGroupDTO.setLocallyModifiedAndStaleCount(null); + processGroupDTO.setSyncFailureCount(null); scrubSnippet(processGroupDTO.getContents()); } diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/groups/StandardProcessGroup.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/groups/StandardProcessGroup.java index 77be3fedd4..9a14464cd8 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/groups/StandardProcessGroup.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/groups/StandardProcessGroup.java @@ -16,31 +16,6 @@ */ package org.apache.nifi.groups; -import static java.util.Objects.requireNonNull; - -import java.io.IOException; -import java.net.URL; -import java.nio.charset.StandardCharsets; -import java.security.SecureRandom; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import java.util.Set; -import java.util.UUID; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicReference; -import java.util.concurrent.locks.Lock; -import java.util.concurrent.locks.ReentrantReadWriteLock; -import java.util.function.Function; -import java.util.stream.Collectors; - import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.builder.HashCodeBuilder; import org.apache.commons.lang3.builder.ToStringBuilder; @@ -139,6 +114,31 @@ import org.apache.nifi.web.api.dto.TemplateDTO; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; +import java.net.URL; +import java.nio.charset.StandardCharsets; +import java.security.SecureRandom; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import java.util.Set; +import java.util.UUID; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicReference; +import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReentrantReadWriteLock; +import java.util.function.Function; +import java.util.stream.Collectors; + +import static java.util.Objects.requireNonNull; + public final class StandardProcessGroup implements ProcessGroup { private final String id; @@ -278,6 +278,12 @@ public final class StandardProcessGroup implements ProcessGroup { int activeRemotePorts = 0; int inactiveRemotePorts = 0; + int upToDate = 0; + int locallyModified = 0; + int stale = 0; + int locallyModifiedAndStale = 0; + int syncFailure = 0; + readLock.lock(); try { for (final ProcessorNode procNode : processors.values()) { @@ -324,6 +330,27 @@ public final class StandardProcessGroup implements ProcessGroup { stopped += childCounts.getStoppedCount(); invalid += childCounts.getInvalidCount(); disabled += childCounts.getDisabledCount(); + + // update the vci counts for this child group + final VersionControlInformation vci = childGroup.getVersionControlInformation(); + if (vci != null) { + if (vci.isModified() && !vci.isCurrent()) { + locallyModifiedAndStale += 1; + } else if (!vci.isCurrent()) { + stale += 1; + } else if (vci.isModified()) { + locallyModified += 1; + } else { + upToDate += 1; + } + } + + // update the vci counts for all nested groups within the child + upToDate += childCounts.getUpToDateCount(); + locallyModified += childCounts.getLocallyModifiedCount(); + stale += childCounts.getStaleCount(); + locallyModifiedAndStale += childCounts.getLocallyModifiedAndStaleCount(); + syncFailure += childCounts.getSyncFailureCount(); } for (final RemoteProcessGroup remoteGroup : findAllRemoteProcessGroups()) { @@ -358,8 +385,8 @@ public final class StandardProcessGroup implements ProcessGroup { readLock.unlock(); } - return new ProcessGroupCounts(inputPortCount, outputPortCount, running, stopped, - invalid, disabled, activeRemotePorts, inactiveRemotePorts); + return new ProcessGroupCounts(inputPortCount, outputPortCount, running, stopped, invalid, disabled, activeRemotePorts, + inactiveRemotePorts, upToDate, locallyModified, stale, locallyModifiedAndStale, syncFailure); } @Override diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/remote/StandardRemoteProcessGroup.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/remote/StandardRemoteProcessGroup.java index 039ac66e94..67710fe713 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/remote/StandardRemoteProcessGroup.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/remote/StandardRemoteProcessGroup.java @@ -16,8 +16,43 @@ */ package org.apache.nifi.remote; -import static java.util.Objects.requireNonNull; +import org.apache.commons.lang3.StringUtils; +import org.apache.nifi.authorization.Resource; +import org.apache.nifi.authorization.resource.Authorizable; +import org.apache.nifi.authorization.resource.ResourceFactory; +import org.apache.nifi.authorization.resource.ResourceType; +import org.apache.nifi.components.ValidationResult; +import org.apache.nifi.connectable.ConnectableType; +import org.apache.nifi.connectable.Connection; +import org.apache.nifi.connectable.Port; +import org.apache.nifi.connectable.Position; +import org.apache.nifi.controller.FlowController; +import org.apache.nifi.controller.ProcessScheduler; +import org.apache.nifi.controller.ScheduledState; +import org.apache.nifi.controller.exception.CommunicationsException; +import org.apache.nifi.engine.FlowEngine; +import org.apache.nifi.events.BulletinFactory; +import org.apache.nifi.events.EventReporter; +import org.apache.nifi.groups.ProcessGroup; +import org.apache.nifi.groups.ProcessGroupCounts; +import org.apache.nifi.groups.RemoteProcessGroup; +import org.apache.nifi.groups.RemoteProcessGroupCounts; +import org.apache.nifi.groups.RemoteProcessGroupPortDescriptor; +import org.apache.nifi.remote.protocol.SiteToSiteTransportProtocol; +import org.apache.nifi.remote.protocol.http.HttpProxy; +import org.apache.nifi.remote.util.SiteToSiteRestApiClient; +import org.apache.nifi.reporting.BulletinRepository; +import org.apache.nifi.reporting.ComponentType; +import org.apache.nifi.reporting.Severity; +import org.apache.nifi.util.FormatUtils; +import org.apache.nifi.util.NiFiProperties; +import org.apache.nifi.web.api.dto.ControllerDTO; +import org.apache.nifi.web.api.dto.PortDTO; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import javax.net.ssl.SSLContext; +import javax.ws.rs.core.Response; import java.io.File; import java.io.IOException; import java.net.InetAddress; @@ -47,42 +82,7 @@ import java.util.concurrent.locks.ReentrantReadWriteLock; import java.util.function.Function; import java.util.stream.Collectors; -import javax.net.ssl.SSLContext; -import javax.ws.rs.core.Response; - -import org.apache.commons.lang3.StringUtils; -import org.apache.nifi.authorization.Resource; -import org.apache.nifi.authorization.resource.Authorizable; -import org.apache.nifi.authorization.resource.ResourceFactory; -import org.apache.nifi.authorization.resource.ResourceType; -import org.apache.nifi.components.ValidationResult; -import org.apache.nifi.connectable.ConnectableType; -import org.apache.nifi.connectable.Connection; -import org.apache.nifi.connectable.Port; -import org.apache.nifi.connectable.Position; -import org.apache.nifi.controller.FlowController; -import org.apache.nifi.controller.ProcessScheduler; -import org.apache.nifi.controller.ScheduledState; -import org.apache.nifi.controller.exception.CommunicationsException; -import org.apache.nifi.engine.FlowEngine; -import org.apache.nifi.events.BulletinFactory; -import org.apache.nifi.events.EventReporter; -import org.apache.nifi.groups.ProcessGroup; -import org.apache.nifi.groups.ProcessGroupCounts; -import org.apache.nifi.groups.RemoteProcessGroup; -import org.apache.nifi.groups.RemoteProcessGroupPortDescriptor; -import org.apache.nifi.remote.protocol.SiteToSiteTransportProtocol; -import org.apache.nifi.remote.protocol.http.HttpProxy; -import org.apache.nifi.remote.util.SiteToSiteRestApiClient; -import org.apache.nifi.reporting.BulletinRepository; -import org.apache.nifi.reporting.ComponentType; -import org.apache.nifi.reporting.Severity; -import org.apache.nifi.util.FormatUtils; -import org.apache.nifi.util.NiFiProperties; -import org.apache.nifi.web.api.dto.ControllerDTO; -import org.apache.nifi.web.api.dto.PortDTO; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import static java.util.Objects.requireNonNull; /** * Represents the Root Process Group of a remote NiFi Instance. Holds @@ -137,7 +137,7 @@ public class StandardRemoteProcessGroup implements RemoteProcessGroup { // Maps a Port Name to a PullingPort that can be used to receive files from that port private final Map outputPorts = new HashMap<>(); - private ProcessGroupCounts counts = new ProcessGroupCounts(0, 0, 0, 0, 0, 0, 0, 0); + private RemoteProcessGroupCounts counts = new RemoteProcessGroupCounts(0, 0); private Long refreshContentsTimestamp = null; private Boolean destinationSecure; private Integer listeningPort; @@ -829,7 +829,7 @@ public class StandardRemoteProcessGroup implements RemoteProcessGroup { } @Override - public ProcessGroupCounts getCounts() { + public RemoteProcessGroupCounts getCounts() { readLock.lock(); try { return counts; @@ -838,7 +838,7 @@ public class StandardRemoteProcessGroup implements RemoteProcessGroup { } } - private void setCounts(final ProcessGroupCounts counts) { + private void setCounts(final RemoteProcessGroupCounts counts) { writeLock.lock(); try { this.counts = counts; @@ -910,39 +910,12 @@ public class StandardRemoteProcessGroup implements RemoteProcessGroup { if (dto.getOutputPortCount() != null) { outputPortCount = dto.getOutputPortCount(); } - int runningCount = 0; - if (dto.getRunningCount() != null) { - runningCount = dto.getRunningCount(); - } - int stoppedCount = 0; - if (dto.getStoppedCount() != null) { - stoppedCount = dto.getStoppedCount(); - } - int invalidCount = 0; - if (dto.getInvalidCount() != null) { - invalidCount = dto.getInvalidCount(); - } - int disabledCount = 0; - if (dto.getDisabledCount() != null) { - disabledCount = dto.getDisabledCount(); - } - - int activeRemotePortCount = 0; - if (dto.getActiveRemotePortCount() != null) { - activeRemotePortCount = dto.getActiveRemotePortCount(); - } - - int inactiveRemotePortCount = 0; - if (dto.getInactiveRemotePortCount() != null) { - inactiveRemotePortCount = dto.getInactiveRemotePortCount(); - } this.listeningPort = dto.getRemoteSiteListeningPort(); this.listeningHttpPort = dto.getRemoteSiteHttpListeningPort(); this.destinationSecure = dto.isSiteToSiteSecure(); - final ProcessGroupCounts newCounts = new ProcessGroupCounts(inputPortCount, outputPortCount, - runningCount, stoppedCount, invalidCount, disabledCount, activeRemotePortCount, inactiveRemotePortCount); + final RemoteProcessGroupCounts newCounts = new RemoteProcessGroupCounts(inputPortCount, outputPortCount); setCounts(newCounts); this.refreshContentsTimestamp = System.currentTimeMillis(); } finally { diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java index e0594faf24..98c7bc8e8a 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java @@ -16,9 +16,7 @@ */ package org.apache.nifi.web; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.core.Response; - +import com.google.common.collect.Sets; import org.apache.commons.collections4.CollectionUtils; import org.apache.nifi.action.Action; import org.apache.nifi.action.Component; @@ -269,8 +267,8 @@ import org.apache.nifi.web.util.SnippetUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.google.common.collect.Sets; - +import javax.ws.rs.WebApplicationException; +import javax.ws.rs.core.Response; import java.io.IOException; import java.nio.charset.StandardCharsets; import java.util.ArrayList; @@ -3018,6 +3016,8 @@ public class StandardNiFiServiceFacade implements NiFiServiceFacade { final ControllerDTO controllerDTO = new ControllerDTO(); controllerDTO.setId(controllerFacade.getRootGroupId()); controllerDTO.setInstanceId(controllerFacade.getInstanceId()); + controllerDTO.setName(controllerFacade.getName()); + controllerDTO.setComments(controllerFacade.getComments()); controllerDTO.setInputPorts(inputPortDtos); controllerDTO.setOutputPorts(outputPortDtos); controllerDTO.setInputPortCount(inputPortDtos.size()); diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java index fb606047c1..5b33d9025d 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java @@ -101,6 +101,7 @@ import org.apache.nifi.flowfile.attributes.CoreAttributes; import org.apache.nifi.groups.ProcessGroup; import org.apache.nifi.groups.ProcessGroupCounts; import org.apache.nifi.groups.RemoteProcessGroup; +import org.apache.nifi.groups.RemoteProcessGroupCounts; import org.apache.nifi.history.History; import org.apache.nifi.nar.ExtensionManager; import org.apache.nifi.nar.NarClassLoaders; @@ -1648,7 +1649,7 @@ public final class DtoFactory { dto.setInactiveRemoteOutputPortCount(inactiveRemoteOutputPortCount); dto.setVersionedComponentId(group.getVersionedComponentId().orElse(null)); - final ProcessGroupCounts counts = group.getCounts(); + final RemoteProcessGroupCounts counts = group.getCounts(); if (counts != null) { dto.setInputPortCount(counts.getInputPortCount()); dto.setOutputPortCount(counts.getOutputPortCount()); @@ -2175,6 +2176,11 @@ public final class DtoFactory { dto.setOutputPortCount(counts.getOutputPortCount()); dto.setActiveRemotePortCount(counts.getActiveRemotePortCount()); dto.setInactiveRemotePortCount(counts.getInactiveRemotePortCount()); + dto.setUpToDateCount(counts.getUpToDateCount()); + dto.setLocallyModifiedCount(counts.getLocallyModifiedCount()); + dto.setStaleCount(counts.getStaleCount()); + dto.setLocallyModifiedAndStaleCount(counts.getLocallyModifiedAndStaleCount()); + dto.setSyncFailureCount(counts.getSyncFailureCount()); return dto; } @@ -3453,6 +3459,12 @@ public final class DtoFactory { copy.setActiveRemotePortCount(original.getActiveRemotePortCount()); copy.setInactiveRemotePortCount(original.getInactiveRemotePortCount()); + copy.setUpToDateCount(original.getUpToDateCount()); + copy.setLocallyModifiedCount(original.getLocallyModifiedCount()); + copy.setStaleCount(original.getStaleCount()); + copy.setLocallyModifiedAndStaleCount(original.getLocallyModifiedAndStaleCount()); + copy.setSyncFailureCount(original.getSyncFailureCount()); + if (original.getVariables() != null) { copy.setVariables(new HashMap<>(original.getVariables())); } diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/partials/canvas/revert-local-changes-dialog.jsp b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/partials/canvas/revert-local-changes-dialog.jsp index 45d4c4c969..ce18052782 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/partials/canvas/revert-local-changes-dialog.jsp +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/partials/canvas/revert-local-changes-dialog.jsp @@ -17,10 +17,8 @@ <%@ page contentType="text/html" pageEncoding="UTF-8" session="false" %>