From 377b2709c64b32fe93905b466482216c2cc0581c Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Wed, 19 Mar 2014 16:30:32 +0000
Subject: [PATCH] OPENDJ-1368 (CR-3232) Remove AttributeValue

---
 opendj3-server-dev/src/server/org/opends/server/authorization/dseecompat/UserAttr.java |   19 +++++++++++++------
 1 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/opendj3-server-dev/src/server/org/opends/server/authorization/dseecompat/UserAttr.java b/opendj3-server-dev/src/server/org/opends/server/authorization/dseecompat/UserAttr.java
index c1ed59f..efaaad4 100644
--- a/opendj3-server-dev/src/server/org/opends/server/authorization/dseecompat/UserAttr.java
+++ b/opendj3-server-dev/src/server/org/opends/server/authorization/dseecompat/UserAttr.java
@@ -31,6 +31,7 @@
 import java.util.List;
 
 import org.forgerock.i18n.LocalizableMessage;
+import org.forgerock.opendj.ldap.ByteString;
 import org.forgerock.opendj.ldap.DereferenceAliasesPolicy;
 import org.forgerock.opendj.ldap.SearchScope;
 import org.opends.server.core.DirectoryServer;
@@ -215,12 +216,14 @@
                         filter, null);
         LinkedList<SearchResultEntry> result = op.getSearchEntries();
         if (!result.isEmpty()) {
-            AttributeValue val= AttributeValues.create(attrType, attrVal);
+            ByteString val= ByteString.valueOf(attrVal);
             SearchResultEntry resultEntry = result.getFirst();
             if(resultEntry.hasValue(attrType, null, val)) {
                 Entry e=evalCtx.getResourceEntry();
                 if(e.hasValue(attrType, null, val))
+                {
                     matched=EnumEvalResult.TRUE;
+                }
             }
         }
         return matched.getRet(type, undefined);
@@ -277,21 +280,25 @@
         List<Attribute> attrs=evalCtx.getResourceEntry().getAttribute(attrType);
         if(!attrs.isEmpty()) {
             for(Attribute a : attrs) {
-                for(AttributeValue v : a) {
-                    String urlStr=v.getValue().toString();
+                for(ByteString v : a) {
                     LDAPURL url;
                     try {
-                       url=LDAPURL.decode(urlStr, true);
+                       url = LDAPURL.decode(v.toString(), true);
                     } catch (DirectoryException e) {
                         break;
                     }
                     matched=UserDN.evalURL(evalCtx, url);
                     if(matched != EnumEvalResult.FALSE)
+                    {
                         break;
+                    }
                 }
-                if(matched == EnumEvalResult.TRUE)
+                if (matched == EnumEvalResult.TRUE)
+                {
                     break;
-                if(matched == EnumEvalResult.ERR) {
+                }
+                if (matched == EnumEvalResult.ERR)
+                {
                     undefined=true;
                     break;
                 }

--
Gitblit v1.10.0