directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r615071 [2/5] - in /directory: apacheds/branches/bigbang/btree-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/ apacheds/branches/bigbang/core-entry/src/main/java/org/apache/directory/server/core/entry/ apacheds/bra...
Date Thu, 24 Jan 2008 22:39:50 GMT
Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java?rev=615071&r1=615070&r2=615071&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java Thu Jan 24 14:39:32 2008
@@ -21,6 +21,11 @@
 
 
 import org.apache.directory.server.core.DirectoryService;
+import org.apache.directory.server.core.entry.DefaultServerAttribute;
+import org.apache.directory.server.core.entry.ServerAttribute;
+import org.apache.directory.server.core.entry.ServerEntry;
+import org.apache.directory.server.core.entry.ServerEntryUtils;
+import org.apache.directory.server.core.entry.ServerValue;
 import org.apache.directory.server.core.enumeration.SearchResultFilter;
 import org.apache.directory.server.core.enumeration.SearchResultFilteringEnumeration;
 import org.apache.directory.server.core.interceptor.BaseInterceptor;
@@ -36,16 +41,12 @@
 import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.server.schema.registries.Registries;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
-import org.apache.directory.shared.ldap.message.AttributeImpl;
 import org.apache.directory.shared.ldap.message.ServerSearchResult;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
-import org.apache.directory.shared.ldap.util.AttributeUtils;
 
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
-import javax.naming.directory.Attribute;
-import javax.naming.directory.Attributes;
 import javax.naming.directory.SearchControls;
 import javax.naming.directory.SearchResult;
 import java.util.HashSet;
@@ -87,14 +88,18 @@
         {
             LdapDN name = ((ServerSearchResult)result).getDn();
             
-            if ( !name.isNormalized() )
+            if ( name.isNormalized() == false )
             {
             	name = LdapDN.normalize( name, atRegistry.getNormalizerMapping() );
             }
             
-            Attributes entry = result.getAttributes();
+            ServerEntry entry = ServerEntryUtils.toServerEntry( 
+                result.getAttributes(), 
+                name,
+                registries );
             String[] retAttrs = controls.getReturningAttributes();
             addCollectiveAttributes( name, entry, retAttrs );
+            result.setAttributes( ServerEntryUtils.toAttributesImpl( entry ) );
             return true;
         }
     };
@@ -120,15 +125,15 @@
      * @param retAttrs array or attribute type to be specifically included in the result entry(s)
      * @throws NamingException if there are problems accessing subentries
      */
-    private void addCollectiveAttributes( LdapDN normName, Attributes entry, String[] retAttrs ) throws NamingException
+    private void addCollectiveAttributes( LdapDN normName, ServerEntry entry, String[] retAttrs ) throws NamingException
     {
-        Attribute caSubentries;
+        ServerAttribute caSubentries;
 
         //noinspection StringEquality
         if ( ( retAttrs == null ) || ( retAttrs.length != 1 ) || ( retAttrs[0] != SchemaConstants.ALL_USER_ATTRIBUTES ) )
         {
-            Attributes entryWithCAS = nexus.lookup( new LookupOperationContext( registries, normName, new String[] { 
-            	SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT } ) );
+            ServerEntry entryWithCAS = nexus.lookup( new LookupOperationContext( registries, normName, new String[] { 
+            	SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT_OID } ) );
             caSubentries = entryWithCAS.get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT );
         }
         else
@@ -151,14 +156,13 @@
          * OID values in the exclusions set instead of regular names that
          * may have case variance.
          */
