@Test public void testNewContext() { DocumentGrapherExecutionContext ctx1 = JsonHelperConfiguration.newContext(db, log); Assert.assertNotNull(ctx1); DocumentGrapherExecutionContext ctx2 = JsonHelperConfiguration.newContext(db, log); Assert.assertNotNull(ctx2); Assert.assertFalse("Configurazion must be renew",ctx1 == ctx2); }
public static DocumentGrapherExecutionContext newContext(GraphDatabaseService db, Log log) { if(instance == null) { Node configurationNode = db.findNode(Label.label("JSON_CONFIG"), "configuration", "byNode"); if(configurationNode == null) { log.info("Load default configuration: "+JsonHelperConfigurationDefault.class); instance = new JsonHelperConfigurationDefault(); }else { log.info("Load configuration from node: "+JsonHelperConfigurationByNode.class); instance = new JsonHelperConfigurationByNode(configurationNode); } } return instance.buildContext(db, log); }
JsonHelperConfiguration { public static DocumentGrapherExecutionContext newContext(GraphDatabaseService db, Log log) { if(instance == null) { Node configurationNode = db.findNode(Label.label("JSON_CONFIG"), "configuration", "byNode"); if(configurationNode == null) { log.info("Load default configuration: "+JsonHelperConfigurationDefault.class); instance = new JsonHelperConfigurationDefault(); }else { log.info("Load configuration from node: "+JsonHelperConfigurationByNode.class); instance = new JsonHelperConfigurationByNode(configurationNode); } } return instance.buildContext(db, log); } }
JsonHelperConfiguration { public static DocumentGrapherExecutionContext newContext(GraphDatabaseService db, Log log) { if(instance == null) { Node configurationNode = db.findNode(Label.label("JSON_CONFIG"), "configuration", "byNode"); if(configurationNode == null) { log.info("Load default configuration: "+JsonHelperConfigurationDefault.class); instance = new JsonHelperConfigurationDefault(); }else { log.info("Load configuration from node: "+JsonHelperConfigurationByNode.class); instance = new JsonHelperConfigurationByNode(configurationNode); } } return instance.buildContext(db, log); }  }
JsonHelperConfiguration { public static DocumentGrapherExecutionContext newContext(GraphDatabaseService db, Log log) { if(instance == null) { Node configurationNode = db.findNode(Label.label("JSON_CONFIG"), "configuration", "byNode"); if(configurationNode == null) { log.info("Load default configuration: "+JsonHelperConfigurationDefault.class); instance = new JsonHelperConfigurationDefault(); }else { log.info("Load configuration from node: "+JsonHelperConfigurationByNode.class); instance = new JsonHelperConfigurationByNode(configurationNode); } } return instance.buildContext(db, log); }  static DocumentGrapherExecutionContext newContext(GraphDatabaseService db, Log log); static void reset(); }
JsonHelperConfiguration { public static DocumentGrapherExecutionContext newContext(GraphDatabaseService db, Log log) { if(instance == null) { Node configurationNode = db.findNode(Label.label("JSON_CONFIG"), "configuration", "byNode"); if(configurationNode == null) { log.info("Load default configuration: "+JsonHelperConfigurationDefault.class); instance = new JsonHelperConfigurationDefault(); }else { log.info("Load configuration from node: "+JsonHelperConfigurationByNode.class); instance = new JsonHelperConfigurationByNode(configurationNode); } } return instance.buildContext(db, log); }  static DocumentGrapherExecutionContext newContext(GraphDatabaseService db, Log log); static void reset();  }