Stops the replication between two servers.

@param iDatabaseName
database name to replicate
@param iRemoteServer
remote server alias as IP+address
@return The instance itself. Useful to execute method in chain
@throws IOException
436034
public synchronized OServerAdmin replicationStop(final String iDatabaseName, final String iRemoteServer) throws IOException {
    sendRequest(OChannelBinaryProtocol.REQUEST_REPLICATION, new ODocument().field("operation", "stop").field("node", iRemoteServer)
        .field("db", iDatabaseName), "Stop replication");

    OLogManager.instance().debug(this, "Stopped replication of database '%s' from server '%s' to '%s'", iDatabaseName,
        storage.getURL(), iRemoteServer);
    return this;
  }
957651
void deleteReplica(Storable replica) throws PersistException {
        // Prevent trigger from being invoked by deleting replica.
        TriggerManager tm = mTriggerManager;
        tm.locallyDisableDelete();
        try {
            replica.delete();
        } finally {
            tm.locallyEnableDelete();
        }
    }
1235894
public RemoteDatabase getRemoteDatabase()
        throws RemoteException
    {
        if (m_remoteDatabase != null)
            return m_remoteDatabase;
        try {
            if (this.getTableCount() == 0)
                return null;    // Never
            ClientTable table = (ClientTable)m_vTableList.get(0);
            RemoteTable tableRemote = table.getRemoteTable();
            if (tableRemote != null)
            {
                synchronized (this.getSyncObject(tableRemote))
                {   // In case this is called from another task
                    // Move these properties up in case they are in the environment properties.
                    Map<String,Object> propDatabase = BaseDatabase.addDBProperties(this.getProperties(), this, null);
                    BaseDatabase.addDBProperty(propDatabase, this, null, this.getDatabaseName(false) + BaseDatabase.DBSHARED_PARAM_SUFFIX);
                    BaseDatabase.addDBProperty(propDatabase, this, null, this.getDatabaseName(false) + BaseDatabase.DBUSER_PARAM_SUFFIX);
                    m_remoteDatabase = tableRemote.getRemoteDatabase(propDatabase);
                }
            }
            if (m_remoteDatabase != null)
            {
                synchronized (this.getSyncObject(m_remoteDatabase))
                {   // In case this is called from another task
                    m_remoteProperties = m_remoteDatabase.getDBProperties();
                }
            }
        } catch (RemoteException ex)    {
            Utility.getLogger().warning("dbServer exception: " + ex.getMessage());
            throw ex;
        } catch (Exception ex)  {
            ex.printStackTrace();
        }
        return m_remoteDatabase;
    }
388647
public int doMove(int iRelPosition) throws DBException
    {
        try   {
            if (m_iCurrentRecord == m_iRecordsAccessed)
            {   // Impossible to be at the record count, unless hasNext has moved to the next record
                m_iRecordsAccessed++;
                if (this.getDataSource() != null) // Always
                    return Constants.NORMAL_RETURN;   // This is already the current record
            }
            Object objData = m_tableRemote.doMove(iRelPosition, 1);
            if (objData instanceof Vector)
            {
                this.setDataSource(objData);

                m_iCurrentRecord++;
                m_iRecordsAccessed++;
                return Constants.NORMAL_RETURN;   // Normal return
            }
            else if (objData instanceof Number)
                return ((Number)objData).intValue();    // Usually EOF
            else
                return Constants.ERROR_RETURN;  // Never
        } catch (RemoteException ex) {
            throw new DBException(ex.getMessage());
        }
    }
295598
@Override
    public synchronized void deactivate() throws InterruptedException, CouldNotPerformException {
        manageLock.lockWrite(this);
        try {
            try {
                validateInitialization();
            } catch (InvalidStateException ex) {
                // was never initialized!
                return;
            }

            // skip initial data sync if still running
            if (initialDataSyncFuture != null && !initialDataSyncFuture.isDone()) {
                initialDataSyncFuture.cancel(true);
            }

            logger.debug("Deactivate AbstractControllerServer for: " + this);
            // The order is important: The informer publishes a zero event when the availabilityState is set to deactivating which leads remotes to disconnect
            // The remotes try to reconnect again and start a requestData. If the server is still active it will respond
            // and the remotes will think that the server is still there..
            if (serverWatchDog != null) {
                serverWatchDog.deactivate();
            }
            // inform remotes about deactivation
            setAvailabilityState(DEACTIVATING);
            if (informerWatchDog != null) {
                informerWatchDog.deactivate();
            }
            setAvailabilityState(OFFLINE);
        } finally {
            manageLock.unlockWrite(this);
        }
    }
442682
public synchronized OServerAdmin dropDatabase() throws IOException {
    storage.checkConnection();
    boolean retry = true;

    while (retry)
      try {

        final OChannelBinaryClient network = storage.beginRequest(OChannelBinaryProtocol.REQUEST_DB_DROP);
        try {
          network.writeString(storage.getName());
        } finally {
          storage.endRequest(network);
        }

        storage.getResponse(network);
        retry = false;
      } catch (OModificationOperationProhibitedException oope) {
        retry = handleDBFreeze();
      } catch (Exception e) {
        OLogManager.instance().exception("Cannot delete the remote storage: " + storage.getName(), e, OStorageException.class);
      }

    for (OStorage s : Orient.instance().getStorages()) {
      if (s.getURL().startsWith(getURL())) {
        s.removeResource(OSchema.class.getSimpleName());
        s.removeResource(OIndexManager.class.getSimpleName());
        s.removeResource(OSecurity.class.getSimpleName());
      }
    }

    ODatabaseRecordThreadLocal.INSTANCE.set(null);

    return this;
  }
