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

Jean-Noël Rouvignac
18.25.2016 8cdc460410cbf823ab0fede5d27856331aa3c1cf
opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/MultimasterReplication.java
@@ -37,10 +37,11 @@
import org.forgerock.i18n.slf4j.LocalizedLogger;
import org.forgerock.opendj.config.server.ConfigChangeResult;
import org.forgerock.opendj.config.server.ConfigException;
import org.forgerock.opendj.ldap.ResultCode;
import org.forgerock.opendj.config.server.ConfigurationAddListener;
import org.forgerock.opendj.config.server.ConfigurationChangeListener;
import org.forgerock.opendj.config.server.ConfigurationDeleteListener;
import org.forgerock.opendj.ldap.DN;
import org.forgerock.opendj.ldap.ResultCode;
import org.forgerock.opendj.server.config.server.ReplicationDomainCfg;
import org.forgerock.opendj.server.config.server.ReplicationSynchronizationProviderCfg;
import org.opends.server.api.Backend;
@@ -53,7 +54,6 @@
import org.opends.server.replication.service.DSRSShutdownSync;
import org.opends.server.types.BackupConfig;
import org.opends.server.types.Control;
import org.forgerock.opendj.ldap.DN;
import org.opends.server.types.DirectoryException;
import org.opends.server.types.Entry;
import org.opends.server.types.LDIFExportConfig;
@@ -91,7 +91,6 @@
                  BackupTaskListener, RestoreTaskListener, ImportTaskListener,
                  ExportTaskListener
{
  private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass();
  private ReplicationServerListener replicationServerListener;
@@ -105,7 +104,7 @@
  private static int replayThreadNumber = 10;
  /** Enum that symbolizes the state of the multimaster replication. */
  private static enum State
  private enum State
  {
    STARTING, RUNNING, STOPPING
  }
@@ -165,7 +164,6 @@
        }
    }
    LDAPReplicationDomain domain = null;
    DN temp = dn;
    while (domain == null && temp != null)
@@ -251,7 +249,6 @@
    }
  }
  /** {@inheritDoc} */
  @Override
  public void initializeSynchronizationProvider(
      ReplicationSynchronizationProviderCfg cfg) throws ConfigException
@@ -300,9 +297,7 @@
    return value == null ? Platform.computeNumberOfThreads(16, 2.0f) : value;
  }
  /**
   * Create the threads that will wait for incoming update messages.
   */
  /** Create the threads that will wait for incoming update messages. */
  private static synchronized void createReplayThreads()
  {
    replayThreads.clear();
@@ -316,9 +311,7 @@
    }
  }
  /**
   * Stop the threads that are waiting for incoming update messages.
   */
  /** Stop the threads that are waiting for incoming update messages. */
  private static synchronized void stopReplayThreads()
  {
    //  stop the replay threads
@@ -341,7 +334,6 @@
    replayThreads.clear();
  }
  /** {@inheritDoc} */
  @Override
  public boolean isConfigurationAddAcceptable(
      ReplicationDomainCfg configuration, List<LocalizableMessage> unacceptableReasons)
@@ -350,7 +342,6 @@
      configuration, unacceptableReasons);
  }
  /** {@inheritDoc} */
  @Override
  public ConfigChangeResult applyConfigurationAdd(
     ReplicationDomainCfg configuration)
@@ -375,7 +366,6 @@
    return ccr;
  }
  /** {@inheritDoc} */
  @Override
  public void doPostOperation(PostOperationAddOperation addOperation)
  {
@@ -383,8 +373,6 @@
    genericPostOperation(addOperation, dn);
  }
  /** {@inheritDoc} */
  @Override
  public void doPostOperation(PostOperationDeleteOperation deleteOperation)
  {
@@ -392,7 +380,6 @@
    genericPostOperation(deleteOperation, dn);
  }
  /** {@inheritDoc} */
  @Override
  public void doPostOperation(PostOperationModifyDNOperation modifyDNOperation)
  {
@@ -400,7 +387,6 @@
    genericPostOperation(modifyDNOperation, dn);
  }
  /** {@inheritDoc} */
  @Override
  public void doPostOperation(PostOperationModifyOperation modifyOperation)
  {
@@ -408,7 +394,6 @@
    genericPostOperation(modifyOperation, dn);
  }
  /** {@inheritDoc} */
  @Override
  public SynchronizationProviderResult handleConflictResolution(
      PreOperationModifyOperation modifyOperation)
@@ -421,7 +406,6 @@
    return new SynchronizationProviderResult.ContinueProcessing();
  }
  /** {@inheritDoc} */
  @Override
  public SynchronizationProviderResult handleConflictResolution(
      PreOperationAddOperation addOperation) throws DirectoryException
@@ -434,7 +418,6 @@
    return new SynchronizationProviderResult.ContinueProcessing();
  }
  /** {@inheritDoc} */
  @Override
  public SynchronizationProviderResult handleConflictResolution(
      PreOperationDeleteOperation deleteOperation) throws DirectoryException
@@ -447,7 +430,6 @@
    return new SynchronizationProviderResult.ContinueProcessing();
  }
  /** {@inheritDoc} */
  @Override
  public SynchronizationProviderResult handleConflictResolution(
      PreOperationModifyDNOperation modifyDNOperation) throws DirectoryException
