private void updateControllerServiceIdentifiers(final ProcessorConfigDTO configDto, final Map<String, String> serviceIdMap) { if (configDto == null) { return; } final Map<String, String> properties = configDto.getProperties(); final Map<String, PropertyDescriptorDTO> descriptors = configDto.getDescriptors(); if (properties != null && descriptors != null) { for (final PropertyDescriptorDTO descriptor : descriptors.values()) { if (descriptor.getIdentifiesControllerService() != null) { final String currentServiceId = properties.get(descriptor.getName()); if (currentServiceId == null) { continue; } // if this is a copy/paste action, we can continue to reference the same service, in this case // the serviceIdMap will be empty if (serviceIdMap.containsKey(currentServiceId)) { final String newServiceId = serviceIdMap.get(currentServiceId); properties.put(descriptor.getName(), newServiceId); } } } } }
final ControllerServiceReferencingComponentEntity nodeEntity = entry.getValue(); nodeEntity.getComponent().getDescriptors().values().stream().forEach(propertyDescriptor -> { propertyDescriptorMap.computeIfAbsent(propertyDescriptor.getName(), nodeIdToPropertyDescriptor -> new HashMap<>()).put(nodeIdentifier, propertyDescriptor); }); nodeReferencingComponentsMap.put(nodeIdentifier, nodeEntity.getComponent().getReferencingComponents()); final PropertyDescriptorDTO clientPropertyDescriptor = clientEntity.getComponent().getDescriptors().get(propertyDescriptor.getName()); PropertyDescriptorDtoMerger.merge(clientPropertyDescriptor, propertyDescriptorByNodeId);
propertyDescriptorMap.computeIfAbsent(propertyDescriptor.getName(), nodeIdToPropertyDescriptor -> new HashMap<>()).put(nodeId, propertyDescriptor); }); final PropertyDescriptorDTO clientPropertyDescriptor = clientDto.getDescriptors().get(propertyDescriptor.getName()); PropertyDescriptorDtoMerger.merge(clientPropertyDescriptor, propertyDescriptorByNodeId);
propertyDescriptorMap.computeIfAbsent(propertyDescriptor.getName(), nodeIdToPropertyDescriptor -> new HashMap<>()).put(nodeId, propertyDescriptor); }); final PropertyDescriptorDTO clientPropertyDescriptor = clientDto.getConfig().getDescriptors().get(propertyDescriptor.getName()); PropertyDescriptorDtoMerger.merge(clientPropertyDescriptor, propertyDescriptorByNodeId);
if (descriptors != null) { descriptors.values().stream().forEach(propertyDescriptor -> { propertyDescriptorMap.computeIfAbsent(propertyDescriptor.getName(), nodeIdToPropertyDescriptor -> new HashMap<>()).put(nodeId, propertyDescriptor); }); final PropertyDescriptorDTO clientPropertyDescriptor = clientDto.getDescriptors().get(propertyDescriptor.getName()); PropertyDescriptorDtoMerger.merge(clientPropertyDescriptor, propertyDescriptorByNodeId);
private Map<String,ComponentDescriptor> buildComponentDescriptorMap(final ProcessorConfigDTO processorConfig){ final Map<String, ComponentDescriptor> descriptors = new HashMap<>(); for(String key : processorConfig.getDescriptors().keySet()){ PropertyDescriptorDTO descriptor = processorConfig.getDescriptors().get(key); List<AllowableValueEntity> allowableValuesEntity = descriptor.getAllowableValues(); Map<String,String> allowableValues = new HashMap<>(); if(allowableValuesEntity != null) { for (AllowableValueEntity allowableValueEntity : allowableValuesEntity) { final AllowableValueDTO allowableValueDTO = allowableValueEntity.getAllowableValue(); allowableValues.put(allowableValueDTO.getValue(), allowableValueDTO.getDisplayName()); } } ComponentDescriptor componentDescriptor = new ComponentDescriptor.Builder() .name(descriptor.getName()) .displayName(descriptor.getDisplayName()) .defaultValue(descriptor.getDefaultValue()) .allowableValues(allowableValues) .build(); descriptors.put(key,componentDescriptor); } return descriptors; }
private static void scrubControllerServices(final Set<ControllerServiceDTO> controllerServices) { for (final ControllerServiceDTO serviceDTO : controllerServices) { final Map<String, String> properties = serviceDTO.getProperties(); final Map<String, PropertyDescriptorDTO> descriptors = serviceDTO.getDescriptors(); if (properties != null && descriptors != null) { for (final PropertyDescriptorDTO descriptor : descriptors.values()) { if (Boolean.TRUE.equals(descriptor.isSensitive())) { properties.put(descriptor.getName(), null); } scrubPropertyDescriptor(descriptor); } } serviceDTO.setControllerServiceApis(null); serviceDTO.setExtensionMissing(null); serviceDTO.setMultipleVersionsAvailable(null); serviceDTO.setCustomUiUrl(null); serviceDTO.setValidationErrors(null); serviceDTO.setValidationStatus(null); } }
for (PropertyDescriptorDTO descriptor : descriptors) { if (Boolean.TRUE.equals(descriptor.isSensitive())) { processorProperties.put(descriptor.getName(), null);