Package org.neo4j.server.configuration

Examples of org.neo4j.server.configuration.ServerConfigurator


        webServer = startWebServer(serverGraphDatabase, PORT);
    }

    public static NeoServer startWebServer(
      ImpermanentGraphDatabase gdb, int port) {
      Configurator configurator = new ServerConfigurator(gdb);
      configurator.configuration().setProperty(Configurator.WEBSERVER_PORT_PROPERTY_KEY,  port);
    NeoServer server = new WrappingNeoServer(gdb, configurator );
    server.start();
        tryConnect();
    return server;
  }
View Full Code Here


    @BeforeClass
    public static void startServerWithACleanDb() {
        graphDatabase = new EmbeddedGraphDatabase("target/db1");

        ServerConfigurator config = new ServerConfigurator(graphDatabase);
        config.configuration().setProperty("org.neo4j.server.thirdparty.delete.key", "secret-key");
        config.getThirdpartyJaxRsClasses().add(new ThirdPartyJaxRsPackage("org.neo4j.server.extension.test.delete", "/cleandb"));

        WrappingNeoServerBootstrapper bootstrapper = new WrappingNeoServerBootstrapper(graphDatabase, config);
        bootstrapper.start();
        neoServer = bootstrapper.getServer();
    }
View Full Code Here

    @Before
    public void setUp() throws Exception {

        ImpermanentGraphDatabase db = new ImpermanentGraphDatabase();

        ServerConfigurator config = new ServerConfigurator(db);
        config.configuration().setProperty("org.neo4j.server.credentials", "neo4j:master");
        config.getThirdpartyJaxRsPackages().add(new ThirdPartyJaxRsPackage("org.neo4j.server.extension.auth", "/admin"));
        testBootstrapper = new WrappingNeoServerBootstrapper(db, config);
        testBootstrapper.start();
    }
View Full Code Here

   

    try {
      GraphDatabaseAPI api = (GraphDatabaseAPI) StructrApp.getInstance().getGraphDatabaseService();

      ServerConfigurator config = new ServerConfigurator(api);

      config.configuration()
        .addProperty(Configurator.WEBSERVER_ADDRESS_PROPERTY_KEY, host);

      config.configuration()
        .addProperty(Configurator.WEBSERVER_PORT_PROPERTY_KEY, port);
     
      logger.log(Level.INFO, "Starting Neo4j server on port {0}", new Object[] { String.valueOf(port) });

      neoServerBootstrapper = new WrappingNeoServerBootstrapper(api, config);
View Full Code Here

    /**
     * Start the server wrapper.
     * //todo change to CommunityServerBuilder
     */
    private void startServerWrapper() {
        ServerConfigurator configurator = new ServerConfigurator((GraphDatabaseAPI) getDatabase());
        populateConfigurator(configurator);
        bootstrapper = new WrappingNeoServerBootstrapper((GraphDatabaseAPI) getDatabase(), configurator);
        bootstrapper.start();
    }
View Full Code Here

    }

    @Before
    public void setUp() throws Exception {
        ImpermanentGraphDatabase db = new ImpermanentGraphDatabase();
        final ServerConfigurator configurator = new ServerConfigurator(db) {
            @Override
            public List<ThirdPartyJaxRsPackage> getThirdpartyJaxRsPackages() {
                return Collections.singletonList(new ThirdPartyJaxRsPackage("org.springframework.data.neo4j.rest.support","/test"));
            }
        };
        final Configuration configuration = configurator.configuration();
        configuration.setProperty(Configurator.WEBSERVER_PORT_PROPERTY_KEY, PORT);
        final WrappingNeoServerBootstrapper bootstrapper = new WrappingNeoServerBootstrapper(db, configurator);
        touched=0;
        bootstrapper.start();
        neoServer = bootstrapper.getServer();
View Full Code Here

    private Node refNode;

    @BeforeClass
    public static void startDb() throws Exception {
        db = new ImpermanentGraphDatabase();
        final ServerConfigurator configurator = new ServerConfigurator(db);
        configurator.configuration().setProperty(Configurator.WEBSERVER_PORT_PROPERTY_KEY,PORT);
        final WrappingNeoServerBootstrapper bootstrapper = new WrappingNeoServerBootstrapper(db, configurator);
        int exit = bootstrapper.start();
        if (exit != 0 ) throw new IllegalStateException("Server not started correctly.");
        neoServer = bootstrapper.getServer();
View Full Code Here

    private static final String SERVER_ROOT_URI = "http://" + HOSTNAME + ":" + PORT + "/db/data/";
    private static ImpermanentGraphDatabase db;

    public void startServer() throws Exception {
        db = new ImpermanentGraphDatabase();
        final ServerConfigurator configurator = new ServerConfigurator(db);
        configurator.configuration().setProperty(Configurator.WEBSERVER_PORT_PROPERTY_KEY,PORT);
        final WrappingNeoServerBootstrapper bootstrapper = new WrappingNeoServerBootstrapper(db, configurator);
        bootstrapper.start();
        neoServer = bootstrapper.getServer();
    }
View Full Code Here

    return graphDb;
  }
  public GraphDatabaseService connectHAWrapped(String dir, Map<String, String> haConfig, Map<String, Object> serverProperties) {
    GraphDatabaseAPI graphDb = (GraphDatabaseAPI) this.connectHA(dir, haConfig);

    ServerConfigurator config = new ServerConfigurator( graphDb );
    Iterator<String> iterator = serverProperties.keySet().iterator();
    while(iterator.hasNext()) {
      String key = iterator.next();
      config.configuration().setProperty(key, serverProperties.get(key));
    }

    new WrappingNeoServerBootstrapper( graphDb, config ).start();

    return graphDb;
View Full Code Here

    return graphDb;
  }
  public GraphDatabaseService connectWrapped(String dir, Map<String, String> properties, Map<String, Object> serverProperties) {
    GraphDatabaseAPI graphDb = (GraphDatabaseAPI) this.connect(dir, properties);

    ServerConfigurator config = new ServerConfigurator( graphDb );
    Iterator<String> iterator = serverProperties.keySet().iterator();
    while(iterator.hasNext()) {
      String key = iterator.next();
      config.configuration().setProperty(key, serverProperties.get(key));
    }

    new WrappingNeoServerBootstrapper( graphDb, config ).start();

    return graphDb;
View Full Code Here

TOP

Related Classes of org.neo4j.server.configuration.ServerConfigurator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.