+ public synchronized Flux<RicConfigUpdate> setConfiguration(@NotNull Collection<RicConfig> ricConfigs,
+ Properties dmaapPublisherConfig, Properties dmaapConsumerConfig) {
+
+ Collection<RicConfigUpdate> modifications = new ArrayList<>();
+ this.dmaapPublisherConfig = dmaapPublisherConfig;
+ this.dmaapConsumerConfig = dmaapConsumerConfig;
+
+ Map<String, RicConfig> newRicConfigs = new HashMap<>();
+ for (RicConfig newConfig : ricConfigs) {
+ RicConfig oldConfig = this.ricConfigs.get(newConfig.name());
+ if (oldConfig == null) {
+ newRicConfigs.put(newConfig.name(), newConfig);
+ modifications.add(new RicConfigUpdate(newConfig, RicConfigUpdate.Type.ADDED));
+ this.ricConfigs.remove(newConfig.name());
+ } else if (!newConfig.equals(oldConfig)) {
+ modifications.add(new RicConfigUpdate(newConfig, RicConfigUpdate.Type.CHANGED));
+ newRicConfigs.put(newConfig.name(), newConfig);
+ this.ricConfigs.remove(newConfig.name());
+ } else {
+ newRicConfigs.put(oldConfig.name(), oldConfig);
+ }
+ }
+ for (RicConfig deletedConfig : this.ricConfigs.values()) {
+ modifications.add(new RicConfigUpdate(deletedConfig, RicConfigUpdate.Type.REMOVED));
+ }
+ this.ricConfigs = newRicConfigs;