From 5ceb2e9601d2501d021d0c61188ec913076555a0 Mon Sep 17 00:00:00 2001
From: matthew_swift <matthew_swift@localhost>
Date: Wed, 26 Sep 2007 12:21:02 +0000
Subject: [PATCH] Merge branches/temp-admin@3208 onto trunk@3208.
---
opends/src/server/org/opends/server/extensions/PlainSASLMechanismHandler.java | 57 ++++++---------------------------------------------------
1 files changed, 6 insertions(+), 51 deletions(-)
diff --git a/opends/src/server/org/opends/server/extensions/PlainSASLMechanismHandler.java b/opends/src/server/org/opends/server/extensions/PlainSASLMechanismHandler.java
index 1a4d7e2..815dafa 100644
--- a/opends/src/server/org/opends/server/extensions/PlainSASLMechanismHandler.java
+++ b/opends/src/server/org/opends/server/extensions/PlainSASLMechanismHandler.java
@@ -86,11 +86,8 @@
*/
private static final DebugTracer TRACER = getTracer();
- // The DN of the configuration entry for this SASL mechanism handler.
- private DN configEntryDN;
-
// The identity mapper that will be used to map ID strings to user entries.
- private IdentityMapper identityMapper;
+ private IdentityMapper<?> identityMapper;
// The current configuration for this SASL mechanism handler.
private PlainSASLMechanismHandlerCfg currentConfig;
@@ -118,20 +115,12 @@
throws ConfigException, InitializationException
{
configuration.addPlainChangeListener(this);
-
currentConfig = configuration;
- configEntryDN = configuration.dn();
// Get the identity mapper that should be used to find users.
DN identityMapperDN = configuration.getIdentityMapperDN();
identityMapper = DirectoryServer.getIdentityMapper(identityMapperDN);
- if (identityMapper == null)
- {
- Message message = ERR_SASLPLAIN_NO_SUCH_IDENTITY_MAPPER.get(
- String.valueOf(identityMapperDN), String.valueOf(configEntryDN));
- throw new ConfigException(message);
- }
DirectoryServer.registerSASLMechanismHandler(SASL_MECHANISM_PLAIN, this);
@@ -158,7 +147,7 @@
@Override()
public void processSASLBind(BindOperation bindOperation)
{
- IdentityMapper identityMapper = this.identityMapper;
+ IdentityMapper<?> identityMapper = this.identityMapper;
// Get the SASL credentials provided by the user and decode them.
String authzID = null;
@@ -606,23 +595,7 @@
PlainSASLMechanismHandlerCfg configuration,
List<Message> unacceptableReasons)
{
- boolean configAcceptable = true;
- DN cfgEntryDN = configuration.dn();
-
- // Get the identity mapper that should be used to find users.
- DN identityMapperDN = configuration.getIdentityMapperDN();
- IdentityMapper newIdentityMapper =
- DirectoryServer.getIdentityMapper(identityMapperDN);
- if (newIdentityMapper == null)
- {
- unacceptableReasons.add(ERR_SASLPLAIN_NO_SUCH_IDENTITY_MAPPER.get(
- String.valueOf(identityMapperDN),
- String.valueOf(cfgEntryDN)));
- configAcceptable = false;
- }
-
-
- return configAcceptable;
+ return true;
}
@@ -640,29 +613,11 @@
// Get the identity mapper that should be used to find users.
DN identityMapperDN = configuration.getIdentityMapperDN();
- IdentityMapper newIdentityMapper =
- DirectoryServer.getIdentityMapper(identityMapperDN);
- if (newIdentityMapper == null)
- {
- if (resultCode == ResultCode.SUCCESS)
- {
- resultCode = ResultCode.CONSTRAINT_VIOLATION;
- }
-
- messages.add(ERR_SASLPLAIN_NO_SUCH_IDENTITY_MAPPER.get(
- String.valueOf(identityMapperDN),
- String.valueOf(configEntryDN)));
- }
+ identityMapper = DirectoryServer.getIdentityMapper(identityMapperDN);
+ currentConfig = configuration;
- if (resultCode == ResultCode.SUCCESS)
- {
- identityMapper = newIdentityMapper;
- currentConfig = configuration;
- }
-
-
- return new ConfigChangeResult(resultCode, adminActionRequired, messages);
+ return new ConfigChangeResult(resultCode, adminActionRequired, messages);
}
}
--
Gitblit v1.10.0