RexsterApplicationGraph { void loadExtensionsConfigurations(final List<HierarchicalConfiguration> extensionConfigurations) { this.extensionConfigurations = new HashSet<ExtensionConfiguration>(); if (extensionConfigurations != null) { for (HierarchicalConfiguration configuration : extensionConfigurations) { final String namespace = configuration.getString("namespace", ""); final String name = configuration.getString("name", ""); final HierarchicalConfiguration extensionConfig = configuration.configurationAt("configuration"); if (!namespace.isEmpty() && !name.isEmpty() && extensionConfig != null) { this.extensionConfigurations.add(new ExtensionConfiguration(namespace, name, extensionConfig)); } else { logger.warn("Graph [" + graphName + "] - Extension [" + namespace + ":" + name + "] does not have a valid configuration. Please check rexster.xml"); } } this.initializeExtensionHypermediaCache(); } } RexsterApplicationGraph(final String graphName, final Graph graph);  RexsterApplicationGraph(final String graphName, final Graph graph,
                                   final HierarchicalConfiguration graphConfig);  RexsterApplicationGraph(final String graphName, final Graph graph, final List<String> allowableNamespaces,
                                   final List<HierarchicalConfiguration> extensionConfigurations); String getGraphName(); Graph getGraph(); Graph getUnwrappedGraph(); TransactionalGraph tryGetTransactionalGraph(); boolean isTransactionalGraph(); void tryCommit(); void tryRollback(); boolean isExtensionAllowed(final ExtensionSegmentSet extensionSegmentSet); ExtensionConfiguration findExtensionConfiguration(final String namespace, final String extensionName); Set<ExtensionAllowed> getExtensionAllowables(); Set<ExtensionConfiguration> getExtensionConfigurations(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode();  }
@Test public void loadExtensionsConfigurations() { String xmlString = "<extension><namespace>tp</namespace><name>extensionname</name><configuration><test>1</test></configuration></extension>"; XMLConfiguration xmlConfig = new XMLConfiguration(); try { xmlConfig.load(new StringReader(xmlString)); } catch (ConfigurationException ex) { Assert.fail(ex.getMessage()); } List<HierarchicalConfiguration> list = new ArrayList<HierarchicalConfiguration>(); list.add(xmlConfig); RexsterApplicationGraph rag = new RexsterApplicationGraph("graph", null); List allowables = new ArrayList(); allowables.add("tp:*"); rag.loadAllowableExtensions(allowables); rag.loadExtensionsConfigurations(list); ExtensionConfiguration extConfig = rag.findExtensionConfiguration("tp", "extensionname"); Assert.assertNotNull(extConfig); Assert.assertEquals("extensionname", extConfig.getExtensionName()); Assert.assertEquals("tp", extConfig.getNamespace()); Assert.assertNotNull(extConfig.getConfiguration()); Map map = extConfig.tryGetMapFromConfiguration(); Assert.assertNotNull(map); Assert.assertTrue(map.containsKey("test")); Assert.assertEquals("1", map.get("test")); }