From c3ddd7489abd06155b872cc23cef3575e2ee1b9a Mon Sep 17 00:00:00 2001
From: Nicolas Capponi <nicolas.capponi@forgerock.com>
Date: Wed, 08 Jan 2014 09:55:13 +0000
Subject: [PATCH] Align server types API with SDK types API

---
 opendj3-server-dev/src/server/org/opends/server/extensions/SASLContext.java |   23 ++++++++++++-----------
 1 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/opendj3-server-dev/src/server/org/opends/server/extensions/SASLContext.java b/opendj3-server-dev/src/server/org/opends/server/extensions/SASLContext.java
index a5dbd93..ae30059 100644
--- a/opendj3-server-dev/src/server/org/opends/server/extensions/SASLContext.java
+++ b/opendj3-server-dev/src/server/org/opends/server/extensions/SASLContext.java
@@ -277,7 +277,7 @@
         bindOp.setSASLAuthUserEntry(authEntry);
         final AuthenticationInfo authInfo = new AuthenticationInfo(authEntry,
             authzEntry, mechanism, clientCredentials,
-            DirectoryServer.isRootDN(authEntry.getDN()));
+            DirectoryServer.isRootDN(authEntry.getName()));
         bindOp.setAuthenticationInfo(authInfo);
 
         // If confidentiality/integrity has been negotiated then
@@ -373,7 +373,7 @@
       bindOp.setSASLAuthUserEntry(authEntry);
       final AuthenticationInfo authInfo = new AuthenticationInfo(authEntry,
           authzEntry, mechanism, clientCredentials,
-          DirectoryServer.isRootDN(authEntry.getDN()));
+          DirectoryServer.isRootDN(authEntry.getName()));
       bindOp.setAuthenticationInfo(authInfo);
 
       // If confidentiality/integrity has been negotiated, then create a
@@ -746,7 +746,7 @@
       authzDN = actualAuthzDN;
     }
 
-    if (!authzDN.equals(authEntry.getDN()))
+    if (!authzDN.equals(authEntry.getName()))
     {
       if (authzDN.isRootDN())
       {
@@ -777,7 +777,7 @@
         }
       }
       final AuthenticationInfo authInfo = new AuthenticationInfo(authEntry,
-          DirectoryServer.isRootDN(authEntry.getDN()));
+          DirectoryServer.isRootDN(authEntry.getName()));
       if (!hasPrivilege(authInfo))
       {
         callback.setAuthorized(false);
@@ -842,12 +842,13 @@
       }
     }
 
-    if ((authzEntry == null) || (!authzEntry.getDN().equals(authEntry.getDN())))
+    if ((authzEntry == null) || (!authzEntry.getName().
+        equals(authEntry.getName())))
     {
       // Create temporary authorization information and run it both
       // through the privilege and then the access control subsystems.
       final AuthenticationInfo authInfo = new AuthenticationInfo(authEntry,
-          DirectoryServer.isRootDN(authEntry.getDN()));
+          DirectoryServer.isRootDN(authEntry.getName()));
       if (!hasPrivilege(authInfo))
       {
         callback.setAuthorized(false);
@@ -1002,7 +1003,7 @@
         .mayProxy(authInfo.getAuthenticationEntry(), e, bindOp))
     {
       setCallbackMsg(ERR_SASL_AUTHZID_INSUFFICIENT_ACCESS.get(String
-          .valueOf(authEntry.getDN())));
+          .valueOf(authEntry.getName())));
       ret = false;
     }
 
@@ -1028,7 +1029,7 @@
     if (!tempConn.hasPrivilege(Privilege.PROXIED_AUTH, bindOp))
     {
       setCallbackMsg(ERR_SASL_AUTHZID_INSUFFICIENT_PRIVILEGES.get(String
-          .valueOf(authEntry.getDN())));
+          .valueOf(authEntry.getName())));
       ret = false;
     }
     return ret;
@@ -1181,7 +1182,7 @@
       if (!authState.isPasswordPolicy())
       {
         final Message message = ERR_SASL_ACCOUNT_NOT_LOCAL.get(mechanism,
-            String.valueOf(authEntry.getDN()));
+            String.valueOf(authEntry.getName()));
         setCallbackMsg(ResultCode.INAPPROPRIATE_AUTHENTICATION, message);
         return;
       }
@@ -1192,7 +1193,7 @@
       if ((clearPasswords == null) || clearPasswords.isEmpty())
       {
         setCallbackMsg(ERR_SASL_NO_REVERSIBLE_PASSWORDS.get(mechanism,
-            String.valueOf(authEntry.getDN())));
+            String.valueOf(authEntry.getName())));
         return;
       }
     }
@@ -1203,7 +1204,7 @@
         TRACER.debugCaught(DebugLogLevel.ERROR, e);
       }
       setCallbackMsg(ERR_SASL_CANNOT_GET_REVERSIBLE_PASSWORDS.get(
-          String.valueOf(authEntry.getDN()), mechanism, String.valueOf(e)));
+          String.valueOf(authEntry.getName()), mechanism, String.valueOf(e)));
       return;
     }
 

--
Gitblit v1.10.0