@Override CapabilityRegistry.RuntimeStatus getStepCapabilityStatus(Step step){ RuntimeCapabilityRegistry.RuntimeStatus result = RuntimeCapabilityRegistry.RuntimeStatus.NORMAL; Map<CapabilityId, RuntimeCapabilityRegistry.RuntimeStatus> statuses = managementModel.getCapabilityRegistry().getRuntimeStatus(step.address, step.getManagementResourceRegistration(managementModel)); if (statuses.isEmpty()) { // TODO. If there are no capabilities but the process is reload/restart required, then what? // Should we interpret this as meaning the step depends on all capabilities and something must be // reload/restart required, so prevent execution? Example: a deployment may not have a capability // but depends on the overall functioning of the system. User make some changes to some resources // (e.g. a datasource) that aren't reflected in the runtime, and then deploys a new version // of the app that assumes those resources are in the correct runtime state. But they won't // be until reload, so the deployment change should not take effect. // OTOH, doing this would prevent something like // /core-service=management/service=configuration-changes:write-attribute(name=max-history,value=5) // taking immediate effect. Which is silly. Unless we add a capability for it, which seems a bit overboard. } else { for (RuntimeCapabilityRegistry.RuntimeStatus status : statuses.values()) { if (status != RuntimeCapabilityRegistry.RuntimeStatus.NORMAL) { result = status; break; } } } return result; }
@Override CapabilityRegistry.RuntimeStatus getStepCapabilityStatus(Step step){ RuntimeCapabilityRegistry.RuntimeStatus result = RuntimeCapabilityRegistry.RuntimeStatus.NORMAL; Map<CapabilityId, RuntimeCapabilityRegistry.RuntimeStatus> statuses = managementModel.getCapabilityRegistry().getRuntimeStatus(step.address, step.getManagementResourceRegistration(managementModel)); if (statuses.isEmpty()) { // TODO. If there are no capabilities but the process is reload/restart required, then what? // Should we interpret this as meaning the step depends on all capabilities and something must be // reload/restart required, so prevent execution? Example: a deployment may not have a capability // but depends on the overall functioning of the system. User make some changes to some resources // (e.g. a datasource) that aren't reflected in the runtime, and then deploys a new version // of the app that assumes those resources are in the correct runtime state. But they won't // be until reload, so the deployment change should not take effect. // OTOH, doing this would prevent something like // /core-service=management/service=configuration-changes:write-attribute(name=max-history,value=5) // taking immediate effect. Which is silly. Unless we add a capability for it, which seems a bit overboard. } else { for (RuntimeCapabilityRegistry.RuntimeStatus status : statuses.values()) { if (status != RuntimeCapabilityRegistry.RuntimeStatus.NORMAL) { result = status; break; } } } return result; }