directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r612866 [2/2] - in /directory: apacheds/branches/bigbang/core-entry/src/main/java/org/apache/directory/server/core/entry/ apacheds/branches/bigbang/core-entry/src/test/java/org/apache/directory/server/core/entry/ apacheds/branches/bigbang/c...
Date Thu, 17 Jan 2008 16:57:49 GMT
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=612866&r1=612865&r2=612866&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 17 08:57:36 2008
@@ -209,11 +209,9 @@
             ServerAttribute names = entry.get( mNameAT );
             targetRegistries.getOidRegistry().register( oid, oid );
             
-            Iterator<ServerValue<?>> namesValues = names.getAll();
-            
-            while ( namesValues.hasNext() )
+            for ( ServerValue<?> value:names )
             {
-                targetRegistries.getOidRegistry().register( ( String ) namesValues.next().get( ), oid );
+                targetRegistries.getOidRegistry().register( ( String ) value.get(), oid );
             }
         }
         

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/SchemaEntityFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/SchemaEntityFactory.java?rev=612866&r1=612865&r2=612866&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/SchemaEntityFactory.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/SchemaEntityFactory.java Thu Jan 17 08:57:36 2008
@@ -24,7 +24,6 @@
 import java.util.ArrayList;
 import java.util.Comparator;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
 
@@ -127,11 +126,9 @@
             Set<String> depsSet = new HashSet<String>();
             ServerAttribute depsAttr = entry.get( MetaSchemaConstants.M_DEPENDENCIES_AT );
             
-            Iterator<ServerValue<?>> values = depsAttr.getAll();
-            
-            while ( values.hasNext() )
+            for ( ServerValue<?> value:depsAttr )
             {
-                depsSet.add( (String)values.next().get() );
+                depsSet.add( (String)value.get() );
             }
 
             dependencies = depsSet.toArray( EMPTY );
@@ -590,12 +587,11 @@
         
         String[] strings = new String[attr.size()];
         
-        Iterator<ServerValue<?>> values = attr.getAll();
         int pos = 0;
         
-        while ( values.hasNext() )
+        for ( ServerValue<?> value:attr )
         {
-            strings[pos++] = (String)values.next().get();
+            strings[pos++] = (String)value.get();
         }
         
         return strings;
