Copies a database to a remote server instance.

@param iDatabaseName
@param iDatabaseUserName
@param iDatabaseUserPassword
@param iRemoteName
@param iRemoteEngine
@return The instance itself. Useful to execute method in chain
@throws IOException
191474
public synchronized OServerAdmin copyDatabase(final String iDatabaseName, final String iDatabaseUserName,
      final String iDatabaseUserPassword, final String iRemoteName, final String iRemoteEngine) throws IOException {
    storage.checkConnection();

    try {

      final OChannelBinaryClient network = storage.beginRequest(OChannelBinaryProtocol.REQUEST_DB_COPY);
      try {
        network.writeString(iDatabaseName);
        network.writeString(iDatabaseUserName);
        network.writeString(iDatabaseUserPassword);
        network.writeString(iRemoteName);
        network.writeString(iRemoteEngine);
      } finally {
        storage.endRequest(network);
      }

      storage.getResponse(network);

      OLogManager.instance().debug(this, "Database '%s' has been copied to the server '%s'", iDatabaseName, iRemoteName);

    } catch (Exception e) {
      OLogManager.instance().exception("Cannot copy the database: " + iDatabaseName, e, OStorageException.class);
    }

    return this;
  }
451014
function(objID, typeName)
    {
        var objType = this.getTypeFromName(typeName);
	        instanceFactory.prototype = objType;
	        var instance = new instanceFactory(objID);
        this.remoteInstanceCache[objID] = instance;
        return instance;
    }
285782
public RemoteTable makeRemoteTable(String strRecordClassName, String strTableSessionClassName, Map<String, Object> properties, Map<String, Object> propDatabase)
        throws RemoteException
    {
        BaseTransport transport = this.createProxyTransport(MAKE_REMOTE_TABLE);
        transport.addParam(NAME, strRecordClassName);
        transport.addParam(SESSION_CLASS_NAME, strTableSessionClassName);
        transport.addParam(PROPERTIES, properties);
        transport.addParam(PROPERTIES_DB, propDatabase);
        String strTableID = (String)transport.sendMessageAndGetReply();
        // See if I have this one already
        TableProxy tableProxy = null;
//x        tableProxy = (TableProxy)this.getChildList().get(strTableID);
        if (tableProxy == null)
            tableProxy = new TableProxy(this, strTableID); // This will add it to my list
        return tableProxy;
    }
877594
public static AuthorizationDto fromAuthorization(Authorization dbAuthorization, ProcessEngineConfiguration engineConfiguration) {
    AuthorizationDto authorizationDto = new AuthorizationDto();

    authorizationDto.setId(dbAuthorization.getId());
    authorizationDto.setType(dbAuthorization.getAuthorizationType());

    Permission[] dbPermissions = getPermissions(dbAuthorization, engineConfiguration);
    authorizationDto.setPermissions(PermissionConverter.getNamesForPermissions(dbAuthorization, dbPermissions));

    authorizationDto.setUserId(dbAuthorization.getUserId());
    authorizationDto.setGroupId(dbAuthorization.getGroupId());
    authorizationDto.setResourceType(dbAuthorization.getResourceType());
    authorizationDto.setResourceId(dbAuthorization.getResourceId());

    return authorizationDto;
  }
1250796
public User createAccountWithHashedPassword(String userName, String hashedPassword) throws IOException {
        if (!PASSWORD_ENCODER.isPasswordHashed(hashedPassword)) {
            throw new IllegalArgumentException("this method should only be called with a pre-hashed password");
        }
        User user = User.getById(userName, true);
        user.addProperty(Details.fromHashedPassword(hashedPassword));
        SecurityListener.fireUserCreated(user.getId());
        return user;
    }
810609
def connect(self,
                engine: str = None,
                interface: str = None,
                host: str = None,
                port: int = None,
                database: str = None,
                driver: str = None,
                dsn: str = None,
                odbc_connection_string: str = None,
                user: str = None,
                password: str = None,
                autocommit: bool = True,
                charset: str = "utf8",
                use_unicode: bool = True) -> bool:
        

        # Catch all exceptions, so the error-catcher never shows a password.
        # Note also that higher-level things may catch exceptions, so use the
        # logger as well.
        try:
            return self._connect(
                engine=engine, interface=interface,
                host=host, port=port, database=database,
                driver=driver, dsn=dsn,
                odbc_connection_string=odbc_connection_string,
                user=user, password=password,
                autocommit=autocommit, charset=charset,
                use_unicode=use_unicode)
        except Exception as e:
            self.reraise_connection_exception(e)
982870
protected DBInstance getDbInstance(String identifier) throws IllegalStateException {
		DBInstance instance;
		try {
			DescribeDBInstancesResult describeDBInstancesResult = this.amazonRds
					.describeDBInstances(new DescribeDBInstancesRequest()
							.withDBInstanceIdentifier(identifier));
			instance = describeDBInstancesResult.getDBInstances().get(0);
		}
		catch (DBInstanceNotFoundException e) {
			throw new IllegalStateException(MessageFormat.format(
					"No database instance with id:''{0}'' found. Please specify a valid db instance",
					identifier));
		}
		return instance;
	}
1192144
public OvhOfficeUser serviceName_user_activationEmail_GET(String serviceName, String activationEmail) throws IOException {
		String qPath = "/license/office/{serviceName}/user/{activationEmail}";
		StringBuilder sb = path(qPath, serviceName, activationEmail);
		String resp = exec(qPath, "GET", sb.toString(), null);
		return convertTo(resp, OvhOfficeUser.class);
	}
