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

Jean-Noel Rouvignac
16.16.2014 f4fa5a05ecf9790438ac7fb5d04e8346bf30e428
opendj3-server-dev/src/server/org/opends/server/replication/plugin/PersistentServerState.java
@@ -37,7 +37,6 @@
import org.opends.server.core.ModifyOperationBasis;
import org.opends.server.protocols.internal.InternalSearchOperation;
import org.opends.server.protocols.internal.SearchRequest;
import static org.opends.server.protocols.internal.Requests.*;
import org.opends.server.protocols.ldap.LDAPAttribute;
import org.opends.server.protocols.ldap.LDAPModification;
import org.opends.server.replication.common.CSN;
@@ -48,6 +47,7 @@
import static org.opends.messages.ReplicationMessages.*;
import static org.opends.server.protocols.internal.InternalClientConnection.*;
import static org.opends.server.protocols.internal.Requests.*;
/**
 * This class implements a ServerState that is stored in the backend
@@ -158,30 +158,17 @@
   */
  private SearchResultEntry searchBaseEntry()
  {
    try
    // Search the database entry that is used to periodically save the ServerState
    final SearchRequest request = newSearchRequest(baseDN, SearchScope.BASE_OBJECT).addAttribute(REPLICATION_STATE);
    final InternalSearchOperation search = getRootConnection().processSearch(request);
    final ResultCode resultCode = search.getResultCode();
    if (resultCode != ResultCode.SUCCESS
        && resultCode != ResultCode.NO_SUCH_OBJECT)
    {
      final SearchRequest request =
          newSearchRequest(baseDN, SearchScope.BASE_OBJECT, "objectclass=*").addAttribute(REPLICATION_STATE);
      /*
       * Search the database entry that is used to periodically
       * save the ServerState
       */
      final InternalSearchOperation search = getRootConnection().processSearch(request);
      final ResultCode resultCode = search.getResultCode();
      if (resultCode != ResultCode.SUCCESS
          && resultCode != ResultCode.NO_SUCH_OBJECT)
      {
        logger.error(ERR_ERROR_SEARCHING_RUV, search.getResultCode().getName(), search,
                search.getErrorMessage(), baseDN);
        return null;
      }
      return getFirstResult(search);
    }
    catch (DirectoryException e)
    {
      // cannot happen
      logger.error(ERR_ERROR_SEARCHING_RUV, search.getResultCode().getName(), search, search.getErrorMessage(), baseDN);
      return null;
    }
    return getFirstResult(search);
  }
  /**