directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r612574 [1/2] - in /directory/apacheds/branches/bigbang: core-entry/src/main/java/org/apache/directory/server/core/entry/ core-integ/src/test/java/org/apache/directory/server/core/schema/ core/src/main/java/org/apache/directory/server/core/...
Date Wed, 16 Jan 2008 21:37:34 GMT
Author: elecharny
Date: Wed Jan 16 13:37:31 2008
New Revision: 612574

URL: http://svn.apache.org/viewvc?rev=612574&view=rev
Log:
Removed a lot of Attribute(s) and replaved them with ServerEntry/ServerAttribute

Modified:
    directory/apacheds/branches/bigbang/core-entry/src/main/java/org/apache/directory/server/core/entry/DefaultServerAttribute.java
    directory/apacheds/branches/bigbang/core-entry/src/main/java/org/apache/directory/server/core/entry/ObjectClassAttribute.java
    directory/apacheds/branches/bigbang/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerAttribute.java
    directory/apacheds/branches/bigbang/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerEntryUtils.java
    directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/AbstractSchemaChangeHandler.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/AttributeClassLoader.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/DescriptionParsers.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandler.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/MetaComparatorHandler.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/MetaDitContentRuleHandler.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/MetaDitStructureRuleHandler.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/MetaMatchingRuleHandler.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/MetaMatchingRuleUseHandler.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/MetaNameFormHandler.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/MetaNormalizerHandler.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/MetaObjectClassHandler.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/MetaSchemaHandler.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/MetaSyntaxCheckerHandler.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/MetaSyntaxHandler.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/SchemaChangeHandler.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/SchemaEntityFactory.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/SchemaOperationControl.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDao.java
    directory/apacheds/branches/bigbang/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultRegistries.java

Modified: directory/apacheds/branches/bigbang/core-entry/src/main/java/org/apache/directory/server/core/entry/DefaultServerAttribute.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core-entry/src/main/java/org/apache/directory/server/core/entry/DefaultServerAttribute.java?rev=612574&r1=612573&r2=612574&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core-entry/src/main/java/org/apache/directory/server/core/entry/DefaultServerAttribute.java (original)
+++ directory/apacheds/branches/bigbang/core-entry/src/main/java/org/apache/directory/server/core/entry/DefaultServerAttribute.java Wed Jan 16 13:37:31 2008
@@ -19,7 +19,6 @@
 package org.apache.directory.server.core.entry;
 
 
-import org.apache.directory.server.schema.registries.Registries;
 import org.apache.directory.shared.ldap.entry.AbstractBinaryValue;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.entry.AbstractStringValue;
@@ -571,6 +570,54 @@
         }
         
         return values.iterator().next();
+    }
+
+    
+    /**
+     * Get the String value, if and only if the value is known to be a String,
+     * otherwise a InvalidAttributeValueException will be thrown
+     *
+     * @return The value as a String
+     * @throws InvalidAttributeValueException If the value is a byte[]
+     */
+    public String getString() throws InvalidAttributeValueException
+    {
+        ServerValue<?> value = get();
+        
+        if ( value instanceof ServerStringValue )
+        {
+            return (String)value.get();
+        }
+        else
+        {
+            String message = "The value is expected to be a String";
+            LOG.error( message );
+            throw new InvalidAttributeValueException( message );
+        }
+    }
+
+
+    /**
+     * Get the byte[] value, if and only if the value is known to be Binary,
+     * otherwise a InvalidAttributeValueException will be thrown
+     *
+     * @return The value as a String
+     * @throws InvalidAttributeValueException If the value is a String
+     */
+    public byte[] getBytes() throws InvalidAttributeValueException
+    {
+        ServerValue<?> value = get();
+        
+        if ( value instanceof ServerBinaryValue )
+        {
+            return (byte[])value.get();
+        }
+        else
+        {
+            String message = "The value is expected to be a byte[]";
+            LOG.error( message );
+            throw new InvalidAttributeValueException( message );
+        }
     }
 
 

Modified: directory/apacheds/branches/bigbang/core-entry/src/main/java/org/apache/directory/server/core/entry/ObjectClassAttribute.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core-entry/src/main/java/org/apache/directory/server/core/entry/ObjectClassAttribute.java?rev=612574&r1=612573&r2=612574&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core-entry/src/main/java/org/apache/directory/server/core/entry/ObjectClassAttribute.java (original)
+++ directory/apacheds/branches/bigbang/core-entry/src/main/java/org/apache/directory/server/core/entry/ObjectClassAttribute.java Wed Jan 16 13:37:31 2008
@@ -27,6 +27,7 @@
 
 import javax.naming.NamingException;
 import javax.naming.directory.InvalidAttributeIdentifierException;
+import javax.naming.directory.InvalidAttributeValueException;
 
 import java.util.HashSet;
 import java.util.Iterator;
@@ -399,6 +400,45 @@
     }
 
     
+    /**
+     * Get the String value, if and only if the value is known to be a String,
+     * otherwise a InvalidAttributeValueException will be thrown
+     *
+     * @return The value as a String
+     * @throws InvalidAttributeValueException If the value is a byte[]
+     */
+    public String getString() throws InvalidAttributeValueException
+    {
+        ServerValue<?> value = get();
+        
+        if ( value instanceof ServerStringValue )
+        {
+            return (String)value.get();
+        }
+        else
+        {
+            String message = "The value is expected to be a String";
+            LOG.error( message );
+            throw new InvalidAttributeValueException( message );
+        }
+    }
+
+
+    /**
+     * Get the byte[] value, if and only if the value is known to be Binary,
+     * otherwise a InvalidAttributeValueException will be thrown
+     *
+     * @return The value as a String
+     * @throws InvalidAttributeValueException If the value is a String
+     */
+    public byte[] getBytes() throws InvalidAttributeValueException
+    {
+        String message = "The value for an objectClass is expected to be a String";
+        LOG.error( message );
+        throw new InvalidAttributeValueException( message );
+    }
+
+
     public boolean add( byte[] val )
     {
         String message = "Binary values are not accepted by ObjectClassAttributes";

Modified: directory/apacheds/branches/bigbang/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerAttribute.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerAttribute.java?rev=612574&r1=612573&r2=612574&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerAttribute.java (original)
+++ directory/apacheds/branches/bigbang/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerAttribute.java Wed Jan 16 13:37:31 2008
@@ -23,6 +23,7 @@
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 
 import javax.naming.NamingException;
+import javax.naming.directory.InvalidAttributeValueException;
 
 
 /**
@@ -78,4 +79,24 @@
      * @throws NamingException if there is a failure to check syntaxes of values
      */
     boolean isValid() throws NamingException;
+    
+    
+    /**
+     * Get the String value, if and only if the value is known to be a String,
+     * otherwise a InvalidAttributeValueException will be thrown
+     *
+     * @return The value as a String
+     * @throws InvalidAttributeValueException If the value is a byte[]
+     */
+    String getString() throws InvalidAttributeValueException;
+
+
+    /**
+     * Get the byte[] value, if and only if the value is known to be Binary,
+     * otherwise a InvalidAttributeValueException will be thrown
+     *
+     * @return The value as a String
+     * @throws InvalidAttributeValueException If the value is a String
+     */
+    byte[] getBytes() throws InvalidAttributeValueException;
 }

