/** * This makes a copy without the nested content -so is suitable for returning as part of the list of a parent's * values * * @return the copy */ public PublishedExports shallowCopy() { PublishedExports that = new PublishedExports(); that.description = this.description; that.updated = this.updated; that.updatedTime = this.updatedTime; return that; }
@Override public String asString() throws IOException { return exports.asJson(); } }
/** * 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); }
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); } }
PublishedExports exports = new PublishedExports(CONTAINER_LOGS_TAG); exports.setUpdated(now.getTime()); synchronized (logFolderExports) { updateExportsFromList(exports, getLogFolderExports()); exports = new PublishedExports(CONTAINER_PWDS_TAG); exports.setUpdated(now.getTime()); synchronized (workFolderExports) { updateExportsFromList(exports, getWorkFolderExports());
public PublishedExportsSet shallowCopy() { PublishedExportsSet that = new PublishedExportsSet(); for (Map.Entry<String, PublishedExports> entry : exports.entrySet()) { that.put(entry.getKey(), entry.getValue().shallowCopy()); } return that; } }
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); } }
PublishedExports exports = new PublishedExports(CONTAINER_LOGS_TAG); exports.setUpdated(now.getTime()); synchronized (logFolderExports) { updateExportsFromList(exports, getLogFolderExports()); exports = new PublishedExports(CONTAINER_PWDS_TAG); exports.setUpdated(now.getTime()); synchronized (workFolderExports) { updateExportsFromList(exports, getWorkFolderExports());
public PublishedExportsSet shallowCopy() { PublishedExportsSet that = new PublishedExportsSet(); for (Map.Entry<String, PublishedExports> entry : exports.entrySet()) { that.put(entry.getKey(), entry.getValue().shallowCopy()); } return that; } }
/** * 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); }
@Override public String asString() throws IOException { return exports.asJson(); } }
/** * This makes a copy without the nested content -so is suitable for returning as part of the list of a parent's * values * * @return the copy */ public PublishedExports shallowCopy() { PublishedExports that = new PublishedExports(); that.description = this.description; that.updated = this.updated; that.updatedTime = this.updatedTime; return that; }
/** * 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()); }