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); } }
protected void enumeratePublishedExports(PublishedExportsSet exports, UL<Hamlet> ul) { for(String key : exports.keys()) { PublishedExports export = exports.get(key); LI<UL<Hamlet>> item = ul.li(); item.span().$class("bold")._(export.description)._(); UL sublist = item.ul(); for (Entry<String, List<ExportEntry>> entry : export.entries.entrySet()) { LI sublistItem = sublist.li()._(entry.getKey()); for (ExportEntry exportEntry : entry.getValue()) { sublistItem._(exportEntry.getValue()); } sublistItem._(); } sublist._(); item._(); } } }
protected void enumeratePublishedExports(PublishedExportsSet exports, UL<Hamlet> ul) { for(String key : exports.keys()) { PublishedExports export = exports.get(key); LI<UL<Hamlet>> item = ul.li(); item.span().$class("bold")._(export.description)._(); UL sublist = item.ul(); for (Entry<String, List<ExportEntry>> entry : export.entries.entrySet()) { LI sublistItem = sublist.li()._(entry.getKey()); for (ExportEntry exportEntry : entry.getValue()) { sublistItem._(exportEntry.getValue()); } sublistItem._(); } sublist._(); item._(); } } }
Assert.assertEquals("component", expEntries.get(0).getLevel()); Assert.assertEquals("role", expEntries.get(0).getTag()); Assert.assertEquals("fqdn:aFolder", expEntries.get(0).getValue()); Assert.assertNull(expEntries.get(0).getValidUntil()); Assert.assertEquals(null, expEntries.get(0).getValidUntil()); Assert.assertEquals("component", expEntries.get(0).getLevel()); Assert.assertEquals("role", expEntries.get(0).getTag()); Assert.assertEquals("fqdn:folderB", expEntries.get(0).getValue()); Assert.assertNull(expEntries.get(0).getValidUntil()); Assert.assertEquals(null, expEntries.get(0).getValidUntil());
Assert.assertEquals("component", expEntries.get(0).getLevel()); Assert.assertEquals("role", expEntries.get(0).getTag()); Assert.assertEquals("fqdn:aFolder", expEntries.get(0).getValue()); Assert.assertNull(expEntries.get(0).getValidUntil()); Assert.assertEquals(null, expEntries.get(0).getValidUntil()); Assert.assertEquals("component", expEntries.get(0).getLevel()); Assert.assertEquals("role", expEntries.get(0).getTag()); Assert.assertEquals("fqdn:folderB", expEntries.get(0).getValue()); Assert.assertNull(expEntries.get(0).getValidUntil()); Assert.assertEquals(null, expEntries.get(0).getValidUntil());
Assert.assertEquals(exports.get("JMX_Endpoint").get(0).getValue(), "http://HOST1:60012/jmx"); Assert.assertEquals("application", expEntries.get(0).getLevel()); Assert.assertEquals(null, expEntries.get(0).getTag()); Assert.assertEquals("http://HOST1:60012/jmx", expEntries.get(0).getValue()); Assert.assertNull(expEntries.get(0).getValidUntil()); Assert.assertEquals(1, expEntries.size()); expEntries = pubExports.entries.get("JMX_Endpoint"); Assert.assertEquals("http://HOST1:60012/jmx", expEntries.get(0).getValue());
Assert.assertEquals(exports.get("JMX_Endpoint").get(0).getValue(), "http://HOST1:60012/jmx"); Assert.assertEquals("application", expEntries.get(0).getLevel()); Assert.assertEquals(null, expEntries.get(0).getTag()); Assert.assertEquals("http://HOST1:60012/jmx", expEntries.get(0).getValue()); Assert.assertNull(expEntries.get(0).getValidUntil()); Assert.assertEquals(1, expEntries.size()); expEntries = pubExports.entries.get("JMX_Endpoint"); Assert.assertEquals("http://HOST1:60012/jmx", expEntries.get(0).getValue());
Assert.assertEquals("component", expEntries.get(0).getLevel()); Assert.assertEquals("1", expEntries.get(0).getTag()); Assert.assertEquals("http://host1:10010", expEntries.get(0).getValue()); Assert.assertNotNull(expEntries.get(0).getUpdatedTime()); Assert.assertNull(expEntries.get(0).getValidUntil());
Assert.assertEquals("component", expEntries.get(0).getLevel()); Assert.assertEquals("1", expEntries.get(0).getTag()); Assert.assertEquals("http://host1:10010", expEntries.get(0).getValue()); Assert.assertNotNull(expEntries.get(0).getUpdatedTime()); Assert.assertNull(expEntries.get(0).getValidUntil());