Examples of OServerAdmin


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

  }

  public static void dropDatabase(final ODatabase database, final String directory, String storageType) throws IOException {
    if (existsDatabase(database, storageType)) {
      if (database.getURL().startsWith("remote:")) {
        new OServerAdmin(database.getURL()).connect("root", getServerRootPassword(directory)).dropDatabase(storageType);
      } else {
        if (database.isClosed())
          database.open("admin", "admin");
        database.drop();
      }
View Full Code Here

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

    }
  }

  public static boolean existsDatabase(final ODatabase database, String storageType) throws IOException {
    if (database.getURL().startsWith("remote"))
      return new OServerAdmin(database.getURL()).connect("root", getServerRootPassword()).existsDatabase(storageType);

    return database.exists();
  }
View Full Code Here

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

    return database.exists();
  }

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

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

    return new ODatabaseDocumentTx(url).exists();
  }

  public static void freezeDatabase(final ODatabase database) throws IOException {
    if (database.getURL().startsWith("remote")) {
      final OServerAdmin serverAdmin = new OServerAdmin(database.getURL());
      serverAdmin.connect("root", getServerRootPassword()).freezeDatabase("plocal");
      serverAdmin.close();
    } else {
      database.freeze();
    }
  }
View Full Code Here

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

    }
  }

  public static void releaseDatabase(final ODatabase database) throws IOException {
    if (database.getURL().startsWith("remote")) {
      final OServerAdmin serverAdmin = new OServerAdmin(database.getURL());
      serverAdmin.connect("root", getServerRootPassword()).releaseDatabase("plocal");
      serverAdmin.close();
    } else {
      database.release();
    }
  }
View Full Code Here

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

      currentDatabaseName = currentDatabase.getName();
    } else {
      // CONNECT TO REMOTE SERVER
      message("\nConnecting to remote Server instance [" + iURL + "] with user '" + iUserName + "'...");

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

    message("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(iDatabaseType, iStorageType).close();
      connect(iDatabaseURL, OUser.ADMIN, OUser.ADMIN);

    } else {
      // LOCAL CONNECTION
      if (iStorageType != null) {
View Full Code Here

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

    if (currentDatabase.getURL().startsWith(OEngineRemote.NAME)) {
      if (storageType == null)
        storageType = "plocal";

      new OServerAdmin(currentDatabase.getURL()).connect(currentDatabaseUserName, currentDatabaseUserPassword).freezeDatabase(
          storageType);
    } else {
      // LOCAL CONNECTION
      currentDatabase.freeze();
    }
View Full Code Here

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

    if (currentDatabase.getURL().startsWith(OEngineRemote.NAME)) {
      if (storageType == null)
        storageType = "plocal";

      new OServerAdmin(currentDatabase.getURL()).connect(currentDatabaseUserName, currentDatabaseUserPassword).releaseDatabase(
          storageType);
    } else {
      // LOCAL CONNECTION
      currentDatabase.release();
    }
View Full Code Here

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

    if (currentDatabase.getURL().startsWith(OEngineRemote.NAME)) {
      if (storageType == null)
        storageType = "plocal";

      new OServerAdmin(currentDatabase.getURL()).connect(currentDatabaseUserName, currentDatabaseUserPassword).freezeCluster(
          clusterId, storageType);
    } else {
      // LOCAL CONNECTION
      currentDatabase.freezeCluster(clusterId);
    }
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.