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

neil_a_wilson
26.14.2007 39ee9286999c0faf5e78ab2a68d69d10c7600ff9
opends/src/server/org/opends/server/extensions/SubjectDNToUserAttributeCertificateMapper.java
@@ -32,7 +32,6 @@
import java.security.cert.Certificate;
import java.security.cert.X509Certificate;
import javax.security.auth.x500.X500Principal;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
@@ -83,9 +82,6 @@
   */
  private static final DebugTracer TRACER = getTracer();
  // The attribute type that will be used to map the certificate's subject.
  private AttributeType subjectAttributeType;
  // The DN of the configuration entry for this certificate mapper.
  private DN configEntryDN;
@@ -118,18 +114,6 @@
    currentConfig = configuration;
    configEntryDN = configuration.dn();
    // Get the attribute type that will be used to hold the fingerprint.
    String attrName = configuration.getSubjectAttribute();
    subjectAttributeType =
         DirectoryServer.getAttributeType(toLowerCase(attrName), false);
    if (subjectAttributeType == null)
    {
      Message message =
          ERR_SDTUACM_NO_SUCH_ATTR.get(String.valueOf(configEntryDN), attrName);
      throw new ConfigException(message);
    }
  }
@@ -152,7 +136,7 @@
  {
    SubjectDNToUserAttributeCertificateMapperCfg config =
         currentConfig;
    AttributeType subjectAttributeType = this.subjectAttributeType;
    AttributeType subjectAttributeType = config.getSubjectAttribute();
    // Make sure that a peer certificate was provided.
@@ -255,23 +239,9 @@
                           configuration,
                      List<Message> unacceptableReasons)
  {
    // If we've gotten to this point, then the configuration should be
    // acceptable.
    boolean configAcceptable = true;
    DN cfgEntryDN = configuration.dn();
    // Make sure that the subject attribute is defined in the server schema.
    String attrName = configuration.getSubjectAttribute();
    AttributeType newSubjectType =
                       DirectoryServer.getAttributeType(toLowerCase(attrName),
                                       false);
    if (newSubjectType == null)
    {
      unacceptableReasons.add(ERR_SDTUACM_NO_SUCH_ATTR.get(
              String.valueOf(cfgEntryDN),
              attrName));
      configAcceptable = false;
    }
    return configAcceptable;
  }
@@ -284,36 +254,8 @@
              SubjectDNToUserAttributeCertificateMapperCfg
                   configuration)
  {
    ResultCode         resultCode          = ResultCode.SUCCESS;
    boolean            adminActionRequired = false;
    ArrayList<Message> messages            = new ArrayList<Message>();
    // Make sure that the fingerprint attribute is defined in the server schema.
    String attrName = configuration.getSubjectAttribute();
    AttributeType newSubjectType =
                       DirectoryServer.getAttributeType(toLowerCase(attrName),
                                       false);
    if (newSubjectType == null)
    {
      if (resultCode == ResultCode.SUCCESS)
      {
        resultCode = ResultCode.NO_SUCH_ATTRIBUTE;
      }
      messages.add(ERR_SDTUACM_NO_SUCH_ATTR.get(
              String.valueOf(configEntryDN), attrName));
    }
    if (resultCode == ResultCode.SUCCESS)
    {
      subjectAttributeType = newSubjectType;
      currentConfig        = configuration;
    }
   return new ConfigChangeResult(resultCode, adminActionRequired, messages);
    currentConfig = configuration;
    return new ConfigChangeResult(ResultCode.SUCCESS, false);
  }
}