118700
public ODatabaseRecord delete(final ORID iRecord, final OPERATION_MODE iMode) {
    executeDeleteRecord(iRecord, -1, true, true, iMode);
    return this;
  }
226864
boolean tryDeleteReplica(Storable replica) throws PersistException {
        // Prevent trigger from being invoked by deleting replica.
        TriggerManager tm = mTriggerManager;
        tm.locallyDisableDelete();
        try {
            return replica.tryDelete();
        } finally {
            tm.locallyEnableDelete();
        }
    }
1174315
public OvhDatabase serviceName_database_databaseName_GET(String serviceName, String databaseName) throws IOException {
		String qPath = "/hosting/privateDatabase/{serviceName}/database/{databaseName}";
		StringBuilder sb = path(qPath, serviceName, databaseName);
		String resp = exec(qPath, "GET", sb.toString(), null);
		return convertTo(resp, OvhDatabase.class);
	}
911475
@PreDestroy
    public void stopRepository() throws InterruptedException {
        LOGGER.info("Initiating shutdown of ModeShape");
        final String repoName = repository.getName();
        try {
            final Future<Boolean> futureUndeployRepo = modeShapeEngine.undeploy(repoName);
            if (futureUndeployRepo.get()) {
                LOGGER.info("ModeShape repository {} has undeployed.", repoName);
            } else {
                LOGGER.error("ModeShape repository {} undeploy failed without an exception, still deployed.", repoName);
            }
            LOGGER.info("Repository {} undeployed.", repoName);
        } catch (final NoSuchRepositoryException e) {
            LOGGER.error("Repository {} unknown, cannot undeploy.", repoName, e);
        } catch (final ExecutionException e) {
            LOGGER.error("Repository {} cannot undeploy.", repoName, e.getCause());
        }
        final Future<Boolean> futureShutdownEngine = modeShapeEngine.shutdown();
        try {
            if (futureShutdownEngine.get()) {
                LOGGER.info("ModeShape Engine has shutdown.");
            } else {
                LOGGER.error("ModeShape Engine shutdown failed without an exception, still running.");
            }
        } catch (final ExecutionException e) {
            LOGGER.error("ModeShape Engine shutdown failed.", e.getCause());
        }
    }
438648
public void stopServer() throws Exception {
        if (!externalDatabaseHost) {
            try (Connection sqlConnection = getConnection()) {
                sqlConnection.prepareStatement("SHUTDOWN").execute();
            } catch (Exception e) {
            }

            try {
                server.stop();
            } catch (Exception e) {
            }
        }
    }
190826
@Override
    public void stop() throws EngineTerminationException, InternalException {
        synchronized (STOP_LOCK) {
            if (!userCodeRunning) {
                return;
            }

            vm().suspend();
            try {
                OUTER:
                for (ThreadReference thread : vm().allThreads()) {
                    // could also tag the thread (e.g. using name), to find it easier
                    for (StackFrame frame : thread.frames()) {
                        if (remoteAgent.equals(frame.location().declaringType().name()) &&
                                (    "invoke".equals(frame.location().method().name())
                                || "varValue".equals(frame.location().method().name()))) {
                            ObjectReference thiz = frame.thisObject();
                            Field inClientCode = thiz.referenceType().fieldByName("inClientCode");
                            Field expectingStop = thiz.referenceType().fieldByName("expectingStop");
                            Field stopException = thiz.referenceType().fieldByName("stopException");
                            if (((BooleanValue) thiz.getValue(inClientCode)).value()) {
                                thiz.setValue(expectingStop, vm().mirrorOf(true));
                                ObjectReference stopInstance = (ObjectReference) thiz.getValue(stopException);

                                vm().resume();
                                debug("Attempting to stop the client code...\n");
                                thread.stop(stopInstance);
                                thiz.setValue(expectingStop, vm().mirrorOf(false));
                            }

                            break OUTER;
                        }
                    }
                }
            } catch (ClassNotLoadedException | IncompatibleThreadStateException | InvalidTypeException ex) {
                throw new InternalException("Exception on remote stop: " + ex);
            } finally {
                vm().resume();
            }
        }
    }
657587
public synchronized void stop() throws IOException {
		this.stopped = true;
		if (this.server != null && this.waitingClient) {
			this.server.close();
			this.server = null;
		}
	}
141183
void stop( Instance instance, PluginInterface plugin ) throws IOException {

		String instancePath = InstanceHelpers.computeInstancePath( instance );
		if( instance.getStatus() != InstanceStatus.DEPLOYED_STARTED )
			this.logger.fine( instancePath + " cannot be stopped. Prerequisite status: DEPLOYED_STARTED (but was " + instance.getStatus() + ")." );
		else
			stopInstance( instance, plugin, false );
	}
866145
public void remove(Object data, int iOpenMode) throws DBException, RemoteException
    {
        synchronized(m_objSync)
        {
            m_tableRemote.remove(data, iOpenMode);
        }
    }
696838
public boolean exitsMongoDbDataBase(String dataBaseName) {
        List<String> dataBaseList = mongoClient.getDatabaseNames();
        return dataBaseList.contains(dataBaseName);
    }
1101455
public void stop() throws Exception {
        // verify server isn't null
        if (server == null) {
            throw new NullPointerException("Internal server instance was null, server already stopped perhaps?");
        }
        
        logger.info("HttpServer [{}] on [{}] stopping...", configuration.safeGetName(), configuration.getPortString());

        server.stop();

        logger.info("HttpServer [{}] on [{}] stopped", configuration.safeGetName(), configuration.getPortString());
    }