NIFI-2261

- Addressed issue enabling/disabling controller services where the wrong URI was referenced.
- Addressed with the update revisions in the controller service references.
- Addressed issue with showing the disconnected from cluster dialog on page load.
- Addressed issue with URI when adding a dynamic property.

This closes #654.
This commit is contained in:
Matt Gilman 2016-07-14 12:43:18 -04:00 committed by Mark Payne
parent 3373e18158
commit 4f26072444
4 changed files with 19 additions and 6 deletions

View File

@ -1556,6 +1556,7 @@ public class StandardNiFiServiceFacade implements NiFiServiceFacade {
final Set<ConfiguredComponent> updated = controllerServiceDAO.updateControllerServiceReferencingComponents(controllerServiceId, scheduledState, controllerServiceState); final Set<ConfiguredComponent> updated = controllerServiceDAO.updateControllerServiceReferencingComponents(controllerServiceId, scheduledState, controllerServiceState);
final ControllerServiceReference updatedReference = controllerServiceDAO.getControllerService(controllerServiceId).getReferences(); final ControllerServiceReference updatedReference = controllerServiceDAO.getControllerService(controllerServiceId).getReferences();
// get the revisions of the updated components
final Map<String, Revision> updatedRevisions = new HashMap<>(); final Map<String, Revision> updatedRevisions = new HashMap<>();
for (final ConfiguredComponent component : updated) { for (final ConfiguredComponent component : updated) {
final Revision currentRevision = revisionManager.getRevision(component.getIdentifier()); final Revision currentRevision = revisionManager.getRevision(component.getIdentifier());
@ -1563,6 +1564,15 @@ public class StandardNiFiServiceFacade implements NiFiServiceFacade {
updatedRevisions.put(component.getIdentifier(), currentRevision.incrementRevision(requestRevision.getClientId())); updatedRevisions.put(component.getIdentifier(), currentRevision.incrementRevision(requestRevision.getClientId()));
} }
// return the current revision if the component wasn't updated
for (final Map.Entry<String, Revision> entry : referenceRevisions.entrySet()) {
final String componentId = entry.getKey();
if (!updatedRevisions.containsKey(componentId)) {
final Revision currentRevision = revisionManager.getRevision(componentId);
updatedRevisions.put(componentId, currentRevision);
}
}
final ControllerServiceReferencingComponentsEntity entity = createControllerServiceReferencingComponentsEntity(updatedReference, updatedRevisions); final ControllerServiceReferencingComponentsEntity entity = createControllerServiceReferencingComponentsEntity(updatedReference, updatedRevisions);
return new StandardRevisionUpdate<>(entity, null, new HashSet<>(updatedRevisions.values())); return new StandardRevisionUpdate<>(entity, null, new HashSet<>(updatedRevisions.values()));
} }

View File

@ -873,7 +873,7 @@ nf.Canvas = (function () {
var clusterSummary = clusterSummaryResponse.clusterSummary; var clusterSummary = clusterSummaryResponse.clusterSummary;
// show disconnected message on load if necessary // show disconnected message on load if necessary
if (clusterSummary.connectedToCluster === false) { if (clusterSummary.clustered && !clusterSummary.connectedToCluster) {
nf.Canvas.showDisconnectedFromClusterMessage(); nf.Canvas.showDisconnectedFromClusterMessage();
} }

View File

@ -613,7 +613,7 @@ nf.ControllerService = (function () {
// wait until the polling of each service finished // wait until the polling of each service finished
return $.Deferred(function (deferred) { return $.Deferred(function (deferred) {
updated.done(function () { updated.done(function () {
var serviceUpdated = pollService(controllerServiceEntity.component, function (service, bulletins) { var serviceUpdated = pollService(controllerServiceEntity, function (service, bulletins) {
if ($.isArray(bulletins)) { if ($.isArray(bulletins)) {
if (enabled) { if (enabled) {
updateBulletins(bulletins, $('#enable-controller-service-bulletins')); updateBulletins(bulletins, $('#enable-controller-service-bulletins'));
@ -746,12 +746,14 @@ nf.ControllerService = (function () {
* Polls the specified services referencing components to see if the * Polls the specified services referencing components to see if the
* specified condition is satisfied. * specified condition is satisfied.
* *
* @param {object} controllerService * @param {object} controllerServiceEntity
* @param {function} completeCondition * @param {function} completeCondition
* @param {function} bulletinDeferred * @param {function} bulletinDeferred
* @param {function} pollCondition * @param {function} pollCondition
*/ */
var pollService = function (controllerService, completeCondition, bulletinDeferred, pollCondition) { var pollService = function (controllerServiceEntity, completeCondition, bulletinDeferred, pollCondition) {
var controllerService = controllerServiceEntity.component;
// we want to keep polling until the condition is met // we want to keep polling until the condition is met
return $.Deferred(function (deferred) { return $.Deferred(function (deferred) {
var current = 2; var current = 2;
@ -769,7 +771,7 @@ nf.ControllerService = (function () {
var bulletins = bulletinDeferred(controllerService); var bulletins = bulletinDeferred(controllerService);
var service = $.ajax({ var service = $.ajax({
type: 'GET', type: 'GET',
url: controllerService.uri, url: controllerServiceEntity.uri,
dataType: 'json' dataType: 'json'
}); });

View File

@ -548,9 +548,10 @@ nf.ProcessorConfiguration = (function () {
dialogContainer: '#new-processor-property-container', dialogContainer: '#new-processor-property-container',
descriptorDeferred: function (propertyName) { descriptorDeferred: function (propertyName) {
var processor = $('#processor-configuration').data('processorDetails'); var processor = $('#processor-configuration').data('processorDetails');
var d = nf.Processor.get(processor.id);
return $.ajax({ return $.ajax({
type: 'GET', type: 'GET',
url: processor.uri + '/descriptors', url: d.uri + '/descriptors',
data: { data: {
propertyName: propertyName propertyName: propertyName
}, },