-        Attribute collectiveExclusions = entry.get( SchemaConstants.COLLECTIVE_EXCLUSIONS_AT );
+        ServerAttribute collectiveExclusions = entry.get( SchemaConstants.COLLECTIVE_EXCLUSIONS_AT );
         Set<String> exclusions = new HashSet<String>();
         
         if ( collectiveExclusions != null )
         {
-            if ( AttributeUtils.containsValueCaseIgnore( collectiveExclusions, SchemaConstants.EXCLUDE_ALL_COLLECTIVE_ATTRIBUTES_AT_OID )
-                || AttributeUtils.containsValue( collectiveExclusions, SchemaConstants.EXCLUDE_ALL_COLLECTIVE_ATTRIBUTES_AT, 
-                    atRegistry.lookup( SchemaConstants.COLLECTIVE_EXCLUSIONS_AT_OID ) ) )
+            if ( collectiveExclusions.contains( SchemaConstants.EXCLUDE_ALL_COLLECTIVE_ATTRIBUTES_AT_OID )
+                || collectiveExclusions.contains( SchemaConstants.EXCLUDE_ALL_COLLECTIVE_ATTRIBUTES_AT  ) )
             {
                 /*
                  * This entry does not allow any collective attributes
@@ -169,9 +173,9 @@
 
             exclusions = new HashSet<String>();
             
-            for ( int ii = 0; ii < collectiveExclusions.size(); ii++ )
+            for ( ServerValue<?> value:collectiveExclusions )
             {
-                AttributeType attrType = atRegistry.lookup( ( String ) collectiveExclusions.get( ii ) );
+                AttributeType attrType = atRegistry.lookup( ( String ) value.get() );
                 exclusions.add( attrType.getOid() );
             }
         }
@@ -193,7 +197,15 @@
         
         for ( String retAttr:retAttrs )
         {
-            retIdsSet.add( retAttr.toLowerCase() );
+            if ( retAttr.equals( SchemaConstants.ALL_USER_ATTRIBUTES ) ||
+                retAttr.equals( SchemaConstants.ALL_OPERATIONAL_ATTRIBUTES ) )
+            {
+                retIdsSet.add( retAttr );
+            }
+            else
+            {
+                retIdsSet.add( atRegistry.lookup( retAttr ).getOid() );
+            }
         }
 
         /*
@@ -201,19 +213,17 @@
          * attributes of the subentry and copy collective attributes from the
          * subentry into the entry.
          */
-        for ( int ii = 0; ii < caSubentries.size(); ii++ )
+        for ( ServerValue<?> value:caSubentries )
         {
-            String subentryDnStr = ( String ) caSubentries.get( ii );
+            String subentryDnStr = ( String ) value.get();
             LdapDN subentryDn = new LdapDN( subentryDnStr );
-            Attributes subentry = nexus.lookup( new LookupOperationContext( registries, subentryDn ) );
-            NamingEnumeration<String> attrIds = subentry.getIDs();
+            ServerEntry subentry = nexus.lookup( new LookupOperationContext( registries, subentryDn ) );
             
-            while ( attrIds.hasMore() )
+            for ( AttributeType attributeType:subentry.getAttributeTypes() )
             {
-                String attrId = attrIds.next();
-                AttributeType attrType = atRegistry.lookup( attrId );
-
-                if ( !attrType.isCollective() )
+                String attrId = attributeType.getName();
+                
+                if ( !attributeType.isCollective() )
                 {
                     continue;
                 }
@@ -222,12 +232,12 @@
                  * Skip the addition of this collective attribute if it is excluded
                  * in the 'collectiveAttributes' attribute.
                  */
-                if ( exclusions.contains( attrType.getOid() ) )
+                if ( exclusions.contains( attributeType.getOid() ) )
                 {
                     continue;
                 }
                 
-                Set<AttributeType> allSuperTypes = getAllSuperTypes( attrType );
+                Set<AttributeType> allSuperTypes = getAllSuperTypes( attributeType );
 
                 for ( String retId : retIdsSet )
                 {
@@ -240,7 +250,7 @@
 
                     if ( allSuperTypes.contains( retType ) )
                     {
-                        retIdsSet.add( attrId );
+                        retIdsSet.add( atRegistry.lookup( attrId ).getOid() );
                         break;
                     }
                 }
@@ -249,20 +259,21 @@
                  * If not all attributes or this collective attribute requested specifically
                  * then bypass the inclusion process.
                  */
-                if ( !( retIdsSet.contains( SchemaConstants.ALL_USER_ATTRIBUTES ) || retIdsSet.contains( attrId ) ) )
+                if ( !( retIdsSet.contains( SchemaConstants.ALL_USER_ATTRIBUTES ) || 
+                    retIdsSet.contains( atRegistry.lookup( attrId ).getOid() ) ) )
                 {
                     continue;
                 }
                 
-                Attribute subentryColAttr = subentry.get( attrId );
-                Attribute entryColAttr = entry.get( attrId );
+                ServerAttribute subentryColAttr = subentry.get( attrId );
+                ServerAttribute entryColAttr = entry.get( attrId );
 
                 /*
                  * If entry does not have attribute for collective attribute then create it.
                  */
                 if ( entryColAttr == null )
                 {
-                    entryColAttr = new AttributeImpl( attrId );
+                    entryColAttr = new DefaultServerAttribute( attrId, atRegistry.lookup( attrId ) );
                     entry.put( entryColAttr );
                 }
 
@@ -270,9 +281,9 @@
                  *  Add all the collective attribute values in the subentry
                  *  to the currently processed collective attribute in the entry.
                  */
-                for ( int jj = 0; jj < subentryColAttr.size(); jj++ )
+                for ( ServerValue<?> subentryColVal:subentryColAttr )
                 {
-                    entryColAttr.add( subentryColAttr.get( jj ) );
+                    entryColAttr.add( (String)subentryColVal.get() );
                 }
             }
         }
@@ -301,9 +312,9 @@
     // ------------------------------------------------------------------------
     // Interceptor Method Overrides
     // ------------------------------------------------------------------------
-    public Attributes lookup( NextInterceptor nextInterceptor, LookupOperationContext opContext ) throws NamingException
+    public ServerEntry lookup( NextInterceptor nextInterceptor, LookupOperationContext opContext ) throws NamingException
     {
-        Attributes result = nextInterceptor.lookup( opContext );
+        ServerEntry result = nextInterceptor.lookup( opContext );
         
         if ( result == null )
         {

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributesSchemaChecker.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributesSchemaChecker.java?rev=615071&r1=615070&r2=615071&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributesSchemaChecker.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributesSchemaChecker.java Thu Jan 24 14:39:32 2008
@@ -31,7 +31,9 @@
 import javax.naming.directory.DirContext;
 import javax.naming.directory.ModificationItem;
 
+import org.apache.directory.server.core.entry.ServerAttribute;
 import org.apache.directory.server.core.entry.ServerEntry;
+import org.apache.directory.server.core.entry.ServerEntryUtils;
 import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
 import org.apache.directory.server.core.partition.PartitionNexus;
 import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
@@ -43,7 +45,6 @@
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.SchemaUtils;
-import org.apache.directory.shared.ldap.util.AttributeUtils;
 
 
 /**
@@ -98,11 +99,15 @@
     
     public void checkModify( Registries registries, LdapDN normName, List<ModificationItemImpl> mods ) throws NamingException
     {
-        Attributes originalEntry = nexus.lookup( new LookupOperationContext( registries, normName ) );
-        Attributes targetEntry = SchemaUtils.getTargetEntry( mods, originalEntry );
-        Attribute targetObjectClasses = targetEntry.get( SchemaConstants.OBJECT_CLASS_AT );
+        ServerEntry originalEntry = nexus.lookup( new LookupOperationContext( registries, normName ) );
+        ServerEntry targetEntry = ServerEntryUtils.toServerEntry( 
+            SchemaUtils.getTargetEntry( mods, ServerEntryUtils.toAttributesImpl( originalEntry ) ),
+            normName,
+            registries);
         
-        if ( AttributeUtils.containsValueCaseIgnore( targetObjectClasses, SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRY_OC ) )
+        ServerAttribute targetObjectClasses = targetEntry.get( SchemaConstants.OBJECT_CLASS_AT );
+        
+        if ( targetObjectClasses.contains( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRY_OC ) )
         {
             return;
         }

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/enumeration/ReferralHandlingEnumeration.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/enumeration/ReferralHandlingEnumeration.java?rev=615071&r1=615070&r2=615071&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/enumeration/ReferralHandlingEnumeration.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/enumeration/ReferralHandlingEnumeration.java Thu Jan 24 14:39:32 2008
@@ -31,6 +31,7 @@
 import javax.naming.directory.SearchControls;
 import javax.naming.directory.SearchResult;
 
+import org.apache.directory.server.core.entry.ServerEntryUtils;
 import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
 import org.apache.directory.server.core.partition.PartitionNexus;
 import org.apache.directory.server.core.referral.ReferralLut;
@@ -188,7 +189,7 @@
         {
             LdapDN prefetchedDn = new LdapDN( prefetched.getName() );
             prefetchedDn.normalize( normalizerMap );
-            refs = nexus.lookup( new LookupOperationContext( registries, prefetchedDn ) ).get( SchemaConstants.REF_AT );
+            refs = ServerEntryUtils.toAttributeImpl( nexus.lookup( new LookupOperationContext( registries, prefetchedDn ) ).get( SchemaConstants.REF_AT ) );
         }
 
         if ( refs == null )

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/event/Evaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/event/Evaluator.java?rev=615071&r1=615070&r2=615071&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/event/Evaluator.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/event/Evaluator.java Thu Jan 24 14:39:32 2008
@@ -21,8 +21,8 @@
 
 
 import javax.naming.NamingException;
-import javax.naming.directory.Attributes;
 
+import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.shared.ldap.filter.ExprNode;
 
 
@@ -45,5 +45,5 @@
      * @return true if the filter selects the candidate false otherwise
      * @throws javax.naming.NamingException if there is a database fault during evaluation
      */
-    boolean evaluate( ExprNode node, String dn, Attributes entry ) throws NamingException;
+    boolean evaluate( ExprNode node, String dn, ServerEntry entry ) throws NamingException;
 }

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java?rev=615071&r1=615070&r2=615071&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java Thu Jan 24 14:39:32 2008
@@ -30,7 +30,7 @@
 import java.util.Set;
 
 import org.apache.directory.server.core.DirectoryService;
-import org.apache.directory.server.core.entry.ServerEntryUtils;
+import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.interceptor.BaseInterceptor;
 import org.apache.directory.server.core.interceptor.NextInterceptor;
 import org.apache.directory.server.core.interceptor.context.AddOperationContext;
@@ -65,7 +65,6 @@
 import javax.naming.Binding;
 import javax.naming.Name;
 import javax.naming.NamingException;
-import javax.naming.directory.Attributes;
 import javax.naming.directory.SearchControls;
 import javax.naming.event.EventContext;
 import javax.naming.event.NamespaceChangeListener;
@@ -247,7 +246,7 @@
         //super.add( next, opContext );
         
     	LdapDN name = opContext.getDn();
-        Attributes entry = ServerEntryUtils.toAttributesImpl( opContext.getEntry() );
+        ServerEntry entry = opContext.getEntry();
         
         Set<EventSourceRecord> selecting = getSelectingSources( name, entry );
         
@@ -277,7 +276,7 @@
     public void delete( NextInterceptor next, DeleteOperationContext opContext ) throws NamingException
     {
     	LdapDN name = opContext.getDn();
-        Attributes entry = nexus.lookup( new LookupOperationContext( opContext.getRegistries(), name ) );
+    	ServerEntry entry = nexus.lookup( new LookupOperationContext( opContext.getRegistries(), name ) );
 
         next.delete( opContext );
         //super.delete( next, opContext );
@@ -307,9 +306,9 @@
     }
 
 
-    private void notifyOnModify( Registries registries, LdapDN name, List<ModificationItemImpl> mods, Attributes oriEntry ) throws NamingException
+    private void notifyOnModify( Registries registries, LdapDN name, List<ModificationItemImpl> mods, ServerEntry oriEntry ) throws NamingException
     {
-        Attributes entry = nexus.lookup( new LookupOperationContext( registries, name ) );
+        ServerEntry entry = nexus.lookup( new LookupOperationContext( registries, name ) );
         Set<EventSourceRecord> selecting = getSelectingSources( name, entry );
         
         if ( selecting.isEmpty() )
@@ -340,7 +339,7 @@
     {
         Invocation invocation = InvocationStack.getInstance().peek();
         PartitionNexusProxy proxy = invocation.getProxy();
-        Attributes oriEntry = proxy.lookup( new LookupOperationContext( opContext.getRegistries(), opContext.getDn() ), PartitionNexusProxy.LOOKUP_BYPASS );
+        ServerEntry oriEntry = proxy.lookup( new LookupOperationContext( opContext.getRegistries(), opContext.getDn() ), PartitionNexusProxy.LOOKUP_BYPASS );
         
         next.modify( opContext );
 
@@ -350,7 +349,7 @@
 
     private void notifyOnNameChange( Registries registries, LdapDN oldName, LdapDN newName ) throws NamingException
     {
-        Attributes entry = nexus.lookup( new LookupOperationContext( registries, newName ) );
+        ServerEntry entry = nexus.lookup( new LookupOperationContext( registries, newName ) );
         Set<EventSourceRecord> selecting = getSelectingSources( oldName, entry );
         
         if ( selecting.isEmpty() )
@@ -415,7 +414,7 @@
     }
 
 
-    Set<EventSourceRecord> getSelectingSources( LdapDN name, Attributes entry ) throws NamingException
+    Set<EventSourceRecord> getSelectingSources( LdapDN name, ServerEntry entry ) throws NamingException
     {
         if ( sources.isEmpty() )
         {

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/event/ExpressionEvaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/event/ExpressionEvaluator.java?rev=615071&r1=615070&r2=615071&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/event/ExpressionEvaluator.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/event/ExpressionEvaluator.java Thu Jan 24 14:39:32 2008
@@ -21,8 +21,8 @@
 
 
 import javax.naming.NamingException;
-import javax.naming.directory.Attributes;
 
+import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.server.schema.registries.OidRegistry;
 import org.apache.directory.shared.ldap.filter.AndNode;
@@ -94,7 +94,7 @@
     /**
      * @see Evaluator#evaluate(ExprNode, String, Attributes)
      */
-    public boolean evaluate( ExprNode node, String dn, Attributes entry ) throws NamingException
+    public boolean evaluate( ExprNode node, String dn, ServerEntry entry ) throws NamingException
     {
         if ( node.isLeaf() )
         {

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/event/LeafEvaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/event/LeafEvaluator.java?rev=615071&r1=615070&r2=615071&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/event/LeafEvaluator.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/event/LeafEvaluator.java Thu Jan 24 14:39:32 2008
@@ -22,11 +22,12 @@
 
 import java.util.Comparator;
 
-import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
-import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
 
+import org.apache.directory.server.core.entry.ServerAttribute;
+import org.apache.directory.server.core.entry.ServerEntry;
+import org.apache.directory.server.core.entry.ServerValue;
 import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.server.schema.registries.OidRegistry;
 import org.apache.directory.shared.ldap.NotImplementedException;
@@ -43,7 +44,6 @@
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.MatchingRule;
 import org.apache.directory.shared.ldap.schema.Normalizer;
-import org.apache.directory.shared.ldap.util.AttributeUtils;
 
 
 /**
@@ -105,7 +105,7 @@
     /**
      * @see Evaluator#evaluate(ExprNode, String, Attributes)
      */
-    public boolean evaluate( ExprNode node, String dn, Attributes entry ) throws NamingException
+    public boolean evaluate( ExprNode node, String dn, ServerEntry entry ) throws NamingException
     {
         if ( node instanceof ScopeNode )
         {
@@ -155,13 +155,13 @@
      * @return the ava evaluation on the perspective candidate
      * @throws javax.naming.NamingException if there is a database access failure
      */
-    private boolean evalGreaterOrLesser( SimpleNode node, Attributes entry, boolean isGreaterOrLesser ) throws NamingException
+    private boolean evalGreaterOrLesser( SimpleNode node, ServerEntry entry, boolean isGreaterOrLesser ) throws NamingException
     {
         String attrId = node.getAttribute();
 
         // get the attribute associated with the node
         AttributeType type = attributeTypeRegistry.lookup( oidRegistry.getOid( attrId ) );
-        Attribute attr = AttributeUtils.getAttribute( entry, type );
+        ServerAttribute attr = entry.get( type );
 
         // If we do not have the attribute just return false
         if ( null == attr )
@@ -176,7 +176,6 @@
         Normalizer normalizer = getNormalizer( attrId );
         Comparator comparator = getComparator( attrId );
         Object filterValue = normalizer.normalize( node.getValue() );
-        NamingEnumeration list = attr.getAll();
 
         /*
          * Cheaper to not check isGreater in one loop - better to separate
@@ -184,12 +183,12 @@
          */
         if ( isGreaterOrLesser == COMPARE_GREATER )
         {
-            while ( list.hasMore() )
+            for ( ServerValue<?> value:attr )
             {
-                Object value = normalizer.normalize( list.next() );
+                Object normValue = normalizer.normalize( value );
 
                 // Found a value that is greater than or equal to the ava value
-                if ( 0 >= comparator.compare( value, filterValue ) )
+                if ( 0 >= comparator.compare( normValue, filterValue ) )
                 {
                     return true;
                 }
@@ -197,12 +196,12 @@
         }
         else
         {
-            while ( list.hasMore() )
+            for ( ServerValue<?> value:attr )
             {
-                Object value = normalizer.normalize( list.next() );
+                Object normValue = normalizer.normalize( value );
 
                 // Found a value that is less than or equal to the ava value
-                if ( 0 <= comparator.compare( value, filterValue ) )
+                if ( 0 <= comparator.compare( normValue, filterValue ) )
                 {
                     return true;
                 }
@@ -222,15 +221,14 @@
      * @param entry the perspective candidate
      * @return the ava evaluation on the perspective candidate
      */
-    private boolean evalPresence( String attrId, Attributes entry ) throws NamingException
+    private boolean evalPresence( String attrId, ServerEntry entry ) throws NamingException
     {
         if ( entry == null )
         {
             return false;
         }
 
-        AttributeType type = attributeTypeRegistry.lookup( oidRegistry.getOid( attrId ) );
-        return null != AttributeUtils.getAttribute( entry, type );
+        return null != entry.get( attrId );
     }
 
 
@@ -243,14 +241,14 @@
      * @return the ava evaluation on the perspective candidate
      * @throws javax.naming.NamingException if there is a database access failure
      */
-    private boolean evalEquality( EqualityNode node, Attributes entry ) throws NamingException
+    private boolean evalEquality( EqualityNode node, ServerEntry entry ) throws NamingException
     {
         Normalizer normalizer = getNormalizer( node.getAttribute() );
         Comparator comparator = getComparator( node.getAttribute() );
 
         // get the attribute associated with the node
         AttributeType type = attributeTypeRegistry.lookup( node.getAttribute() );
-        Attribute attr = AttributeUtils.getAttribute( entry, type );
+        ServerAttribute attr = entry.get( node.getAttribute() );
 
         // If we do not have the attribute just return false
         if ( null == attr )
@@ -259,7 +257,14 @@
         }
 
         // check if AVA value exists in attribute
-        if ( AttributeUtils.containsValue( attr, node.getValue(), type ) )
+        if ( node.getValue() instanceof String )
+        {
+            if ( attr.contains( (String)node.getValue() ) )
+            {
+                return true;
+            }
+        }
+        else if ( attr.contains( (byte[])node.getValue() ) )
         {
             return true;
         }
@@ -268,23 +273,30 @@
         Object filterValue = normalizer.normalize( node.getValue() );
 
         // check if the normalized value is present
-        if ( AttributeUtils.containsValue( attr, filterValue, type ) )
+        if ( filterValue instanceof String)
+        {
+            if ( attr.contains( (String)filterValue ) )
+            {
+                return true;
+            }
+        }
+        else if ( attr.contains( (byte[])filterValue ) )
         {
             return true;
         }
 
+                
+
         /*
          * We need to now iterate through all values because we could not get
          * a lookup to work.  For each value we normalize and use the comparator
          * to determine if a match exists.
          */
-        NamingEnumeration list = attr.getAll();
-        
-        while ( list.hasMore() )
+        for( ServerValue<?> value:attr )
         {
-            Object value = normalizer.normalize( list.next() );
+            Object normValue = normalizer.normalize( value.get() );
 
-            if ( 0 == comparator.compare( value, filterValue ) )
+            if ( 0 == comparator.compare( normValue, filterValue ) )
             {
                 return true;
             }

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/event/ScopeEvaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/event/ScopeEvaluator.java?rev=615071&r1=615070&r2=615071&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/event/ScopeEvaluator.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/event/ScopeEvaluator.java Thu Jan 24 14:39:32 2008
@@ -22,8 +22,8 @@
 
 import javax.naming.NamingException;
 import javax.naming.directory.SearchControls;
-import javax.naming.directory.Attributes;
 
+import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.filter.ScopeNode;
 import org.apache.directory.shared.ldap.name.LdapDN;
@@ -45,7 +45,7 @@
     /**
      * @see Evaluator#evaluate(ExprNode, String, Attributes)
      */
-    public boolean evaluate( ExprNode node, String dn, Attributes record ) throws NamingException
+    public boolean evaluate( ExprNode node, String dn, ServerEntry record ) throws NamingException
     {
         ScopeNode snode = ( ScopeNode ) node;
 
@@ -53,6 +53,7 @@
         {
             case ( SearchControls.OBJECT_SCOPE  ):
                 return dn.equals( snode.getBaseDn() );
+            
             case ( SearchControls.ONELEVEL_SCOPE  ):
                 if ( dn.endsWith( snode.getBaseDn() ) )
                 {
@@ -60,8 +61,10 @@
                     LdapDN scopeDn = new LdapDN( snode.getBaseDn() );
                     return ( scopeDn.size() + 1 ) == candidateDn.size();
                 }
+            
             case ( SearchControls.SUBTREE_SCOPE  ):
                 return dn.endsWith( snode.getBaseDn() );
+            
             default:
                 throw new NamingException( "Unrecognized search scope!" );
         }

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/event/SubstringEvaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/event/SubstringEvaluator.java?rev=615071&r1=615070&r2=615071&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/event/SubstringEvaluator.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/event/SubstringEvaluator.java Thu Jan 24 14:39:32 2008
@@ -23,11 +23,12 @@
 import java.util.regex.Pattern;
 import java.util.regex.PatternSyntaxException;
 
-import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
-import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
 
+import org.apache.directory.server.core.entry.ServerAttribute;
+import org.apache.directory.server.core.entry.ServerEntry;
+import org.apache.directory.server.core.entry.ServerValue;
 import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.server.schema.registries.OidRegistry;
 import org.apache.directory.shared.ldap.filter.ExprNode;
@@ -67,7 +68,7 @@
     /**
      * @see Evaluator#evaluate(ExprNode, String, Attributes)
      */
-    public boolean evaluate( ExprNode node, String dn, Attributes entry ) throws NamingException
+    public boolean evaluate( ExprNode node, String dn, ServerEntry entry ) throws NamingException
     {
         Pattern regex = null;
         SubstringNode snode = (SubstringNode)node;
@@ -84,7 +85,7 @@
         
 
         // get the attribute
-        Attribute attr = entry.get( snode.getAttribute() );
+        ServerAttribute attr = entry.get( snode.getAttribute() );
 
         // if the attribute does not exist just return false
         if ( null == attr )
@@ -110,17 +111,15 @@
          * The test uses the comparator obtained from the appropriate 
          * substring matching rule.
          */
-        NamingEnumeration list = attr.getAll();
 
-        while ( list.hasMore() )
+        for ( ServerValue<?> value: attr )
         {
-            String value = ( String ) normalizer.normalize( list.next() );
+            String normValue = ( String ) normalizer.normalize( value );
 
             // Once match is found cleanup and return true
 
-            if ( regex.matcher( value ).matches() )
+            if ( regex.matcher( normValue ).matches() )
             {
-                list.close();
                 return true;
             }
         }

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java?rev=615071&r1=615070&r2=615071&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java Thu Jan 24 14:39:32 2008
@@ -21,7 +21,8 @@
 
 import org.apache.commons.collections.map.LRUMap;
 import org.apache.directory.server.core.DirectoryService;
-import org.apache.directory.server.core.entry.ServerEntryUtils;
+import org.apache.directory.server.core.entry.ServerAttribute;
+import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.entry.ServerValue;
 import org.apache.directory.server.core.interceptor.BaseInterceptor;
 import org.apache.directory.server.core.interceptor.NextInterceptor;
@@ -53,13 +54,11 @@
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.OidNormalizer;
-import org.apache.directory.shared.ldap.util.AttributeUtils;
 import org.apache.directory.shared.ldap.util.EmptyEnumeration;
 
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
 import javax.naming.directory.Attribute;
-import javax.naming.directory.Attributes;
 import javax.naming.directory.DirContext;
 import javax.naming.directory.SearchResult;
 
@@ -176,7 +175,7 @@
         {
         	// We don't know if the parent is an alias or not, so we will launch a 
         	// lookup, and update the cache if it's not an alias
-            Attributes attrs;
+            ServerEntry attrs;
             
             try
             {
@@ -190,9 +189,9 @@
                 throw e2;
             }
             
-            Attribute objectClass = attrs.get( SchemaConstants.OBJECT_CLASS_AT );
+            ServerAttribute objectClass = attrs.get( SchemaConstants.OBJECT_CLASS_AT );
             
-            if ( AttributeUtils.containsValueCaseIgnore( objectClass, SchemaConstants.ALIAS_OC ) )
+            if ( objectClass.contains( SchemaConstants.ALIAS_OC ) )
             {
                 String msg = "Attempt to add entry to alias '" + name.getUpName() + "' not allowed.";
                 ResultCodeEnum rc = ResultCodeEnum.ALIAS_PROBLEM;
@@ -285,11 +284,11 @@
     /**
      * Checks to see the base being searched exists, otherwise throws the appropriate LdapException.
      */
-    public Attributes lookup( NextInterceptor nextInterceptor, LookupOperationContext opContext ) throws NamingException
+    public ServerEntry lookup( NextInterceptor nextInterceptor, LookupOperationContext opContext ) throws NamingException
     {
         if ( opContext.getDn().getNormName().equals( subschemSubentryDn.getNormName() ) )
         {
-            return ServerEntryUtils.toAttributesImpl( nexus.getRootDSE( null ) );
+            return nexus.getRootDSE( null );
         }
         
         // check if entry to lookup exists
@@ -319,7 +318,7 @@
         
         assertHasEntry( nextInterceptor, msg, opContext.getDn() );
 
-        Attributes entry = nexus.lookup( new LookupOperationContext( registries, opContext.getDn() ) );
+        ServerEntry entry = nexus.lookup( new LookupOperationContext( registries, opContext.getDn() ) );
         List<ModificationItemImpl> items = opContext.getModItems();
 
         for ( ModificationItemImpl item : items )
@@ -327,7 +326,7 @@
             if ( item.getModificationOp() == DirContext.ADD_ATTRIBUTE )
             {
                 Attribute modAttr = item.getAttribute();
-                Attribute entryAttr = entry.get( modAttr.getID() );
+                ServerAttribute entryAttr = entry.get( modAttr.getID() );
 
                 if ( entryAttr != null )
                 {

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/BaseInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/BaseInterceptor.java?rev=615071&r1=615070&r2=615071&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/BaseInterceptor.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/BaseInterceptor.java Thu Jan 24 14:39:32 2008
@@ -49,7 +49,6 @@
 import javax.naming.Context;
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
-import javax.naming.directory.Attributes;
 import javax.naming.directory.SearchResult;
 import javax.naming.ldap.LdapContext;
 import java.util.Iterator;
@@ -176,7 +175,7 @@
     }
 
 
-    public Attributes lookup( NextInterceptor next, LookupOperationContext opContext ) throws NamingException
+    public ServerEntry lookup( NextInterceptor next, LookupOperationContext opContext ) throws NamingException
     {
         return next.lookup( opContext );
     }

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/Interceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/Interceptor.java?rev=615071&r1=615070&r2=615071&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/Interceptor.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/Interceptor.java Thu Jan 24 14:39:32 2008
@@ -47,7 +47,6 @@
 
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
-import javax.naming.directory.Attributes;
 import javax.naming.directory.SearchResult;
 import java.util.Iterator;
 
@@ -212,7 +211,7 @@
     /**
      * Filters {@link Partition#lookup( LookupOperationContext )} call.
      */
-    Attributes lookup( NextInterceptor next, LookupOperationContext opContext ) throws NamingException;
+    ServerEntry lookup( NextInterceptor next, LookupOperationContext opContext ) throws NamingException;
 
 
     /**

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java?rev=615071&r1=615070&r2=615071&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java Thu Jan 24 14:39:32 2008
@@ -58,7 +58,6 @@
 import javax.naming.ConfigurationException;
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
-import javax.naming.directory.Attributes;
 import javax.naming.directory.SearchResult;
 
 
@@ -157,9 +156,9 @@
         }
 
 
-        public Attributes lookup( NextInterceptor next, LookupOperationContext opContext ) throws NamingException
+        public ServerEntry lookup( NextInterceptor next, LookupOperationContext opContext ) throws NamingException
         {
-            return ( Attributes ) nexus.lookup( opContext ).clone();
+            return ( ServerEntry ) nexus.lookup( opContext ).clone();
         }
 
 
@@ -841,7 +840,7 @@
     }
 
 
-    public Attributes lookup( LookupOperationContext opContext ) throws NamingException
+    public ServerEntry lookup( LookupOperationContext opContext ) throws NamingException
     {
         Entry entry = getStartingEntry();
         Interceptor head = entry.interceptor;
@@ -1229,7 +1228,7 @@
                 }
 
 
-                public Attributes lookup( LookupOperationContext opContext ) throws NamingException
+                public ServerEntry lookup( LookupOperationContext opContext ) throws NamingException
                 {
                     Entry next = getNextEntry();
                     Interceptor interceptor = next.interceptor;

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/NextInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/NextInterceptor.java?rev=615071&r1=615070&r2=615071&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/NextInterceptor.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/NextInterceptor.java Thu Jan 24 14:39:32 2008
@@ -24,7 +24,6 @@
 
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
-import javax.naming.directory.Attributes;
 import javax.naming.directory.SearchResult;
 
 import org.apache.directory.server.core.entry.ServerEntry;
@@ -136,7 +135,7 @@
     /**
      * Calls the next interceptor's {@link Interceptor#lookup( NextInterceptor, LookupOperationContext )}.
      */
-    Attributes lookup( LookupOperationContext opContext ) throws NamingException;
+    ServerEntry lookup( LookupOperationContext opContext ) throws NamingException;
 
 
     /**

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java?rev=615071&r1=615070&r2=615071&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java Thu Jan 24 14:39:32 2008
@@ -319,12 +319,12 @@
         // execute lookup/getRootDSE operation
         opCtx = new LookupOperationContext( registries, target );
         opCtx.addRequestControls( requestControls );
-        Attributes attributes = nexusProxy.lookup( opCtx );
+        ServerEntry serverEntry = nexusProxy.lookup( opCtx );
 
         // clear the request controls and set the response controls 
         requestControls = EMPTY_CONTROLS;
         responseControls = opCtx.getResponseControls();
-        return attributes;
+        return ServerEntryUtils.toAttributesImpl( serverEntry );
     }
     
     
@@ -339,13 +339,25 @@
         // execute lookup/getRootDSE operation
         opCtx = new LookupOperationContext( registries, target, attrIds );
         opCtx.addRequestControls( requestControls );
-        Attributes attributes = nexusProxy.lookup( opCtx );
+        ServerEntry serverEntry = nexusProxy.lookup( opCtx );
 
         // clear the request controls and set the response controls 
         requestControls = EMPTY_CONTROLS;
         responseControls = opCtx.getResponseControls();
         
-        return attributes;
+        
+        Attributes result = ServerEntryUtils.toAttributesImpl( serverEntry );
+
+        // Now remove the ObjectClass attribute if it has not been requested
+        if ( ( opCtx.getAttrsId() != null ) && ( opCtx.getAttrsId().size() != 0 ) )
+        {
+            if ( serverEntry.get( SchemaConstants.OBJECT_CLASS_AT ).size() == 0 )
+            {
+                result.remove( SchemaConstants.OBJECT_CLASS_AT );
+            }
+        }
+        
+        return result;
     }
     
     

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java?rev=615071&r1=615070&r2=615071&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java Thu Jan 24 14:39:32 2008
@@ -21,6 +21,7 @@
 
 
 import org.apache.directory.server.core.DirectoryService;
+import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.interceptor.BaseInterceptor;
 import org.apache.directory.server.core.interceptor.NextInterceptor;
 import org.apache.directory.server.core.interceptor.context.AddContextPartitionOperationContext;
@@ -53,7 +54,6 @@
 
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
-import javax.naming.directory.Attributes;
 import javax.naming.directory.SearchResult;
 import java.util.Map;
 
@@ -78,6 +78,9 @@
 
     /** The association between attributeTypes and their normalizers */
     private Map<String, OidNormalizer> attrNormalizers; 
+    
+    /** The globa attributeType registry */
+    private AttributeTypeRegistry attributeRegistry;
 
     /**
      * Initialize the registries, normalizers. 
@@ -85,7 +88,7 @@
     public void init( DirectoryService directoryService ) throws NamingException
     {
         OidRegistry oidRegistry = directoryService.getRegistries().getOidRegistry();
-        AttributeTypeRegistry attributeRegistry = directoryService.getRegistries().getAttributeTypeRegistry();
+        attributeRegistry = directoryService.getRegistries().getAttributeTypeRegistry();
         NameComponentNormalizer ncn = new ConcreteNameComponentNormalizer( attributeRegistry, oidRegistry );
         normVisitor = new NormalizingVisitor( ncn, oidRegistry );
         //expVisitor = new ExpandingVisitor( attributeRegistry );
@@ -190,10 +193,36 @@
         return nextInterceptor.list( opContext );
     }
 
+    
+    private String[] normalizeAttrsId( String[] attrIds ) throws NamingException
+    {
+        if ( attrIds == null )
+        {
+            return attrIds;
+        }
+        
+        String[] normalizedAttrIds = new String[attrIds.length];
+        int pos = 0;
+        
+        for ( String id:attrIds )
+        {
+            String oid = attributeRegistry.lookup( id ).getOid();
+            normalizedAttrIds[pos++] = oid;
+        }
+        
+        return normalizedAttrIds;
+    }
 
-    public Attributes lookup( NextInterceptor nextInterceptor, LookupOperationContext opContext ) throws NamingException
+    public ServerEntry lookup( NextInterceptor nextInterceptor, LookupOperationContext opContext ) throws NamingException
     {
         opContext.getDn().normalize( attrNormalizers );
+        
+        if ( opContext.getAttrsId() != null )
+        {
+            // We have to normalize the requested IDs
+            opContext.setAttrsId( normalizeAttrsId( opContext.getAttrsIdArray() ) );
+        }
+        
         return nextInterceptor.lookup( opContext );
     }
 

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java?rev=615071&r1=615070&r2=615071&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java Thu Jan 24 14:39:32 2008
@@ -27,7 +27,9 @@
 
 import org.apache.directory.server.constants.ApacheSchemaConstants;
 import org.apache.directory.server.core.DirectoryService;
+import org.apache.directory.server.core.entry.ServerAttribute;
 import org.apache.directory.server.core.entry.ServerEntry;
+import org.apache.directory.server.core.entry.ServerEntryUtils;
 import org.apache.directory.server.core.entry.ServerValue;
 import org.apache.directory.server.core.enumeration.SearchResultFilter;
 import org.apache.directory.server.core.enumeration.SearchResultFilteringEnumeration;
@@ -44,6 +46,7 @@
 import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
 import org.apache.directory.server.core.invocation.Invocation;
 import org.apache.directory.server.core.invocation.InvocationStack;
+import org.apache.directory.server.core.jndi.ServerLdapContext;
 import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.server.schema.registries.Registries;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
@@ -55,7 +58,6 @@
 import org.apache.directory.shared.ldap.name.Rdn;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.UsageEnum;
-import org.apache.directory.shared.ldap.util.AttributeUtils;
 import org.apache.directory.shared.ldap.util.DateUtils;
 
 import javax.naming.NamingEnumeration;
@@ -85,8 +87,21 @@
         public boolean accept( Invocation invocation, SearchResult result, SearchControls controls ) 
             throws NamingException
         {
-            return controls.getReturningAttributes() == null || filterDenormalized( result.getAttributes() );
-
+            ServerEntry serverEntry = ServerEntryUtils.toServerEntry( 
+                result.getAttributes(), 
+                new LdapDN( result.getName() ), 
+                ((ServerLdapContext)invocation.getCaller()).getService().getRegistries() );
+            
+            if ( controls.getReturningAttributes() == null )
+            {
+                return true;
+            }
+            
+            boolean denormalized = filterDenormalized( serverEntry );
+            
+            result.setAttributes( ServerEntryUtils.toAttributesImpl( serverEntry ) );
+            
+            return denormalized;
         }
     };
 
@@ -98,8 +113,12 @@
         public boolean accept( Invocation invocation, SearchResult result, SearchControls controls )
             throws NamingException
         {
-            return controls.getReturningAttributes() != null || filter( result.getAttributes() );
-
+            ServerEntry serverEntry = ServerEntryUtils.toServerEntry( 
+                result.getAttributes(), 
+                new LdapDN( result.getName() ), 
+                ((ServerLdapContext)invocation.getCaller()).getService().getRegistries() );
+            
+            return controls.getReturningAttributes() != null || filterOperationalAttributes( serverEntry );
         }
     };
 
@@ -271,9 +290,9 @@
     }
 
 
-    public Attributes lookup( NextInterceptor nextInterceptor, LookupOperationContext opContext ) throws NamingException
+    public ServerEntry lookup( NextInterceptor nextInterceptor, LookupOperationContext opContext ) throws NamingException
     {
-        Attributes result = nextInterceptor.lookup( opContext );
+        ServerEntry result = nextInterceptor.lookup( opContext );
         
         if ( result == null )
         {
@@ -282,7 +301,7 @@
 
         if ( opContext.getAttrsId() == null )
         {
-            filter( result );
+            filterOperationalAttributes( result );
         }
         else
         {
@@ -330,32 +349,30 @@
      * @return true always
      * @throws NamingException if there are failures in evaluation
      */
-    private boolean filter( Attributes attributes ) throws NamingException
+    private boolean filterOperationalAttributes( ServerEntry attributes ) throws NamingException
     {
-        NamingEnumeration<String> list = attributes.getIDs();
+        Set<AttributeType> removedAttributes = new HashSet<AttributeType>();
 
-        while ( list.hasMore() )
+        // Build a list of attributeType to remove
+        for ( AttributeType attributeType:attributes.getAttributeTypes() )
         {
-            String attrId =  list.next();
-
-            AttributeType type = null;
-
-            if ( atRegistry.hasAttributeType( attrId ) )
-            {
-                type = atRegistry.lookup( attrId );
-            }
-
-            if ( type != null && type.getUsage() != UsageEnum.USER_APPLICATIONS )
+            if ( attributeType.getUsage() != UsageEnum.USER_APPLICATIONS )
             {
-                attributes.remove( attrId );
+                removedAttributes.add( attributeType );
             }
         }
         
+        // Now remove the attributes which are not USERs
+        for ( AttributeType attributeType:removedAttributes )
+        {
+            attributes.remove( attributeType );
+        }
+        
         return true;
     }
 
 
-    private void filter( LookupOperationContext lookupContext, Attributes entry ) throws NamingException
+    private void filter( LookupOperationContext lookupContext, ServerEntry entry ) throws NamingException
     {
         LdapDN dn = lookupContext.getDn();
         List<String> ids = lookupContext.getAttrsId();
@@ -363,28 +380,19 @@
         // still need to protect against returning op attrs when ids is null
         if ( ids == null )
         {
-            filter( entry );
+            filterOperationalAttributes( entry );
             return;
         }
 
+        Set<AttributeType> attributeTypes = entry.getAttributeTypes();
+
         if ( dn.size() == 0 )
         {
-            Set<String> idsSet = new HashSet<String>( ids.size() );
-
-            for ( String id:ids  )
-            {
-                idsSet.add( id.toLowerCase() );
-            }
-
-            NamingEnumeration<String> list = entry.getIDs();
-
-            while ( list.hasMore() )
+            for ( AttributeType attributeType:attributeTypes )
             {
-                String attrId = list.nextElement().toLowerCase();
-
-                if ( !idsSet.contains( attrId ) )
+                if ( !ids.contains( attributeType.getOid() ) )
                 {
-                    entry.remove( attrId );
+                    entry.remove( attributeType );
                 }
             }
         }
@@ -397,38 +405,35 @@
     }
 
     
-    public void denormalizeEntryOpAttrs( Attributes entry ) throws NamingException
+    public void denormalizeEntryOpAttrs( ServerEntry entry ) throws NamingException
     {
         if ( service.isDenormalizeOpAttrsEnabled() )
         {
-            AttributeType type = atRegistry.lookup( SchemaConstants.CREATORS_NAME_AT );
-            Attribute attr = AttributeUtils.getAttribute( entry, type );
+            ServerAttribute attr = entry.get( SchemaConstants.CREATORS_NAME_AT );
 
             if ( attr != null )
             {
-                LdapDN creatorsName = new LdapDN( ( String ) attr.get() );
+                LdapDN creatorsName = new LdapDN( attr.getString() );
                 
                 attr.clear();
                 attr.add( denormalizeTypes( creatorsName ).getUpName() );
             }
             
-            type = atRegistry.lookup( SchemaConstants.MODIFIERS_NAME_AT );
-            attr = AttributeUtils.getAttribute( entry, type );
+            attr = entry.get( SchemaConstants.MODIFIERS_NAME_AT );
             
             if ( attr != null )
             {
-                LdapDN modifiersName = new LdapDN( ( String ) attr.get() );
+                LdapDN modifiersName = new LdapDN( attr.getString() );
 
                 attr.clear();
                 attr.add( denormalizeTypes( modifiersName ).getUpName() );
             }
 
-            type = atRegistry.lookup( ApacheSchemaConstants.SCHEMA_MODIFIERS_NAME_AT );
-            attr = AttributeUtils.getAttribute( entry, type );
+            attr = entry.get( ApacheSchemaConstants.SCHEMA_MODIFIERS_NAME_AT );
             
             if ( attr != null )
             {
-                LdapDN modifiersName = new LdapDN( ( String ) attr.get() );
+                LdapDN modifiersName = new LdapDN( attr.getString() );
 
                 attr.clear();
                 attr.add( denormalizeTypes( modifiersName ).getUpName() );
@@ -487,7 +492,7 @@
     }
 
 
-    private boolean filterDenormalized( Attributes entry ) throws NamingException
+    private boolean filterDenormalized( ServerEntry entry ) throws NamingException
     {
         denormalizeEntryOpAttrs( entry );
         return true;

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/AbstractPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/AbstractPartition.java?rev=615071&r1=615070&r2=615071&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/AbstractPartition.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/AbstractPartition.java Thu Jan 24 14:39:32 2008
@@ -21,12 +21,12 @@
 
 
 import org.apache.directory.server.core.DirectoryService;
+import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.interceptor.context.EntryOperationContext;
 import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
 
 import javax.naming.NameNotFoundException;
 import javax.naming.NamingException;
-import javax.naming.directory.Attributes;
 
 
 /**
@@ -166,7 +166,7 @@
      * with null <tt>attributeIds</tt> by default.  Please override
      * this method if there is more effective way for your implementation.
      */
-    public Attributes lookup( LookupOperationContext lookupContext ) throws NamingException
+    public ServerEntry lookup( LookupOperationContext lookupContext ) throws NamingException
     {
         return null;
     }

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java?rev=615071&r1=615070&r2=615071&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java Thu Jan 24 14:39:32 2008
@@ -27,6 +27,7 @@
 import org.apache.directory.server.core.entry.ServerAttribute;
 import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.entry.ServerEntryUtils;
+import org.apache.directory.server.core.entry.ServerValue;
 import org.apache.directory.server.core.interceptor.context.AddContextPartitionOperationContext;
 import org.apache.directory.server.core.interceptor.context.AddOperationContext;
 import org.apache.directory.server.core.interceptor.context.BindOperationContext;
@@ -87,7 +88,6 @@
 import javax.naming.NameNotFoundException;
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
-import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
 import javax.naming.directory.SearchControls;
 import javax.naming.directory.SearchResult;
@@ -584,7 +584,7 @@
 
         AttributeType attrType = registry.lookup( compareContext.getOid() );
         
-        Attribute attr = partition.lookup( new LookupOperationContext( registries, compareContext.getDn() ) ).get( attrType.getName() );
+        ServerAttribute attr = partition.lookup( new LookupOperationContext( registries, compareContext.getDn() ) ).get( attrType.getName() );
 
         // complain if the attribute being compared does not exist in the entry
         if ( attr == null )
@@ -593,8 +593,14 @@
         }
 
         // see first if simple match without normalization succeeds
-        // TODO Fix DIRSERVER-832
-        if ( attr.contains( compareContext.getValue() ) )
+        if ( compareContext.getValue() instanceof String )
+        {
+            if ( attr.contains( (String)compareContext.getValue()  ) )
+            {
+                return true;
+            }
+        }
+        else if ( attr.contains( (byte[])compareContext.getValue()  ) )
         {
             return true;
         }
@@ -609,9 +615,9 @@
         Normalizer normalizer = attrType.getEquality().getNormalizer();
         Object reqVal = normalizer.normalize( compareContext.getValue() );
 
-        for ( int ii = 0; ii < attr.size(); ii++ )
+        for ( ServerValue<?> value:attr )
         {
-            Object attrValObj = normalizer.normalize( attr.get( ii ) );
+            Object attrValObj = normalizer.normalize( value.get() );
             
             if ( attrValObj instanceof String )
             {
@@ -1014,7 +1020,7 @@
     }
 
 
-    public Attributes lookup( LookupOperationContext opContext ) throws NamingException
+    public ServerEntry lookup( LookupOperationContext opContext ) throws NamingException
     {
         LdapDN dn = opContext.getDn();
         
@@ -1027,11 +1033,11 @@
             {
                 for ( AttributeType attributeType:attributeTypes )
                 {
-                    String id = attributeType.getName();
+                    String oid = attributeType.getOid();
                     
-                    if ( opContext.getAttrsId().contains( id ) )
+                    if ( opContext.getAttrsId().contains( oid ) )
                     {
-                        ServerAttribute attr = rootDSE.get( id );
+                        ServerAttribute attr = rootDSE.get( oid );
                         retval.put( (ServerAttribute)attr.clone() );
                     }
                     
@@ -1048,7 +1054,7 @@
                 }
             }
             
-            return ServerEntryUtils.toAttributesImpl( retval );
+            return retval;
         }
 
         Partition backend = getPartition( dn );

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/Partition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/Partition.java?rev=615071&r1=615070&r2=615071&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/Partition.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/Partition.java Thu Jan 24 14:39:32 2008
@@ -281,7 +281,7 @@
      * @return an Attributes object representing the entry
      * @throws NamingException if there are any problems
      */
-    Attributes lookup( LookupOperationContext lookupContext ) throws NamingException;
+    ServerEntry lookup( LookupOperationContext lookupContext ) throws NamingException;
 
     /**
      * Fast operation to check and see if a particular entry exists.

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexusProxy.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexusProxy.java?rev=615071&r1=615070&r2=615071&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexusProxy.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexusProxy.java Thu Jan 24 14:39:32 2008
@@ -44,7 +44,6 @@
 import org.apache.directory.server.core.authz.AciAuthorizationInterceptor;
 import org.apache.directory.server.core.authz.DefaultAuthorizationInterceptor;
 import org.apache.directory.server.core.entry.ServerEntry;
-import org.apache.directory.server.core.entry.ServerEntryUtils;
 import org.apache.directory.server.core.enumeration.SearchResultFilter;
 import org.apache.directory.server.core.enumeration.SearchResultFilteringEnumeration;
 import org.apache.directory.server.core.event.EventInterceptor;
@@ -573,7 +572,7 @@
     }
 
 
-    public Attributes lookup( LookupOperationContext opContext ) throws NamingException
+    public ServerEntry lookup( LookupOperationContext opContext ) throws NamingException
     {
         if ( opContext.getDn().size() == 0 )
         {
@@ -585,11 +584,11 @@
                 {
                     if ( ROOT_DSE_NO_OPERATIONNAL == null )
                     {
-                        ROOT_DSE_NO_OPERATIONNAL = ServerEntryUtils.toServerEntry( lookup( opContext, null ), opContext.getDn(), opContext.getRegistries() );
+                        ROOT_DSE_NO_OPERATIONNAL = lookup( opContext, null );
                     }
                 }
 
-                return ServerEntryUtils.toAttributesImpl( ROOT_DSE_NO_OPERATIONNAL );
+                return ROOT_DSE_NO_OPERATIONNAL;
             } 
             else if ( ( attrs.size() == 1 ) && ( attrs.contains( SchemaConstants.ALL_OPERATIONAL_ATTRIBUTES ) ) )
             {
@@ -597,11 +596,11 @@
                 {
                     if ( ROOT_DSE_ALL == null )
                     {
-                        ROOT_DSE_ALL = ServerEntryUtils.toServerEntry( lookup( opContext, null ), opContext.getDn(), opContext.getRegistries() );
+                        ROOT_DSE_ALL = lookup( opContext, null );
                     }
                 }
 
-                return ServerEntryUtils.toAttributesImpl( ROOT_DSE_ALL );
+                return ROOT_DSE_ALL;
             }
 
         }
@@ -610,7 +609,7 @@
     }
 
 
-    public Attributes lookup( LookupOperationContext opContext, Collection<String> bypass ) throws NamingException
+    public ServerEntry lookup( LookupOperationContext opContext, Collection<String> bypass ) throws NamingException
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java?rev=615071&r1=615070&r2=615071&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java Thu Jan 24 14:39:32 2008
@@ -20,7 +20,10 @@
 package org.apache.directory.server.core.partition.impl.btree;
 
 
+import org.apache.directory.server.core.entry.DefaultServerEntry;
+import org.apache.directory.server.core.entry.ServerAttribute;
 import org.apache.directory.server.core.entry.ServerEntry;
+import org.apache.directory.server.core.entry.ServerEntryUtils;
 import org.apache.directory.server.core.enumeration.SearchResultEnumeration;
 import org.apache.directory.server.core.interceptor.context.AddOperationContext;
 import org.apache.directory.server.core.interceptor.context.DeleteOperationContext;
@@ -45,7 +48,6 @@
 
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
-import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
 import javax.naming.directory.SearchControls;
 import javax.naming.directory.SearchResult;
@@ -327,20 +329,23 @@
     }
 
 
-    public Attributes lookup( LookupOperationContext opContext ) throws NamingException
+    public ServerEntry lookup( LookupOperationContext opContext ) throws NamingException
     {
-        Attributes entry = lookup( getEntryId( opContext.getDn().getNormName() ) );
+        ServerEntry entry = ServerEntryUtils.toServerEntry( 
+            lookup( getEntryId( opContext.getDn().getNormName() ) ),
+                opContext.getDn(),
+                opContext.getRegistries() );
 
         if ( ( opContext.getAttrsId() == null ) || ( opContext.getAttrsId().size() == 0 ) )
         {
             return entry;
         }
 
-        Attributes retval = new AttributesImpl();
+        ServerEntry retval = new DefaultServerEntry( opContext.getRegistries(), opContext.getDn() );
 
         for ( String attrId:opContext.getAttrsId() )
         {
-            Attribute attr = entry.get( attrId );
+            ServerAttribute attr = entry.get( attrId );
 
             if ( attr != null )
             {

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/EntryNode.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/EntryNode.java?rev=615071&r1=615070&r2=615071&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/EntryNode.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/EntryNode.java Thu Jan 24 14:39:32 2008
@@ -198,7 +198,6 @@
         }
         catch ( NamingException e )
         {
-            e.printStackTrace();
             buf.append( "ERROR: " + e.getMessage() );
         }
 

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/tree/BranchNode.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/tree/BranchNode.java?rev=615071&r1=615070&r2=615071&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/tree/BranchNode.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/tree/BranchNode.java Thu Jan 24 14:39:32 2008
@@ -23,8 +23,12 @@
 import java.util.HashMap;
 import java.util.Map;
 
+import javax.naming.NamingException;
+
 import org.apache.directory.server.core.partition.Partition;
 import org.apache.directory.shared.ldap.name.LdapDN;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 /**
@@ -38,6 +42,8 @@
  */
 public class BranchNode implements Node
 {
+    private static final Logger LOG = LoggerFactory.getLogger( BranchNode.class );
+
     /** Stores the list of all the descendant partitions and containers */
     private Map<String, Node> children;
     
@@ -71,7 +77,7 @@
      * @param partition The associated partition to add as a tree node
      * @return The modified tree structure.
      */
-    public BranchNode recursivelyAddPartition( BranchNode current, LdapDN dn, int index, Partition partition )
+    public BranchNode recursivelyAddPartition( BranchNode current, LdapDN dn, int index, Partition partition ) throws NamingException
     {
         String rdnAtIndex = dn.getRdn( index ).toString();
         
@@ -81,7 +87,21 @@
         }
         else
         {
-            Node child = recursivelyAddPartition( new BranchNode(), dn, index + 1, partition );
+            Node newNode = current.getChild( rdnAtIndex );
+            
+            if ( newNode instanceof LeafNode )
+            {
+                String message = "Overlapping partitions are not allowed";
+                LOG.error( message );
+                throw new NamingException( message );
+            }
+        
+            if ( newNode == null )
+            {
+                newNode = new BranchNode();
+            }
+
+            Node child = recursivelyAddPartition( (BranchNode)newNode, dn, index + 1, partition );
             return current.addNode( rdnAtIndex, child );
         }
     }
@@ -137,7 +157,7 @@
     public String toString()
     {
         StringBuilder sb = new StringBuilder();
-        sb.append( " { " );
+        sb.append( "{" );
         boolean isFirst = true;
         
         for ( Node child:children.values() )
@@ -153,7 +173,7 @@
 
             if ( child instanceof BranchNode )
             {
-                sb.append( "Branch:").append( child.toString() );
+                sb.append( "Branch: ").append( child.toString() );
             }
             else
             {
@@ -161,7 +181,7 @@
             }
         }
 
-        sb.append( " } " );
+        sb.append( "}" );
         return sb.toString();
     }
 }

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/tree/LeafNode.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/tree/LeafNode.java?rev=615071&r1=615070&r2=615071&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/tree/LeafNode.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/tree/LeafNode.java Thu Jan 24 14:39:32 2008
@@ -20,8 +20,6 @@
 package org.apache.directory.server.core.partition.tree;
 
 
-import javax.naming.NamingException;
-
 import org.apache.directory.server.core.partition.Partition;
 
 
@@ -70,13 +68,6 @@
      */
     public String toString()
     {
-        try
-        {
-            return partition.getSuffixDn().getUpName();
-        }
-        catch ( NamingException ne )
-        {
-            return "Unkown partition";
-        }
+        return partition.getSuffix();
     }
 }

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java?rev=615071&r1=615070&r2=615071&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java Thu Jan 24 14:39:32 2008
@@ -33,7 +33,6 @@
 import org.apache.directory.server.core.authz.DefaultAuthorizationInterceptor;
 import org.apache.directory.server.core.entry.ServerAttribute;
 import org.apache.directory.server.core.entry.ServerEntry;
-import org.apache.directory.server.core.entry.ServerEntryUtils;
 import org.apache.directory.server.core.entry.ServerStringValue;
 import org.apache.directory.server.core.entry.ServerValue;
 import org.apache.directory.server.core.enumeration.ReferralHandlingEnumeration;
@@ -88,7 +87,6 @@
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
 import javax.naming.directory.Attribute;
-import javax.naming.directory.Attributes;
 import javax.naming.directory.DirContext;
 import javax.naming.directory.ModificationItem;
 import javax.naming.directory.SearchControls;
@@ -409,11 +407,9 @@
                 return;
             }
 
-            ServerEntry referral = ServerEntryUtils.toServerEntry( 
-                invocation.getProxy().lookup( 
+            ServerEntry referral = invocation.getProxy().lookup( 
                     new LookupOperationContext( registries, farthest ), 
-                    PartitionNexusProxy.LOOKUP_BYPASS ),
-                farthest, registries );
+                    PartitionNexusProxy.LOOKUP_BYPASS );
             
             AttributeType refsType = atRegistry.lookup( oidRegistry.getOid( SchemaConstants.REF_AT ) );
             ServerAttribute refs = referral.get( refsType );
@@ -454,11 +450,10 @@
                 return next.compare( opContext );
             }
 
-            ServerEntry referral = ServerEntryUtils.toServerEntry( 
-                invocation.getProxy().lookup( 
+            ServerEntry referral = invocation.getProxy().lookup( 
                     new LookupOperationContext( registries, farthest ), 
-                    PartitionNexusProxy.LOOKUP_BYPASS ),
-                farthest, registries );
+                    PartitionNexusProxy.LOOKUP_BYPASS );
+            
             ServerAttribute refs = referral.get( SchemaConstants.REF_AT );
             doReferralException( farthest, new LdapDN( name.getUpName() ), refs );
 
@@ -513,11 +508,10 @@
                 return;
             }
 
-            ServerEntry referral = ServerEntryUtils.toServerEntry( 
-                invocation.getProxy().lookup( 
+            ServerEntry referral = invocation.getProxy().lookup( 
                     new LookupOperationContext( registries, farthest ), 
-                    PartitionNexusProxy.LOOKUP_BYPASS ),
-                farthest, registries );
+                    PartitionNexusProxy.LOOKUP_BYPASS );
+            
             ServerAttribute refs = referral.get( SchemaConstants.REF_AT );
             doReferralException( farthest, new LdapDN( name.getUpName() ), refs );
             
@@ -590,11 +584,10 @@
             }
             else if ( farthestSrc != null )
             {
-                ServerEntry referral = ServerEntryUtils.toServerEntry( 
-                    invocation.getProxy().lookup( 
+                ServerEntry referral = invocation.getProxy().lookup( 
                         new LookupOperationContext( registries, farthestSrc ), 
-                        PartitionNexusProxy.LOOKUP_BYPASS ),
-                    farthestSrc, registries );
+                        PartitionNexusProxy.LOOKUP_BYPASS );
+                
                 ServerAttribute refs = referral.get( SchemaConstants.REF_AT );
                 doReferralException( farthestSrc, new LdapDN( oldName.getUpName() ), refs );
             }
@@ -665,11 +658,10 @@
             }
             else if ( farthestSrc != null )
             {
-                ServerEntry referral = ServerEntryUtils.toServerEntry( 
-                    invocation.getProxy().lookup( 
+                ServerEntry referral = invocation.getProxy().lookup( 
                         new LookupOperationContext( registries, farthestSrc ), 
-                        PartitionNexusProxy.LOOKUP_BYPASS ),
-                    farthestSrc, registries );
+                        PartitionNexusProxy.LOOKUP_BYPASS );
+                
                 ServerAttribute refs = referral.get( SchemaConstants.REF_AT );
                 doReferralException( farthestSrc, new LdapDN( oldName.getUpName() ), refs );
                 
@@ -746,11 +738,10 @@
             
             if ( farthestSrc != null )
             {
-                ServerEntry referral = ServerEntryUtils.toServerEntry( 
-                    invocation.getProxy().lookup( 
+                ServerEntry referral = invocation.getProxy().lookup( 
                         new LookupOperationContext( registries, farthestSrc ), 
-                        PartitionNexusProxy.LOOKUP_BYPASS ),
-                    farthestSrc, registries );
+                        PartitionNexusProxy.LOOKUP_BYPASS );
+                
                 ServerAttribute refs = referral.get( SchemaConstants.REF_AT );
                 doReferralException( farthestSrc, new LdapDN( oldName.getUpName() ), refs );
                 
@@ -879,11 +870,10 @@
                 return;
             }
 
-            ServerEntry referral = ServerEntryUtils.toServerEntry( 
-                invocation.getProxy().lookup( 
+            ServerEntry referral = invocation.getProxy().lookup( 
                     new LookupOperationContext( registries, farthest ), 
-                    PartitionNexusProxy.LOOKUP_BYPASS ),
-                    farthest, registries );
+                    PartitionNexusProxy.LOOKUP_BYPASS );
+            
             ServerAttribute refs = referral.get( SchemaConstants.REF_AT );
             doReferralException( farthest, new LdapDN( name.getUpName() ), refs );
         }
@@ -1009,8 +999,8 @@
         {
             if ( lut.isReferral( base ) )
             {
-                Attributes referral = invocation.getProxy().lookup( new LookupOperationContext( registries, base ), PartitionNexusProxy.LOOKUP_BYPASS );
-                Attribute refs = referral.get( SchemaConstants.REF_AT );
+                ServerEntry referral = invocation.getProxy().lookup( new LookupOperationContext( registries, base ), PartitionNexusProxy.LOOKUP_BYPASS );
+                ServerAttribute refs = referral.get( SchemaConstants.REF_AT );
                 doReferralExceptionOnSearchBase( base, refs, controls.getSearchScope() );
             }
 
@@ -1021,8 +1011,8 @@
                 return next.search( opContext );
             }
 
-            Attributes referral = invocation.getProxy().lookup( new LookupOperationContext( registries, farthest ), PartitionNexusProxy.LOOKUP_BYPASS );
-            Attribute refs = referral.get( SchemaConstants.REF_AT );
+            ServerEntry referral = invocation.getProxy().lookup( new LookupOperationContext( registries, farthest ), PartitionNexusProxy.LOOKUP_BYPASS );
+            ServerAttribute refs = referral.get( SchemaConstants.REF_AT );
             doReferralExceptionOnSearchBase( farthest, new LdapDN( base.getUpName() ), refs, controls.getSearchScope() );
             throw new IllegalStateException( "Should never get here: shutting up compiler" );
         }
@@ -1031,8 +1021,8 @@
         {
             if ( lut.isReferral( base ) )
             {
-                Attributes referral = invocation.getProxy().lookup( new LookupOperationContext( registries, base ), PartitionNexusProxy.LOOKUP_BYPASS );
-                Attribute refs = referral.get( SchemaConstants.REF_AT );
+                ServerEntry referral = invocation.getProxy().lookup( new LookupOperationContext( registries, base ), PartitionNexusProxy.LOOKUP_BYPASS );
+                ServerAttribute refs = referral.get( SchemaConstants.REF_AT );
                 doReferralExceptionOnSearchBase( base, refs, controls.getSearchScope() );
             }
 
@@ -1045,8 +1035,8 @@
                 return new ReferralHandlingEnumeration( srfe, lut, opContext.getRegistries(), nexus, controls.getSearchScope(), true );
             }
 
-            Attributes referral = invocation.getProxy().lookup( new LookupOperationContext( registries, farthest ), PartitionNexusProxy.LOOKUP_BYPASS );
-            Attribute refs = referral.get( SchemaConstants.REF_AT );
+            ServerEntry referral = invocation.getProxy().lookup( new LookupOperationContext( registries, farthest ), PartitionNexusProxy.LOOKUP_BYPASS );
+            ServerAttribute refs = referral.get( SchemaConstants.REF_AT );
             doReferralExceptionOnSearchBase( farthest, new LdapDN( base.getUpName() ), refs, controls.getSearchScope() );
             throw new IllegalStateException( "Should never get here: shutting up compiler" );
         }
@@ -1071,14 +1061,14 @@
     }
 
 
-    public void doReferralExceptionOnSearchBase( LdapDN base, Attribute refs, int scope ) throws NamingException
+    public void doReferralExceptionOnSearchBase( LdapDN base, ServerAttribute refs, int scope ) throws NamingException
     {
         // handle referral here
         List<String> list = new ArrayList<String>( refs.size() );
         
-        for ( int ii = 0; ii < refs.size(); ii++ )
+        for ( ServerValue<?> value:refs )
         {
-            String val = ( String ) refs.get( ii );
+            String val = ( String ) value.get();
 
             // need to add non-ldap URLs as-is
             if ( !val.startsWith( "ldap" ) )
@@ -1137,15 +1127,15 @@
     }
 
 
-    public void doReferralExceptionOnSearchBase( LdapDN farthest, LdapDN targetUpdn, Attribute refs, int scope )
+    public void doReferralExceptionOnSearchBase( LdapDN farthest, LdapDN targetUpdn, ServerAttribute refs, int scope )
         throws NamingException
     {
         // handle referral here
         List<String> list = new ArrayList<String>( refs.size() );
         
-        for ( int ii = 0; ii < refs.size(); ii++ )
+        for ( ServerValue<?> value:refs )
         {
-            String val = ( String ) refs.get( ii );
+            String val = ( String ) value.get();
 
             // need to add non-ldap URLs as-is
             if ( !val.startsWith( "ldap" ) )

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java?rev=615071&r1=615070&r2=615071&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java Thu Jan 24 14:39:32 2008
@@ -783,10 +783,7 @@
     
     private ServerEntry lookupPartition( LdapDN dn ) throws NamingException
     {
-        return ServerEntryUtils.toServerEntry( 
-            partition.lookup( 
-                new LookupOperationContext( registries, dn ) ), 
-            dn, registries );
+        return partition.lookup( new LookupOperationContext( registries, dn ) );
     }
     
     private void loadComparators( Schema schema, Registries targetRegistries ) throws NamingException



Mime
View raw message