341106
public String replicateTable(String tableName, boolean toCopyData) throws SQLException {
        String tempTableName = MySqlCommunication.getTempTableName(tableName);
        LOG.debug("Replicate table {} into {}", tableName, tempTableName);
        if (this.tableExists(tempTableName)) {
            this.truncateTempTable(tempTableName);
        } else {
            this.createTempTable(tableName);
        }
        if (toCopyData) {
            final String sql = "INSERT INTO " + tempTableName + " SELECT * FROM " + tableName + ";";
            this.executeUpdate(sql);
        }
        return tempTableName;
    }
282789
@Override
    public RemoteObjectInstance getRemoteObjectInstance(String appName, String moduleName, String compName, String namespaceString,
                                                        String jndiName) throws NamingException, RemoteException {
        NamingConstants.JavaColonNamespace namespace = NamingConstants.JavaColonNamespace.fromName(namespaceString);
        ComponentMetaData cmd = getCMD(appName, moduleName, compName, namespace);

        RemoteObjectInstance roi = null;
        try {
            ComponentMetaDataAccessorImpl.getComponentMetaDataAccessor().beginContext(cmd);

            Iterator<RemoteJavaColonNamingHelper> remoteJCNHelpers = remoteJavaColonNamingHelpers.getServices();
            while (remoteJCNHelpers.hasNext()) {
                RemoteJavaColonNamingHelper helper = remoteJCNHelpers.next();
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    Tr.debug(tc, "getRemoteObjectInstance - checking " + helper);
                }
                roi = helper.getRemoteObjectInstance(namespace, jndiName);
                if (roi != null)
                    break;
            }
        } finally {
            ComponentMetaDataAccessorImpl.getComponentMetaDataAccessor().endContext();
        }

        return roi;
    }
1296404
public static @NotNull Database forUrlAndCredentials(@NotNull String url, @Nullable String username, @Nullable String password) {
        return new Database(new DriverManagerConnectionProvider(url, username, password));
    }
831023
public OperationTransformer.TransformedOperation transformServerOperation(final String hostName, final TransformingProxyController remoteProxyController,
                                                                              final Transformers.TransformationInputs transformationInputs,
                                                                              final ModelNode original) throws OperationFailedException {
        final OperationTransformer.TransformedOperation transformed = remoteProxyController.transformOperation(transformationInputs, original);
        final HostControllerUpdateTask.ExecutedHostRequest hostRequest = finalResultFutures.get(hostName);
        if(hostRequest == null) {
            // in case it's local hosts-controller
            return transformed;
        }
        return new OperationTransformer.TransformedOperation(transformed.getTransformedOperation(), new OperationResultTransformer() {
            @Override
            public ModelNode transformResult(ModelNode result) {
                final ModelNode step1 = transformed.transformResult(result);
                return hostRequest.transformResult(step1);
            }
        });
    }
70482
public Database getDatabase(String instanceId, String databaseId) {
    // [START getDatabase]
    Database db = dbAdminClient.getDatabase(instanceId, databaseId);
    // [END getDatabase]
    return db;
  }
1263998
public RemoteDatabase getRemoteDatabase(Map<String, Object> properties) throws RemoteException
    {
        Record record = this.getMainRecord();
        BaseDatabase database = record.getTable().getDatabase();
        Application app = (Application)this.getTask().getApplication();
        DatabaseSession remoteDatabase = null;
        for (Task task : app.getTaskList().keySet())
        {
            if (task instanceof BaseSession)
            {
                remoteDatabase = ((BaseSession)task).getDatabaseSession(database);
                if (remoteDatabase != null)
                    break;
            }
        }
        if (database != null)
            if (properties != null)
                database.getProperties().putAll(properties);    // Add these properties to the current db properties.
        if (remoteDatabase == null)
            remoteDatabase = createDatabaseSession(database, properties);
        return remoteDatabase;
    }
484160
public final void migrateTo(DataStore<StoredCredential> credentialDataStore) throws IOException {
    DatastoreService service = DatastoreServiceFactory.getDatastoreService();
    PreparedQuery queryResult = service.prepare(new Query(KIND));
    for (Entity entity : queryResult.asIterable()) {
      StoredCredential storedCredential = new StoredCredential().setAccessToken(
          (String) entity.getProperty("accessToken"))
          .setRefreshToken((String) entity.getProperty("refreshToken"))
          .setExpirationTimeMilliseconds((Long) entity.getProperty("expirationTimeMillis"));
      credentialDataStore.set(entity.getKey().getName(), storedCredential);
    }
  }
1286189
@Deprecated
  public static BigtableTableAdminClient create(
      @Nonnull com.google.bigtable.admin.v2.InstanceName instanceName) throws IOException {
    return create(instanceName.getProject(), instanceName.getInstance());
  }
1360864
@InterfaceAudience.Private
    public Database getDatabase(String name, boolean mustExist) {
        synchronized (lockDatabases) {
            if (options.isReadOnly())
                mustExist = true;
            Database db = databases.get(name);
            if (db == null) {
                if (!isValidDatabaseName(name))
                    throw new IllegalArgumentException("Invalid database name: " + name);
                String path = pathForDatabaseNamed(name);
                if (path == null)
                    return null;
                db = new Database(path, name, this, options.isReadOnly());
                if (mustExist && !db.exists()) {
                    Log.i(Database.TAG, "mustExist is true and db (%s) does not exist", name);
                    return null;
                }
                db.setName(name);
                databases.put(name, db);
            }
            Log.v(Log.TAG_DATABASE, "getDatabase() %s %s", this, db);
            return db;
        }
    }