@@ -717,11 +713,9 @@
         {
             List<String> values = new ArrayList<String>();
             
-            Iterator<ServerValue<?>> namesValues = names.getAll();
-            
-            while ( namesValues.hasNext() )
+            for ( ServerValue<?> name:names )
             {
-                values.add( (String)namesValues.next().get() );
+                values.add( (String)name.get() );
             }
             
             mso.setNames( values.toArray( EMPTY ) );

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/SchemaOperationControl.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/SchemaOperationControl.java?rev=612866&r1=612865&r2=612866&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/SchemaOperationControl.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/SchemaOperationControl.java Thu Jan 17 08:57:36 2008
@@ -24,7 +24,6 @@
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -72,16 +71,12 @@
 import org.apache.directory.shared.ldap.schema.syntax.ComparatorDescription;
 import org.apache.directory.shared.ldap.schema.syntax.NormalizerDescription;
 import org.apache.directory.shared.ldap.schema.syntax.SyntaxCheckerDescription;
-import org.apache.directory.shared.ldap.util.AttributeUtils;
 import org.apache.directory.shared.ldap.util.DateUtils;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-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;
 
@@ -295,11 +290,8 @@
     {
         ServerAttribute oc = entry.get( objectClassAT );
         
-        Iterator<ServerValue<?>> values = oc.getAll();
-        
-        while ( values.hasNext() )
+        for ( ServerValue<?> value:oc )
         {
-            ServerValue<?> value = values.next();
 
             String oid = registries.getOidRegistry().getOid( ( String ) value.get() );
             
@@ -347,12 +339,8 @@
     {
         ServerAttribute oc = entry.get( objectClassAT );
         
-        Iterator<ServerValue<?>> values = oc.getAll();
-        
-        while ( values.hasNext() )
+        for ( ServerValue<?> value:oc )
         {
-            ServerValue<?> value = values.next();
-            
             String oid = registries.getOidRegistry().getOid( ( String ) value.get() );
             
             if ( objectClass2handlerMap.containsKey( oid ) )
@@ -400,12 +388,8 @@
     {
         ServerAttribute oc = entry.get( objectClassAT );
         
-        Iterator<ServerValue<?>> values = oc.getAll();
-        
-        while ( values.hasNext() )
+        for ( ServerValue<?> value:oc )
         {
-            ServerValue<?> value = values.next();
-
             String oid = registries.getOidRegistry().getOid( ( String ) value.get() );
             
             if ( objectClass2handlerMap.containsKey( oid ) )
@@ -433,12 +417,8 @@
     {
         ServerAttribute oc = entry.get( objectClassAT );
         
-        Iterator<ServerValue<?>> values = oc.getAll();
-        
-        while ( values.hasNext() )
+        for ( ServerValue<?> value:oc )
         {
-            ServerValue<?> value = values.next();
-
             String oid = registries.getOidRegistry().getOid( ( String ) value.get() );
             
             if ( objectClass2handlerMap.containsKey( oid ) )
@@ -468,12 +448,8 @@
     {
         ServerAttribute oc = entry.get( objectClassAT );
         
-        Iterator<ServerValue<?>> values = oc.getAll();
-        
-        while ( values.hasNext() )
+        for ( ServerValue<?> value:oc )
         {
-            ServerValue<?> value = values.next();
-
             String oid = registries.getOidRegistry().getOid( ( String ) value.get() );
             
             if ( objectClass2handlerMap.containsKey( oid ) )
@@ -501,12 +477,8 @@
     {
         ServerAttribute oc = entry.get( objectClassAT );
         
-        Iterator<ServerValue<?>> values = oc.getAll();
-        
-        while ( values.hasNext() )
+        for ( ServerValue<?> value:oc )
         {
-            ServerValue<?> value = values.next();
-
             String oid = registries.getOidRegistry().getOid( ( String ) value.get() );
             
             if ( objectClass2handlerMap.containsKey( oid ) )
@@ -534,12 +506,8 @@
     {
         ServerAttribute oc = entry.get( objectClassAT );
         
-        Iterator<ServerValue<?>> values = oc.getAll();
-        
-        while ( values.hasNext() )
+        for ( ServerValue<?> value:oc )
         {
-            ServerValue<?> value = values.next();
-
             String oid = registries.getOidRegistry().getOid( ( String ) value.get() );
             
             if ( objectClass2handlerMap.containsKey( oid ) )

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java?rev=612866&r1=612865&r2=612866&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java Thu Jan 17 08:57:36 2008
@@ -24,6 +24,10 @@
 
 import org.apache.directory.server.constants.ApacheSchemaConstants;
 import org.apache.directory.server.core.DirectoryService;
+import org.apache.directory.server.core.entry.DefaultServerAttribute;
+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.SearchResultFilter;
 import org.apache.directory.server.core.enumeration.SearchResultFilteringEnumeration;
@@ -170,15 +174,17 @@
             LdapDN suffix = new LdapDN( suffixes.next() );
             //suffix = LdapDN.normalize( suffix, registry.getNormalizerMapping() );
             suffix.normalize( atRegistry.getNormalizerMapping() );
+            
             NamingEnumeration<SearchResult> subentries = nexus.search( 
                 new SearchOperationContext( registries, suffix, AliasDerefMode.NEVER_DEREF_ALIASES, filter, controls ) );
             
             while ( subentries.hasMore() )
             {
                 SearchResult result = subentries.next();
-                Attributes subentry = result.getAttributes();
-                String dn = result.getName();
-                String subtree = ( String ) subentry.get( SchemaConstants.SUBTREE_SPECIFICATION_AT ).get();
+                LdapDN dnName = new LdapDN( result.getName() );
+                
+                ServerEntry subentry = ServerEntryUtils.toServerEntry( result.getAttributes(), dnName, registries );
+                String subtree = subentry.get( SchemaConstants.SUBTREE_SPECIFICATION_AT ).getString();
                 SubtreeSpecification ss;
 
                 try
@@ -187,11 +193,10 @@
                 }
                 catch ( Exception e )
                 {
-                    LOG.warn( "Failed while parsing subtreeSpecification for " + dn );
+                    LOG.warn( "Failed while parsing subtreeSpecification for " + dnName );
                     continue;
                 }
 
-                LdapDN dnName = new LdapDN( dn );
                 dnName.normalize( atRegistry.getNormalizerMapping() );
                 subentryCache.setSubentry( dnName.toString(), ss, getSubentryTypes( subentry ) );
             }
@@ -199,33 +204,34 @@
     }
     
     
-    private int getSubentryTypes( Attributes subentry ) throws NamingException
+    private int getSubentryTypes( ServerEntry subentry ) throws NamingException
     {
         int types = 0;
         
-        Attribute oc = subentry.get( SchemaConstants.OBJECT_CLASS_AT );
+        ServerAttribute oc = subentry.get( SchemaConstants.OBJECT_CLASS_AT );
+        
         if ( oc == null )
         {
             throw new LdapSchemaViolationException( "A subentry must have an objectClass attribute", 
                 ResultCodeEnum.OBJECT_CLASS_VIOLATION );
         }
         
-        if ( AttributeUtils.containsValueCaseIgnore( oc, SchemaConstants.ACCESS_CONTROL_SUBENTRY_OC ) )
+        if ( oc.contains( SchemaConstants.ACCESS_CONTROL_SUBENTRY_OC ) )
         {
             types |= Subentry.ACCESS_CONTROL_SUBENTRY;
         }
         
-        if ( AttributeUtils.containsValueCaseIgnore( oc, "subschema" ) )
+        if ( oc.contains( "subschema" ) )
         {
             types |= Subentry.SCHEMA_SUBENTRY;
         }
         
-        if ( AttributeUtils.containsValueCaseIgnore( oc, SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRY_OC ) )
+        if ( oc.contains( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRY_OC ) )
         {
             types |= Subentry.COLLECTIVE_SUBENTRY;
         }
         
-        if ( AttributeUtils.containsValueCaseIgnore( oc, ApacheSchemaConstants.TRIGGER_EXECUTION_SUBENTRY_OC ) )
+        if ( oc.contains( ApacheSchemaConstants.TRIGGER_EXECUTION_SUBENTRY_OC ) )
         {
             types |= Subentry.TRIGGER_SUBENTRY;
         }
@@ -323,9 +329,9 @@
      * @return the set of subentry op attrs for an entry
      * @throws NamingException if there are problems accessing entry information
      */
-    public Attributes getSubentryAttributes( Name dn, Attributes entryAttrs ) throws NamingException
+    public ServerEntry getSubentryAttributes( LdapDN dn, ServerEntry entryAttrs ) throws NamingException
     {
-        Attributes subentryAttrs = new AttributesImpl();
+        ServerEntry subentryAttrs = new DefaultServerEntry( registries, dn );
         Iterator<String> list = subentryCache.nameIterator();
         
         while ( list.hasNext() )
@@ -339,46 +345,62 @@
 
             if ( evaluator.evaluate( ss, apDn, dn, entryAttrs ) )
             {                
-                Attribute operational;
+                ServerAttribute operational;
                 
                 if ( subentry.isAccessControlSubentry() )
                 {
                     operational = subentryAttrs.get( SchemaConstants.ACCESS_CONTROL_SUBENTRIES_AT );
+                    
                     if ( operational == null )
                     {
-                        operational = new AttributeImpl( SchemaConstants.ACCESS_CONTROL_SUBENTRIES_AT );
+                        operational = new DefaultServerAttribute( 
+                                            SchemaConstants.ACCESS_CONTROL_SUBENTRIES_AT, 
+                                            atRegistry.lookup( SchemaConstants.ACCESS_CONTROL_SUBENTRIES_AT ) );
                         subentryAttrs.put( operational );
                     }
+                    
                     operational.add( subentryDn.toString() );
                 }
                 if ( subentry.isSchemaSubentry() )
                 {
                     operational = subentryAttrs.get( SchemaConstants.SUBSCHEMA_SUBENTRY_AT );
+                    
                     if ( operational == null )
                     {
-                        operational = new AttributeImpl( SchemaConstants.SUBSCHEMA_SUBENTRY_AT );
+                        operational = new DefaultServerAttribute( 
+                                            SchemaConstants.SUBSCHEMA_SUBENTRY_AT,
+                                            atRegistry.lookup( SchemaConstants.SUBSCHEMA_SUBENTRY_AT ) );
                         subentryAttrs.put( operational );
                     }
+                    
                     operational.add( subentryDn.toString() );
                 }
                 if ( subentry.isCollectiveSubentry() )
                 {
                     operational = subentryAttrs.get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT );
+                    
                     if ( operational == null )
                     {
-                        operational = new AttributeImpl( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT );
+                        operational = new DefaultServerAttribute( 
+                                            SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT,
+                                            atRegistry.lookup( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
                         subentryAttrs.put( operational );
                     }
+                    
                     operational.add( subentryDn.toString() );
                 } 
                 if ( subentry.isTriggerSubentry() )
                 {
                     operational = subentryAttrs.get( SchemaConstants.TRIGGER_EXECUTION_SUBENTRIES_AT );
+                    
                     if ( operational == null )
                     {
-                        operational = new AttributeImpl( SchemaConstants.TRIGGER_EXECUTION_SUBENTRIES_AT );
+                        operational = new DefaultServerAttribute( 
+                                            SchemaConstants.TRIGGER_EXECUTION_SUBENTRIES_AT,
+                                            atRegistry.lookup( SchemaConstants.TRIGGER_EXECUTION_SUBENTRIES_AT ) );
                         subentryAttrs.put( operational );
                     }
+                    
                     operational.add( subentryDn.toString() );
                 }
             }
@@ -391,11 +413,11 @@
     public void add( NextInterceptor next, AddOperationContext addContext ) throws NamingException
     {
     	LdapDN name = addContext.getDn();
-        Attributes entry = ServerEntryUtils.toAttributesImpl( addContext.getEntry() );
+        ServerEntry entry = addContext.getEntry();
     	
-        Attribute objectClasses = entry.get( SchemaConstants.OBJECT_CLASS_AT );
+        ServerAttribute objectClasses = entry.get( SchemaConstants.OBJECT_CLASS_AT );
 
-        if ( AttributeUtils.containsValueCaseIgnore( objectClasses, SchemaConstants.SUBENTRY_OC ) )
+        if ( objectClasses.contains( SchemaConstants.SUBENTRY_OC ) )
         {
             // get the name of the administrative point and its administrativeRole attributes
             LdapDN apName = ( LdapDN ) name.clone();
@@ -431,7 +453,7 @@
              * to modify the subentry operational attributes of.
              * ----------------------------------------------------------------
              */
-            String subtree = ( String ) entry.get( SchemaConstants.SUBTREE_SPECIFICATION_AT ).get();
+            String subtree = entry.get( SchemaConstants.SUBTREE_SPECIFICATION_AT ).getString();
             SubtreeSpecification ss;
             
             try
@@ -476,13 +498,13 @@
                 LdapDN dn = new LdapDN( result.getName() );
                 dn.normalize( atRegistry.getNormalizerMapping() );
 
-                if ( evaluator.evaluate( ss, apName, dn, candidate ) )
+                if ( evaluator.evaluate( ss, apName, dn, ServerEntryUtils.toServerEntry( candidate, dn, registries ) ) )
                 {
                     nexus.modify( new ModifyOperationContext( registries, dn, getOperationalModsForAdd( candidate, operational )  ));
                 }
             }
 
-            addContext.setEntry( ServerEntryUtils.toServerEntry( entry, name, addContext.getRegistries() ) );
+            addContext.setEntry(  entry );
         }
         else
         {
@@ -499,7 +521,7 @@
 
                 if ( evaluator.evaluate( ss, apDn, name, entry ) )
                 {
-                    Attribute operational;
+                    ServerAttribute operational;
                     
                     if ( subentry.isAccessControlSubentry() )
                     {
@@ -507,7 +529,8 @@
                         
                         if ( operational == null )
                         {
-                            operational = new AttributeImpl( SchemaConstants.ACCESS_CONTROL_SUBENTRIES_AT );
+                            operational = new DefaultServerAttribute( 
+                                atRegistry.lookup( SchemaConstants.ACCESS_CONTROL_SUBENTRIES_AT ) );
                             entry.put( operational );
                         }
                         
@@ -520,7 +543,8 @@
                         
                         if ( operational == null )
                         {
-                            operational = new AttributeImpl( SchemaConstants.SUBSCHEMA_SUBENTRY_AT );
+                            operational = new DefaultServerAttribute( 
+                                atRegistry.lookup( SchemaConstants.SUBSCHEMA_SUBENTRY_AT ) );
                             entry.put( operational );
                         }
                         
@@ -533,7 +557,8 @@
                         
                         if ( operational == null )
                         {
-                            operational = new AttributeImpl( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT );
+                            operational = new DefaultServerAttribute( 
+                                atRegistry.lookup( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
                             entry.put( operational );
                         }
                         
@@ -546,7 +571,8 @@
                         
                         if ( operational == null )
                         {
-                            operational = new AttributeImpl( SchemaConstants.TRIGGER_EXECUTION_SUBENTRIES_AT );
+                            operational = new DefaultServerAttribute( 
+                                atRegistry.lookup( SchemaConstants.TRIGGER_EXECUTION_SUBENTRIES_AT ) );
                             entry.put( operational );
                         }
                         
@@ -555,7 +581,7 @@
                 }
             }
             
-            addContext.setEntry( ServerEntryUtils.toServerEntry( entry, name, addContext.getRegistries() ) );
+            addContext.setEntry( entry );
 
             next.add( addContext );
         }
@@ -606,7 +632,7 @@
                 LdapDN dn = new LdapDN( result.getName() );
                 dn.normalize( atRegistry.getNormalizerMapping() );
 
-                if ( evaluator.evaluate( ss, apName, dn, candidate ) )
+                if ( evaluator.evaluate( ss, apName, dn, ServerEntryUtils.toServerEntry( candidate, dn, registries ) ) )
                 {
                     nexus.modify( new ModifyOperationContext( registries, dn, getOperationalModsForRemove( name, candidate ) ) );
                 }
@@ -650,7 +676,7 @@
     }
 
 
-    private List<ModificationItemImpl> getModsOnEntryRdnChange( Name oldName, Name newName, Attributes entry )
+    private List<ModificationItemImpl> getModsOnEntryRdnChange( Name oldName, Name newName, ServerEntry entry )
         throws NamingException
     {
         List<ModificationItemImpl> modList = new ArrayList<ModificationItemImpl>();
@@ -690,11 +716,11 @@
                 for ( String aSUBENTRY_OPATTRS : SUBENTRY_OPATTRS )
                 {
                     int op = DirContext.REPLACE_ATTRIBUTE;
-                    Attribute opAttr = entry.get( aSUBENTRY_OPATTRS );
+                    ServerAttribute opAttr = entry.get( aSUBENTRY_OPATTRS );
                     
                     if ( opAttr != null )
                     {
-                        opAttr = ( Attribute ) opAttr.clone();
+                        opAttr = ( ServerAttribute ) opAttr.clone();
                         opAttr.remove( subentryDn );
 
                         if ( opAttr.size() < 1 )
@@ -702,7 +728,7 @@
                             op = DirContext.REMOVE_ATTRIBUTE;
                         }
 
-                        modList.add( new ModificationItemImpl( op, opAttr ) );
+                        modList.add( new ModificationItemImpl( op, ServerEntryUtils.toAttributeImpl( opAttr ) ) );
                     }
                 }
             }
@@ -727,10 +753,14 @@
     {
         LdapDN name = opContext.getDn();
 
-        Attributes entry = nexus.lookup( new LookupOperationContext( registries, name ) );
-        Attribute objectClasses = AttributeUtils.getAttribute( entry, objectClassType );
+        ServerEntry entry = ServerEntryUtils.toServerEntry( 
+            nexus.lookup( new LookupOperationContext( registries, name ) ),
+            name,
+            registries );
+        
+        ServerAttribute objectClasses = entry.get( objectClassType );
 
-        if ( AttributeUtils.containsValueCaseIgnore( objectClasses, SchemaConstants.SUBENTRY_OC ) )
+        if ( objectClasses.contains( SchemaConstants.SUBENTRY_OC ) )
         {
             Subentry subentry = subentryCache.getSubentry( name.toNormName() );
             SubtreeSpecification ss = subentry.getSubtreeSpecification();
@@ -762,7 +792,7 @@
                 LdapDN dn = new LdapDN( result.getName() );
                 dn.normalize( atRegistry.getNormalizerMapping() );
 
-                if ( evaluator.evaluate( ss, apName, dn, candidate ) )
+                if ( evaluator.evaluate( ss, apName, dn, ServerEntryUtils.toServerEntry( candidate, dn, registries ) ) )
                 {
                     nexus.modify( new ModifyOperationContext( registries, dn, getOperationalModsForReplace( name, newName, subentry, candidate ) ) );
                 }
@@ -801,11 +831,14 @@
         LdapDN oriChildName = opContext.getDn();
         LdapDN parent = opContext.getParent();
 
+        ServerEntry entry = ServerEntryUtils.toServerEntry( 
+            nexus.lookup( new LookupOperationContext( registries, oriChildName ) ),
+            oriChildName,
+            registries );
         
-        Attributes entry = nexus.lookup( new LookupOperationContext( registries, oriChildName ) );
-        Attribute objectClasses = AttributeUtils.getAttribute( entry, objectClassType );
+        ServerAttribute objectClasses = entry.get( objectClassType );
 
-        if ( AttributeUtils.containsValueCaseIgnore( objectClasses, SchemaConstants.SUBENTRY_OC ) )
+        if ( objectClasses.contains( SchemaConstants.SUBENTRY_OC ) )
         {
             Subentry subentry = subentryCache.getSubentry( oriChildName.toNormName() );
             SubtreeSpecification ss = subentry.getSubtreeSpecification();
@@ -838,7 +871,7 @@
                 LdapDN dn = new LdapDN( result.getName() );
                 dn.normalize( atRegistry.getNormalizerMapping() );
 
-                if ( evaluator.evaluate( ss, apName, dn, candidate ) )
+                if ( evaluator.evaluate( ss, apName, dn, ServerEntryUtils.toServerEntry( candidate, dn, registries ) ) )
                 {
                     nexus.modify( new ModifyOperationContext( registries, dn, getOperationalModsForReplace( oriChildName, newName, subentry,
                         candidate ) ) );
@@ -876,10 +909,14 @@
         LdapDN oriChildName = opContext.getDn();
         LdapDN newParentName = opContext.getParent();
         
-        Attributes entry = nexus.lookup( new LookupOperationContext( registries, oriChildName ) );
-        Attribute objectClasses = entry.get( SchemaConstants.OBJECT_CLASS_AT );
+        ServerEntry entry = ServerEntryUtils.toServerEntry( 
+            nexus.lookup( new LookupOperationContext( registries, oriChildName ) ),
+            oriChildName,
+            registries );
 
-        if ( AttributeUtils.containsValueCaseIgnore( objectClasses, SchemaConstants.SUBENTRY_OC ) )
+        ServerAttribute objectClasses = entry.get( SchemaConstants.OBJECT_CLASS_AT );
+
+        if ( objectClasses.contains( SchemaConstants.SUBENTRY_OC ) )
         {
             Subentry subentry = subentryCache.getSubentry( oriChildName.toString() );
             SubtreeSpecification ss = subentry.getSubtreeSpecification();
@@ -912,7 +949,7 @@
                 LdapDN dn = new LdapDN( result.getName() );
                 dn.normalize( atRegistry.getNormalizerMapping() );
 
-                if ( evaluator.evaluate( ss, apName, dn, candidate ) )
+                if ( evaluator.evaluate( ss, apName, dn, ServerEntryUtils.toServerEntry( candidate, dn, registries ) ) )
                 {
                     nexus.modify( new ModifyOperationContext( registries, dn, getOperationalModsForReplace( oriChildName, newName, subentry,
                         candidate ) ) );
@@ -949,9 +986,10 @@
     // -----------------------------------------------------------------------
 
     
-    private int getSubentryTypes( Attributes entry, List<ModificationItemImpl> mods ) throws NamingException
+    private int getSubentryTypes( ServerEntry entry, List<ModificationItemImpl> mods ) throws NamingException
     {
-        Attribute ocFinalState = ( Attribute ) entry.get( SchemaConstants.OBJECT_CLASS_AT ).clone();
+        ServerAttribute ocFinalState = ( ServerAttribute ) entry.get( SchemaConstants.OBJECT_CLASS_AT ).clone();
+        
         for ( ModificationItemImpl mod : mods )
         {
             if ( mod.getAttribute().getID().equalsIgnoreCase( SchemaConstants.OBJECT_CLASS_AT ) )
@@ -961,25 +999,27 @@
                     case ( DirContext.ADD_ATTRIBUTE ):
                         for ( int jj = 0; jj < mod.getAttribute().size(); jj++ )
                         {
-                            ocFinalState.add( mod.getAttribute().get( jj ) );
+                            ocFinalState.add( (String)mod.getAttribute().get( jj ) );
                         }
                     
                         break;
+                        
                     case ( DirContext.REMOVE_ATTRIBUTE ):
                         for ( int jj = 0; jj < mod.getAttribute().size(); jj++ )
                         {
-                            ocFinalState.remove( mod.getAttribute().get( jj ) );
+                            ocFinalState.remove( (String)mod.getAttribute().get( jj ) );
                         }
                     
                         break;
+                        
                     case ( DirContext.REPLACE_ATTRIBUTE ):
-                        ocFinalState = mod.getAttribute();
+                        ocFinalState = ServerEntryUtils.toServerAttribute( mod.getAttribute(), atRegistry.lookup( SchemaConstants.OBJECT_CLASS_AT ) );
                         break;
                 }
             }
         }
         
-        Attributes attrs = new AttributesImpl();
+        ServerEntry attrs = new DefaultServerEntry( registries, LdapDN.EMPTY_LDAPDN );
         attrs.put( ocFinalState );
         return getSubentryTypes( attrs );
     }
@@ -989,9 +1029,13 @@
         LdapDN name = opContext.getDn();
         List<ModificationItemImpl> mods = opContext.getModItems();
         
-        Attributes entry = nexus.lookup( new LookupOperationContext( registries, name ) );
-        Attributes oldEntry = (Attributes) entry.clone();
-        Attribute objectClasses = AttributeUtils.getAttribute( entry, objectClassType );
+        ServerEntry entry = ServerEntryUtils.toServerEntry( 
+            nexus.lookup( new LookupOperationContext( registries, name ) ),
+            name,
+            registries );
+        
+        ServerEntry oldEntry = (ServerEntry) entry.clone();
+        ServerAttribute objectClasses = entry.get( objectClassType );
         boolean isSubtreeSpecificationModification = false;
         ModificationItem subtreeMod = null;
 
@@ -1004,7 +1048,7 @@
             }
         }
 
-        if ( AttributeUtils.containsValueCaseIgnore( objectClasses, SchemaConstants.SUBENTRY_OC ) && isSubtreeSpecificationModification )
+        if ( objectClasses.contains( SchemaConstants.SUBENTRY_OC ) && isSubtreeSpecificationModification )
         {
             SubtreeSpecification ssOld = subentryCache.removeSubentry( name.toString() ).getSubtreeSpecification();
             SubtreeSpecification ssNew;
@@ -1043,7 +1087,7 @@
                 LdapDN dn = new LdapDN( result.getName() );
                 dn.normalize( atRegistry.getNormalizerMapping() );
 
-                if ( evaluator.evaluate( ssOld, apName, dn, candidate ) )
+                if ( evaluator.evaluate( ssOld, apName, dn, ServerEntryUtils.toServerEntry( candidate, dn, registries ) ) )
                 {
                     nexus.modify( new ModifyOperationContext( registries, dn, getOperationalModsForRemove( name, candidate ) ) );
                 }
@@ -1063,7 +1107,7 @@
                 LdapDN dn = new LdapDN( result.getName() );
                 dn.normalize( atRegistry.getNormalizerMapping() );
 
-                if ( evaluator.evaluate( ssNew, apName, dn, candidate ) )
+                if ( evaluator.evaluate( ssNew, apName, dn, ServerEntryUtils.toServerEntry( candidate, dn, registries ) ) )
                 {
                     nexus.modify( new ModifyOperationContext( registries, dn, getOperationalModsForAdd( candidate, operational ) )) ;
                 }
@@ -1073,10 +1117,13 @@
         {
             next.modify( opContext );
             
-            if ( !AttributeUtils.containsValueCaseIgnore( objectClasses, SchemaConstants.SUBENTRY_OC ) )
+            if ( !objectClasses.contains( SchemaConstants.SUBENTRY_OC ) )
             {
-	            Attributes newEntry = nexus.lookup( new LookupOperationContext( registries, name ) );
-	            
+                ServerEntry newEntry = ServerEntryUtils.toServerEntry( 
+                    nexus.lookup( new LookupOperationContext( registries, name ) ),
+                    name,
+                    registries );
+
 	            List<ModificationItemImpl> subentriesOpAttrMods = getModsOnEntryModification( name, oldEntry, newEntry );
                 
 	            if ( subentriesOpAttrMods.size() > 0)
@@ -1444,7 +1491,7 @@
     }
     
     
-    private List<ModificationItemImpl> getModsOnEntryModification( LdapDN name, Attributes oldEntry, Attributes newEntry )
+    private List<ModificationItemImpl> getModsOnEntryModification( LdapDN name, ServerEntry oldEntry, ServerEntry newEntry )
     throws NamingException
 	{
 	    List<ModificationItemImpl> modList = new ArrayList<ModificationItemImpl>();
@@ -1471,10 +1518,11 @@
                 for ( String aSUBENTRY_OPATTRS : SUBENTRY_OPATTRS )
                 {
                     int op = DirContext.REPLACE_ATTRIBUTE;
-                    Attribute opAttr = oldEntry.get( aSUBENTRY_OPATTRS );
+                    ServerAttribute opAttr = oldEntry.get( aSUBENTRY_OPATTRS );
+                    
                     if ( opAttr != null )
                     {
-                        opAttr = ( Attribute ) opAttr.clone();
+                        opAttr = ( ServerAttribute ) opAttr.clone();
                         opAttr.remove( subentryDn );
 
                         if ( opAttr.size() < 1 )
@@ -1482,7 +1530,7 @@
                             op = DirContext.REMOVE_ATTRIBUTE;
                         }
 
-                        modList.add( new ModificationItemImpl( op, opAttr ) );
+                        modList.add( new ModificationItemImpl( op, ServerEntryUtils.toAttributeImpl( opAttr ) ) );
                     }
                 }
 	        }

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/subtree/SubtreeEvaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/subtree/SubtreeEvaluator.java?rev=612866&r1=612865&r2=612866&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/subtree/SubtreeEvaluator.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/subtree/SubtreeEvaluator.java Thu Jan 17 08:57:36 2008
@@ -24,8 +24,9 @@
 
 import javax.naming.Name;
 import javax.naming.NamingException;
-import javax.naming.directory.Attributes;
 
+import org.apache.directory.server.core.entry.ServerEntry;
+import org.apache.directory.server.core.entry.ServerEntryUtils;
 import org.apache.directory.server.core.event.Evaluator;
 import org.apache.directory.server.core.event.ExpressionEvaluator;
 import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
@@ -56,7 +57,7 @@
      * @param attrRegistry registry to be looked up
      * @throws NamingException 
      */
-    public SubtreeEvaluator(OidRegistry oidRegistry, AttributeTypeRegistry attrRegistry)
+    public SubtreeEvaluator( OidRegistry oidRegistry, AttributeTypeRegistry attrRegistry )
     {
         evaluator = new ExpressionEvaluator(oidRegistry, attrRegistry );
     }
@@ -71,7 +72,7 @@
      * @return true if the entry is selected by the specification, false if it is not
      * @throws javax.naming.NamingException if errors are encountered while evaluating selection
      */
-    public boolean evaluate( SubtreeSpecification subtree, Name apDn, Name entryDn, Attributes entry )
+    public boolean evaluate( SubtreeSpecification subtree, Name apDn, Name entryDn, ServerEntry entry )
         throws NamingException
     {
         // TODO: Try to make this cast unnecessary.
@@ -94,6 +95,7 @@
          * distinguished name relative to the administrative point.
          */
         Name apRelativeRdn;
+        
         if ( !NamespaceTools.isDescendant( apDn, entryDn ) )
         {
             return false;
@@ -114,6 +116,7 @@
          * baseRelativeRdn we can later make comparisons with specific exclusions.
          */
         Name baseRelativeRdn;
+        
         if ( subtree.getBase() != null && subtree.getBase().size() == 0 )
         {
             baseRelativeRdn = apRelativeRdn;
@@ -163,9 +166,11 @@
          * as well and reject if the relative names are equal.
          */
         Iterator list = subtree.getChopBeforeExclusions().iterator();
+        
         while ( list.hasNext() )
         {
             Name chopBefore = ( Name ) list.next();
+            
             if ( NamespaceTools.isDescendant( chopBefore, baseRelativeRdn ) )
             {
                 return false;
@@ -173,9 +178,11 @@
         }
 
         list = subtree.getChopAfterExclusions().iterator();
+        
         while ( list.hasNext() )
         {
             Name chopAfter = ( Name ) list.next();
+            
             if ( NamespaceTools.isDescendant( chopAfter, baseRelativeRdn ) && !chopAfter.equals( baseRelativeRdn ) )
             {
                 return false;
@@ -189,7 +196,7 @@
          */
         if ( subtree.getRefinement() != null )
         {
-            return evaluator.evaluate( subtree.getRefinement(), entryLdapDn.toNormName(), entry );
+            return evaluator.evaluate( subtree.getRefinement(), entryLdapDn.toNormName(), ServerEntryUtils.toAttributesImpl( entry ) );
         }
 
         /*

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/trigger/TriggerInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/trigger/TriggerInterceptor.java?rev=612866&r1=612865&r2=612866&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/trigger/TriggerInterceptor.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/trigger/TriggerInterceptor.java Thu Jan 17 08:57:36 2008
@@ -22,6 +22,8 @@
 
 
 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.interceptor.BaseInterceptor;
 import org.apache.directory.server.core.interceptor.InterceptorChain;
@@ -59,7 +61,6 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
@@ -446,25 +447,28 @@
         // will not be valid at the new location.
         // This will certainly be fixed by the SubentryInterceptor,
         // but after this service.
-        Attributes importedEntry = proxy.lookup( new LookupOperationContext( registries, oriChildName ), PartitionNexusProxy.LOOKUP_EXCLUDING_OPR_ATTRS_BYPASS );
+        ServerEntry importedEntry = ServerEntryUtils.toServerEntry( 
+            proxy.lookup( new LookupOperationContext( registries, oriChildName ), PartitionNexusProxy.LOOKUP_EXCLUDING_OPR_ATTRS_BYPASS ),
+            oriChildName,
+            registries );
+        
         // As the target entry does not exist yet and so
         // its subentry operational attributes are not there,
         // we need to construct an entry to represent it
         // at least with minimal requirements which are object class
         // and access control subentry operational attributes.
         SubentryInterceptor subentryInterceptor = ( SubentryInterceptor ) chain.get( SubentryInterceptor.class.getName() );
-        Attributes fakeImportedEntry = subentryInterceptor.getSubentryAttributes( newDN, importedEntry );
-        NamingEnumeration<? extends Attribute> attrList = importedEntry.getAll();
+        ServerEntry fakeImportedEntry = subentryInterceptor.getSubentryAttributes( newDN, importedEntry );
         
-        while ( attrList.hasMore() )
+        for ( ServerAttribute attribute:importedEntry )
         {
-            fakeImportedEntry.put( attrList.next() );
+            fakeImportedEntry.put( attribute );
         }
         
         // Gather Trigger Specifications which apply to the entry being imported.
         // Note: Entry Trigger Specifications are not valid for Import.
         List<TriggerSpecification> importTriggerSpecs = new ArrayList<TriggerSpecification>();
-        addPrescriptiveTriggerSpecs( importTriggerSpecs, proxy, newDN, fakeImportedEntry );
+        addPrescriptiveTriggerSpecs( importTriggerSpecs, proxy, newDN, ServerEntryUtils.toAttributesImpl( fakeImportedEntry ) );
         
         Map<ActionTime, List<TriggerSpecification>> exportTriggerMap = getActionTimeMappedTriggerSpecsForOperation( exportTriggerSpecs, LdapOperation.MODIFYDN_EXPORT );
         
@@ -521,25 +525,28 @@
         // will not be valid at the new location.
         // This will certainly be fixed by the SubentryInterceptor,
         // but after this service.
-        Attributes importedEntry = proxy.lookup( new LookupOperationContext( registries, oriChildName ), PartitionNexusProxy.LOOKUP_EXCLUDING_OPR_ATTRS_BYPASS );
+        ServerEntry importedEntry = ServerEntryUtils.toServerEntry( 
+            proxy.lookup( new LookupOperationContext( registries, oriChildName ), PartitionNexusProxy.LOOKUP_EXCLUDING_OPR_ATTRS_BYPASS ),
+            oriChildName,
+            registries );
+
         // As the target entry does not exist yet and so
         // its subentry operational attributes are not there,
         // we need to construct an entry to represent it
         // at least with minimal requirements which are object class
         // and access control subentry operational attributes.
         SubentryInterceptor subentryInterceptor = ( SubentryInterceptor ) chain.get( SubentryInterceptor.class.getName() );
-        Attributes fakeImportedEntry = subentryInterceptor.getSubentryAttributes( newDN, importedEntry );
-        NamingEnumeration <? extends Attribute> attrList = importedEntry.getAll();
+        ServerEntry fakeImportedEntry = subentryInterceptor.getSubentryAttributes( newDN, importedEntry );
         
-        while ( attrList.hasMore() )
+        for ( ServerAttribute attribute:importedEntry )
         {
-            fakeImportedEntry.put( attrList.next() );
+            fakeImportedEntry.put( attribute );
         }
         
         // Gather Trigger Specifications which apply to the entry being imported.
         // Note: Entry Trigger Specifications are not valid for Import.
         List<TriggerSpecification> importTriggerSpecs = new ArrayList<TriggerSpecification>();
-        addPrescriptiveTriggerSpecs( importTriggerSpecs, proxy, newDN, fakeImportedEntry );
+        addPrescriptiveTriggerSpecs( importTriggerSpecs, proxy, newDN, ServerEntryUtils.toAttributesImpl( fakeImportedEntry ) );
         
         Map<ActionTime, List<TriggerSpecification>> exportTriggerMap = getActionTimeMappedTriggerSpecsForOperation( exportTriggerSpecs, LdapOperation.MODIFYDN_EXPORT );
         

Modified: directory/apacheds/branches/bigbang/core/src/test/java/org/apache/directory/server/core/schema/PartitionSchemaLoaderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/test/java/org/apache/directory/server/core/schema/PartitionSchemaLoaderTest.java?rev=612866&r1=612865&r2=612866&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/test/java/org/apache/directory/server/core/schema/PartitionSchemaLoaderTest.java (original)
+++ directory/apacheds/branches/bigbang/core/src/test/java/org/apache/directory/server/core/schema/PartitionSchemaLoaderTest.java Thu Jan 17 08:57:36 2008
@@ -39,11 +39,9 @@
 import org.apache.directory.server.schema.registries.DefaultOidRegistry;
 import org.apache.directory.server.schema.registries.DefaultRegistries;
 import org.apache.directory.server.schema.registries.Registries;
-import org.apache.directory.shared.ldap.message.AttributesImpl;
 import org.apache.directory.shared.ldap.name.LdapDN;
 
 import javax.naming.NamingException;
-import javax.naming.directory.Attributes;
 import java.io.File;
 import java.io.IOException;
 import java.util.HashSet;

Modified: directory/apacheds/branches/bigbang/core/src/test/java/org/apache/directory/server/core/subtree/SubtreeEvaluatorTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/test/java/org/apache/directory/server/core/subtree/SubtreeEvaluatorTest.java?rev=612866&r1=612865&r2=612866&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/test/java/org/apache/directory/server/core/subtree/SubtreeEvaluatorTest.java (original)
+++ directory/apacheds/branches/bigbang/core/src/test/java/org/apache/directory/server/core/subtree/SubtreeEvaluatorTest.java Thu Jan 17 08:57:36 2008
@@ -23,13 +23,12 @@
 import java.util.HashSet;
 import java.util.Set;
 
-import javax.naming.Name;
 import javax.naming.NamingException;
-import javax.naming.directory.Attribute;
-import javax.naming.directory.Attributes;
 
 import junit.framework.TestCase;
 
+import org.apache.directory.server.core.entry.DefaultServerEntry;
+import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.schema.bootstrap.ApacheSchema;
 import org.apache.directory.server.schema.bootstrap.BootstrapSchemaLoader;
 import org.apache.directory.server.schema.bootstrap.CoreSchema;
@@ -40,8 +39,6 @@
 import org.apache.directory.server.schema.registries.Registries;
 import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.filter.FilterParser;
-import org.apache.directory.shared.ldap.message.AttributeImpl;
-import org.apache.directory.shared.ldap.message.AttributesImpl;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.subtree.SubtreeSpecification;
 import org.apache.directory.shared.ldap.subtree.SubtreeSpecificationModifier;
@@ -90,11 +87,9 @@
     {
         SubtreeSpecificationModifier modifier = new SubtreeSpecificationModifier();
         SubtreeSpecification ss = modifier.getSubtreeSpecification();
-        Name apDn = new LdapDN( "ou=system" );
-        Name entryDn = new LdapDN( "ou=users,ou=system" );
-        Attribute objectClasses = new AttributeImpl( "objectClass" );
-        Attributes entry = new AttributesImpl();
-        entry.put( objectClasses );
+        LdapDN apDn = new LdapDN( "ou=system" );
+        LdapDN entryDn = new LdapDN( "ou=users,ou=system" );
+        ServerEntry entry = new DefaultServerEntry( registries, entryDn, "objectClass" );
 
         assertTrue( evaluator.evaluate( ss, apDn, entryDn, entry ) );
 
@@ -111,11 +106,9 @@
         SubtreeSpecificationModifier modifier = new SubtreeSpecificationModifier();
         modifier.setBase( new LdapDN( "ou=users" ) );
         SubtreeSpecification ss = modifier.getSubtreeSpecification();
-        Name apDn = new LdapDN( "ou=system" );
-        Name entryDn = new LdapDN( "ou=users,ou=system" );
-        Attribute objectClasses = new AttributeImpl( "objectClass" );
-        Attributes entry = new AttributesImpl();
-        entry.put( objectClasses );
+        LdapDN apDn = new LdapDN( "ou=system" );
+        LdapDN entryDn = new LdapDN( "ou=users,ou=system" );
+        ServerEntry entry = new DefaultServerEntry( registries, entryDn, "objectClass" );
 
         assertTrue( evaluator.evaluate( ss, apDn, entryDn, entry ) );
 
@@ -134,11 +127,9 @@
         modifier.setMaxBaseDistance( 3 );
         modifier.setBase( new LdapDN( "ou=users" ) );
         SubtreeSpecification ss = modifier.getSubtreeSpecification();
-        Name apDn = new LdapDN( "ou=system" );
-        Name entryDn = new LdapDN( "ou=users,ou=system" );
-        Attribute objectClasses = new AttributeImpl( "objectClass" );
-        Attributes entry = new AttributesImpl();
-        entry.put( objectClasses );
+        LdapDN apDn = new LdapDN( "ou=system" );
+        LdapDN entryDn = new LdapDN( "ou=users,ou=system" );
+        ServerEntry entry = new DefaultServerEntry( registries, entryDn, "objectClass" );
 
         assertFalse( evaluator.evaluate( ss, apDn, entryDn, entry ) );
 
@@ -170,11 +161,9 @@
         modifier.setMaxBaseDistance( 3 );
         modifier.setBase( new LdapDN( "ou=users" ) );
         SubtreeSpecification ss = modifier.getSubtreeSpecification();
-        Name apDn = new LdapDN( "ou=system" );
-        Name entryDn = new LdapDN( "ou=users,ou=system" );
-        Attribute objectClasses = new AttributeImpl( "objectClass" );
-        Attributes entry = new AttributesImpl();
-        entry.put( objectClasses );
+        LdapDN apDn = new LdapDN( "ou=system" );
+        LdapDN entryDn = new LdapDN( "ou=users,ou=system" );
+        ServerEntry entry = new DefaultServerEntry( registries, entryDn, "objectClass" );
 
         assertFalse( evaluator.evaluate( ss, apDn, entryDn, entry ) );
 
@@ -206,11 +195,9 @@
         modifier.setMaxBaseDistance( 3 );
         modifier.setBase( new LdapDN( "ou=users" ) );
         SubtreeSpecification ss = modifier.getSubtreeSpecification();
-        Name apDn = new LdapDN( "ou=system" );
-        Name entryDn = new LdapDN( "ou=users,ou=system" );
-        Attribute objectClasses = new AttributeImpl( "objectClass" );
-        Attributes entry = new AttributesImpl();
-        entry.put( objectClasses );
+        LdapDN apDn = new LdapDN( "ou=system" );
+        LdapDN entryDn = new LdapDN( "ou=users,ou=system" );
+        ServerEntry entry = new DefaultServerEntry( registries, entryDn, "objectClass" );
 
         assertFalse( evaluator.evaluate( ss, apDn, entryDn, entry ) );
 
@@ -241,11 +228,10 @@
         modifier.setMaxBaseDistance( 3 );
         modifier.setBase( new LdapDN( "ou=users" ) );
         SubtreeSpecification ss = modifier.getSubtreeSpecification();
-        Name apDn = new LdapDN( "ou=system" );
-        Name entryDn = new LdapDN( "ou=users,ou=system" );
-        Attribute objectClasses = new AttributeImpl( "objectClass", "person" );
-        Attributes entry = new AttributesImpl();
-        entry.put( objectClasses );
+        LdapDN apDn = new LdapDN( "ou=system" );
+        LdapDN entryDn = new LdapDN( "ou=users,ou=system" );
+        ServerEntry entry = new DefaultServerEntry( registries, entryDn );
+        entry.put( "objectClass", "person" );
 
         assertFalse( evaluator.evaluate( ss, apDn, entryDn, entry ) );
 
@@ -265,9 +251,9 @@
         assertFalse( evaluator.evaluate( ss, apDn, entryDn, entry ) );
 
         // now change the refinement so the entry is rejected
-        objectClasses = new AttributeImpl( "objectClass", "organizationalUnit" );
-        entry = new AttributesImpl();
-        entry.put( objectClasses );
+        entry = new DefaultServerEntry( registries, entryDn );
+        entry.put( "objectClass", "organizationalUnit" );
+        
 
         assertFalse( evaluator.evaluate( ss, apDn, entryDn, entry ) );
 
@@ -299,13 +285,12 @@
         modifier.setMaxBaseDistance( 3 );
         modifier.setBase( new LdapDN( "ou=users" ) );
         SubtreeSpecification ss = modifier.getSubtreeSpecification();
-        Name apDn = new LdapDN( "ou=system" );
-        Name entryDn = new LdapDN( "ou=users,ou=system" );
-        Attribute objectClasses = new AttributeImpl( "objectClass", "person" );
-        Attribute cn = new AttributeImpl( "cn", "Ersin" );
-        Attributes entry = new AttributesImpl();
-        entry.put( objectClasses );
-        entry.put( cn );
+        LdapDN apDn = new LdapDN( "ou=system" );
+        LdapDN entryDn = new LdapDN( "ou=users,ou=system" );
+
+        ServerEntry entry = new DefaultServerEntry( registries, entryDn );;
+        entry.put( "objectClass", "person" );
+        entry.put( "cn", "Ersin" );
 
         assertFalse( evaluator.evaluate( ss, apDn, entryDn, entry ) );
 
@@ -313,11 +298,9 @@
         assertTrue( evaluator.evaluate( ss, apDn, entryDn, entry ) );
 
         // now change the filter so the entry is rejected
-        objectClasses = new AttributeImpl( "objectClass", "person" );
-        cn = new AttributeImpl( "cn", "Alex" );
-        entry = new AttributesImpl();
-        entry.put( objectClasses );
-        entry.put( cn );
+        entry = new DefaultServerEntry( registries, entryDn );;
+        entry.put( "objectClass", "person" );
+        entry.put( "cn", "Alex" );
 
         assertFalse( evaluator.evaluate( ss, apDn, entryDn, entry ) );
 

Modified: directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/operation/support/EntryUtil.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/operation/support/EntryUtil.java?rev=612866&r1=612865&r2=612866&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/operation/support/EntryUtil.java (original)
+++ directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/operation/support/EntryUtil.java Thu Jan 17 08:57:36 2008
@@ -27,7 +27,6 @@
 
 import org.apache.directory.server.core.entry.DefaultServerEntry;
 import org.apache.directory.server.core.entry.ServerEntry;
-import org.apache.directory.server.core.entry.ServerEntryUtils;
 import org.apache.directory.server.core.interceptor.context.AddOperationContext;
 import org.apache.directory.server.core.interceptor.context.EntryOperationContext;
 import org.apache.directory.server.core.interceptor.context.LookupOperationContext;

Modified: directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationInterceptor.java?rev=612866&r1=612865&r2=612866&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationInterceptor.java (original)
+++ directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationInterceptor.java Thu Jan 17 08:57:36 2008
@@ -35,7 +35,6 @@
 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.SearchResultFilteringEnumeration;
 import org.apache.directory.server.core.interceptor.BaseInterceptor;
@@ -83,7 +82,6 @@
 import java.net.InetSocketAddress;
 import java.text.ParseException;
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
 
 
@@ -331,11 +329,8 @@
         }
 
         // Iterate all context partitions to send all entries of them.
-        Iterator<ServerValue<?>> namingContexts = namingContextsAttr.getAll();
-        
-        while ( namingContexts.hasNext() )
+        for ( ServerValue<?> namingContext:namingContextsAttr )
         {
-            ServerValue<?> namingContext = namingContexts.next();
             // Convert attribute value to JNDI name.
             LdapDN contextName;
             

Modified: directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationClientContextHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationClientContextHandler.java?rev=612866&r1=612865&r2=612866&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationClientContextHandler.java (original)
+++ directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationClientContextHandler.java Thu Jan 17 08:57:36 2008
@@ -62,7 +62,6 @@
 import javax.naming.directory.SearchControls;
 import javax.naming.directory.SearchResult;
 import java.net.InetSocketAddress;
-import java.util.Iterator;
 import java.util.Map;
 
 
@@ -362,12 +361,8 @@
         }
 
         // Iterate all context partitions to send all entries of them.
-        Iterator<ServerValue<?>> namingContexts = namingContextsAttr.getAll();
-        
-        while ( namingContexts.hasNext() )
+        for ( ServerValue<?> namingContext:namingContextsAttr )
         {
-            ServerValue<?> namingContext = namingContexts.next();
-
             // Convert attribute value to JNDI name.
             LdapDN contextName;
 

Modified: directory/apacheds/branches/bigbang/mitosis/src/test/java/org/apache/directory/mitosis/service/AbstractReplicationServiceTestCase.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/mitosis/src/test/java/org/apache/directory/mitosis/service/AbstractReplicationServiceTestCase.java?rev=612866&r1=612865&r2=612866&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/mitosis/src/test/java/org/apache/directory/mitosis/service/AbstractReplicationServiceTestCase.java (original)
+++ directory/apacheds/branches/bigbang/mitosis/src/test/java/org/apache/directory/mitosis/service/AbstractReplicationServiceTestCase.java Thu Jan 17 08:57:36 2008
@@ -20,7 +20,6 @@
 
 package org.apache.directory.mitosis.service;
 
-import junit.framework.TestCase;
 import org.apache.commons.io.FileUtils;
 import org.apache.directory.mitosis.common.Replica;
 import org.apache.directory.mitosis.common.ReplicaId;

Modified: directory/apacheds/branches/bigbang/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/AbstractMessageCodecTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/AbstractMessageCodecTest.java?rev=612866&r1=612865&r2=612866&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/AbstractMessageCodecTest.java (original)
+++ directory/apacheds/branches/bigbang/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/AbstractMessageCodecTest.java Thu Jan 17 08:57:36 2008
@@ -21,7 +21,6 @@
 
 
 import junit.framework.Assert;
-import junit.framework.TestCase;
 
 import org.apache.directory.mitosis.service.protocol.message.BaseMessage;
 import org.apache.mina.common.ByteBuffer;

Modified: directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/jndi/ServerContextFactoryTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/jndi/ServerContextFactoryTest.java?rev=612866&r1=612865&r2=612866&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/jndi/ServerContextFactoryTest.java (original)
+++ directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/jndi/ServerContextFactoryTest.java Thu Jan 17 08:57:36 2008
@@ -20,27 +20,21 @@
 package org.apache.directory.server.jndi;
 
 
-import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.entry.DefaultServerEntry;
 import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.partition.Partition;
 import org.apache.directory.server.core.partition.impl.btree.Index;
 import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmIndex;
 import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition;
-import org.apache.directory.server.core.unit.AbstractAdminTestCase;
 import org.apache.directory.server.unit.AbstractServerTest;
 import org.apache.directory.shared.ldap.name.LdapDN;
 
-import javax.naming.Context;
-import javax.naming.InitialContext;
 import javax.naming.NamingException;
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
 import javax.naming.directory.DirContext;
-import javax.naming.directory.InitialDirContext;
 
 import java.util.HashSet;
-import java.util.Hashtable;
 import java.util.Set;
 
 

Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/Entry.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/Entry.java?rev=612866&r1=612865&r2=612866&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/Entry.java (original)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/Entry.java Thu Jan 17 08:57:36 2008
@@ -23,7 +23,6 @@
 
 import javax.naming.NamingException;
 
-import java.io.Serializable;
 import java.util.Iterator;
 import java.util.List;
 
@@ -40,7 +39,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public interface Entry<T extends EntryAttribute<?>> extends Cloneable
+public interface Entry<T extends EntryAttribute<?>> extends Cloneable, Iterable<T>
 {
     /**
      * Removes all the attributes.

Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/Value.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/Value.java?rev=612866&r1=612865&r2=612866&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/Value.java (original)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/Value.java Thu Jan 17 08:57:36 2008
@@ -21,8 +21,6 @@
 
 import java.io.Serializable;
 
-import javax.naming.NamingException;
-
 
 /**
  * A interface for wrapping attribute values stored into an EntryAttribute. These

Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/AbstractClientAttribute.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/AbstractClientAttribute.java?rev=612866&r1=612865&r2=612866&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/AbstractClientAttribute.java (original)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/AbstractClientAttribute.java Thu Jan 17 08:57:36 2008
@@ -19,10 +19,8 @@
 package org.apache.directory.shared.ldap.entry.client;
 
 
-import org.apache.directory.shared.asn1.primitives.OID;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.schema.AttributeType;
-import org.apache.directory.shared.ldap.util.StringTools;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 

Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientAttribute.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientAttribute.java?rev=612866&r1=612865&r2=612866&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientAttribute.java (original)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientAttribute.java Thu Jan 17 08:57:36 2008
@@ -19,7 +19,6 @@
 package org.apache.directory.shared.ldap.entry.client;
 
 
-import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 
 import javax.naming.NamingException;

Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientBinaryValue.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientBinaryValue.java?rev=612866&r1=612865&r2=612866&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientBinaryValue.java (original)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientBinaryValue.java Thu Jan 17 08:57:36 2008
@@ -21,15 +21,11 @@
 
 import org.apache.directory.shared.ldap.NotImplementedException;
 import org.apache.directory.shared.ldap.entry.AbstractBinaryValue;
-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.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import javax.naming.NamingException;
 import java.util.Arrays;
-import java.util.Comparator;
 
 
 /**

Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientStringValue.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientStringValue.java?rev=612866&r1=612865&r2=612866&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientStringValue.java (original)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientStringValue.java Thu Jan 17 08:57:36 2008
@@ -21,14 +21,10 @@
 
 import org.apache.directory.shared.ldap.NotImplementedException;
 import org.apache.directory.shared.ldap.entry.AbstractStringValue;
-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.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import javax.naming.NamingException;
-import java.util.Comparator;
 
 
 /**

Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientValue.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientValue.java?rev=612866&r1=612865&r2=612866&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientValue.java (original)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientValue.java Thu Jan 17 08:57:36 2008
@@ -20,7 +20,6 @@
 
 
 import org.apache.directory.shared.ldap.entry.Value;
-import org.apache.directory.shared.ldap.schema.AttributeType;
 
 import javax.naming.NamingException;
 

Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/DefaultClientAttribute.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/DefaultClientAttribute.java?rev=612866&r1=612865&r2=612866&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/DefaultClientAttribute.java (original)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/DefaultClientAttribute.java Thu Jan 17 08:57:36 2008
@@ -19,11 +19,7 @@
 package org.apache.directory.shared.ldap.entry.client;
 
 
-import org.apache.directory.shared.ldap.entry.AbstractBinaryValue;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
-import org.apache.directory.shared.ldap.entry.AbstractStringValue;
-import org.apache.directory.shared.ldap.schema.AttributeType;
-import org.apache.directory.shared.ldap.util.StringTools;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 

Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/name/Rdn.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/name/Rdn.java?rev=612866&r1=612865&r2=612866&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/name/Rdn.java (original)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/name/Rdn.java Thu Jan 17 08:57:36 2008
@@ -25,7 +25,6 @@
 import java.io.ObjectInput;
 import java.io.ObjectOutput;
 import java.io.Serializable;
-import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;

Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaUtils.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaUtils.java?rev=612866&r1=612865&r2=612866&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaUtils.java (original)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaUtils.java Thu Jan 17 08:57:36 2008
@@ -31,7 +31,6 @@
 import javax.naming.directory.ModificationItem;
 
 import org.apache.directory.shared.ldap.message.AttributeImpl;
-import org.apache.directory.shared.ldap.message.ModificationItemImpl;
 import org.apache.directory.shared.ldap.schema.syntax.AbstractAdsSchemaDescription;
 import org.apache.directory.shared.ldap.schema.syntax.AbstractSchemaDescription;
 import org.apache.directory.shared.ldap.schema.syntax.AttributeTypeDescription;
@@ -189,72 +188,6 @@
                     }
                     targetEntry.put( combined );
                 }
-                break;
-            default:
-                throw new IllegalStateException( "undefined modification type: " + modOp );
-        }
-
-        return targetEntry;
-    }
-
-
-    /**
-     * Gets the target entry as it would look after a modification operation 
-     * was performed on it.
-     * 
-     * @param mod the modification
-     * @param entry the source entry that is modified
-     * @return the resultant entry after the modification has taken place
-     * @throws NamingException if there are problems accessing attributes
-     */
-    public static Attributes getTargetEntry( ModificationItemImpl mod, Attributes entry ) throws NamingException
-    {
-        Attributes targetEntry = ( Attributes ) entry.clone();
-        int modOp = mod.getModificationOp();
-        switch ( modOp )
-        {
-            case ( DirContext.REPLACE_ATTRIBUTE  ):
-                targetEntry.put( mod.getAttribute() );
-                break;
-            case ( DirContext.REMOVE_ATTRIBUTE  ):;
-                Attribute toBeRemoved = mod.getAttribute();
-
-                if ( toBeRemoved.size() == 0 )
-                {
-                    targetEntry.remove( mod.getAttribute().getID() );
-                }
-                else
-                {
-                    Attribute existing = targetEntry.get( mod.getAttribute().getID() );
-
-                    if ( existing != null )
-                    {
-                        for ( int ii = 0; ii < toBeRemoved.size(); ii++ )
-                        {
-                            existing.remove( toBeRemoved.get( ii ) );
-                        }
-                    }
-                }
-                break;
-            case ( DirContext.ADD_ATTRIBUTE  ):
-                String id = mod.getAttribute().getID();
-                Attribute combined = new AttributeImpl( id );
-                Attribute toBeAdded = mod.getAttribute();
-                Attribute existing = entry.get( id );
-
-                if ( existing != null )
-                {
-                    for ( int ii = 0; ii < existing.size(); ii++ )
-                    {
-                        combined.add( existing.get( ii ) );
-                    }
-                }
-
-                for ( int ii = 0; ii < toBeAdded.size(); ii++ )
-                {
-                    combined.add( toBeAdded.get( ii ) );
-                }
-                targetEntry.put( combined );
                 break;
             default:
                 throw new IllegalStateException( "undefined modification type: " + modOp );



Mime
View raw message