You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by mc...@apache.org on 2015/02/17 21:32:54 UTC
[1/4] incubator-nifi git commit: NIFI-250: - Updating fill color
dialog styling for use in updated modal plugin. - Making the fill color
dialog draggable.
Repository: incubator-nifi
Updated Branches:
refs/heads/NIFI-250 4ce7202d9 -> 6457929b2
NIFI-250:
- Updating fill color dialog styling for use in updated modal plugin.
- Making the fill color dialog draggable.
Project: http://git-wip-us.apache.org/repos/asf/incubator-nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-nifi/commit/e4e61daa
Tree: http://git-wip-us.apache.org/repos/asf/incubator-nifi/tree/e4e61daa
Diff: http://git-wip-us.apache.org/repos/asf/incubator-nifi/diff/e4e61daa
Branch: refs/heads/NIFI-250
Commit: e4e61daa26c996d3234982cf1409bb501631b9d0
Parents: 4ce7202
Author: Matt Gilman <ma...@gmail.com>
Authored: Tue Feb 17 12:48:39 2015 -0500
Committer: Matt Gilman <ma...@gmail.com>
Committed: Tue Feb 17 12:48:39 2015 -0500
----------------------------------------------------------------------
.../nifi-web/nifi-web-ui/src/main/webapp/css/dialog.css | 1 -
.../nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-header.js | 3 +++
2 files changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/e4e61daa/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/dialog.css
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/dialog.css b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/dialog.css
index 9635f8a..88555e7 100644
--- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/dialog.css
+++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/dialog.css
@@ -74,7 +74,6 @@
display: none;
width: 195px;
height: 400px;
- border: 1px solid #eee;
}
#fill-color-value {
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/e4e61daa/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-header.js
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-header.js b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-header.js
index bfe7312..53b7cc9 100644
--- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-header.js
+++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-header.js
@@ -213,6 +213,9 @@ nf.CanvasHeader = (function () {
$('#fill-color').minicolors('value', '');
}
}
+ }).draggable({
+ containment: 'parent',
+ handle: '.dialog-header'
});
// initialize the fill color picker
[3/4] incubator-nifi git commit: NIFI-250: - Only showing the enable
button when the controller service is valid. - Adding polling during
deactivation of controller service references to know when it's ok to attempt
to disable the controller service.
Posted by mc...@apache.org.
NIFI-250:
- Only showing the enable button when the controller service is valid.
- Adding polling during deactivation of controller service references to know when it's ok to attempt to disable the controller service.
Project: http://git-wip-us.apache.org/repos/asf/incubator-nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-nifi/commit/e61a01ac
Tree: http://git-wip-us.apache.org/repos/asf/incubator-nifi/tree/e61a01ac
Diff: http://git-wip-us.apache.org/repos/asf/incubator-nifi/diff/e61a01ac
Branch: refs/heads/NIFI-250
Commit: e61a01ac6968ba2f1e4f8fa1d3ca9c2cbca400e6
Parents: f22407f
Author: Matt Gilman <ma...@gmail.com>
Authored: Tue Feb 17 14:55:44 2015 -0500
Committer: Matt Gilman <ma...@gmail.com>
Committed: Tue Feb 17 14:55:44 2015 -0500
----------------------------------------------------------------------
.../js/nf/canvas/nf-controller-service.js | 110 +++++++++++++++++--
.../src/main/webapp/js/nf/canvas/nf-settings.js | 9 +-
2 files changed, 110 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/e61a01ac/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-controller-service.js
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-controller-service.js b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-controller-service.js
index aa62f79..cd8503e 100644
--- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-controller-service.js
+++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-controller-service.js
@@ -348,8 +348,89 @@ nf.ControllerService = (function () {
};
// updates the referencing components with the specified state
- var updateReferencingComponents = function (controllerService, state) {
+ var updateReferencingComponents = function (controllerService, activated) {
+ var revision = nf.Client.getRevision();
+
+ // issue the request to update the referencing components
+ var updated = $.ajax({
+ type: 'PUT',
+ url: controllerService.uri + '/references',
+ data: {
+ clientId: revision.clientId,
+ version: revision.version,
+ activated: activated
+ },
+ dataType: 'json'
+ }).done(function (response) {
+ // update the revision
+ nf.Client.setRevision(response.revision);
+
+ // update the service
+ reloadControllerServiceReferences(controllerService);
+ }).fail(nf.Common.handleAjaxError);
+ // if we are activating, we can stop here
+ if (activated === true) {
+ return updated;
+ }
+
+ // since we are deactivating, we want to keep polling until
+ // everything has stopped and there are 0 active threads
+ return $.Deferred(function(deferred) {
+ var current = 1;
+ var getTimeout = function () {
+ var val = current;
+
+ // update the current timeout for the next time
+ current = Math.max(current * 2, 8);
+
+ return val * 1000;
+ };
+
+ // polls for the current status of the referencing components
+ var pollReferencingComponent = function() {
+ $.ajax({
+ type: 'GET',
+ url: controllerService.uri + '/references',
+ dataType: 'json'
+ }).done(function (response) {
+ checkDeactivated(response.controllerServiceReferencingComponents);
+ }).fail(function (xhr, status, error) {
+ deferred.reject();
+ nf.Common.handleAjaxError(xhr, status, error);
+ });
+ };
+
+ // checks the referencing components to see if any are still active
+ var checkDeactivated = function (controllerServiceReferencingComponents) {
+ var stillRunning = false;
+
+ $.each(controllerServiceReferencingComponents, function(referencingComponent) {
+ if (referencingComponent.referenceType === 'ControllerService') {
+ if (referencingComponent.enable === true) {
+ stillRunning = true;
+ return false;
+ }
+ } else {
+ if (referencingComponent.state === 'RUNNING' || referencingComponent.activeThreadCount > 0) {
+ stillRunning = true;
+ return false;
+ }
+ }
+ });
+
+ if (stillRunning) {
+ setTimeout(pollReferencingComponent(), getTimeout());
+ } else {
+ deferred.resolve();
+ }
+ };
+
+ // see if the references have already stopped
+ updated.done(function(response) {
+ checkDeactivated(response.controllerServiceReferencingComponents);
+ });
+ }).promise();
};
/**
@@ -478,11 +559,17 @@ nf.ControllerService = (function () {
var controllerServiceData = controllerServiceGrid.getData();
var controllerService = controllerServiceData.getItemById(controllerServiceId);
- // disable all referencing components
- updateReferencingComponents(controllerService, false);
+ // deactivate all referencing components
+ var deactivated = updateReferencingComponents(controllerService, false);
- // enable this controller service
- setEnabled(controllerService, false);
+ // once all referencing components have been deactivated...
+ deactivated.done(function() {
+ // disable this service
+ setEnabled(controllerService, false).done(function() {
+ // close the dialog
+ $('#disable-controller-service-dialog').modal('hide');
+ });
+ });
}
}
}, {
@@ -534,13 +621,20 @@ nf.ControllerService = (function () {
var controllerServiceData = controllerServiceGrid.getData();
var controllerService = controllerServiceData.getItemById(controllerServiceId);
+ // enable this controller service
+ var enabled = setEnabled(controllerService, true);
+
+ // determine if we want to also activate referencing components
var scope = $('#enable-controller-service-scope').combo('getSelectedOption').value;
if (scope === config.serviceAndReferencingComponents) {
- updateReferencingComponents(controllerService, true);
+ // once the service is enabled, activate all referencing components
+ enabled.done(function() {
+ updateReferencingComponents(controllerService, true);
+ });
}
- // enable this controller service
- setEnabled(controllerService, true);
+ // hide the dialog immediately as there's nothing to show
+ $(this).modal('hide');
}
}
}, {
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/e61a01ac/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-settings.js
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-settings.js b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-settings.js
index eef5448..744198f 100644
--- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-settings.js
+++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-settings.js
@@ -751,7 +751,14 @@ nf.Settings = (function () {
if (dataContext.enabled === true) {
markup += '<img src="images/iconDisable.png" title="Disable" class="pointer disable-controller-service" style="margin-top: 2px;" /> ';
} else {
- markup += '<img src="images/iconEdit.png" title="Edit" class="pointer edit-controller-service" style="margin-top: 2px;" /> <img src="images/iconEnable.png" title="Enable" class="pointer enable-controller-service" style="margin-top: 2px;"/> <img src="images/iconDelete.png" title="Remove" class="pointer delete-controller-service" style="margin-top: 2px;" /> ';
+ markup += '<img src="images/iconEdit.png" title="Edit" class="pointer edit-controller-service" style="margin-top: 2px;" /> ';
+
+ // only enable the enable icon if the service has no validation errors
+ if (nf.Common.isEmpty(dataContext.validationErrors)) {
+ markup += '<img src="images/iconEnable.png" title="Enable" class="pointer enable-controller-service" style="margin-top: 2px;"/> ';
+ }
+
+ markup += '<img src="images/iconDelete.png" title="Remove" class="pointer delete-controller-service" style="margin-top: 2px;" /> ';
}
return markup;
[4/4] incubator-nifi git commit: NIFI-250: - Adding auditing to
activating/deactivating controller service references.
Posted by mc...@apache.org.
NIFI-250:
- Adding auditing to activating/deactivating controller service references.
Project: http://git-wip-us.apache.org/repos/asf/incubator-nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-nifi/commit/6457929b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-nifi/tree/6457929b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-nifi/diff/6457929b
Branch: refs/heads/NIFI-250
Commit: 6457929b25ba5923bebeb6ab4566e4208d1a092e
Parents: e61a01a
Author: Matt Gilman <ma...@gmail.com>
Authored: Tue Feb 17 15:32:31 2015 -0500
Committer: Matt Gilman <ma...@gmail.com>
Committed: Tue Feb 17 15:32:31 2015 -0500
----------------------------------------------------------------------
.../nifi/audit/ControllerServiceAuditor.java | 74 ++++++++++++++++++++
1 file changed, 74 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/6457929b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/audit/ControllerServiceAuditor.java
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/audit/ControllerServiceAuditor.java b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/audit/ControllerServiceAuditor.java
index 849bdae..a97d768 100644
--- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/audit/ControllerServiceAuditor.java
+++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/audit/ControllerServiceAuditor.java
@@ -30,9 +30,13 @@ import org.apache.nifi.action.component.details.ExtensionDetails;
import org.apache.nifi.action.details.ActionDetails;
import org.apache.nifi.action.details.ConfigureDetails;
import org.apache.nifi.components.PropertyDescriptor;
+import org.apache.nifi.controller.ConfiguredComponent;
+import org.apache.nifi.controller.ProcessorNode;
+import org.apache.nifi.controller.ScheduledState;
import org.apache.nifi.web.security.user.NiFiUserUtils;
import org.apache.nifi.user.NiFiUser;
import org.apache.nifi.controller.service.ControllerServiceNode;
+import org.apache.nifi.controller.service.ControllerServiceReference;
import org.apache.nifi.web.api.dto.ControllerServiceDTO;
import org.apache.nifi.web.dao.ControllerServiceDAO;
import org.aspectj.lang.ProceedingJoinPoint;
@@ -213,6 +217,76 @@ public class ControllerServiceAuditor extends NiFiAuditor {
}
/**
+ * Audits the update of a component referencing a controller service.
+ *
+ * @param proceedingJoinPoint
+ * @return
+ * @throws Throwable
+ */
+ @Around("within(org.apache.nifi.web.dao.ControllerServiceDAO+) && "
+ + "execution(org.apache.nifi.controller.service.ControllerServiceReference updateControllerServiceReferencingComponents(java.lang.String, boolean))")
+ public Object updateControllerServiceReferenceAdvice(ProceedingJoinPoint proceedingJoinPoint) throws Throwable {
+ // update the controller service references
+ final ControllerServiceReference controllerServiceReference = (ControllerServiceReference) proceedingJoinPoint.proceed();
+
+ // get the current user
+ final NiFiUser user = NiFiUserUtils.getNiFiUser();
+
+ if (user != null) {
+ final Collection<Action> actions = new ArrayList<>();
+
+ // consider each component updates
+ for (final ConfiguredComponent component : controllerServiceReference.getReferencingComponents()) {
+ if (component instanceof ProcessorNode) {
+ final ProcessorNode processor = ((ProcessorNode) component);
+
+ // create the processor details
+ ExtensionDetails processorDetails = new ExtensionDetails();
+ processorDetails.setType(processor.getProcessor().getClass().getSimpleName());
+
+ // create a processor action
+ Action processorAction = new Action();
+ processorAction.setUserDn(user.getDn());
+ processorAction.setUserName(user.getUserName());
+ processorAction.setTimestamp(new Date());
+ processorAction.setSourceId(processor.getIdentifier());
+ processorAction.setSourceName(processor.getName());
+ processorAction.setSourceType(Component.Processor);
+ processorAction.setComponentDetails(processorDetails);
+ processorAction.setOperation(ScheduledState.RUNNING.equals(processor.getScheduledState()) ? Operation.Start : Operation.Stop);
+ actions.add(processorAction);
+ } else if (component instanceof ControllerServiceNode) {
+ final ControllerServiceNode controllerService = ((ControllerServiceNode) component);
+
+ // create the processor details
+ ExtensionDetails serviceDetails = new ExtensionDetails();
+ serviceDetails.setType(controllerService.getControllerServiceImplementation().getClass().getSimpleName());
+
+ // create a controller service action
+ Action serviceAction = new Action();
+ serviceAction.setUserDn(user.getDn());
+ serviceAction.setUserName(user.getUserName());
+ serviceAction.setTimestamp(new Date());
+ serviceAction.setSourceId(controllerService.getIdentifier());
+ serviceAction.setSourceName(controllerService.getName());
+ serviceAction.setSourceType(Component.ControllerService);
+ serviceAction.setComponentDetails(serviceDetails);
+ serviceAction.setOperation(controllerService.isDisabled() ? Operation.Disable : Operation.Enable);
+ actions.add(serviceAction);
+ }
+ }
+
+ // ensure there are actions to record
+ if (!actions.isEmpty()) {
+ // save the actions
+ saveActions(actions, logger);
+ }
+ }
+
+ return controllerServiceReference;
+ }
+
+ /**
* Audits the removal of a controller service via deleteControllerService().
*
* @param proceedingJoinPoint
[2/4] incubator-nifi git commit: NIFI-250: - Updating the controller
service references endpoint to accept an activated flag that drivens whether
processors/reporting tasks are started/stopped and controller services
enabled/disabled.
Posted by mc...@apache.org.
NIFI-250:
- Updating the controller service references endpoint to accept an activated flag that drivens whether processors/reporting tasks are started/stopped and controller services enabled/disabled.
Project: http://git-wip-us.apache.org/repos/asf/incubator-nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-nifi/commit/f22407f5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-nifi/tree/f22407f5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-nifi/diff/f22407f5
Branch: refs/heads/NIFI-250
Commit: f22407f59347010aede5c12cd64652a381f4fd59
Parents: e4e61da
Author: Matt Gilman <ma...@gmail.com>
Authored: Tue Feb 17 14:54:32 2015 -0500
Committer: Matt Gilman <ma...@gmail.com>
Committed: Tue Feb 17 14:54:32 2015 -0500
----------------------------------------------------------------------
.../java/org/apache/nifi/web/NiFiServiceFacade.java | 4 ++--
.../org/apache/nifi/web/StandardNiFiServiceFacade.java | 4 ++--
.../apache/nifi/web/api/ControllerServiceResource.java | 13 +++++++++----
.../org/apache/nifi/web/dao/ControllerServiceDAO.java | 4 ++--
.../web/dao/impl/StandardControllerServiceDAO.java | 12 ++++++++++--
5 files changed, 25 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/f22407f5/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/NiFiServiceFacade.java
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/NiFiServiceFacade.java b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/NiFiServiceFacade.java
index 8ed7062..77ed70a 100644
--- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/NiFiServiceFacade.java
+++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/NiFiServiceFacade.java
@@ -981,10 +981,10 @@ public interface NiFiServiceFacade {
*
* @param revision
* @param controllerServiceId
- * @param state
+ * @param activated
* @return
*/
- ConfigurationSnapshot<Set<ControllerServiceReferencingComponentDTO>> updateControllerServiceReferencingComponents(Revision revision, String controllerServiceId, String state);
+ ConfigurationSnapshot<Set<ControllerServiceReferencingComponentDTO>> updateControllerServiceReferencingComponents(Revision revision, String controllerServiceId, boolean activated);
/**
* Updates the specified label.
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/f22407f5/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java
index 2ed5611..75a281a 100644
--- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java
+++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java
@@ -1210,11 +1210,11 @@ public class StandardNiFiServiceFacade implements NiFiServiceFacade {
}
@Override
- public ConfigurationSnapshot<Set<ControllerServiceReferencingComponentDTO>> updateControllerServiceReferencingComponents(final Revision revision, final String controllerServiceId, final String state) {
+ public ConfigurationSnapshot<Set<ControllerServiceReferencingComponentDTO>> updateControllerServiceReferencingComponents(final Revision revision, final String controllerServiceId, final boolean activated) {
return optimisticLockingManager.configureFlow(revision, new ConfigurationRequest<Set<ControllerServiceReferencingComponentDTO>>() {
@Override
public Set<ControllerServiceReferencingComponentDTO> execute() {
- final ControllerServiceReference reference = controllerServiceDAO.updateControllerServiceReferencingComponents(controllerServiceId, state);
+ final ControllerServiceReference reference = controllerServiceDAO.updateControllerServiceReferencingComponents(controllerServiceId, activated);
return dtoFactory.createControllerServiceReferencingComponentsDto(reference);
}
});
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/f22407f5/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ControllerServiceResource.java
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ControllerServiceResource.java b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ControllerServiceResource.java
index aaf3b40..c72b8ff 100644
--- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ControllerServiceResource.java
+++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ControllerServiceResource.java
@@ -385,8 +385,8 @@ public class ControllerServiceResource extends ApplicationResource {
* @param availability Whether the controller service is available on the NCM only (ncm) or on the
* nodes only (node). If this instance is not clustered all services should use the node availability.
* @param id The id of the controller service to retrieve
- * @param state Possible values include 'START' or 'STOP'. For processors and reporting tasks this will
- * set the scheduled state accordingly. For controller services this will enable or disable accordingly.
+ * @param activated Whether or not to activate referencing components. For processors and reporting tasks this
+ * will set the scheduled state accordingly. For controller services this will enable or disable accordingly.
* @return A controllerServiceEntity.
*/
@PUT
@@ -400,8 +400,13 @@ public class ControllerServiceResource extends ApplicationResource {
@FormParam(VERSION) LongParameter version,
@FormParam(CLIENT_ID) @DefaultValue(StringUtils.EMPTY) ClientIdParameter clientId,
@PathParam("availability") String availability, @PathParam("id") String id,
- @FormParam("state") String state) {
+ @FormParam("activated") Boolean activated) {
+ // ensure the activate flag has been specified
+ if (activated == null) {
+ throw new IllegalArgumentException("Must specified whether or not to activate the controller service references.");
+ }
+
final Availability avail = parseAvailability(availability);
// replicate if cluster manager
@@ -423,7 +428,7 @@ public class ControllerServiceResource extends ApplicationResource {
// get the controller service
final ConfigurationSnapshot<Set<ControllerServiceReferencingComponentDTO>> response =
- serviceFacade.updateControllerServiceReferencingComponents(new Revision(clientVersion, clientId.getClientId()), id, state);
+ serviceFacade.updateControllerServiceReferencingComponents(new Revision(clientVersion, clientId.getClientId()), id, activated);
// create the revision
final RevisionDTO revision = new RevisionDTO();
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/f22407f5/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/dao/ControllerServiceDAO.java
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/dao/ControllerServiceDAO.java b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/dao/ControllerServiceDAO.java
index 293519e..a457833 100644
--- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/dao/ControllerServiceDAO.java
+++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/dao/ControllerServiceDAO.java
@@ -70,10 +70,10 @@ public interface ControllerServiceDAO {
* Updates the referencing components for the specified controller service.
*
* @param controllerServiceId
- * @param state
+ * @param activated
* @return
*/
- ControllerServiceReference updateControllerServiceReferencingComponents(String controllerServiceId, String state);
+ ControllerServiceReference updateControllerServiceReferencingComponents(String controllerServiceId, boolean activated);
/**
* Determines whether this controller service can be updated.
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/f22407f5/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/dao/impl/StandardControllerServiceDAO.java
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/dao/impl/StandardControllerServiceDAO.java b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/dao/impl/StandardControllerServiceDAO.java
index beb9460..0460a6c 100644
--- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/dao/impl/StandardControllerServiceDAO.java
+++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/dao/impl/StandardControllerServiceDAO.java
@@ -137,11 +137,19 @@ public class StandardControllerServiceDAO extends ComponentDAO implements Contro
}
@Override
- public ControllerServiceReference updateControllerServiceReferencingComponents(final String controllerServiceId, final String state) {
+ public ControllerServiceReference updateControllerServiceReferencingComponents(final String controllerServiceId, final boolean activated) {
// get the controller service
final ControllerServiceNode controllerService = locateControllerService(controllerServiceId);
-// serviceProvider.
+ // TODO - these actions need to be atomic... can't have partial success... maybe already handled?
+
+ // perform the desired action
+ if (activated) {
+ serviceProvider.activateReferencingComponents(controllerService);
+ } else {
+ serviceProvider.deactivateReferencingComponents(controllerService);
+ }
+
return controllerService.getReferences();
}