use of org.apache.nifi.controller.service.ControllerServiceReference in project nifi by apache.
the class StandardNiFiServiceFacade method getControllerServiceReferencingComponents.
@Override
public ControllerServiceReferencingComponentsEntity getControllerServiceReferencingComponents(final String controllerServiceId) {
final ControllerServiceNode service = controllerServiceDAO.getControllerService(controllerServiceId);
final ControllerServiceReference ref = service.getReferences();
return createControllerServiceReferencingComponentsEntity(ref, Sets.newHashSet(controllerServiceId));
}
use of org.apache.nifi.controller.service.ControllerServiceReference in project nifi by apache.
the class StandardProcessGroup method getComponentsAffectedByVariable.
@Override
public Set<ConfiguredComponent> getComponentsAffectedByVariable(final String variableName) {
final Set<ConfiguredComponent> affected = new HashSet<>();
// Determine any Processors that references the variable
for (final ProcessorNode processor : getProcessors()) {
for (final VariableImpact impact : getVariableImpact(processor)) {
if (impact.isImpacted(variableName)) {
affected.add(processor);
}
}
}
// find any references to that service and add it.
for (final ControllerServiceNode service : getControllerServices(false)) {
for (final VariableImpact impact : getVariableImpact(service)) {
if (impact.isImpacted(variableName)) {
affected.add(service);
final ControllerServiceReference reference = service.getReferences();
affected.addAll(reference.findRecursiveReferences(ConfiguredComponent.class));
}
}
}
// is overriding the variable and its components are actually referencing a different variable.
for (final ProcessGroup childGroup : getProcessGroups()) {
final ComponentVariableRegistry childRegistry = childGroup.getVariableRegistry();
final VariableDescriptor descriptor = childRegistry.getVariableKey(variableName);
final boolean overridden = childRegistry.getVariableMap().containsKey(descriptor);
if (!overridden) {
affected.addAll(childGroup.getComponentsAffectedByVariable(variableName));
}
}
return affected;
}
use of org.apache.nifi.controller.service.ControllerServiceReference in project nifi by apache.
the class StandardAuthorizableLookup method getControllerServiceReferencingComponent.
@Override
public Authorizable getControllerServiceReferencingComponent(String controllerServiceId, String id) {
final ControllerServiceNode controllerService = controllerServiceDAO.getControllerService(controllerServiceId);
final ControllerServiceReference referencingComponents = controllerService.getReferences();
final ConfiguredComponent reference = findControllerServiceReferencingComponent(referencingComponents, id);
if (reference == null) {
throw new ResourceNotFoundException("Unable to find referencing component with id " + id);
}
return reference;
}
Aggregations