Examples of OServerAdmin


Examples of com.orientechnologies.orient.client.remote.OServerAdmin

    }
  }

  public static void deleteDatabase(final ODatabase database) throws IOException {
    if (database.getStorage() instanceof OStorageRemote) {
      new OServerAdmin((OStorageRemote) database.getStorage()).connect("root", getServerRootPassword()).deleteDatabase();
    } else {
      database.delete();
    }
  }
View Full Code Here

Examples of com.orientechnologies.orient.client.remote.OServerAdmin

    }
  }

  public static boolean existsDatabase(final ODatabase database) throws IOException {
    if (database.getURL().startsWith("remote")) {
      return new OServerAdmin(database.getURL()).connect("root", getServerRootPassword()).existsDatabase();
    } else {
      return database.exists();
    }
  }
View Full Code Here

Examples of com.orientechnologies.orient.client.remote.OServerAdmin

      currentDatabase.open(iUserName, iUserPassword);

      currentDatabaseName = currentDatabase.getName();

      if (currentDatabase.getStorage() instanceof OStorageRemote)
        serverAdmin = new OServerAdmin((OStorageRemote) currentDatabase.getStorage());
    } else {
      // CONNECT TO REMOTE SERVER
      out.print("Connecting to remote Server instance [" + iURL + "] with user '" + iUserName + "'...");

      serverAdmin = new OServerAdmin(iURL).connect(iUserName, iUserPassword);
    }

    out.println("OK");
  }
View Full Code Here

Examples of com.orientechnologies.orient.client.remote.OServerAdmin

    currentDatabaseUserPassword = iUserPassword;

    if (iDatabaseURL.startsWith(OEngineRemote.NAME)) {
      // REMOTE CONNECTION
      final String dbURL = iDatabaseURL.substring(OEngineRemote.NAME.length() + 1);
      new OServerAdmin(dbURL).connect(iUserName, iUserPassword).createDatabase(iStorageType).close();
      connect(iDatabaseURL, OUser.ADMIN, OUser.ADMIN);

    } else {
      // LOCAL CONNECTION
      currentDatabase = new ODatabaseDocumentTx(iDatabaseURL);
View Full Code Here

Examples of com.orientechnologies.orient.client.remote.OServerAdmin

        return;
      }

      // REMOTE CONNECTION
      final String dbURL = currentDatabase.getURL().substring(OEngineRemote.NAME.length() + 1);
      new OServerAdmin(dbURL).connect(currentDatabaseUserName, currentDatabaseUserPassword).deleteDatabase();
    } else {
      // LOCAL CONNECTION
      currentDatabase.delete();
      currentDatabase = null;
    }
View Full Code Here

Examples of com.orientechnologies.orient.client.remote.OServerAdmin

      @ConsoleParameter(name = "password", description = "Server administrator password") String iUserPassword) throws IOException {

    if (iDatabaseURL.startsWith(OEngineRemote.NAME)) {
      // REMOTE CONNECTION
      final String dbURL = iDatabaseURL.substring(OEngineRemote.NAME.length() + 1);
      serverAdmin = new OServerAdmin(dbURL).connect(iUserName, iUserPassword);
      serverAdmin.deleteDatabase();
      disconnect();
    } else {
      // LOCAL CONNECTION
      currentDatabase = new ODatabaseDocumentTx(iDatabaseURL);
View Full Code Here

Examples of com.orientechnologies.orient.client.remote.OServerAdmin

      ODatabaseDocumentTx.setDefaultSerializer(prev);
    }
  }

  private void dropDatabase() throws IOException {
    OServerAdmin admin = new OServerAdmin("remote:localhost/test");
    admin.connect("root", "D2AFD02F20640EC8B7A5140F34FCA49D2289DB1F0D0598BB9DE8AAA75A0792F3");
    admin.dropDatabase("plocal");
  }
View Full Code Here

Examples of com.orientechnologies.orient.client.remote.OServerAdmin

    admin.connect("root", "D2AFD02F20640EC8B7A5140F34FCA49D2289DB1F0D0598BB9DE8AAA75A0792F3");
    admin.dropDatabase("plocal");
  }

  private void createDatabase() throws IOException {
    OServerAdmin admin = new OServerAdmin("remote:localhost/test");
    admin.connect("root", "D2AFD02F20640EC8B7A5140F34FCA49D2289DB1F0D0598BB9DE8AAA75A0792F3");
    admin.createDatabase("document", "plocal");
  }
View Full Code Here

Examples of com.orientechnologies.orient.client.remote.OServerAdmin

    super(url);
  }

  @Test
  public void testListDatabasesMemoryDB() throws Exception {
    final OServerAdmin admin = new OServerAdmin("remote:localhost").connect("root", ODatabaseHelper.getServerRootPassword());

    final String plocalDatabaseName = "plocalTestListDatabasesMemoryDB" + Math.random();
    admin.createDatabase(plocalDatabaseName, "graph", "plocal");

    final String memoryDatabaseName = "memoryTestListDatabasesMemoryDB" + Math.random();
    admin.createDatabase(memoryDatabaseName, "graph", "memory");

    final Map<String, String> list = admin.listDatabases();

    Assert.assertTrue(list.containsKey(plocalDatabaseName), "Check plocal db is in list");
    Assert.assertTrue(list.containsKey(memoryDatabaseName), "Check memory db is in list");
  }
View Full Code Here

Examples of com.orientechnologies.orient.client.remote.OServerAdmin

    createDatabase(database, url, "server", type);
  }

  public static void createDatabase(ODatabase database, final String url, String directory, String type) throws IOException {
    if (url.startsWith(OEngineRemote.NAME)) {
      new OServerAdmin(url).connect("root", getServerRootPassword(directory)).createDatabase("document", type).close();
    } else {
      database.create();
      database.close();
    }
  }
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.