Examples of OServer


Examples of com.orientechnologies.orient.server.OServer

  public static void main(String[] args) throws Exception {
    new EdgeBug().run();
  }

  public void run() throws Exception {
    OServer server = setupDatabase();
    try {
      setupClasses();
      populateDatabase();
      tryLabelQuery();
      runEdgeTest();
    } finally {
      server.shutdown();
    }
  }
View Full Code Here

Examples of com.orientechnologies.orient.server.OServer

    }
  }

  private OServer setupDatabase() throws Exception {
    OGlobalConfiguration.STORAGE_KEEP_OPEN.setValue(true);
    OServer ret = OServerMain.create();
    ret.startup("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"
        + "<orient-server>"
        + "<network>"
        + "<protocols>"
        + "<protocol name=\"binary\" implementation=\"com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary\"/>"
        + "<protocol name=\"http\" implementation=\"com.orientechnologies.orient.server.network.protocol.http.ONetworkProtocolHttpDb\"/>"
View Full Code Here

Examples of com.orientechnologies.orient.server.OServer

  protected void doStart() throws Exception {
    // global startup
    Orient.instance().startup();

    // instance startup
    OServer server = new OServer();
    OServerConfiguration config = createConfiguration();
    server.startup(config);

    // create default root user to avoid orientdb prompt on console
    server.addUser(OServerConfiguration.SRV_ROOT_ADMIN, null, "*");

    // Log global configuration
    if (log.isDebugEnabled()) {
      StringWriter buff = new StringWriter();
      OGlobalConfiguration.dumpConfiguration(new PrintStream(new WriterOutputStream(buff), true));
      log.debug("Global configuration:\n{}", buff);
    }

    server.activate();
    log.info("Activated");

    this.server = server;
  }
View Full Code Here

Examples of com.orientechnologies.orient.server.OServer

  public void embeddedServerProgrammatic() throws Exception {
    File homeDir = util.createTempDir("orientdb-home").getCanonicalFile();
    System.setProperty("orient.home", homeDir.getPath());
    System.setProperty(Orient.ORIENTDB_HOME, homeDir.getPath());

    OServer server = new OServer();
    OServerConfiguration config = new OServerConfiguration();

    // Unsure what this is used for, its apparently assigned to xml location, but forcing it here
    config.location = "DYNAMIC-CONFIGURATION";

    File databaseDir = new File(homeDir, "db");
    config.properties = new OServerEntryConfiguration[] {
        new OServerEntryConfiguration("server.database.path", databaseDir.getPath())
    };

    config.handlers = Lists.newArrayList();

    config.hooks = Lists.newArrayList();

    config.network = new OServerNetworkConfiguration();
    config.network.protocols = Lists.newArrayList(
        new OServerNetworkProtocolConfiguration("binary", ONetworkProtocolBinary.class.getName())
    );

    OServerNetworkListenerConfiguration binaryListener = new OServerNetworkListenerConfiguration();
    binaryListener.ipAddress = "0.0.0.0";
    binaryListener.portRange = "2424-2430";
    binaryListener.protocol = "binary";
    binaryListener.socket = "default";

    config.network.listeners = Lists.newArrayList(
        binaryListener
    );

    config.storages = new OServerStorageConfiguration[] {};

    config.users = new OServerUserConfiguration[] {
        new OServerUserConfiguration("admin", "admin", "*")
    };

    config.security = new OServerSecurityConfiguration();
    config.security.users = Lists.newArrayList();
    config.security.resources = Lists.newArrayList();

    server.startup(config);

    // Dump config to log stream
    StringWriter buff = new StringWriter();
    OGlobalConfiguration.dumpConfiguration(new PrintStream(new WriterOutputStream(buff), true));
    log("Global configuration:\n{}", buff);

    server.activate();
    server.shutdown();
  }
View Full Code Here

Examples of com.orientechnologies.orient.server.OServer

    OLogManager.instance().info(this, "ORIENTDB_HOME: " + System.getProperty("ORIENTDB_HOME"));

    // loop for start & stop server
    for (int i = 0; i < 5; i++) {
      OLogManager.instance().info(this, "Iteration " + i);
      OServer server = OServerMain.create().startup().activate();
      // create database if does not exist
      OObjectDatabaseTx database = new OObjectDatabaseTx("plocal:" + System.getProperty("ORIENTDB_HOME") + "/test-db");
      if (!database.exists())
        database.create();
      database.open("admin", "admin");
      database.countClass("ouser");
      database.close();
      server.shutdown();
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.