- public void setConfiguration(@NotNull Collection<RicConfig> ricConfigs, Properties dmaapPublisherConfig,
- Properties dmaapConsumerConfig) {
-
- Collection<Notification> notifications = new Vector<>();
- synchronized (this) {
- 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);
- notifications.add(new Notification(newConfig, RicConfigUpdate.ADDED));
- this.ricConfigs.remove(newConfig.name());
- } else if (!newConfig.equals(oldConfig)) {
- notifications.add(new Notification(newConfig, RicConfigUpdate.CHANGED));
- newRicConfigs.put(newConfig.name(), newConfig);
- this.ricConfigs.remove(newConfig.name());
- } else {
- newRicConfigs.put(oldConfig.name(), oldConfig);
- }
- }
- for (RicConfig deletedConfig : this.ricConfigs.values()) {
- notifications.add(new Notification(deletedConfig, RicConfigUpdate.REMOVED));
+ public synchronized Flux<RicConfigUpdate> setConfiguration(
+ ApplicationConfigParser.ConfigParserResult parserResult) {
+
+ Collection<RicConfigUpdate> modifications = new ArrayList<>();
+ this.dmaapPublisherConfig = parserResult.dmaapPublisherConfig();
+ this.dmaapConsumerConfig = parserResult.dmaapConsumerConfig();
+ this.controllerConfigs = parserResult.controllerConfigs();
+
+ Map<String, RicConfig> newRicConfigs = new HashMap<>();
+ for (RicConfig newConfig : parserResult.ricConfigs()) {
+ RicConfig oldConfig = this.ricConfigs.get(newConfig.name());
+ this.ricConfigs.remove(newConfig.name());
+ if (oldConfig == null) {
+ newRicConfigs.put(newConfig.name(), newConfig);
+ modifications.add(new RicConfigUpdate(newConfig, RicConfigUpdate.Type.ADDED));
+ } else if (!newConfig.equals(oldConfig)) {
+ modifications.add(new RicConfigUpdate(newConfig, RicConfigUpdate.Type.CHANGED));
+ newRicConfigs.put(newConfig.name(), newConfig);
+ } else {
+ newRicConfigs.put(oldConfig.name(), oldConfig);