Пример #1
0
  public boolean setupConnections() throws SQLException {
    if (!configuration.getLocalDb().isEnabled()) {
      getLogger().warning("Local Database is not enabled, disabling plugin");
      plugin.getPluginLoader().disablePlugin(this);
      return false;
    }

    localConn = setupConnection(configuration.getLocalDb());

    if (configuration.getConversionDb().isEnabled()) {
      conversionConn = setupConnection(configuration.getConversionDb());
    }

    if (configuration.getExternalDb().isEnabled()) {
      externalConn = setupConnection(configuration.getExternalDb());
    }

    return true;
  }
Пример #2
0
  private void setupConversion() {
    getLogger().info("Running pre-conversion launch checks");
    ConvertDatabaseConfig conversionDb = configuration.getConversionDb();

    if (configuration.getLocalDb().getHost().equals(conversionDb.getHost())
        && configuration.getLocalDb().getName().equals(conversionDb.getName())) {
      if (!conversionChecks()) {
        return;
      }
    }

    // Begin the converting
    getLogger()
        .info("Conversion will begin shortly. You have 30 seconds to kill the process to abort.");
    try {
      Thread.sleep(30000L);
    } catch (InterruptedException e) {
      e.printStackTrace();
    }
    getLogger().info("Launching conversion process");
    new UUIDConvert(conversionConn);
  }