Examples of OServerAdmin


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

import com.orientechnologies.orient.core.exception.OConfigurationException;

public class TestUtils {
  public static void createDatabase(ODatabase database, final String iURL) throws IOException {
    if (iURL.startsWith(OEngineRemote.NAME)) {
      new OServerAdmin(iURL).connect("root", getServerRootPassword()).createDatabase("local").close();
    } else {
      database.create();
      database.close();
    }
  }
View Full Code Here

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

    }
  }

  public static void deleteDatabase(final ODatabase database) throws IOException {
    if (database.getURL().startsWith("remote:")) {
      new OServerAdmin(database.getURL()).connect("root", getServerRootPassword()).dropDatabase();
    } 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).dropDatabase();
    } 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.dropDatabase();
      disconnect();
    } else {
      // LOCAL CONNECTION
      currentDatabase = new ODatabaseDocumentTx(iDatabaseURL);
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

import com.orientechnologies.orient.core.exception.OConfigurationException;

public class TestUtils {
  public static void createDatabase(ODatabase database, final String iURL) throws IOException {
    if (iURL.startsWith(OEngineRemote.NAME)) {
      new OServerAdmin(iURL).connect("root", getServerRootPassword()).createDatabase("local").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.