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

Jean-Noel Rouvignac
06.41.2013 8ed297692b7674b67b8d05a26fa9b04c20930e37
opends/src/server/org/opends/server/replication/server/changelog/je/ReplicationDbEnv.java
@@ -34,6 +34,7 @@
import org.opends.messages.Message;
import org.opends.messages.MessageBuilder;
import org.opends.server.loggers.debug.DebugTracer;
import org.opends.server.replication.server.ChangelogState;
import org.opends.server.replication.server.ReplicationServer;
import org.opends.server.replication.server.changelog.api.ChangelogException;
@@ -166,12 +167,14 @@
  }
  /**
   * Read the list of known servers from the database and start dbHandler
   * for each of them.
   * Read the list of known servers from the database and start dbHandler for
   * each of them.
   *
   * @throws ChangelogException in case of underlying Exception
   * @return the {@link ChangelogState} read from the changelogState DB
   * @throws ChangelogException
   *           if a database problem occurs
   */
  public void initializeFromChangelogStateDB() throws ChangelogException
  public ChangelogState readChangelogState() throws ChangelogException
  {
    DatabaseEntry key = new DatabaseEntry();
    DatabaseEntry data = new DatabaseEntry();
@@ -179,6 +182,8 @@
    try
    {
      final ChangelogState result = new ChangelogState();
      OperationStatus status = cursor.getFirst(key, data, LockMode.DEFAULT);
      while (status == OperationStatus.SUCCESS)
      {
@@ -197,7 +202,7 @@
          if (debugEnabled())
            debug("has read baseDn=" + baseDn + " generationId=" +generationId);
          replicationServer.initDomainGenerationID(baseDn, generationId);
          result.setDomainGenerationId(baseDn, generationId);
        }
        else
        {
@@ -207,11 +212,13 @@
          if (debugEnabled())
            debug("has read: baseDn=" + baseDn + " serverId=" + serverId);
          replicationServer.addServerIdToDomain(serverId, baseDn);
          result.addServerIdToDomain(serverId, baseDn);
        }
        status = cursor.getNext(key, data, LockMode.DEFAULT);
      }
      return result;
    }
    catch (RuntimeException e)
    {