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

Jean-Noel Rouvignac
24.01.2014 6d1ebe16f8bfd23ef5de615dc7fab6468f7ef3f8
opendj3-server-dev/src/server/org/opends/server/extensions/RegularExpressionIdentityMapper.java
@@ -26,6 +26,10 @@
 */
package org.opends.server.extensions;
import static org.opends.messages.ExtensionMessages.*;
import static org.opends.server.protocols.internal.InternalClientConnection.*;
import static org.opends.server.protocols.internal.Requests.*;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
@@ -51,12 +55,8 @@
import org.opends.server.protocols.internal.InternalClientConnection;
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.types.*;
import static org.opends.messages.ExtensionMessages.*;
import static org.opends.server.protocols.internal.InternalClientConnection.*;
/**
 * This class provides an implementation of a Directory Server identity mapper
 * that uses a regular expression to process the provided ID string, and then
@@ -368,10 +368,7 @@
  public ConfigChangeResult applyConfigurationChange(
              RegularExpressionIdentityMapperCfg configuration)
  {
    ResultCode         resultCode          = ResultCode.SUCCESS;
    boolean            adminActionRequired = false;
    ArrayList<LocalizableMessage> messages            = new ArrayList<LocalizableMessage>();
    final ConfigChangeResult ccr = new ConfigChangeResult();
    Pattern newMatchPattern = null;
    try
@@ -380,11 +377,8 @@
    }
    catch (PatternSyntaxException pse)
    {
      LocalizableMessage message = ERR_REGEXMAP_INVALID_MATCH_PATTERN.get(
                      configuration.getMatchPattern(),
                                  pse.getMessage());
      messages.add(message);
      resultCode = ResultCode.CONSTRAINT_VIOLATION;
      ccr.addMessage(ERR_REGEXMAP_INVALID_MATCH_PATTERN.get(configuration.getMatchPattern(), pse.getMessage()));
      ccr.setResultCode(ResultCode.CONSTRAINT_VIOLATION);
    }
    String newReplacePattern = configuration.getReplacePattern();
@@ -398,7 +392,7 @@
         configuration.getMatchAttribute().toArray(new AttributeType[0]);
    if (resultCode == ResultCode.SUCCESS)
    if (ccr.getResultCode() == ResultCode.SUCCESS)
    {
      attributeTypes = newAttributeTypes;
      currentConfig  = configuration;
@@ -406,8 +400,6 @@
      replacePattern = newReplacePattern;
    }
   return new ConfigChangeResult(resultCode, adminActionRequired, messages);
    return ccr;
  }
}