public static Databases getDatabases(String... schemaNames) {
   DatabaseInfo databaseInfo = getHsqlDatabaseInfo(schemaNames);
   DataSource dataSource = createDataSource(databaseInfo);
   SQLHandler sqlHandler = new DefaultSQLHandler();
   DatabaseConnection databaseConnection =
       new DatabaseConnection(databaseInfo, sqlHandler, dataSource);
   IdentifierProcessor identifierProcessor =
       new IdentifierProcessor(UPPER_CASE, "\"", databaseInfo.getDefaultSchemaName());
   Database database = new HsqldbDatabase(databaseConnection, identifierProcessor);
   return new Databases(database, asList(database), new ArrayList<String>());
 }
Beispiel #2
0
 public void start(int port) throws Exception {
   LOG.warn("Port used: " + port + " location " + WEBAPP_LOCATION + " " + databaseInfo.toString());
   server = new Server(port);
   WebAppContext root = new WebAppContext();
   root.setContextPath("/");
   root.setDescriptor(WEBAPP_LOCATION + "/WEB-INF/web.xml");
   root.setResourceBase(WEBAPP_LOCATION);
   root.setParentLoaderPriority(true);
   root.setAttribute(ConsoleFilter.DATABASE_ATTRIBUTE, databaseInfo);
   setupRequestLimits(root, REQUEST_TIME_LIMIT, MAX_OPS_LIMIT);
   server.setHandler(root);
   server.start();
 }
 public void start(int port) throws Exception {
   LOG.warn("Port used: " + port + " location " + WEBAPP_LOCATION + " " + databaseInfo.toString());
   server = new Server(port);
   WebAppContext root = new WebAppContext();
   root.setContextPath("/");
   root.setDescriptor(WEBAPP_LOCATION + "/WEB-INF/web.xml");
   root.setResourceBase(WEBAPP_LOCATION);
   root.setParentLoaderPriority(true);
   root.setAttribute(BackendFilter.DATABASE_ATTRIBUTE, databaseInfo);
   //        setupRequestLimits(root, REQUEST_TIME_LIMIT, MAX_OPS_LIMIT);
   final HandlerList handlers = new HandlerList();
   final Handler resourceHandler = createResourceHandler("/console_assets", WEBAPP_LOCATION);
   handlers.setHandlers(new Handler[] {resourceHandler, root});
   server.setHandler(handlers);
   server.start();
 }
 public static Backend expose(GraphDatabaseService database) {
   return new Backend(DatabaseInfo.expose(database));
 }
 public static Backend sandbox(GraphDatabaseService database) {
   return new Backend(DatabaseInfo.sandbox(database));
 }
Beispiel #6
0
 public static Console expose(GraphDatabaseService database) {
   return new Console(DatabaseInfo.expose(database));
 }
Beispiel #7
0
 public static Console sandbox(GraphDatabaseService database) {
   return new Console(DatabaseInfo.sandbox(database));
 }