From c93ee25db11a3a624fdc68c3e70f0c39ed0718a4 Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Sun, 26 Aug 2007 00:14:04 +0000
Subject: [PATCH] Update configuration definitions to make a few different types of changes:

---
 opendj-sdk/opends/src/server/org/opends/server/extensions/FingerprintCertificateMapper.java |   57 ++++++---------------------------------------------------
 1 files changed, 6 insertions(+), 51 deletions(-)

diff --git a/opendj-sdk/opends/src/server/org/opends/server/extensions/FingerprintCertificateMapper.java b/opendj-sdk/opends/src/server/org/opends/server/extensions/FingerprintCertificateMapper.java
index c7b3a71..d74ccbb 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/extensions/FingerprintCertificateMapper.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/extensions/FingerprintCertificateMapper.java
@@ -82,8 +82,7 @@
    */
   private static final DebugTracer TRACER = getTracer();
 
-  // The attribute type that will be used to map the certificate's fingerprint.
-  private AttributeType fingerprintAttributeType;
+
 
   // The DN of the configuration entry for this certificate mapper.
   private DN configEntryDN;
@@ -121,18 +120,6 @@
     configEntryDN = configuration.dn();
 
 
-    // Get the attribute type that will be used to hold the fingerprint.
-    String attrName = configuration.getFingerprintAttribute();
-    fingerprintAttributeType =
-         DirectoryServer.getAttributeType(toLowerCase(attrName), false);
-    if (fingerprintAttributeType == null)
-    {
-      Message message =
-          ERR_FCM_NO_SUCH_ATTR.get(String.valueOf(configEntryDN), attrName);
-      throw new ConfigException(message);
-    }
-
-
     // Get the algorithm that will be used to generate the fingerprint.
     switch (configuration.getFingerprintAlgorithm())
     {
@@ -164,7 +151,7 @@
          throws DirectoryException
   {
     FingerprintCertificateMapperCfg config = currentConfig;
-    AttributeType fingerprintAttributeType = this.fingerprintAttributeType;
+    AttributeType fingerprintAttributeType = config.getFingerprintAttribute();
     String fingerprintAlgorithm = this.fingerprintAlgorithm;
 
     // Make sure that a peer certificate was provided.
@@ -289,23 +276,9 @@
                       FingerprintCertificateMapperCfg 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 fingerprint attribute is defined in the server schema.
-    String attrName = configuration.getFingerprintAttribute();
-    AttributeType newFingerprintType =
-                       DirectoryServer.getAttributeType(toLowerCase(attrName),
-                                       false);
-    if (newFingerprintType == null)
-    {
-      unacceptableReasons.add(ERR_FCM_NO_SUCH_ATTR.get(
-              String.valueOf(cfgEntryDN),
-              attrName));
-      configAcceptable = false;
-    }
-
-
     return configAcceptable;
   }
 
@@ -322,23 +295,6 @@
     ArrayList<Message> messages            = new ArrayList<Message>();
 
 
-    // Make sure that the fingerprint attribute is defined in the server schema.
-    String attrName = configuration.getFingerprintAttribute();
-    AttributeType newFingerprintType =
-                       DirectoryServer.getAttributeType(toLowerCase(attrName),
-                                       false);
-    if (newFingerprintType == null)
-    {
-      if (resultCode == ResultCode.SUCCESS)
-      {
-        resultCode = ResultCode.NO_SUCH_ATTRIBUTE;
-      }
-
-      messages.add(ERR_FCM_NO_SUCH_ATTR.get(
-              String.valueOf(configEntryDN), attrName));
-    }
-
-
     // Get the algorithm that will be used to generate the fingerprint.
     String newFingerprintAlgorithm = null;
     switch (configuration.getFingerprintAlgorithm())
@@ -354,9 +310,8 @@
 
     if (resultCode == ResultCode.SUCCESS)
     {
-      fingerprintAttributeType = newFingerprintType;
-      fingerprintAlgorithm     = newFingerprintAlgorithm;
-      currentConfig            = configuration;
+      fingerprintAlgorithm = newFingerprintAlgorithm;
+      currentConfig        = configuration;
     }
 
 

--
Gitblit v1.10.0