BiFunction<TopologyProcessor, Long, BaseTopologyRule> function; if ((function = bundles.get(processor.getTopologyComponentBundleId())) != null) { Optional<Object> ruleList = processor.getConfig().getAnyOptional(RulesProcessor.CONFIG_KEY_RULES); if (ruleList.isPresent()) { ObjectMapper objectMapper = new ObjectMapper();
String subType = topologyData.getBundleIdToType().get(topologyProcessor.getTopologyComponentBundleId().toString()); if (TopologyLayoutConstants.JSON_KEY_CUSTOM_PROCESSOR_SUB_TYPE.equals(subType)) { QueryParam queryParam = new QueryParam(CustomProcessorInfo.NAME, topologyProcessor.getConfig().get(CustomProcessorInfo.NAME)); Collection<TopologyComponentBundle> result = listCustomProcessorBundlesWithFilter(Collections.singletonList(queryParam)); if (result.size() != 1) { throw new IllegalStateException("Not able to find topology component bundle for custom processor :" + topologyProcessor.getConfig().get (CustomProcessorInfo.NAME)); Optional<Object> ruleListObj = topologyProcessor.getConfig().getAnyOptional(RulesProcessor.CONFIG_KEY_RULES); ruleListObj.ifPresent(ruleList -> { List<Long> ruleIds = new ObjectMapper().convertValue(ruleList, new TypeReference<List<Long>>() {}); ruleIds.forEach(ruleId -> updatedRuleIds.add(oldToNewWindowIds.get(ruleId))); topologyProcessor.getConfig().setAny(RulesProcessor.CONFIG_KEY_RULES, updatedRuleIds); }); addTopologyProcessor(newTopology.getId(), topologyProcessor);