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); } } } } }
private void lookupSensitiveProcessorProperties(final Set<ProcessorDTO> processors) { final ProcessGroup rootGroup = flowController.getFlowManager().getRootGroup(); // go through each processor for (final ProcessorDTO processorDTO : processors) { final ProcessorConfigDTO processorConfig = processorDTO.getConfig(); // ensure that some property configuration have been specified if (processorConfig != null && processorConfig.getProperties() != null) { final Map<String, String> processorProperties = processorConfig.getProperties(); // find the corresponding processor final ProcessorNode processorNode = rootGroup.findProcessor(processorDTO.getId()); if (processorNode == null) { throw new IllegalArgumentException(String.format("Unable to create snippet because Processor '%s' could not be found", processorDTO.getId())); } // look for sensitive properties get the actual value for (Entry<PropertyDescriptor, String> entry : processorNode.getProperties().entrySet()) { final PropertyDescriptor descriptor = entry.getKey(); if (descriptor.isSensitive()) { processorProperties.put(descriptor.getName(), entry.getValue()); } } } } }
AuthorizeControllerServiceReference.authorizeControllerServiceReferences(config.getProperties(), authorizable, authorizer, lookup);
values.put(AUTO_TERMINATED_RELATIONSHIPS, StringUtils.join(autoTerminatedRelationshipNames, ", ")); if (newConfig.getProperties() != null) { Map<String, String> properties = newConfig.getProperties(); Map<PropertyDescriptor, String> configuredProperties = processor.getProperties(); for (String propertyName : properties.keySet()) {
if (config.getProperties() == null) { config.setProperties(new LinkedHashMap<>()); final ConfigurableComponent configurableComponent = controllerFacade.getTemporaryComponent(dto.getType(), dto.getBundle()); configurableComponent.getPropertyDescriptors().forEach(descriptor -> { if (config.getProperties().get(descriptor.getName()) == null) { config.getProperties().put(descriptor.getName(), descriptor.getDefaultValue());
if (config != null && config.getProperties() != null) { AuthorizeControllerServiceReference.authorizeControllerServiceReferences(config.getProperties(), authorizable, authorizer, lookup);
dto.getProperties().put(descriptor.getName(), propertyValue);
ProcessorDTO processorDTO = (ProcessorDTO) componentDto; Map<String, PropertyDescriptorDTO> map = processorDTO.getConfig().getDescriptors(); Map<String, String> props = processorDTO.getConfig().getProperties(); for (Entry<String, PropertyDescriptorDTO> entry : map.entrySet()) { if (entry.getValue().getIdentifiesControllerService() != null && props.get(entry.getKey()) != null) {
if (processorConfig.getProperties() != null) { Map<String, String> processorProperties = processorConfig.getProperties();
private ComponentDetails getComponentConfiguration(final ProcessorDTO processor) { final ProcessorConfigDTO processorConfig = processor.getConfig(); return new ComponentDetails.Builder() .id(processor.getId()) .name(processor.getName()) .type(processor.getType()) .state(processor.getState()) .annotationData(processorConfig.getAnnotationData()) .properties(processorConfig.getProperties()) .descriptors(buildComponentDescriptorMap(processorConfig)) .validateErrors(processor.getValidationErrors()).build(); }
configDTO.getConcurrentlySchedulableTaskCount(), configDTO.getPenaltyDuration(), configDTO.getProperties(), configDTO.getSchedulingPeriod(), configDTO.getSchedulingStrategy(),
procNode.setProperties(config.getProperties());
private ProcessorConfigDTO copy(final ProcessorConfigDTO original) { final ProcessorConfigDTO copy = new ProcessorConfigDTO(); copy.setAnnotationData(original.getAnnotationData()); copy.setAutoTerminatedRelationships(copy(original.getAutoTerminatedRelationships())); copy.setComments(original.getComments()); copy.setSchedulingStrategy(original.getSchedulingStrategy()); copy.setExecutionNode(original.getExecutionNode()); copy.setConcurrentlySchedulableTaskCount(original.getConcurrentlySchedulableTaskCount()); copy.setCustomUiUrl(original.getCustomUiUrl()); copy.setDescriptors(copy(original.getDescriptors())); copy.setProperties(copy(original.getProperties())); copy.setSchedulingPeriod(original.getSchedulingPeriod()); copy.setPenaltyDuration(original.getPenaltyDuration()); copy.setYieldDuration(original.getYieldDuration()); copy.setRunDurationMillis(original.getRunDurationMillis()); copy.setBulletinLevel(original.getBulletinLevel()); copy.setDefaultConcurrentTasks(original.getDefaultConcurrentTasks()); copy.setDefaultSchedulingPeriod(original.getDefaultSchedulingPeriod()); copy.setLossTolerant(original.isLossTolerant()); return copy; }
final String annotationData = config.getAnnotationData(); final Integer maxTasks = config.getConcurrentlySchedulableTaskCount(); final Map<String, String> configProperties = config.getProperties(); final String schedulingPeriod = config.getSchedulingPeriod(); final String penaltyDuration = config.getPenaltyDuration();
if (config.getProperties() != null) { procNode.setProperties(config.getProperties());
.map(RelationshipDTO::getName) .collect(Collectors.toList())); map.put(PROPERTIES_KEY, new HashMap<>(nullToEmpty(processorDTOConfig.getProperties())));
.map(RelationshipDTO::getName) .collect(Collectors.toList())); map.put(PROPERTIES_KEY, new HashMap<>(nullToEmpty(processorDTOConfig.getProperties())));