mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

jvergara
05.14.2007 81b66dafd30d3893f5199a7ca5efaae9eff3e180
opends/src/guitools/org/opends/guitools/replicationcli/ReplicationCliMain.java
@@ -4144,6 +4144,30 @@
      printProgressMessage(formatter.getFormattedDone());
      printProgressMessage(formatter.getLineBreak());
    }
    // If we must initialize the schema do so.
    if (mustInitializeSchema(server1, server2))
    {
      printProgressMessage(formatter.getFormattedWithPoints(
          INFO_ENABLE_REPLICATION_INITIALIZING_SCHEMA.get(
              ConnectionUtils.getHostPort(ctxDestination),
              ConnectionUtils.getHostPort(ctxSource))));
      if (argParser.useSecondServerAsSchemaSource())
      {
        ctxSource = ctx2;
        ctxDestination = ctx1;
      }
      else
      {
        ctxSource = ctx1;
        ctxDestination = ctx2;
      }
      initializeSuffix(Constants.SCHEMA_DN, ctxSource,
          ctxDestination, false);
      printProgressMessage(formatter.getFormattedDone());
      printProgressMessage(formatter.getLineBreak());
    }
  }
  /**
@@ -6063,4 +6087,24 @@
    }
    return isLocalHost;
  }
  private boolean mustInitializeSchema(ServerDescriptor server1,
      ServerDescriptor server2)
  {
    boolean mustInitializeSchema = false;
    if (!argParser.noSchemaReplication())
    {
      String id1 = server1.getSchemaReplicationID();
      String id2 = server2.getSchemaReplicationID();
      if (id1 != null)
      {
        mustInitializeSchema = id1.equals(id2);
      }
      else
      {
        mustInitializeSchema = true;
      }
    }
    return mustInitializeSchema;
  }
}