@Override public Graph configureGraphInstance(GraphConfigurationContext configuration) throws GraphConfigurationException { Map configurationMap = ApacheConfigurationUtils.toMap(configuration.getProperties()); Map convertedConfigurationMap = new HashMap(); for (Object key : configurationMap.keySet()) { Object convertedKey = key.toString().replaceAll("-", "."); Object convertedValue = configurationMap.get(key); if (convertedValue instanceof List) { convertedValue = join((Iterable) convertedValue); } convertedConfigurationMap.put(convertedKey, convertedValue); } for (Object key : convertedConfigurationMap.keySet()) { System.out.println(key + " = " + convertedConfigurationMap.get(key)); } return new AccumuloVertexiumBlueprintsGraphFactory().createGraph(convertedConfigurationMap); }
public Graph configureGraphInstance(final GraphConfigurationContext context) throws GraphConfigurationException { final String graphFile = context.getProperties().getString(Tokens.REXSTER_GRAPH_LOCATION); final boolean highAvailabilityMode = context.getProperties().getBoolean(Tokens.REXSTER_GRAPH_HA, false); final HierarchicalConfiguration graphSectionConfig = (HierarchicalConfiguration) context.getProperties(); SubnodeConfiguration neo4jSpecificConfiguration;
public Configuration convertConfiguration(final GraphConfigurationContext context) throws GraphConfigurationException { Configuration properties = context.getProperties(); try { final Configuration titanConfig = new BaseConfiguration();
@Override public Graph configureGraphInstance(GraphConfigurationContext context) throws GraphConfigurationException { Configuration conf = context.getProperties(); try { conf = ((HierarchicalConfiguration) conf).configurationAt(Tokens.REXSTER_GRAPH_PROPERTIES); } catch (IllegalArgumentException iae) { throw new GraphConfigurationException("Check graph configuration. Missing or empty configuration element: " + Tokens.REXSTER_GRAPH_PROPERTIES); } AccumuloGraphConfiguration cfg = new AccumuloGraphConfiguration(conf); if (cfg.getInstanceType().equals(InstanceType.Mock)) { cfg.setPassword("".getBytes()); cfg.setUser("root"); } cfg.setGraphName(context.getProperties().getString(Tokens.REXSTER_GRAPH_NAME)); return GraphFactory.open(cfg.getConfiguration()); }
public Graph configureGraphInstance(final GraphConfigurationContext context) throws GraphConfigurationException { final String graphFile = context.getProperties().getString(Tokens.REXSTER_GRAPH_LOCATION); if (graphFile == null || graphFile.length() == 0) { throw new GraphConfigurationException("Check graph configuration. Missing or empty configuration element: " + Tokens.REXSTER_GRAPH_LOCATION); } // get the <properties> section of the xml configuration final HierarchicalConfiguration graphSectionConfig = (HierarchicalConfiguration) context.getProperties(); SubnodeConfiguration orientDbSpecificConfiguration; try { orientDbSpecificConfiguration = graphSectionConfig.configurationAt(Tokens.REXSTER_GRAPH_PROPERTIES); } catch (IllegalArgumentException iae) { throw new GraphConfigurationException("Check graph configuration. Missing or empty configuration element: " + Tokens.REXSTER_GRAPH_PROPERTIES, iae); } try { final String username = orientDbSpecificConfiguration.getString("username", ""); final String password = orientDbSpecificConfiguration.getString("password", ""); // calling the open method opens the connection to graphdb. looks like the // implementation of shutdown will call the orientdb close method. return OrientGraphFactory.getTxGraphImplFactory().getGraph(graphFile, username, password); } catch (Exception ex) { throw new GraphConfigurationException(ex); } }
@Override public Graph configureGraphInstance(GraphConfigurationContext context) throws GraphConfigurationException { Configuration conf = context.getProperties(); try { conf = ((HierarchicalConfiguration) conf).configurationAt(Tokens.REXSTER_GRAPH_PROPERTIES); } catch (IllegalArgumentException iae) { throw new GraphConfigurationException("Check graph configuration. Missing or empty configuration element: " + Tokens.REXSTER_GRAPH_PROPERTIES); } AccumuloGraphConfiguration cfg = new AccumuloGraphConfiguration(conf); if (cfg.getInstanceType().equals(InstanceType.Mock)) { cfg.setPassword("".getBytes()); cfg.setUser("root"); } cfg.setGraphName(context.getProperties().getString(Tokens.REXSTER_GRAPH_NAME)); return GraphFactory.open(cfg.getConfiguration()); }
protected BigdataGraph configure(final GraphConfigurationContext context) throws Exception { final Configuration config = context.getProperties();