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

gbellato
01.04.2006 b5acb25ee2ad9bf8b166b9de1a34e6aab6ea23b7
opends/src/server/org/opends/server/synchronization/MultimasterSynchronization.java
@@ -72,6 +72,21 @@
    new HashMap<DN, SynchronizationDomain>() ;
  /**
   * Get the ServerState associated to the SynchronizationDomain
   * with a given DN.
   *
   * @param baseDn The DN of the Synchronization Domain for which the
   *               ServerState must be returned.
   * @return the ServerState associated to the SynchronizationDomain
   *         with the DN in parameter.
   */
  public static ServerState getServerState(DN baseDn)
  {
    SynchronizationDomain domain = findDomain(baseDn);
    return domain.getServerState();
  }
  /**
   * {@inheritDoc}
   */
  public void initializeSynchronizationProvider(ConfigEntry configEntry)
@@ -245,6 +260,47 @@
    return domain.handleConflictResolution(modifyOperation);
  }
  /**
   * {@inheritDoc}
   */
  @Override
  public SynchronizationProviderResult handleConflictResolution(
      AddOperation addOperation) throws DirectoryException
  {
    SynchronizationDomain domain = findDomain(addOperation.getEntryDN());
    if (domain == null)
      return new SynchronizationProviderResult(true);
    return domain.handleConflictResolution(addOperation);
  }
  /**
   * {@inheritDoc}
   */
  @Override
  public SynchronizationProviderResult handleConflictResolution(
      DeleteOperation deleteOperation) throws DirectoryException
  {
    SynchronizationDomain domain = findDomain(deleteOperation.getEntryDN());
    if (domain == null)
      return new SynchronizationProviderResult(true);
    return domain.handleConflictResolution(deleteOperation);
  }
  /**
   * {@inheritDoc}
   */
  @Override
  public SynchronizationProviderResult handleConflictResolution(
      ModifyDNOperation modifyDNOperation) throws DirectoryException
  {
    SynchronizationDomain domain = findDomain(modifyDNOperation.getEntryDN());
    if (domain == null)
      return new SynchronizationProviderResult(true);
    return domain.handleConflictResolution(modifyDNOperation);
  }
  /**
   * {@inheritDoc}
@@ -275,57 +331,35 @@
   * {@inheritDoc}
   */
  @Override
  public SynchronizationProviderResult doPreOperation(
      DeleteOperation deleteOperation) throws DirectoryException
  {
    return new SynchronizationProviderResult(true);
  }
  /**
   * {@inheritDoc}
   */
  @Override
  public SynchronizationProviderResult doPreOperation(
      ModifyDNOperation modifyDNOperation) throws DirectoryException
  {
    return new SynchronizationProviderResult(true);
  }
  /**
   * {@inheritDoc}
   */
  @Override
  public SynchronizationProviderResult doPreOperation(AddOperation addOperation)
  {
    SynchronizationDomain domain = findDomain(addOperation.getEntryDN());
    if (domain == null)
      return new SynchronizationProviderResult(true);
    domain.setChangeNumber(addOperation);
    return new SynchronizationProviderResult(true);
  }
    if (!addOperation.isSynchronizationOperation())
      domain.doPreOperation(addOperation);
  /**
   * Pre-operation processing.
   * Called after operation has been processed by the core server
   * but before being committed to the backend
   * Generate the Change number and update the historical information
   *
   * @param deleteOperation the current operation
   * @return code indicating if operation must be processed
   */
  @Override
  public SynchronizationProviderResult
                  doPreOperation(DeleteOperation deleteOperation)
  {
    SynchronizationDomain domain = findDomain(deleteOperation.getEntryDN());
    if (domain == null)
      return new SynchronizationProviderResult(true);
    domain.setChangeNumber(deleteOperation);
    return new SynchronizationProviderResult(true);
  }
  /**
   * Pre-operation processing.
   * Called after operation has been processed by the core server
   * but before being committed to the backend
   * Generate the Change number and update the historical information
   *
   * @param modifyDNOperation the current operation
   * @return code indicating if operation must be processed
   */
  @Override
  public SynchronizationProviderResult
                  doPreOperation(ModifyDNOperation modifyDNOperation)
  {
    SynchronizationDomain domain = findDomain(modifyDNOperation.getEntryDN());
    if (domain == null)
      return new SynchronizationProviderResult(true);
    domain.setChangeNumber(modifyDNOperation);
    return new SynchronizationProviderResult(true);
  }
@@ -390,21 +424,6 @@
    return;
  }
  /**
   * Get the ServerState associated to the SynchronizationDomain
   * with a given DN.
   *
   * @param baseDn The DN of the Synchronization Domain for which the
   *               ServerState must be returned.
   * @return the ServerState associated to the SynchronizationDomain
   *         with the DN in parameter.
   */
  public static ServerState getServerState(DN baseDn)
  {
    SynchronizationDomain domain = findDomain(baseDn);
    return domain.getServerState();
  }
}