@@ -460,7 +442,6 @@
    return new SynchronizationProviderResult.ContinueProcessing();
  }
  /** {@inheritDoc} */
  @Override
  public SynchronizationProviderResult
         doPreOperation(PreOperationModifyOperation modifyOperation)
@@ -498,7 +479,6 @@
    return new SynchronizationProviderResult.ContinueProcessing();
  }
  /** {@inheritDoc} */
  @Override
  public SynchronizationProviderResult doPreOperation(
         PreOperationDeleteOperation deleteOperation) throws DirectoryException
@@ -506,7 +486,6 @@
    return new SynchronizationProviderResult.ContinueProcessing();
  }
  /** {@inheritDoc} */
  @Override
  public SynchronizationProviderResult doPreOperation(
         PreOperationModifyDNOperation modifyDNOperation)
@@ -541,7 +520,6 @@
    return new SynchronizationProviderResult.ContinueProcessing();
  }
  /** {@inheritDoc} */
  @Override
  public SynchronizationProviderResult doPreOperation(
         PreOperationAddOperation addOperation)
@@ -566,7 +544,6 @@
    return new SynchronizationProviderResult.ContinueProcessing();
  }
  /** {@inheritDoc} */
  @Override
  public void finalizeSynchronizationProvider()
  {
@@ -599,7 +576,6 @@
   *
   * @param  modifications  The list of modifications that was
   *                                      applied to the schema.
   *
   */
  @Override
  public void processSchemaChange(List<Modification> modifications)
@@ -611,9 +587,8 @@
    }
  }
  /** {@inheritDoc} */
  @Override
  public void processBackupBegin(Backend backend, BackupConfig config)
  public void processBackupBegin(Backend<?> backend, BackupConfig config)
  {
    for (DN dn : backend.getBaseDNs())
    {
@@ -625,10 +600,8 @@
    }
  }
  /** {@inheritDoc} */
  @Override
  public void processBackupEnd(Backend backend, BackupConfig config,
                               boolean successful)
  public void processBackupEnd(Backend<?> backend, BackupConfig config, boolean successful)
  {
    for (DN dn : backend.getBaseDNs())
    {
@@ -640,9 +613,8 @@
    }
  }
  /** {@inheritDoc} */
  @Override
  public void processRestoreBegin(Backend backend, RestoreConfig config)
  public void processRestoreBegin(Backend<?> backend, RestoreConfig config)
  {
    for (DN dn : backend.getBaseDNs())
    {
@@ -654,10 +626,8 @@
    }
  }
  /** {@inheritDoc} */
  @Override
  public void processRestoreEnd(Backend backend, RestoreConfig config,
                                boolean successful)
  public void processRestoreEnd(Backend<?> backend, RestoreConfig config, boolean successful)
  {
    for (DN dn : backend.getBaseDNs())
    {
@@ -669,9 +639,8 @@
    }
  }
  /** {@inheritDoc} */
  @Override
  public void processImportBegin(Backend backend, LDIFImportConfig config)
  public void processImportBegin(Backend<?> backend, LDIFImportConfig config)
  {
    for (DN dn : backend.getBaseDNs())
    {
@@ -683,10 +652,8 @@
    }
  }
  /** {@inheritDoc} */
  @Override
  public void processImportEnd(Backend backend, LDIFImportConfig config,
                               boolean successful)
  public void processImportEnd(Backend<?> backend, LDIFImportConfig config, boolean successful)
  {
    for (DN dn : backend.getBaseDNs())
    {
@@ -698,9 +665,8 @@
    }
  }
  /** {@inheritDoc} */
  @Override
  public void processExportBegin(Backend backend, LDIFExportConfig config)
  public void processExportBegin(Backend<?> backend, LDIFExportConfig config)
  {
    for (DN dn : backend.getBaseDNs())
    {
@@ -712,10 +678,8 @@
    }
  }
  /** {@inheritDoc} */
  @Override
  public void processExportEnd(Backend backend, LDIFExportConfig config,
                               boolean successful)
  public void processExportEnd(Backend<?> backend, LDIFExportConfig config, boolean successful)
  {
    for (DN dn : backend.getBaseDNs())
    {
@@ -737,7 +701,6 @@
    return new ConfigChangeResult();
  }
  /** {@inheritDoc} */
  @Override
  public boolean isConfigurationDeleteAcceptable(
      ReplicationDomainCfg configuration, List<LocalizableMessage> unacceptableReasons)
@@ -769,7 +732,6 @@
    return replicationServerListener;
  }
  /** {@inheritDoc} */
  @Override
  public boolean isConfigurationChangeAcceptable(
      ReplicationSynchronizationProviderCfg configuration,
@@ -781,7 +743,6 @@
  @Override
  public ConfigChangeResult applyConfigurationChange(ReplicationSynchronizationProviderCfg configuration)
  {
    // Stop threads then restart new number of threads
    stopReplayThreads();
    replayThreadNumber = getNumberOfReplayThreadsOrDefault(configuration);
@@ -796,7 +757,6 @@
    return new ConfigChangeResult();
  }
  /** {@inheritDoc} */
  @Override
  public void completeSynchronizationProvider()
  {
@@ -911,5 +871,4 @@
  {
    return connectionTimeoutMS;
  }
}