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

pgamba
09.39.2009 ee928df462895d227253bdf68bba1b3d493be8fa
Improve error handling on entryuid mapping in ECL
2 files modified
30 ■■■■■ changed files
opends/src/messages/messages/replication.properties 3 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/workflowelement/externalchangelog/ECLSearchOperation.java 27 ●●●●● patch | view | raw | blame | history
opends/src/messages/messages/replication.properties
@@ -439,3 +439,6 @@
 attribute for external change log: Attribute: %s , Error: %s
NOTICE_ERR_UNABLE_TO_ENABLE_ECL_183=Error in %s when enabling the external \
 change log: %s
NOTICE_ERR_ENTRY_UID_DSEE_MAPPING_184=Error for entry %s when mapping entry UID\
  attribute to DSEE NsUniqueID attribute. Value to be mapped: %s \
 Error : %s
opends/src/server/org/opends/server/workflowelement/externalchangelog/ECLSearchOperation.java
@@ -29,12 +29,14 @@
import static org.opends.messages.CoreMessages.*;
import static org.opends.messages.ReplicationMessages.*;
import static org.opends.server.loggers.ErrorLogger.logError;
import static org.opends.server.loggers.debug.DebugLogger.debugEnabled;
import static org.opends.server.loggers.debug.DebugLogger.getTracer;
import static org.opends.server.util.ServerConstants.*;
import static org.opends.server.util.StaticUtils.getExceptionMessage;
import static org.opends.server.util.StaticUtils.needsBase64Encoding;
import static org.opends.server.util.StaticUtils.*;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
@@ -1169,8 +1171,28 @@
          DirectoryServer.getAttributeType("targetuniqueid")) == null)
          attributeType =
              DirectoryServer.getDefaultAttributeType("targetuniqueid");
        a = Attributes.create(attributeType,
            ECLSearchOperation.openDsToSunDseeNsUniqueId(targetUUID));
        String dseeValue = null;
        try
        {
          ECLSearchOperation.openDsToSunDseeNsUniqueId(targetUUID);
        }
        catch(Exception e)
        {
          Message errMessage =
            NOTE_ERR_ENTRY_UID_DSEE_MAPPING.get(
                targetDN.toNormalizedString(),
                targetUUID,
                e.getLocalizedMessage());
          logError(errMessage);
          if (debugEnabled())
            TRACER.debugCaught(DebugLogLevel.ERROR, e);
        }
        // If the mapping fails, we don't want to stop the operation
        // or not return this entry.
        if (dseeValue != null)
        {
          a = Attributes.create(attributeType, dseeValue);
        attrList = new ArrayList<Attribute>(1);
        attrList.add(a);
        if(attributeType.isOperational())
@@ -1179,6 +1201,7 @@
          uAttrs.put(attributeType, attrList);
      }
    }
    }
    if((attributeType =
      DirectoryServer.getAttributeType("changelogcookie")) == null)