/** * Build a configuration from the entries * * @param description configuration description * @param entries entries to put */ public PublishedExports(String description, Iterable<Map.Entry<String, List<ExportEntry>>> entries) { this.description = description; putValues(entries); }
/** * Build a configuration from the entries * * @param description configuration description * @param entries entries to put */ public PublishedExports(String description, Iterable<Map.Entry<String, List<ExportEntry>>> entries) { this.description = description; putValues(entries); }
/** * Update the export data from the map * @param exports * @param folderExports */ private void updateExportsFromList(PublishedExports exports, Map<String, ExportEntry> folderExports) { Map<String, List<ExportEntry>> perComponentList = new HashMap<String, List<ExportEntry>>(); for(Map.Entry<String, ExportEntry> logEntry : folderExports.entrySet()) { String componentName = logEntry.getValue().getTag(); if (!perComponentList.containsKey(componentName)) { perComponentList.put(componentName, new ArrayList<ExportEntry>()); } perComponentList.get(componentName).add(logEntry.getValue()); } exports.putValues(perComponentList.entrySet()); }
/** * Update the export data from the map * @param exports * @param folderExports */ private void updateExportsFromList(PublishedExports exports, Map<String, ExportEntry> folderExports) { Map<String, List<ExportEntry>> perComponentList = new HashMap<String, List<ExportEntry>>(); for(Map.Entry<String, ExportEntry> logEntry : folderExports.entrySet()) { String componentName = logEntry.getValue().getTag(); if (!perComponentList.containsKey(componentName)) { perComponentList.put(componentName, new ArrayList<ExportEntry>()); } perComponentList.get(componentName).add(logEntry.getValue()); } exports.putValues(perComponentList.entrySet()); }
private void publishModifiedExportGroups(Set<String> modifiedGroups) { for (String groupName : modifiedGroups) { Map<String, List<ExportEntry>> entries = this.exportGroups.get(groupName); // Publish in old format for the time being Map<String, String> simpleEntries = new HashMap<String, String>(); for (Map.Entry<String, List<ExportEntry>> entry : entries.entrySet()) { List<ExportEntry> exports = entry.getValue(); if (SliderUtils.isNotEmpty(exports)) { // there is no support for multiple exports per name - so extract only the first one simpleEntries.put(entry.getKey(), entry.getValue().get(0).getValue()); } } if (!getAmState().getAppConfSnapshot().getComponentOptBool( groupName, AgentKeys.AM_CONFIG_GENERATION, false)) { publishApplicationInstanceData(groupName, groupName, simpleEntries.entrySet()); } PublishedExports exports = new PublishedExports(groupName); exports.setUpdated(new Date().getTime()); exports.putValues(entries.entrySet()); getAmState().getPublishedExportsSet().put(groupName, exports); } }
private void publishModifiedExportGroups(Set<String> modifiedGroups) { for (String groupName : modifiedGroups) { Map<String, List<ExportEntry>> entries = this.exportGroups.get(groupName); // Publish in old format for the time being Map<String, String> simpleEntries = new HashMap<String, String>(); for (Map.Entry<String, List<ExportEntry>> entry : entries.entrySet()) { List<ExportEntry> exports = entry.getValue(); if (SliderUtils.isNotEmpty(exports)) { // there is no support for multiple exports per name - so extract only the first one simpleEntries.put(entry.getKey(), entry.getValue().get(0).getValue()); } } if (!getAmState().getAppConfSnapshot().getComponentOptBool( groupName, AgentKeys.AM_CONFIG_GENERATION, false)) { publishApplicationInstanceData(groupName, groupName, simpleEntries.entrySet()); } PublishedExports exports = new PublishedExports(groupName); exports.setUpdated(new Date().getTime()); exports.putValues(entries.entrySet()); getAmState().getPublishedExportsSet().put(groupName, exports); } }