Modified: directory/apacheds/branches/bigbang/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerEntryUtils.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerEntryUtils.java?rev=612574&r1=612573&r2=612574&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerEntryUtils.java (original)
+++ directory/apacheds/branches/bigbang/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerEntryUtils.java Wed Jan 16 13:37:31 2008
@@ -86,6 +86,11 @@
     public static ServerAttribute toServerAttribute( Attribute attribute, AttributeType attributeType )
             throws InvalidAttributeIdentifierException
     {
+        if ( attribute == null )
+        {
+            return null;
+        }
+        
         try 
         {
             ServerAttribute serverAttribute = new DefaultServerAttribute( attributeType );

Modified: directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java?rev=612574&r1=612573&r2=612574&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java (original)
+++ directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java Wed Jan 16 13:37:31 2008
@@ -22,6 +22,8 @@
 
 import jdbm.helper.IntegerComparator;
 import org.apache.directory.server.core.DirectoryService;
+import org.apache.directory.server.core.entry.ServerEntry;
+import org.apache.directory.server.core.entry.ServerEntryUtils;
 import org.apache.directory.server.core.integ.CiRunner;
 import static org.apache.directory.server.core.integ.IntegrationUtils.getSchemaContext;
 import static org.apache.directory.server.core.integ.IntegrationUtils.getRootContext;
@@ -265,7 +267,10 @@
             attrs = getSchemaContext( service ).getAttributes( "m-oid=" + oid + ",ou=syntaxCheckers,cn=" + schemaName );
             assertNotNull( attrs );
             SchemaEntityFactory factory = new SchemaEntityFactory( service.getRegistries() );
-            SyntaxChecker syntaxChecker = factory.getSyntaxChecker( attrs, service.getRegistries() );
+            
+            ServerEntry serverEntry = ServerEntryUtils.toServerEntry( attrs, LdapDN.EMPTY_LDAPDN, service.getRegistries() );
+
+            SyntaxChecker syntaxChecker = factory.getSyntaxChecker( serverEntry, service.getRegistries() );
             assertEquals( oid, syntaxChecker.getSyntaxOid() );
         }
         else
@@ -1394,10 +1399,12 @@
         
         Attributes attrs = getSubschemaSubentryAttributes();
         Attribute attrTypes = attrs.get( "attributeTypes" );
-        AttributeTypeDescription attributeTypeDescription = null; 
+        AttributeTypeDescription attributeTypeDescription = null;
+        
         for ( int ii = 0; ii < attrTypes.size(); ii++ )
         {
             String desc = ( String ) attrTypes.get( ii );
+            
             if ( desc.indexOf( "1.3.6.1.4.1.18060.0.4.0.2.10000" ) != -1 )
             {
                 attributeTypeDescription = ATTRIBUTE_TYPE_DESCRIPTION_SCHEMA_PARSER.parseAttributeTypeDescription( desc );
@@ -1410,7 +1417,10 @@
         attrs = getSchemaContext( service ).getAttributes( "m-oid=1.3.6.1.4.1.18060.0.4.0.2.10000,ou=attributeTypes,cn=nis" );
         assertNotNull( attrs );
         SchemaEntityFactory factory = new SchemaEntityFactory( service.getRegistries() );
-        AttributeType at = factory.getAttributeType( attrs, service.getRegistries(), "nis" );
+        
+        ServerEntry serverEntry = ServerEntryUtils.toServerEntry( attrs, LdapDN.EMPTY_LDAPDN, service.getRegistries() );
+        
+        AttributeType at = factory.getAttributeType( serverEntry, service.getRegistries(), "nis" );
         assertEquals( "1.3.6.1.4.1.18060.0.4.0.2.10000", at.getOid() );
         assertEquals( "name", at.getSuperior().getName() );
         assertEquals( "bogus description", at.getDescription() );
@@ -1444,6 +1454,7 @@
         Attributes attrs = getSubschemaSubentryAttributes();
         Attribute attrTypes = attrs.get( "attributeTypes" );
         AttributeTypeDescription attributeTypeDescription = null; 
+        
         for ( int ii = 0; ii < attrTypes.size(); ii++ )
         {
             String desc = ( String ) attrTypes.get( ii );
@@ -1468,7 +1479,10 @@
                 "m-oid=1.3.6.1.4.1.18060.0.4.0.2.10000,ou=attributeTypes,cn=nis" );
         assertNotNull( attrs );
         SchemaEntityFactory factory = new SchemaEntityFactory( service.getRegistries() );
-        AttributeType at = factory.getAttributeType( attrs, service.getRegistries(), "nis" );
+        
+        ServerEntry serverEntry = ServerEntryUtils.toServerEntry( attrs, LdapDN.EMPTY_LDAPDN, service.getRegistries() );
+
+        AttributeType at = factory.getAttributeType( serverEntry, service.getRegistries(), "nis" );
         assertEquals( "1.3.6.1.4.1.18060.0.4.0.2.10000", at.getOid() );
         assertEquals( "name", at.getSuperior().getName() );
         assertEquals( "bogus description", at.getDescription() );

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/AbstractSchemaChangeHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/AbstractSchemaChangeHandler.java?rev=612574&r1=612573&r2=612574&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/AbstractSchemaChangeHandler.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/AbstractSchemaChangeHandler.java Wed Jan 16 13:37:31 2008
@@ -21,6 +21,8 @@
 
 
 import org.apache.directory.server.constants.MetaSchemaConstants;
+import org.apache.directory.server.core.entry.ServerAttribute;
+import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.schema.bootstrap.Schema;
 import org.apache.directory.server.schema.registries.Registries;
 import org.apache.directory.shared.ldap.exception.LdapNamingException;
@@ -29,11 +31,8 @@
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.SchemaObject;
-import org.apache.directory.shared.ldap.util.AttributeUtils;
 
 import javax.naming.NamingException;
-import javax.naming.directory.Attribute;
-import javax.naming.directory.Attributes;
 import javax.naming.directory.SearchResult;
 import java.util.HashSet;
 import java.util.List;
@@ -63,7 +62,7 @@
     }
     
     
-    protected void checkOidIsUnique( Attributes entry ) throws NamingException
+    protected void checkOidIsUnique( ServerEntry entry ) throws NamingException
     {
         String oid = getOid( entry );
 
@@ -97,19 +96,19 @@
     }
     
     
-    protected abstract void modify( LdapDN name, Attributes entry, Attributes targetEntry, boolean cascade ) 
+    protected abstract void modify( LdapDN name, ServerEntry entry, ServerEntry targetEntry, boolean cascade ) 
         throws NamingException;
     
     
-    public final void modify( LdapDN name, int modOp, Attributes mods, Attributes entry, Attributes targetEntry, 
+    public final void modify( LdapDN name, int modOp, ServerEntry mods, ServerEntry entry, ServerEntry targetEntry, 
         boolean cascade ) throws NamingException
     {
         modify( name, entry, targetEntry, cascade );
     }
 
 
-    public final void modify( LdapDN name, List<ModificationItemImpl> mods, Attributes entry,
-        Attributes targetEntry, boolean cascade ) throws NamingException
+    public final void modify( LdapDN name, List<ModificationItemImpl> mods, ServerEntry entry,
+        ServerEntry targetEntry, boolean cascade ) throws NamingException
     {
         modify( name, entry, targetEntry, cascade );
     }
@@ -130,14 +129,16 @@
     }
     
     
-    protected String getOid( Attributes entry ) throws NamingException
+    protected String getOid( ServerEntry entry ) throws NamingException
     {
-        Attribute oid = AttributeUtils.getAttribute( entry, m_oidAT );
+        ServerAttribute oid = entry.get( m_oidAT );
+        
         if ( oid == null )
         {
             return null;
         }
-        return ( String ) oid.get();
+        
+        return oid.getString();
     }
     
     

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/AttributeClassLoader.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/AttributeClassLoader.java?rev=612574&r1=612573&r2=612574&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/AttributeClassLoader.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/AttributeClassLoader.java Wed Jan 16 13:37:31 2008
@@ -23,7 +23,11 @@
 
 
 import javax.naming.NamingException;
-import javax.naming.directory.Attribute;
+import javax.naming.directory.InvalidAttributeValueException;
+
+import org.apache.directory.server.core.entry.ServerAttribute;
+import org.apache.directory.server.core.entry.ServerBinaryValue;
+import org.apache.directory.server.core.entry.ServerValue;
 
 
 /**
@@ -34,7 +38,7 @@
  */
 public class AttributeClassLoader extends ClassLoader
 {
-    public Attribute attribute;
+    public ServerAttribute attribute;
     
 
     public AttributeClassLoader()
@@ -43,26 +47,32 @@
     }
     
     
-    public void setAttribute( Attribute attribute )
+    public void setAttribute( ServerAttribute attribute ) throws NamingException
     {
+        if ( attribute.getType().getSyntax().isHumanReadable() )
+        {
+            throw new InvalidAttributeValueException( "The attribute must be binary" );
+        }
+        
         this.attribute = attribute;
     }
 
     
-    @SuppressWarnings("unchecked")
-    public Class findClass( String name ) throws ClassNotFoundException
+    public Class<?> findClass( String name ) throws ClassNotFoundException
     {
         byte[] classBytes = null;
         
-        try
+        ServerValue<?> value = attribute.get();
+        
+        if ( value instanceof ServerBinaryValue )
         {
-            classBytes = ( byte[] ) attribute.get();
+            classBytes = ((ServerBinaryValue)value).get();
+
+            return defineClass( name, classBytes, 0, classBytes.length );
         }
-        catch ( NamingException e )
+        else
         {
-            throw new ClassNotFoundException( "Failed to access attribute bytes.", e );
+            throw new ClassNotFoundException( "Failed to access attribute bytes." );
         }
-        
-        return defineClass( name, classBytes, 0, classBytes.length );
     }
 }

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/DescriptionParsers.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/DescriptionParsers.java?rev=612574&r1=612573&r2=612574&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/DescriptionParsers.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/DescriptionParsers.java Wed Jan 16 13:37:31 2008
@@ -21,12 +21,14 @@
 
 
 import java.text.ParseException;
+import java.util.Iterator;
 import java.util.List;
 
 import javax.naming.NamingException;
-import javax.naming.directory.Attribute;
 
 import org.apache.directory.server.constants.MetaSchemaConstants;
+import org.apache.directory.server.core.entry.ServerAttribute;
+import org.apache.directory.server.core.entry.ServerValue;
 import org.apache.directory.server.schema.registries.Registries;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeValueException;
@@ -132,7 +134,7 @@
     }
 
     
-    public SyntaxCheckerDescription[] parseSyntaxCheckers( Attribute attr ) throws NamingException
+    public SyntaxCheckerDescription[] parseSyntaxCheckers( ServerAttribute attr ) throws NamingException
     {
         if ( attr == null || attr.size() == 0 )
         {
@@ -141,17 +143,22 @@
         
         SyntaxCheckerDescription[] syntaxCheckerDescriptions = new SyntaxCheckerDescription[attr.size()];
         
-        for ( int ii = 0; ii < attr.size(); ii++ )
+        Iterator<ServerValue<?>> values = attr.getAll();
+        int pos = 0;
+        
+        while ( values.hasNext() )
         {
+            String value = (String)values.next().get();
+            
             try
             {
-                syntaxCheckerDescriptions[ii] = 
-                    syntaxCheckerParser.parseSyntaxCheckerDescription( ( String ) attr.get( ii ) );
+                syntaxCheckerDescriptions[pos++] = 
+                    syntaxCheckerParser.parseSyntaxCheckerDescription( value );
             }
             catch ( ParseException e )
             {
                 LdapInvalidAttributeValueException iave = new LdapInvalidAttributeValueException( 
-                    "The following does not conform to the syntaxCheckerDescription syntax: " + attr.get( ii ), 
+                    "The following does not conform to the syntaxCheckerDescription syntax: " + value, 
                     ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
                 iave.setRootCause( e );
                 throw iave;
@@ -162,7 +169,7 @@
     }
     
     
-    public NormalizerDescription[] parseNormalizers( Attribute attr ) throws NamingException
+    public NormalizerDescription[] parseNormalizers( ServerAttribute attr ) throws NamingException
     {
         if ( attr == null || attr.size() == 0 )
         {
@@ -171,16 +178,21 @@
         
         NormalizerDescription[] normalizerDescriptions = new NormalizerDescription[attr.size()];
         
-        for ( int ii = 0; ii < attr.size(); ii++ )
+        Iterator<ServerValue<?>> values = attr.getAll();
+        int pos = 0;
+        
+        while( values.hasNext() )
         {
+            ServerValue<?> value = values.next();
+        
             try
             {
-                normalizerDescriptions[ii] = normalizerParser.parseNormalizerDescription( ( String ) attr.get( ii ) );
+                normalizerDescriptions[pos++] = normalizerParser.parseNormalizerDescription( (String)value.get() );
             }
             catch ( ParseException e )
             {
                 LdapInvalidAttributeValueException iave = new LdapInvalidAttributeValueException( 
-                    "The following does not conform to the normalizerDescription syntax: " + attr.get( ii ), 
+                    "The following does not conform to the normalizerDescription syntax: " + value.get(), 
                     ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
                 iave.setRootCause( e );
                 throw iave;
@@ -191,7 +203,7 @@
     }
     
 
-    public ComparatorDescription[] parseComparators( Attribute attr ) throws NamingException
+    public ComparatorDescription[] parseComparators( ServerAttribute attr ) throws NamingException
     {
         if ( attr == null || attr.size() == 0 )
         {
@@ -200,16 +212,21 @@
         
         ComparatorDescription[] comparatorDescriptions = new ComparatorDescription[attr.size()];
         
-        for ( int ii = 0; ii < attr.size(); ii++ )
+        Iterator<ServerValue<?>> values = attr.getAll();
+        int pos = 0;
+        
+        while( values.hasNext() )
         {
+            ServerValue<?> value = values.next();
+
             try
             {
-                comparatorDescriptions[ii] = comparatorParser.parseComparatorDescription( ( String ) attr.get( ii ) );
+                comparatorDescriptions[pos++] = comparatorParser.parseComparatorDescription( ( String ) value.get() );
             }
             catch ( ParseException e )
             {
                 LdapInvalidAttributeValueException iave = new LdapInvalidAttributeValueException( 
-                    "The following does not conform to the comparatorDescription syntax: " + attr.get( ii ), 
+                    "The following does not conform to the comparatorDescription syntax: " + value.get(), 
                     ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
                 iave.setRootCause( e );
                 throw iave;
@@ -228,7 +245,7 @@
      * @return the set of attributeType objects for the descriptions 
      * @throws NamingException if there are problems parsing the descriptions
      */
-    public AttributeType[] parseAttributeTypes( Attribute attr ) throws NamingException
+    public AttributeType[] parseAttributeTypes( ServerAttribute attr ) throws NamingException
     {
         if ( attr == null || attr.size() == 0 )
         {
@@ -237,18 +254,23 @@
         
         AttributeType[] attributeTypes = new AttributeType[attr.size()];
         
-        for ( int ii = 0; ii < attr.size(); ii++ )
+        Iterator<ServerValue<?>> values = attr.getAll();
+        int pos = 0;
+        
+        while( values.hasNext() )
         {
+            ServerValue<?> value = values.next();
+        
             AttributeTypeDescription desc = null;
             
             try
             {
-                desc = attributeTypeParser.parseAttributeTypeDescription( ( String ) attr.get( ii ) );
+                desc = attributeTypeParser.parseAttributeTypeDescription( ( String ) value.get() );
             }
             catch ( ParseException e )
             {
                 LdapInvalidAttributeValueException iave = new LdapInvalidAttributeValueException( 
-                    "The following does not conform to the attributeTypeDescription syntax: " + attr.get( ii ), 
+                    "The following does not conform to the attributeTypeDescription syntax: " + value.get(), 
                     ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
                 iave.setRootCause( e );
                 throw iave;
@@ -346,7 +368,7 @@
             
             setSchemaObjectProperties( desc, at );
 
-            attributeTypes[ii] = at;
+            attributeTypes[pos++] = at;
         }
         
         return attributeTypes;
@@ -361,7 +383,7 @@
      * @return the set of objectClass objects for the descriptions 
      * @throws NamingException if there are problems parsing the descriptions
      */
-    public ObjectClass[] parseObjectClasses( Attribute attr ) throws NamingException
+    public ObjectClass[] parseObjectClasses( ServerAttribute attr ) throws NamingException
     {
         if ( attr == null || attr.size() == 0 )
         {
@@ -370,18 +392,23 @@
         
         ObjectClass[] objectClasses = new ObjectClass[attr.size()];
         
-        for ( int ii = 0; ii < attr.size(); ii++ )
+        Iterator<ServerValue<?>> values = attr.getAll();
+        int pos = 0;
+        
+        while( values.hasNext() )
         {
+            ServerValue<?> value = values.next();
+
             ObjectClassDescription desc = null;
             
             try
             {
-                desc = objectClassParser.parseObjectClassDescription( ( String ) attr.get( ii ) );
+                desc = objectClassParser.parseObjectClassDescription( ( String ) value.get() );
             }
             catch ( ParseException e )
             {
                 LdapInvalidAttributeValueException iave = new LdapInvalidAttributeValueException( 
-                    "The following does not conform to the objectClassDescription syntax: " + attr.get( ii ), 
+                    "The following does not conform to the objectClassDescription syntax: " + value.get(), 
                     ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
                 iave.setRootCause( e );
                 throw iave;
@@ -445,7 +472,7 @@
             oc.setType( desc.getKind() );
             setSchemaObjectProperties( desc, oc );
             
-            objectClasses[ii] = oc;
+            objectClasses[pos++] = oc;
         }
         
         return objectClasses;
@@ -460,7 +487,7 @@
      * @return the set of matchingRuleUse objects for the descriptions 
      * @throws NamingException if there are problems parsing the descriptions
      */
-    public MatchingRuleUse[] parseMatchingRuleUses( Attribute attr ) throws NamingException
+    public MatchingRuleUse[] parseMatchingRuleUses( ServerAttribute attr ) throws NamingException
     {
         if ( attr == null || attr.size() == 0 )
         {
@@ -469,18 +496,23 @@
         
         MatchingRuleUse[] matchingRuleUses = new MatchingRuleUse[attr.size()];
         
-        for ( int ii = 0; ii < attr.size(); ii++ )
+        Iterator<ServerValue<?>> values = attr.getAll();
+        int pos = 0;
+        
+        while( values.hasNext() )
         {
+            ServerValue<?> value = values.next();
+
             MatchingRuleUseDescription desc = null;
             
             try
             {
-                desc = matchingRuleUseParser.parseMatchingRuleUseDescription( ( String ) attr.get( ii ) );
+                desc = matchingRuleUseParser.parseMatchingRuleUseDescription( ( String ) value.get() );
             }
             catch ( ParseException e )
             {
                 LdapInvalidAttributeValueException iave = new LdapInvalidAttributeValueException( 
-                    "The following does not conform to the matchingRuleUseDescription syntax: " + attr.get( ii ), 
+                    "The following does not conform to the matchingRuleUseDescription syntax: " + value.get(), 
                     ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
                 iave.setRootCause( e );
                 throw iave;
@@ -490,7 +522,7 @@
             mru.setApplicableAttributesOids( desc.getApplicableAttributes().toArray( EMPTY ) );
             setSchemaObjectProperties( desc, mru );
             
-            matchingRuleUses[ii] = mru;
+            matchingRuleUses[pos++] = mru;
         }
 
         return matchingRuleUses;
@@ -505,7 +537,7 @@
      * @return the set of Syntax objects for the descriptions 
      * @throws NamingException if there are problems parsing the descriptions
      */
-    public Syntax[] parseSyntaxes( Attribute attr ) throws NamingException
+    public Syntax[] parseSyntaxes( ServerAttribute attr ) throws NamingException
     {
         if ( attr == null || attr.size() == 0 )
         {
@@ -513,19 +545,23 @@
         }
         
         Syntax[] syntaxes = new Syntax[attr.size()];
+
+        Iterator<ServerValue<?>> values = attr.getAll();
+        int pos = 0;
         
-        for ( int ii = 0; ii < attr.size(); ii++ )
+        while( values.hasNext() )
         {
+            ServerValue<?> value = values.next();
             LdapSyntaxDescription desc = null;
             
             try
             {
-                desc = syntaxParser.parseLdapSyntaxDescription( ( String ) attr.get( ii ) );
+                desc = syntaxParser.parseLdapSyntaxDescription( ( String ) value.get() );
             }
             catch ( ParseException e )
             {
                 LdapInvalidAttributeValueException iave = new LdapInvalidAttributeValueException( 
-                    "The following does not conform to the ldapSyntaxDescription syntax: " + attr.get( ii ), 
+                    "The following does not conform to the ldapSyntaxDescription syntax: " + value.get(), 
                     ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
                 iave.setRootCause( e );
                 throw iave;
@@ -542,7 +578,7 @@
             SyntaxImpl syntax = new SyntaxImpl( desc.getNumericOid(), globalRegistries.getSyntaxCheckerRegistry() );
             setSchemaObjectProperties( desc, syntax );
             syntax.setHumanReadable( isHumanReadable( desc ) );
-            syntaxes[ii] = syntax;
+            syntaxes[pos++] = syntax;
         }
         
         return syntaxes;
@@ -557,7 +593,7 @@
      * @return the set of matchingRule objects for the descriptions 
      * @throws NamingException if there are problems parsing the descriptions
      */
-    public MatchingRule[] parseMatchingRules( Attribute attr ) throws NamingException
+    public MatchingRule[] parseMatchingRules( ServerAttribute attr ) throws NamingException
     {
         if ( attr == null || attr.size() == 0 )
         {
@@ -566,18 +602,23 @@
         
         MatchingRule[] matchingRules = new MatchingRule[attr.size()];
 
-        for ( int ii = 0; ii < attr.size(); ii++ )
+        Iterator<ServerValue<?>> values = attr.getAll();
+        int pos = 0;
+        
+        while( values.hasNext() )
         {
+            ServerValue<?> value = values.next();
+
             MatchingRuleDescription desc = null;
 
             try
             {
-                desc = matchingRuleParser.parseMatchingRuleDescription( ( String ) attr.get( ii ) );
+                desc = matchingRuleParser.parseMatchingRuleDescription( ( String ) value.get() );
             }
             catch ( ParseException e )
             {
                 LdapInvalidAttributeValueException iave = new LdapInvalidAttributeValueException( 
-                    "The following does not conform to the matchingRuleDescription syntax: " + attr.get( ii ), 
+                    "The following does not conform to the matchingRuleDescription syntax: " + value.get(), 
                     ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
                 iave.setRootCause( e );
                 throw iave;
@@ -593,7 +634,7 @@
             MatchingRuleImpl mr = new MatchingRuleImpl( desc.getNumericOid(), desc.getSyntax(), globalRegistries );
             setSchemaObjectProperties( desc, mr );
             
-            matchingRules[ii] = mr;
+            matchingRules[pos++] = mr;
         }
         
         return matchingRules;
@@ -608,7 +649,7 @@
      * @return the set of DITStructureRule objects for the descriptions 
      * @throws NamingException if there are problems parsing the descriptions
      */
-    public DITStructureRule[] parseDitStructureRules( Attribute attr ) throws NamingException
+    public DITStructureRule[] parseDitStructureRules( ServerAttribute attr ) throws NamingException
     {
         if ( attr == null || attr.size() == 0 )
         {
@@ -617,18 +658,22 @@
         
         DITStructureRule[] ditStructureRules = new DITStructureRule[attr.size()];
         
-        for ( int ii = 0; ii < attr.size(); ii++ )
+        Iterator<ServerValue<?>> values = attr.getAll();
+        int pos = 0;
+        
+        while( values.hasNext() )
         {
+            ServerValue<?> value = values.next();
             DITStructureRuleDescription desc = null;
      
             try
             {
-                desc = ditStructureRuleParser.parseDITStructureRuleDescription( ( String ) attr.get( ii  ) );
+                desc = ditStructureRuleParser.parseDITStructureRuleDescription( ( String ) value.get() );
             }
             catch ( ParseException e )
             {
                 LdapInvalidAttributeValueException iave = new LdapInvalidAttributeValueException( 
-                    "The following does not conform to the ditStructureRuleDescription syntax: " + attr.get( ii ), 
+                    "The following does not conform to the ditStructureRuleDescription syntax: " + value.get(), 
                     ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
                 iave.setRootCause( e );
                 throw iave;
@@ -640,7 +685,7 @@
             
             setSchemaObjectProperties( desc, dsr );
 
-            ditStructureRules[ii] = dsr;
+            ditStructureRules[pos++] = dsr;
         }
         
         return ditStructureRules;
@@ -655,7 +700,7 @@
      * @return the set of DITContentRule objects for the descriptions 
      * @throws NamingException if there are problems parsing the descriptions
      */
-    public DITContentRule[] parseDitContentRules( Attribute attr ) throws NamingException
+    public DITContentRule[] parseDitContentRules( ServerAttribute attr ) throws NamingException
     {
         if ( attr == null || attr.size() == 0 )
         {
@@ -663,19 +708,23 @@
         }
         
         DITContentRule[] ditContentRules = new DITContentRule[attr.size()];
+
+        Iterator<ServerValue<?>> values = attr.getAll();
+        int pos = 0;
         
-        for ( int ii = 0; ii < attr.size(); ii++ )
+        while( values.hasNext() )
         {
+            ServerValue<?> value = values.next();
             DITContentRuleDescription desc = null;
      
             try
             {
-                desc = ditContentRuleParser.parseDITContentRuleDescription( ( String ) attr.get( ii  ) );
+                desc = ditContentRuleParser.parseDITContentRuleDescription( ( String ) value.get() );
             }
             catch ( ParseException e )
             {
                 LdapInvalidAttributeValueException iave = new LdapInvalidAttributeValueException( 
-                    "The following does not conform to the ditContentRuleDescription syntax: " + attr.get( ii ), 
+                    "The following does not conform to the ditContentRuleDescription syntax: " + value.get(), 
                     ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
                 iave.setRootCause( e );
                 throw iave;
@@ -689,7 +738,7 @@
             
             setSchemaObjectProperties( desc, dcr );
 
-            ditContentRules[ii] = dcr;
+            ditContentRules[pos++] = dcr;
         }
         
         return ditContentRules;
@@ -704,7 +753,7 @@
      * @return the set of NameFormRule objects for the descriptions 
      * @throws NamingException if there are problems parsing the descriptions
      */
-    public NameForm[] parseNameForms( Attribute attr ) throws NamingException
+    public NameForm[] parseNameForms( ServerAttribute attr ) throws NamingException
     {
         if ( attr == null || attr.size() == 0 )
         {
@@ -712,19 +761,23 @@
         }
         
         NameForm[] nameForms = new NameForm[attr.size()];
+
+        Iterator<ServerValue<?>> values = attr.getAll();
+        int pos = 0;
         
-        for ( int ii = 0; ii < attr.size(); ii++ )
+        while( values.hasNext() )
         {
+            ServerValue<?> value = values.next();
             NameFormDescription desc = null;
             
             try
             {
-                desc = nameFormParser.parseNameFormDescription( ( String  ) attr.get( ii ) );
+                desc = nameFormParser.parseNameFormDescription( ( String  ) value.get() );
             }
             catch ( ParseException e )
             {
                 LdapInvalidAttributeValueException iave = new LdapInvalidAttributeValueException( 
-                    "The following does not conform to the nameFormDescription syntax: " + attr.get( ii ), 
+                    "The following does not conform to the nameFormDescription syntax: " + value.get(), 
                     ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
                 iave.setRootCause( e );
                 throw iave;
@@ -737,7 +790,7 @@
             
             setSchemaObjectProperties( desc, nf );
             
-            nameForms[ii] = nf;
+            nameForms[pos++] = nf;
         }
         
         return nameForms;

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandler.java?rev=612574&r1=612573&r2=612574&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandler.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandler.java Wed Jan 16 13:37:31 2008
@@ -23,17 +23,16 @@
 import java.util.Set;
 
 import javax.naming.NamingException;
-import javax.naming.directory.Attributes;
 import javax.naming.directory.SearchResult;
 
 import org.apache.directory.server.constants.MetaSchemaConstants;
+import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.schema.bootstrap.Schema;
 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.exception.LdapInvalidNameException;
 import org.apache.directory.shared.ldap.exception.LdapOperationNotSupportedException;
-import org.apache.directory.shared.ldap.message.AttributeImpl;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.name.Rdn;
@@ -64,7 +63,7 @@
     }
 
 
-    protected void modify( LdapDN name, Attributes entry, Attributes targetEntry, boolean cascade ) 
+    protected void modify( LdapDN name, ServerEntry entry, ServerEntry targetEntry, boolean cascade ) 
         throws NamingException
     {
         String oid = getOid( entry );
@@ -93,7 +92,7 @@
     }
 
 
-    public void add( LdapDN name, Attributes entry ) throws NamingException
+    public void add( LdapDN name, ServerEntry entry ) throws NamingException
     {
         LdapDN parentDn = ( LdapDN ) name.clone();
         parentDn.remove( parentDn.size() - 1 );
@@ -106,7 +105,7 @@
     }
 
 
-    public void delete( LdapDN name, Attributes entry, boolean cascade ) throws NamingException
+    public void delete( LdapDN name, ServerEntry entry, boolean cascade ) throws NamingException
     {
         String schemaName = getSchemaName( name );
         AttributeType at = factory.getAttributeType( entry, targetRegistries, schemaName );
@@ -135,7 +134,7 @@
     }
 
 
-    public void rename( LdapDN name, Attributes entry, Rdn newRdn, boolean cascade ) throws NamingException
+    public void rename( LdapDN name, ServerEntry entry, Rdn newRdn, boolean cascade ) throws NamingException
     {
         Schema schema = getSchema( name );
         AttributeType oldAt = factory.getAttributeType( entry, targetRegistries, schema.getSchemaName() );
@@ -149,10 +148,10 @@
                 ResultCodeEnum.UNWILLING_TO_PERFORM );
         }
 
-        Attributes targetEntry = ( Attributes ) entry.clone();
+        ServerEntry targetEntry = ( ServerEntry ) entry.clone();
         String newOid = ( String ) newRdn.getValue();
         checkOidIsUnique( newOid );
-        targetEntry.put( new AttributeImpl( MetaSchemaConstants.M_OID_AT, newOid ) );
+        targetEntry.put( MetaSchemaConstants.M_OID_AT, newOid );
         AttributeType at = factory.getAttributeType( targetEntry, targetRegistries, schema.getSchemaName() );
 
         if ( ! schema.isDisabled() )
@@ -170,7 +169,7 @@
 
 
     public void move( LdapDN oriChildName, LdapDN newParentName, Rdn newRn, boolean deleteOldRn,
-        Attributes entry, boolean cascade ) throws NamingException
+        ServerEntry entry, boolean cascade ) throws NamingException
     {
         checkNewParent( newParentName );
         Schema oldSchema = getSchema( oriChildName );
@@ -186,9 +185,9 @@
         }
 
         Schema newSchema = getSchema( newParentName );
-        Attributes targetEntry = ( Attributes ) entry.clone();
+        ServerEntry targetEntry = ( ServerEntry ) entry.clone();
         String newOid = ( String ) newRn.getValue();
-        targetEntry.put( new AttributeImpl( MetaSchemaConstants.M_OID_AT, newOid ) );
+        targetEntry.put( MetaSchemaConstants.M_OID_AT, newOid );
         checkOidIsUnique( newOid );
         AttributeType at = factory.getAttributeType( targetEntry, targetRegistries, newSchema.getSchemaName() );
 
@@ -209,7 +208,7 @@
     }
 
 
-    public void replace( LdapDN oriChildName, LdapDN newParentName, Attributes entry, boolean cascade ) 
+    public void replace( LdapDN oriChildName, LdapDN newParentName, ServerEntry entry, boolean cascade ) 
         throws NamingException
     {
         checkNewParent( newParentName );

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/MetaComparatorHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/MetaComparatorHandler.java?rev=612574&r1=612573&r2=612574&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/MetaComparatorHandler.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/MetaComparatorHandler.java Wed Jan 16 13:37:31 2008
@@ -25,10 +25,10 @@
 import java.util.List;
 
 import javax.naming.NamingException;
-import javax.naming.directory.Attribute;
-import javax.naming.directory.Attributes;
 
 import org.apache.directory.server.constants.MetaSchemaConstants;
+import org.apache.directory.server.core.entry.ServerAttribute;
+import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.schema.bootstrap.Schema;
 import org.apache.directory.server.schema.registries.ComparatorRegistry;
 import org.apache.directory.server.schema.registries.MatchingRuleRegistry;
@@ -42,7 +42,6 @@
 import org.apache.directory.shared.ldap.name.Rdn;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.syntax.ComparatorDescription;
-import org.apache.directory.shared.ldap.util.AttributeUtils;
 import org.apache.directory.shared.ldap.util.Base64;
 
 
@@ -76,7 +75,7 @@
     }
 
     
-    protected void modify( LdapDN name, Attributes entry, Attributes targetEntry, boolean cascade ) throws NamingException
+    protected void modify( LdapDN name, ServerEntry entry, ServerEntry targetEntry, boolean cascade ) throws NamingException
     {
         String oid = getOid( entry );
         Comparator comparator = factory.getComparator( targetEntry, targetRegistries );
@@ -91,25 +90,27 @@
     }
 
     
-    private ComparatorDescription getComparatorDescription( String schemaName, Attributes entry ) throws NamingException
+    private ComparatorDescription getComparatorDescription( String schemaName, ServerEntry entry ) throws NamingException
     {
         ComparatorDescription description = new ComparatorDescription();
         description.setNumericOid( getOid( entry ) );
         List<String> values = new ArrayList<String>();
         values.add( schemaName );
         description.addExtension( MetaSchemaConstants.X_SCHEMA, values );
-        description.setFqcn( ( String ) AttributeUtils.getAttribute( entry, fqcnAT ).get() );
+        description.setFqcn( entry.get( fqcnAT ).getString() );
+        
+        ServerAttribute desc = entry.get( descAT );
         
-        Attribute desc = AttributeUtils.getAttribute( entry, descAT );
         if ( desc != null && desc.size() > 0 )
         {
-            description.setDescription( ( String ) desc.get() );
+            description.setDescription( desc.getString() );
         }
         
-        Attribute bytecode = AttributeUtils.getAttribute( entry, byteCodeAT );
+        ServerAttribute bytecode = entry.get( byteCodeAT );
+
         if ( bytecode != null && bytecode.size() > 0 )
         {
-            byte[] bytes = ( byte[] ) bytecode.get();
+            byte[] bytes = bytecode.getBytes();
             description.setBytecode( new String( Base64.encode( bytes ) ) );
         }
 
@@ -117,7 +118,7 @@
     }
     
 
-    public void add( LdapDN name, Attributes entry ) throws NamingException
+    public void add( LdapDN name, ServerEntry entry ) throws NamingException
     {
         LdapDN parentDn = ( LdapDN ) name.clone();
         parentDn.remove( parentDn.size() - 1 );
@@ -154,7 +155,7 @@
     }
 
 
-    public void delete( LdapDN name, Attributes entry, boolean cascade ) throws NamingException
+    public void delete( LdapDN name, ServerEntry entry, boolean cascade ) throws NamingException
     {
         String oid = getOid( entry );
         delete( oid, cascade );
@@ -178,7 +179,7 @@
     }
 
     
-    public void rename( LdapDN name, Attributes entry, Rdn newRdn, boolean cascade ) throws NamingException
+    public void rename( LdapDN name, ServerEntry entry, Rdn newRdn, boolean cascade ) throws NamingException
     {
         String oldOid = getOid( entry );
 
@@ -206,7 +207,7 @@
 
 
     public void move( LdapDN oriChildName, LdapDN newParentName, Rdn newRdn, boolean deleteOldRn,
-        Attributes entry, boolean cascade ) throws NamingException
+        ServerEntry entry, boolean cascade ) throws NamingException
     {
         checkNewParent( newParentName );
         String oldOid = getOid( entry );
@@ -241,7 +242,7 @@
     }
 
 
-    public void replace( LdapDN oriChildName, LdapDN newParentName, Attributes entry, boolean cascade ) 
+    public void replace( LdapDN oriChildName, LdapDN newParentName, ServerEntry entry, boolean cascade ) 
         throws NamingException
     {
         checkNewParent( newParentName );
@@ -283,7 +284,7 @@
     }
 
 
-    private void checkOidIsUniqueForComparator( Attributes entry ) throws NamingException
+    private void checkOidIsUniqueForComparator( ServerEntry entry ) throws NamingException
     {
         String oid = getOid( entry );
         

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/MetaDitContentRuleHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/MetaDitContentRuleHandler.java?rev=612574&r1=612573&r2=612574&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/MetaDitContentRuleHandler.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/MetaDitContentRuleHandler.java Wed Jan 16 13:37:31 2008
@@ -20,13 +20,13 @@
 package org.apache.directory.server.core.schema;
 
 
+import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.schema.registries.Registries;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.name.Rdn;
 import org.apache.directory.shared.ldap.schema.DITContentRule;
 
 import javax.naming.NamingException;
-import javax.naming.directory.Attributes;
 
 
 /**
@@ -49,7 +49,7 @@
      * @see org.apache.directory.server.core.schema.AbstractSchemaChangeHandler#modify(org.apache.directory.shared.ldap.name.LdapDN, javax.naming.directory.Attributes, javax.naming.directory.Attributes)
      */
     @Override
-    protected void modify( LdapDN name, Attributes entry, Attributes targetEntry, boolean cascade ) 
+    protected void modify( LdapDN name, ServerEntry entry, ServerEntry targetEntry, boolean cascade ) 
         throws NamingException
     {
         // TODO Auto-generated method stub
@@ -60,7 +60,7 @@
     /* (non-Javadoc)
      * @see org.apache.directory.server.core.schema.SchemaChangeHandler#add(org.apache.directory.shared.ldap.name.LdapDN, javax.naming.directory.Attributes)
      */
-    public void add( LdapDN name, Attributes entry ) throws NamingException
+    public void add( LdapDN name, ServerEntry entry ) throws NamingException
     {
         // TODO Auto-generated method stub
 
@@ -70,7 +70,7 @@
     /* (non-Javadoc)
      * @see org.apache.directory.server.core.schema.SchemaChangeHandler#delete(org.apache.directory.shared.ldap.name.LdapDN, javax.naming.directory.Attributes)
      */
-    public void delete( LdapDN name, Attributes entry, boolean cascade ) throws NamingException
+    public void delete( LdapDN name, ServerEntry entry, boolean cascade ) throws NamingException
     {
         // TODO Auto-generated method stub
 
@@ -81,7 +81,7 @@
      * @see org.apache.directory.server.core.schema.SchemaChangeHandler#move(org.apache.directory.shared.ldap.name.LdapDN, org.apache.directory.shared.ldap.name.LdapDN, java.lang.String, boolean, javax.naming.directory.Attributes)
      */
     public void move( LdapDN oriChildName, LdapDN newParentName, Rdn newRn, boolean deleteOldRn,
-        Attributes entry, boolean cascade ) throws NamingException
+        ServerEntry entry, boolean cascade ) throws NamingException
     {
         // TODO Auto-generated method stub
 
@@ -91,7 +91,7 @@
     /* (non-Javadoc)
      * @see org.apache.directory.server.core.schema.SchemaChangeHandler#move(org.apache.directory.shared.ldap.name.LdapDN, org.apache.directory.shared.ldap.name.LdapDN, javax.naming.directory.Attributes)
      */
-    public void replace( LdapDN oriChildName, LdapDN newParentName, Attributes entry, 
+    public void replace( LdapDN oriChildName, LdapDN newParentName, ServerEntry entry, 
         boolean cascade ) throws NamingException
     {
         // TODO Auto-generated method stub
@@ -102,7 +102,7 @@
     /* (non-Javadoc)
      * @see org.apache.directory.server.core.schema.SchemaChangeHandler#rename(org.apache.directory.shared.ldap.name.LdapDN, javax.naming.directory.Attributes, java.lang.String)
      */
-    public void rename( LdapDN name, Attributes entry, Rdn newRdn, boolean cascade ) throws NamingException
+    public void rename( LdapDN name, ServerEntry entry, Rdn newRdn, boolean cascade ) throws NamingException
     {
         // TODO Auto-generated method stub
 

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/MetaDitStructureRuleHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/MetaDitStructureRuleHandler.java?rev=612574&r1=612573&r2=612574&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/MetaDitStructureRuleHandler.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/MetaDitStructureRuleHandler.java Wed Jan 16 13:37:31 2008
@@ -20,13 +20,13 @@
 package org.apache.directory.server.core.schema;
 
 
+import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.schema.registries.Registries;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.name.Rdn;
 import org.apache.directory.shared.ldap.schema.DITStructureRule;
 
 import javax.naming.NamingException;
-import javax.naming.directory.Attributes;
 
 
 /**
@@ -51,7 +51,7 @@
      * javax.naming.directory.Attributes)
      */
     @Override
-    protected void modify( LdapDN name, Attributes entry, Attributes targetEntry, 
+    protected void modify( LdapDN name, ServerEntry entry, ServerEntry targetEntry, 
         boolean cascade ) throws NamingException
     {
         // TODO Auto-generated method stub
@@ -63,7 +63,7 @@
      * @see org.apache.directory.server.core.schema.SchemaChangeHandler#add(
      * org.apache.directory.shared.ldap.name.LdapDN, javax.naming.directory.Attributes)
      */
-    public void add( LdapDN name, Attributes entry ) throws NamingException
+    public void add( LdapDN name, ServerEntry entry ) throws NamingException
     {
         // TODO Auto-generated method stub
 
@@ -74,7 +74,7 @@
      * @see org.apache.directory.server.core.schema.SchemaChangeHandler#delete(
      * org.apache.directory.shared.ldap.name.LdapDN, javax.naming.directory.Attributes)
      */
-    public void delete( LdapDN name, Attributes entry, boolean cascade ) throws NamingException
+    public void delete( LdapDN name, ServerEntry entry, boolean cascade ) throws NamingException
     {
         // TODO Auto-generated method stub
 
@@ -88,7 +88,7 @@
      * java.lang.String, boolean, javax.naming.directory.Attributes)
      */
     public void move( LdapDN oriChildName, LdapDN newParentName, Rdn newRn, boolean deleteOldRn,
-        Attributes entry, boolean cascade ) throws NamingException
+        ServerEntry entry, boolean cascade ) throws NamingException
     {
         // TODO Auto-generated method stub
 
@@ -101,7 +101,7 @@
      * org.apache.directory.shared.ldap.name.LdapDN, 
      * javax.naming.directory.Attributes)
      */
-    public void replace( LdapDN oriChildName, LdapDN newParentName, Attributes entry, 
+    public void replace( LdapDN oriChildName, LdapDN newParentName, ServerEntry entry, 
         boolean cascade ) throws NamingException
     {
         // TODO Auto-generated method stub
@@ -113,7 +113,7 @@
      * @see org.apache.directory.server.core.schema.SchemaChangeHandler#rename(
      * org.apache.directory.shared.ldap.name.LdapDN, javax.naming.directory.Attributes, java.lang.String)
      */
-    public void rename( LdapDN name, Attributes entry, Rdn newRdn, boolean cascade ) throws NamingException
+    public void rename( LdapDN name, ServerEntry entry, Rdn newRdn, boolean cascade ) throws NamingException
     {
         // TODO Auto-generated method stub
 

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/MetaMatchingRuleHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/MetaMatchingRuleHandler.java?rev=612574&r1=612573&r2=612574&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/MetaMatchingRuleHandler.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/MetaMatchingRuleHandler.java Wed Jan 16 13:37:31 2008
@@ -23,17 +23,16 @@
 import java.util.Set;
 
 import javax.naming.NamingException;
-import javax.naming.directory.Attributes;
 import javax.naming.directory.SearchResult;
 
 import org.apache.directory.server.constants.MetaSchemaConstants;
+import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.schema.bootstrap.Schema;
 import org.apache.directory.server.schema.registries.MatchingRuleRegistry;
 import org.apache.directory.server.schema.registries.Registries;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.exception.LdapInvalidNameException;
 import org.apache.directory.shared.ldap.exception.LdapOperationNotSupportedException;
-import org.apache.directory.shared.ldap.message.AttributeImpl;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.name.Rdn;
@@ -63,7 +62,7 @@
     }
 
 
-    protected void modify( LdapDN name, Attributes entry, Attributes targetEntry, 
+    protected void modify( LdapDN name, ServerEntry entry, ServerEntry targetEntry, 
         boolean cascade ) throws NamingException
     {
         String oid = getOid( entry );
@@ -78,7 +77,7 @@
     }
 
 
-    public void add( LdapDN name, Attributes entry ) throws NamingException
+    public void add( LdapDN name, ServerEntry entry ) throws NamingException
     {
         LdapDN parentDn = ( LdapDN ) name.clone();
         parentDn.remove( parentDn.size() - 1 );
@@ -91,7 +90,7 @@
     }
 
 
-    public void delete( LdapDN name, Attributes entry, boolean cascade ) throws NamingException
+    public void delete( LdapDN name, ServerEntry entry, boolean cascade ) throws NamingException
     {
         String schemaName = getSchemaName( name );
         MatchingRule mr = factory.getMatchingRule( entry, targetRegistries, schemaName );
@@ -120,7 +119,7 @@
     }
 
     
-    public void rename( LdapDN name, Attributes entry, Rdn newRdn, boolean cascade ) throws NamingException
+    public void rename( LdapDN name, ServerEntry entry, Rdn newRdn, boolean cascade ) throws NamingException
     {
         Schema schema = getSchema( name );
         MatchingRule oldMr = factory.getMatchingRule( entry, targetRegistries, schema.getSchemaName() );
@@ -134,11 +133,11 @@
                 ResultCodeEnum.UNWILLING_TO_PERFORM );
         }
 
-        Attributes targetEntry = ( Attributes ) entry.clone();
+        ServerEntry targetEntry = ( ServerEntry ) entry.clone();
         String newOid = ( String ) newRdn.getValue();
         checkOidIsUnique( newOid );
         
-        targetEntry.put( new AttributeImpl( MetaSchemaConstants.M_OID_AT, newOid ) );
+        targetEntry.put( MetaSchemaConstants.M_OID_AT, newOid );
         MatchingRule mr = factory.getMatchingRule( targetEntry, targetRegistries, schema.getSchemaName() );
 
         if ( ! schema.isDisabled() )
@@ -156,7 +155,7 @@
 
 
     public void move( LdapDN oriChildName, LdapDN newParentName, Rdn newRdn, boolean deleteOldRn, 
-        Attributes entry, boolean cascade ) throws NamingException
+        ServerEntry entry, boolean cascade ) throws NamingException
     {
         checkNewParent( newParentName );
         Schema oldSchema = getSchema( oriChildName );
@@ -172,11 +171,11 @@
         }
 
         Schema newSchema = getSchema( newParentName );
-        Attributes targetEntry = ( Attributes ) entry.clone();
+        ServerEntry targetEntry = ( ServerEntry ) entry.clone();
         String newOid = ( String ) newRdn.getValue();
         checkOidIsUnique( newOid );
         
-        targetEntry.put( new AttributeImpl( MetaSchemaConstants.M_OID_AT, newOid ) );
+        targetEntry.put( MetaSchemaConstants.M_OID_AT, newOid );
         MatchingRule mr = factory.getMatchingRule( targetEntry, targetRegistries, newSchema.getSchemaName() );
 
         if ( ! oldSchema.isDisabled() )
@@ -196,7 +195,7 @@
     }
 
 
-    public void replace( LdapDN oriChildName, LdapDN newParentName, Attributes entry, boolean cascade ) 
+    public void replace( LdapDN oriChildName, LdapDN newParentName, ServerEntry entry, boolean cascade ) 
         throws NamingException
     {
         checkNewParent( newParentName );

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/MetaMatchingRuleUseHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/MetaMatchingRuleUseHandler.java?rev=612574&r1=612573&r2=612574&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/MetaMatchingRuleUseHandler.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/MetaMatchingRuleUseHandler.java Wed Jan 16 13:37:31 2008
@@ -20,13 +20,13 @@
 package org.apache.directory.server.core.schema;
 
 
+import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.schema.registries.Registries;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.name.Rdn;
 import org.apache.directory.shared.ldap.schema.MatchingRuleUse;
 
 import javax.naming.NamingException;
-import javax.naming.directory.Attributes;
 
 
 /**
@@ -46,40 +46,40 @@
 
 
     @Override
-    protected void modify( LdapDN name, Attributes entry, Attributes targetEntry, 
+    protected void modify( LdapDN name, ServerEntry entry, ServerEntry targetEntry, 
         boolean cascade ) throws NamingException
     {
         // TODO Auto-generated method stub
     }
 
 
-    public void add( LdapDN name, Attributes entry ) throws NamingException
+    public void add( LdapDN name, ServerEntry entry ) throws NamingException
     {
         // TODO Auto-generated method stub
     }
 
 
-    public void delete( LdapDN name, Attributes entry, boolean cascade ) throws NamingException
+    public void delete( LdapDN name, ServerEntry entry, boolean cascade ) throws NamingException
     {
         // TODO Auto-generated method stub
     }
 
 
     public void move( LdapDN oriChildName, LdapDN newParentName, Rdn newRn, boolean deleteOldRn,
-        Attributes entry, boolean cascade ) throws NamingException
+        ServerEntry entry, boolean cascade ) throws NamingException
     {
         // TODO Auto-generated method stub
     }
 
 
     public void replace( LdapDN oriChildName, LdapDN newParentName,
-                         Attributes entry, boolean cascade ) throws NamingException
+        ServerEntry entry, boolean cascade ) throws NamingException
     {
         // TODO Auto-generated method stub
     }
 
 
-    public void rename( LdapDN name, Attributes entry, Rdn newRdn, boolean cascade ) throws NamingException
+    public void rename( LdapDN name, ServerEntry entry, Rdn newRdn, boolean cascade ) throws NamingException
     {
         // TODO Auto-generated method stub
     }

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/MetaNameFormHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/MetaNameFormHandler.java?rev=612574&r1=612573&r2=612574&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/MetaNameFormHandler.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/MetaNameFormHandler.java Wed Jan 16 13:37:31 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.Registries;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.name.Rdn;
@@ -51,7 +51,7 @@
      * javax.naming.directory.Attributes)
      */
     @Override
-    protected void modify( LdapDN name, Attributes entry, Attributes targetEntry, 
+    protected void modify( LdapDN name, ServerEntry entry, ServerEntry targetEntry, 
         boolean cascade ) throws NamingException
     {
         // TODO Auto-generated method stub
@@ -63,7 +63,7 @@
      * @see org.apache.directory.server.core.schema.SchemaChangeHandler#add(
      * org.apache.directory.shared.ldap.name.LdapDN, javax.naming.directory.Attributes)
      */
-    public void add( LdapDN name, Attributes entry ) throws NamingException
+    public void add( LdapDN name, ServerEntry entry ) throws NamingException
     {
         // TODO Auto-generated method stub
 
@@ -74,7 +74,7 @@
      * @see org.apache.directory.server.core.schema.SchemaChangeHandler#delete(
      * org.apache.directory.shared.ldap.name.LdapDN, javax.naming.directory.Attributes)
      */
-    public void delete( LdapDN name, Attributes entry, boolean cascade ) throws NamingException
+    public void delete( LdapDN name, ServerEntry entry, boolean cascade ) throws NamingException
     {
         // TODO Auto-generated method stub
 
@@ -87,7 +87,7 @@
      * Rdn, boolean, javax.naming.directory.Attributes)
      */
     public void move( LdapDN oriChildName, LdapDN newParentName, Rdn newRn,
-        boolean deleteOldRn, Attributes entry, boolean cascade ) throws NamingException
+        boolean deleteOldRn, ServerEntry entry, boolean cascade ) throws NamingException
     {
         // TODO Auto-generated method stub
 
@@ -99,7 +99,7 @@
      * org.apache.directory.shared.ldap.name.LdapDN, 
      * org.apache.directory.shared.ldap.name.LdapDN, javax.naming.directory.Attributes)
      */
-    public void replace( LdapDN oriChildName, LdapDN newParentName, Attributes entry, 
+    public void replace( LdapDN oriChildName, LdapDN newParentName, ServerEntry entry, 
         boolean cascade ) throws NamingException
     {
         // TODO Auto-generated method stub
@@ -111,7 +111,7 @@
      * @see org.apache.directory.server.core.schema.SchemaChangeHandler#rename(
      * org.apache.directory.shared.ldap.name.LdapDN, javax.naming.directory.Attributes, Rdn, boolean)
      */
-    public void rename( LdapDN name, Attributes entry, Rdn newRdn, boolean cascade ) throws NamingException
+    public void rename( LdapDN name, ServerEntry entry, Rdn newRdn, boolean cascade ) throws NamingException
     {
         // TODO Auto-generated method stub
 

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/MetaNormalizerHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/MetaNormalizerHandler.java?rev=612574&r1=612573&r2=612574&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/MetaNormalizerHandler.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/MetaNormalizerHandler.java Wed Jan 16 13:37:31 2008
@@ -24,10 +24,10 @@
 import java.util.List;
 
 import javax.naming.NamingException;
-import javax.naming.directory.Attribute;
-import javax.naming.directory.Attributes;
 
 import org.apache.directory.server.constants.MetaSchemaConstants;
+import org.apache.directory.server.core.entry.ServerAttribute;
+import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.schema.bootstrap.Schema;
 import org.apache.directory.server.schema.registries.MatchingRuleRegistry;
 import org.apache.directory.server.schema.registries.NormalizerRegistry;
@@ -42,7 +42,6 @@
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.Normalizer;
 import org.apache.directory.shared.ldap.schema.syntax.NormalizerDescription;
-import org.apache.directory.shared.ldap.util.AttributeUtils;
 import org.apache.directory.shared.ldap.util.Base64;
 
 
@@ -77,25 +76,27 @@
 
     
     
-    private NormalizerDescription getNormalizerDescription( String schemaName, Attributes entry ) throws NamingException
+    private NormalizerDescription getNormalizerDescription( String schemaName, ServerEntry entry ) throws NamingException
     {
         NormalizerDescription description = new NormalizerDescription();
         description.setNumericOid( getOid( entry ) );
         List<String> values = new ArrayList<String>();
         values.add( schemaName );
         description.addExtension( MetaSchemaConstants.X_SCHEMA, values );
-        description.setFqcn( ( String ) AttributeUtils.getAttribute( entry, fqcnAT ).get() );
+        description.setFqcn( entry.get( fqcnAT ).getString() );
         
-        Attribute desc = AttributeUtils.getAttribute( entry, descAT );
-        if ( desc != null && desc.size() > 0 )
+        ServerAttribute desc = entry.get( descAT );
+        
+        if ( ( desc != null ) && ( desc.size() > 0 ) )
         {
-            description.setDescription( ( String ) desc.get() );
+            description.setDescription( desc.getString() );
         }
         
-        Attribute bytecode = AttributeUtils.getAttribute( entry, byteCodeAT );
-        if ( bytecode != null && bytecode.size() > 0 )
+        ServerAttribute bytecode =  entry.get( byteCodeAT );
+        
+        if ( ( bytecode != null ) && ( bytecode.size() > 0 ) )
         {
-            byte[] bytes = ( byte[] ) bytecode.get();
+            byte[] bytes = bytecode.getBytes();
             description.setBytecode( new String( Base64.encode( bytes ) ) );
         }
 
@@ -103,7 +104,7 @@
     }
     
     
-    protected void modify( LdapDN name, Attributes entry, Attributes targetEntry, boolean cascade ) throws NamingException
+    protected void modify( LdapDN name, ServerEntry entry, ServerEntry targetEntry, boolean cascade ) throws NamingException
     {
         String oid = getOid( entry );
         Normalizer normalizer = factory.getNormalizer( targetEntry, targetRegistries );
@@ -119,7 +120,7 @@
     }
 
 
-    public void add( LdapDN name, Attributes entry ) throws NamingException
+    public void add( LdapDN name, ServerEntry entry ) throws NamingException
     {
         LdapDN parentDn = ( LdapDN ) name.clone();
         parentDn.remove( parentDn.size() - 1 );
@@ -156,7 +157,7 @@
     }
 
 
-    public void delete( LdapDN name, Attributes entry, boolean cascade ) throws NamingException
+    public void delete( LdapDN name, ServerEntry entry, boolean cascade ) throws NamingException
     {
         delete( getOid( entry ), cascade );
     }
@@ -179,7 +180,7 @@
     }
     
 
-    public void rename( LdapDN name, Attributes entry, Rdn newRdn, boolean cascade ) throws NamingException
+    public void rename( LdapDN name, ServerEntry entry, Rdn newRdn, boolean cascade ) throws NamingException
     {
         String oldOid = getOid( entry );
 
@@ -209,7 +210,7 @@
 
 
     public void move( LdapDN oriChildName, LdapDN newParentName, Rdn newRdn, boolean deleteOldRn,
-        Attributes entry, boolean cascade ) throws NamingException
+        ServerEntry entry, boolean cascade ) throws NamingException
     {
         checkNewParent( newParentName );
         String oldOid = getOid( entry );
@@ -244,7 +245,7 @@
     }
 
 
-    public void replace( LdapDN oriChildName, LdapDN newParentName, Attributes entry, boolean cascade ) 
+    public void replace( LdapDN oriChildName, LdapDN newParentName, ServerEntry entry, boolean cascade ) 
         throws NamingException
     {
         checkNewParent( newParentName );
@@ -286,7 +287,7 @@
     }
 
 
-    private void checkOidIsUniqueForNormalizer( Attributes entry ) throws NamingException
+    private void checkOidIsUniqueForNormalizer( ServerEntry entry ) throws NamingException
     {
         String oid = getOid( entry );
         

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/MetaObjectClassHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/MetaObjectClassHandler.java?rev=612574&r1=612573&r2=612574&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/MetaObjectClassHandler.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/MetaObjectClassHandler.java Wed Jan 16 13:37:31 2008
@@ -23,17 +23,16 @@
 import java.util.Set;
 
 import javax.naming.NamingException;
-import javax.naming.directory.Attributes;
 import javax.naming.directory.SearchResult;
 
 import org.apache.directory.server.constants.MetaSchemaConstants;
+import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.schema.bootstrap.Schema;
 import org.apache.directory.server.schema.registries.ObjectClassRegistry;
 import org.apache.directory.server.schema.registries.Registries;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.exception.LdapInvalidNameException;
 import org.apache.directory.shared.ldap.exception.LdapOperationNotSupportedException;
-import org.apache.directory.shared.ldap.message.AttributeImpl;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.name.Rdn;
@@ -63,7 +62,7 @@
     }
 
 
-    protected void modify( LdapDN name, Attributes entry, Attributes targetEntry, 
+    protected void modify( LdapDN name, ServerEntry entry, ServerEntry targetEntry, 
         boolean cascade ) throws NamingException
     {
         String oid = getOid( entry );
@@ -78,7 +77,7 @@
     }
 
 
-    public void add( LdapDN name, Attributes entry ) throws NamingException
+    public void add( LdapDN name, ServerEntry entry ) throws NamingException
     {
         LdapDN parentDn = ( LdapDN ) name.clone();
         parentDn.remove( parentDn.size() - 1 );
@@ -91,7 +90,7 @@
     }
 
 
-    public void delete( LdapDN name, Attributes entry, boolean cascade ) throws NamingException
+    public void delete( LdapDN name, ServerEntry entry, boolean cascade ) throws NamingException
     {
         String schemaName = getSchemaName( name );
         ObjectClass oc = factory.getObjectClass( entry, targetRegistries, schemaName );
@@ -122,7 +121,7 @@
     }
 
 
-    public void rename( LdapDN name, Attributes entry, Rdn newRdn, boolean cascade ) throws NamingException
+    public void rename( LdapDN name, ServerEntry entry, Rdn newRdn, boolean cascade ) throws NamingException
     {
         Schema schema = getSchema( name );
         ObjectClass oldOc = factory.getObjectClass( entry, targetRegistries, schema.getSchemaName() );
@@ -136,9 +135,9 @@
                 ResultCodeEnum.UNWILLING_TO_PERFORM );
         }
 
-        Attributes targetEntry = ( Attributes ) entry.clone();
+        ServerEntry targetEntry = ( ServerEntry ) entry.clone();
         String newOid = ( String ) newRdn.getValue();
-        targetEntry.put( new AttributeImpl( MetaSchemaConstants.M_OID_AT, newOid ) );
+        targetEntry.put( MetaSchemaConstants.M_OID_AT, newOid );
         checkOidIsUnique( newOid );
         ObjectClass oc = factory.getObjectClass( targetEntry, targetRegistries, schema.getSchemaName() );
 
@@ -157,7 +156,7 @@
 
 
     public void move( LdapDN oriChildName, LdapDN newParentName, Rdn newRdn, boolean deleteOldRn,
-        Attributes entry, boolean cascade ) throws NamingException
+        ServerEntry entry, boolean cascade ) throws NamingException
     {
         checkNewParent( newParentName );
         Schema oldSchema = getSchema( oriChildName );
@@ -173,10 +172,10 @@
         }
 
         Schema newSchema = getSchema( newParentName );
-        Attributes targetEntry = ( Attributes ) entry.clone();
+        ServerEntry targetEntry = ( ServerEntry ) entry.clone();
         String newOid = ( String ) newRdn.getValue();
         checkOidIsUnique( newOid );
-        targetEntry.put( new AttributeImpl( MetaSchemaConstants.M_OID_AT, newOid ) );
+        targetEntry.put( MetaSchemaConstants.M_OID_AT, newOid );
         ObjectClass oc = factory.getObjectClass( targetEntry, targetRegistries, newSchema.getSchemaName() );
 
         if ( ! oldSchema.isDisabled() )
@@ -196,7 +195,7 @@
     }
 
 
-    public void replace( LdapDN oriChildName, LdapDN newParentName, Attributes entry, boolean cascade ) 
+    public void replace( LdapDN oriChildName, LdapDN newParentName, ServerEntry entry, boolean cascade ) 
         throws NamingException
     {
         checkNewParent( newParentName );



Mime
View raw message