directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r615071 [1/5] - in /directory: apacheds/branches/bigbang/btree-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/ apacheds/branches/bigbang/core-entry/src/main/java/org/apache/directory/server/core/entry/ apacheds/bra...
Date Thu, 24 Jan 2008 22:39:50 GMT
Author: elecharny
Date: Thu Jan 24 14:39:32 2008
New Revision: 615071

URL: http://svn.apache.org/viewvc?rev=615071&view=rev
Log:
Removed hundreds of references to [Basic]Attribute[s][Impl]

Added:
    directory/apacheds/branches/bigbang/core/src/test/java/org/apache/directory/server/core/partition/tree/
    directory/apacheds/branches/bigbang/core/src/test/java/org/apache/directory/server/core/partition/tree/PartitionTreeTest.java
Modified:
    directory/apacheds/branches/bigbang/btree-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexComparator.java
    directory/apacheds/branches/bigbang/core-entry/src/main/java/org/apache/directory/server/core/entry/AbstractServerAttribute.java
    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/DefaultServerEntry.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-entry/src/test/java/org/apache/directory/server/core/entry/DefaultServerEntryTest.java
    directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/jndi/DIRSERVER791IT.java
    directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/jndi/RootDSEIT.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/ACDFEngine.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/ACITupleFilter.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/HighestPrecedenceFilter.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/MaxImmSubFilter.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/MaxValueCountFilter.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/MicroOperationFilter.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/MostSpecificProtectedItemFilter.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/MostSpecificUserClassFilter.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedUserClassFilter.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/RestrictedByFilter.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributesSchemaChecker.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/enumeration/ReferralHandlingEnumeration.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/event/Evaluator.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/event/ExpressionEvaluator.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/event/LeafEvaluator.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/event/ScopeEvaluator.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/event/SubstringEvaluator.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/BaseInterceptor.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/Interceptor.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/NextInterceptor.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/AbstractPartition.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/Partition.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexusProxy.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/EntryNode.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/tree/BranchNode.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/tree/LeafNode.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.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/SchemaChecker.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/SchemaPartitionDao.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/subtree/RefinementEvaluator.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/subtree/RefinementLeafEvaluator.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/subtree/SubtreeEvaluator.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/trigger/DeleteStoredProcedureParameterInjector.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/trigger/ModifyStoredProcedureParameterInjector.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/trigger/TriggerInterceptor.java
    directory/apacheds/branches/bigbang/core/src/test/java/org/apache/directory/server/core/authz/support/MaxImmSubFilterTest.java
    directory/apacheds/branches/bigbang/core/src/test/java/org/apache/directory/server/core/authz/support/MaxValueCountFilterTest.java
    directory/apacheds/branches/bigbang/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilterTest.java
    directory/apacheds/branches/bigbang/core/src/test/java/org/apache/directory/server/core/authz/support/RestrictedByFilterTest.java
    directory/apacheds/branches/bigbang/core/src/test/java/org/apache/directory/server/core/interceptor/MockInterceptor.java
    directory/apacheds/branches/bigbang/core/src/test/java/org/apache/directory/server/core/schema/PartitionSchemaLoaderTest.java
    directory/apacheds/branches/bigbang/core/src/test/java/org/apache/directory/server/core/schema/SchemaCheckerTest.java
    directory/apacheds/branches/bigbang/core/src/test/java/org/apache/directory/server/core/subtree/RefinementEvaluatorTest.java
    directory/apacheds/branches/bigbang/core/src/test/java/org/apache/directory/server/core/subtree/RefinementLeafEvaluatorTest.java
    directory/apacheds/branches/bigbang/interceptor-kerberos/src/main/java/org/apache/directory/server/core/kerberos/KeyDerivationInterceptor.java
    directory/apacheds/branches/bigbang/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/BTreeEnumeration.java
    directory/apacheds/branches/bigbang/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/BTreeTupleEnumeration.java
    directory/apacheds/branches/bigbang/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmMasterTable.java
    directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/operation/OperationFactory.java
    directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/operation/support/EntryUtil.java
    directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationInterceptor.java
    directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/PersistentSearchListener.java
    directory/apacheds/branches/bigbang/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/NameOrNumericIdComparator.java
    directory/apacheds/branches/bigbang/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultOidRegistry.java
    directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/ModifyAddTest.java
    directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/ModifyRemoveTest.java
    directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/ModifyReplaceITest.java
    directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/EntryAttribute.java
    directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/AbstractClientAttribute.java
    directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/DefaultClientAttribute.java
    directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/name/LdapDN.java

Modified: directory/apacheds/branches/bigbang/btree-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexComparator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/btree-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexComparator.java?rev=615071&r1=615070&r2=615071&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/btree-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexComparator.java (original)
+++ directory/apacheds/branches/bigbang/btree-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexComparator.java Thu Jan 24 14:39:32 2008
@@ -42,9 +42,38 @@
         {
         	try
         	{
-	        	long thisVal = (Long)o1;
-	        	long anotherVal = (Long)o2;
-	        	return ( thisVal < anotherVal ? -1 : ( thisVal == anotherVal ? 0 : 1 ) );
+	            long thisVal = ( Long ) o1;
+	            long anotherVal = ( Long ) o2;
+	            
+	            if ( thisVal == anotherVal )
+	            {
+	                return 0;
+	            }
+	            
+	            if ( thisVal == anotherVal )
+	            {
+	                return 0;
+	            }
+	            
+	            if ( thisVal >= 0 )
+	            {
+	                if ( anotherVal >= 0 )
+	                {
+	                    return ( thisVal > anotherVal ) ? 1 : -1;
+	                }
+	                else
+	                {
+	                    return -1;
+	                }
+	            }
+	            else if ( anotherVal >= 0 )
+	            {
+	                return 1;
+	            }
+	            else
+	            {
+	                return ( thisVal < anotherVal ) ? -1 : 1;
+	            }
         	}
         	catch ( NullPointerException npe )
         	{

Modified: directory/apacheds/branches/bigbang/core-entry/src/main/java/org/apache/directory/server/core/entry/AbstractServerAttribute.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core-entry/src/main/java/org/apache/directory/server/core/entry/AbstractServerAttribute.java?rev=615071&r1=615070&r2=615071&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core-entry/src/main/java/org/apache/directory/server/core/entry/AbstractServerAttribute.java (original)
+++ directory/apacheds/branches/bigbang/core-entry/src/main/java/org/apache/directory/server/core/entry/AbstractServerAttribute.java Thu Jan 24 14:39:32 2008
@@ -318,6 +318,29 @@
     
     
     /**
+     * @see EntryAttribute#put(List<String>)
+     */
+    public int put( List<?> vals ) throws InvalidAttributeValueException, NamingException
+    {
+        values.clear();
+        
+        for ( Object value:vals )
+        {
+            if ( value instanceof String )
+            {
+                add( (String)value );
+            }
+            else
+            {
+                add( (byte[])value );
+            }
+        }
+        
+        return size();
+    }
+
+    
+    /**
      * @see EntryAttribute#add(byte[]...)
      */
     public int add( byte[]... vals ) throws InvalidAttributeValueException, NamingException
@@ -508,6 +531,54 @@
     
     
     /**
+     * @see EntryAttribute#contains(Object...)
+     */
+    public boolean contains( Object... vals )
+    {
+        boolean isHR = false;
+        
+        try
+        {
+            if ( attributeType.getSyntax().isHumanReadable() )
+            {
+                isHR = true;
+            }
+        }
+        catch ( NamingException ne )
+        {
+            // We have had a pb while getting the syntax...
+            return false;
+        }
+        
+        // Iterate through all the values, and quit if we 
+        // don't find one in the values
+        for ( Object val:vals )
+        {
+            if ( ( val instanceof String ) && isHR ) 
+            {
+                if ( !contains( (String)val ) )
+                {
+                    return false;
+                }
+            }
+            else if ( !isHR )
+            {
+                if ( !contains( (byte[])val ) )
+                {
+                    return false;
+                }
+            }
+            else
+            {
+                return false;
+            }
+        }
+        
+        return true;
+    }
+    
+    
+    /**
      * Get the first value of this attribute. If there is none, 
      * null is returned.
      * 
@@ -641,4 +712,31 @@
     {
         return values.iterator();
     }
+    
+    
+    /**
+     * Check if the current attribute type is of the expected attributeType 
+     *
+     * @param attributeId The AttributeType ID to check
+     * @return True if the current attribute is of the expected attributeType
+     * @throws InvalidAttributeValueException If there is no AttributeType
+     */
+    public boolean isA( String attributeId ) throws InvalidAttributeValueException
+    {
+        if ( StringTools.isEmpty( attributeId ) )
+        {
+            return false;
+        }
+        
+        for ( String name:attributeType.getNames() )
+        {
+            if ( attributeId.equalsIgnoreCase( name ) )
+            {
+                return true;
+            }
+        }
+        
+        return attributeId.equalsIgnoreCase( attributeType.getOid() );
+    }
+    
 }

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=615071&r1=615070&r2=615071&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 Thu Jan 24 14:39:32 2008
@@ -218,6 +218,21 @@
         add( vals );
         setUpId( upId, attributeType );
     }
+    
+    
+    /**
+     * Clone an attribute. All the element are duplicated, so a modification on
+     * the original object won't affect the cloned object, as a modification
+     * on the cloned object has no impact on the original object
+     */
+    public ServerAttribute clone()
+    {
+        // clone the structure by cloner the inherited class
+        ServerAttribute clone = (ServerAttribute)super.clone();
+        
+        // We are done !
+        return clone;
+    }
 
 
     /**

Modified: directory/apacheds/branches/bigbang/core-entry/src/main/java/org/apache/directory/server/core/entry/DefaultServerEntry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core-entry/src/main/java/org/apache/directory/server/core/entry/DefaultServerEntry.java?rev=615071&r1=615070&r2=615071&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core-entry/src/main/java/org/apache/directory/server/core/entry/DefaultServerEntry.java (original)
+++ directory/apacheds/branches/bigbang/core-entry/src/main/java/org/apache/directory/server/core/entry/DefaultServerEntry.java Thu Jan 24 14:39:32 2008
@@ -104,7 +104,7 @@
                 }
             }
             
-            setObjectClassAttribute( new ObjectClassAttribute( registries, SchemaConstants.OBJECT_CLASS_AT, SchemaConstants.TOP_OC ) );
+            setObjectClassAttribute( new ObjectClassAttribute( registries, SchemaConstants.OBJECT_CLASS_AT ) );
         }
         catch ( NamingException ne )
         {
@@ -442,6 +442,13 @@
     public void addObjectClass( ObjectClassAttribute objectClassAttribute ) throws NamingException
     {
         this.objectClassAttribute = objectClassAttribute;
+        
+        ServerAttribute currentOc = serverAttributeMap.get( objectClassAttribute.getType() );
+        
+        for ( ServerValue<?> value:objectClassAttribute )
+        {
+            currentOc.add( value );
+        }
     }
 
 
@@ -1083,14 +1090,39 @@
     }
     
     
+    /**
+     * Clone an entry. All the element are duplicated, so a modification on
+     * the original object won't affect the cloned object, as a modification
+     * on the cloned object has no impact on the original object
+     */
     public ServerEntry clone()
     {
         try
         {
+            // First, clone the structure
             DefaultServerEntry clone = (DefaultServerEntry)super.clone();
             
+            // A serverEntry has a DN, an ObjectClass attribute
+            // and many attributes
+            // Clone the DN
             clone.dn = (LdapDN)dn.clone();
-            //clone.objectClassAttribute = objectClassAttribute.clone();
+            
+            // Clone the ObjectClassAttribute
+            clone.objectClassAttribute = objectClassAttribute.clone();
+            
+            // clone the ServerAttribute Map
+            clone.serverAttributeMap = (Map<AttributeType, ServerAttribute>)(((HashMap<AttributeType, ServerAttribute>)serverAttributeMap).clone());
+            
+            // now clone all the servrAttributes
+            clone.serverAttributeMap.clear();
+            
+            for ( AttributeType key:serverAttributeMap.keySet() )
+            {
+                ServerAttribute value = (ServerAttribute)serverAttributeMap.get( key ).clone();
+                clone.serverAttributeMap.put( key, value );
+            }
+            
+            // We are done !
             return clone;
         }
         catch ( CloneNotSupportedException cnse )

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=615071&r1=615070&r2=615071&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 Thu Jan 24 14:39:32 2008
@@ -253,6 +253,49 @@
 
     
     // -----------------------------------------------------------------------
+    /**
+     * Clone an ObjectClass attribute. All the element are duplicated, 
+     * so a modification on the original object won't affect the cloned 
+     * object, as a modification on the cloned object has no impact on 
+     * the original object
+     */
+    public ObjectClassAttribute clone()
+    {
+        // First, clone the structure
+        ObjectClassAttribute clone = (ObjectClassAttribute)super.clone();
+        
+        // A ObjectClassAttribute has many lists which need to be
+        // duplicated :
+        // - mayList
+        // - mustList
+        // - allObjectClasses
+        // - abstractObjectClasses
+        // - auxiliaryObjectClasses
+        // - structuralObjectClasses
+        // 
+        // There is no need to copy the elements, they can't be modified
+
+        // Clone the mayList. 
+        clone.mayList = (HashSet<AttributeType>)((HashSet<AttributeType>)mayList).clone();
+        
+        // Clone the mustList
+        clone.mustList = (HashSet<AttributeType>)((HashSet<AttributeType>)mustList).clone();
+        
+        // Clone the allObjectClasses
+        clone.allObjectClasses = (HashSet<ObjectClass>)((HashSet<ObjectClass>)allObjectClasses).clone();
+        
+        // Clone the abstractObjectClasses
+        clone.abstractObjectClasses = (HashSet<ObjectClass>)((HashSet<ObjectClass>)abstractObjectClasses).clone();
+        
+        // Clone the auxiliaryObjectClasses
+        clone.auxiliaryObjectClasses = (HashSet<ObjectClass>)((HashSet<ObjectClass>)auxiliaryObjectClasses).clone();
+        
+        // Clone the structuralObjectClasses
+        clone.structuralObjectClasses = (HashSet<ObjectClass>)((HashSet<ObjectClass>)structuralObjectClasses).clone();
+
+        // We are done !
+        return clone;
+    }
 
 
     private Set<ObjectClass> addAncestors( ObjectClass descendant, Set<ObjectClass> ancestors ) throws NamingException
@@ -287,7 +330,7 @@
         }
 
         // add the value to the set of values
-        values.add( new ServerStringValue( attributeType, alias) );
+        //values.add( new ServerStringValue( attributeType, alias) );
 
         Set<ObjectClass> ancestors = addAncestors( objectClass, new HashSet<ObjectClass>() );
         ancestors.add( objectClass );
@@ -295,6 +338,7 @@
         // now create sets of the different kinds of objectClasses
         for ( ObjectClass oc : ancestors )
         {
+            values.add( new ServerStringValue( attributeType, oc.getName() ) );
             switch ( oc.getType() )
             {
                 case STRUCTURAL :

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=615071&r1=615070&r2=615071&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 Thu Jan 24 14:39:32 2008
@@ -99,4 +99,14 @@
      * @throws InvalidAttributeValueException If the value is a String
      */
     byte[] getBytes() throws InvalidAttributeValueException;
+    
+    
+    /**
+     * Check if the current attribute type is of the expected attributeType 
+     *
+     * @param attributeId The AttributeType ID to check
+     * @return True if the current attribute is of the expected attributeType
+     * @throws InvalidAttributeValueException If there is no AttributeType
+     */
+    boolean isA( String attributeId ) 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=615071&r1=615070&r2=615071&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 Thu Jan 24 14:39:32 2008
@@ -30,6 +30,7 @@
 import javax.naming.directory.InvalidAttributeIdentifierException;
 
 import org.apache.directory.server.schema.registries.Registries;
+import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.message.AttributeImpl;
 import org.apache.directory.shared.ldap.message.AttributesImpl;
 import org.apache.directory.shared.ldap.message.ModificationItemImpl;
@@ -62,10 +63,20 @@
 
         for ( AttributeType attributeType:entry.getAttributeTypes() )
         {
-            Attribute attribute = new AttributeImpl( attributeType.getName() );
-            
             ServerAttribute attr = entry.get( attributeType );
             
+            // Deal with a special case : an entry without any ObjectClass
+            if ( attributeType.getOid() == SchemaConstants.OBJECT_CLASS_AT_OID )
+            {
+                if ( attr.size() == 0 )
+                {
+                    // We don't have any objectClass, just dismiss this element
+                    continue;
+                }
+            }
+            
+            Attribute attribute = new AttributeImpl( attributeType.getName() );
+            
             for ( Iterator<ServerValue<?>> iter = attr.iterator(); iter.hasNext();)
             {
                 ServerValue<?> value = iter.next();
@@ -309,5 +320,51 @@
         }
 
         return targetEntry;
+    }
+
+
+    /**
+     * Creates a new attribute which contains the values representing the union
+     * of two attributes. If one attribute is null then the resultant attribute
+     * returned is a copy of the non-null attribute. If both are null then we
+     * cannot determine the attribute ID and an {@link IllegalArgumentException}
+     * is raised.
+     * 
+     * @param attr0 the first attribute
+     * @param attr1 the second attribute
+     * @return a new attribute with the union of values from both attribute
+     *         arguments
+     * @throws NamingException if there are problems accessing attribute values
+     */
+    public static ServerAttribute getUnion( ServerAttribute attr0, ServerAttribute attr1 ) throws NamingException
+    {
+        if ( attr0 == null && attr1 == null )
+        {
+            throw new IllegalArgumentException( "Cannot figure out attribute ID if both args are null" );
+        }
+        else if ( attr0 == null )
+        {
+            return (ServerAttribute)attr1.clone();
+        }
+        else if ( attr1 == null )
+        {
+            return (ServerAttribute)attr0.clone();
+        }
+        else if ( !attr0.getType().equals( attr1.getType() ) )
+        {
+            throw new IllegalArgumentException( "Cannot take union of attributes with different IDs!" );
+        }
+
+        ServerAttribute attr = (ServerAttribute)attr0.clone();
+
+        if ( attr0 != null )
+        {
+            for ( ServerValue<?> value:attr1 )
+            {
+                attr.add( value );
+            }
+        }
+
+        return attr;
     }
 }

Modified: directory/apacheds/branches/bigbang/core-entry/src/test/java/org/apache/directory/server/core/entry/DefaultServerEntryTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core-entry/src/test/java/org/apache/directory/server/core/entry/DefaultServerEntryTest.java?rev=615071&r1=615070&r2=615071&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core-entry/src/test/java/org/apache/directory/server/core/entry/DefaultServerEntryTest.java (original)
+++ directory/apacheds/branches/bigbang/core-entry/src/test/java/org/apache/directory/server/core/entry/DefaultServerEntryTest.java Thu Jan 24 14:39:32 2008
@@ -53,6 +53,7 @@
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.fail;
 
@@ -379,7 +380,7 @@
         oc.add( "top", "person", "inetOrgPerson" );
         
         entry.addObjectClass( oc );
-        //entry.put( "cn", registries.getAttributeTypeRegistry().lookup( "cn" ), "test" );
+        entry.put( "cn", registries.getAttributeTypeRegistry().lookup( "cn" ), "test" );
         
         Attributes attributes = ServerEntryUtils.toAttributesImpl( entry );
         
@@ -399,8 +400,8 @@
             
         }
 
-        // We should still have the ObjectClass Attribute
-        assertEquals( 1, expected.size() );
+        // It should be empty
+        assertEquals( 0, expected.size() );
     }
 
 
@@ -703,7 +704,7 @@
         
         assertNotNull( oldOc );
         assertEquals( 1, oldOc.size() );
-        assertEquals( "top", oldOc.get( 0 ).get().get() );
+        assertEquals( null, oldOc.get( 0 ).get() );
         
         assertNotNull( entry.get( "objectClass" ) );
 
@@ -2045,7 +2046,7 @@
         assertEquals( 1, entry.size() );
         assertNull( entry.get( atCN ) );
         assertNull( entry.get( atPassword ) );
-        assertTrue( entry.contains( OBJECT_CLASS_AT, "top" ) );
+        assertFalse( entry.contains( OBJECT_CLASS_AT, "top" ) );
         
         // test the removal of a bad Attribute
         entry.put( "CN", test1, test2 );

Modified: directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/jndi/DIRSERVER791IT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/jndi/DIRSERVER791IT.java?rev=615071&r1=615070&r2=615071&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/jndi/DIRSERVER791IT.java (original)
+++ directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/jndi/DIRSERVER791IT.java Thu Jan 24 14:39:32 2008
@@ -223,7 +223,7 @@
         DirContext ctx = new InitialDirContext( env );
 
 
-        Attribute attr = new AttributeImpl("bootParameter", "test");
+        Attribute attr = new AttributeImpl("javaDoc", "test");
         ModificationItemImpl modification = new ModificationItemImpl(DirContext.ADD_ATTRIBUTE, attr);
     
         try 

Modified: directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/jndi/RootDSEIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/jndi/RootDSEIT.java?rev=615071&r1=615070&r2=615071&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/jndi/RootDSEIT.java (original)
+++ directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/jndi/RootDSEIT.java Thu Jan 24 14:39:32 2008
@@ -122,8 +122,36 @@
         DirContext ctx = ( DirContext ) initCtx.lookup( "" );
 
         Attributes attributes = ctx.getAttributes( "", new String[]
-            { "namingContexts", "vendorName" } );
+            { "namingContexts", "VENDORNAME" } );
         assertEquals( 2, attributes.size() );
+        assertEquals( "Apache Software Foundation", attributes.get( "vendorName" ).get() );
+        assertTrue( attributes.get( "namingContexts" ).contains( "ou=system" ) );
+    }
+
+
+    /**
+     * Checks for ObjectClass, namingContexts and vendorName attributes.
+     *
+     * @throws NamingException if there are any problems
+     */
+    @Test
+    public void testGetInitialContextLookupAttributesByNameWithOC() throws NamingException
+    {
+        Hashtable<String,Object> env = new Hashtable<String,Object>();
+        env.put( DirectoryService.JNDI_KEY, service );
+        env.put( Context.PROVIDER_URL, "" );
+        env.put( Context.SECURITY_PRINCIPAL, "uid=admin,ou=system" );
+        env.put( Context.SECURITY_CREDENTIALS, "secret" );
+        env.put( Context.SECURITY_AUTHENTICATION, "simple" );
+        env.put( Context.INITIAL_CONTEXT_FACTORY, CoreContextFactory.class.getName() );
+
+        InitialContext initCtx = new InitialContext( env );
+        assertNotNull( initCtx );
+        DirContext ctx = ( DirContext ) initCtx.lookup( "" );
+
+        Attributes attributes = ctx.getAttributes( "", new String[]
+            { "ObjectClass", "namingContexts", "VENDORNAME" } );
+        assertEquals( 3, attributes.size() );
         assertEquals( "Apache Software Foundation", attributes.get( "vendorName" ).get() );
         assertTrue( attributes.get( "namingContexts" ).contains( "ou=system" ) );
     }

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java?rev=615071&r1=615070&r2=615071&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java Thu Jan 24 14:39:32 2008
@@ -1235,8 +1235,9 @@
         LdapDN adminDn = new LdapDN( ServerDNConstants.ADMIN_SYSTEM_DN );
         adminDn.normalize( registries.getAttributeTypeRegistry().getNormalizerMapping() );
         
-        Attributes adminEntry = partitionNexus.lookup( new LookupOperationContext( registries, adminDn ) );
+        ServerEntry adminEntry = partitionNexus.lookup( new LookupOperationContext( registries, adminDn ) );
         Object userPassword = adminEntry.get( SchemaConstants.USER_PASSWORD_AT ).get();
+        
         if ( userPassword instanceof byte[] )
         {
             needToChangeAdminPassword = PartitionNexus.ADMIN_PASSWORD.equals( new String(

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java?rev=615071&r1=615070&r2=615071&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java Thu Jan 24 14:39:32 2008
@@ -62,7 +62,6 @@
 import javax.naming.Context;
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
-import javax.naming.directory.Attributes;
 import javax.naming.directory.SearchResult;
 
 
@@ -291,7 +290,7 @@
     }
 
 
-    public Attributes lookup( NextInterceptor next, LookupOperationContext opContext ) throws NamingException
+    public ServerEntry lookup( NextInterceptor next, LookupOperationContext opContext ) throws NamingException
     {
         if ( IS_DEBUG )
         {

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java?rev=615071&r1=615070&r2=615071&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java Thu Jan 24 14:39:32 2008
@@ -50,7 +50,6 @@
 import org.apache.directory.server.core.collective.CollectiveAttributeInterceptor;
 import org.apache.directory.server.core.entry.ServerAttribute;
 import org.apache.directory.server.core.entry.ServerEntry;
-import org.apache.directory.server.core.entry.ServerEntryUtils;
 import org.apache.directory.server.core.entry.ServerStringValue;
 import org.apache.directory.server.core.entry.ServerValue;
 import org.apache.directory.server.core.event.EventInterceptor;
@@ -589,10 +588,7 @@
             LookupOperationContext lookupContex  = new LookupOperationContext( registries, new String[] { SchemaConstants.USER_PASSWORD_AT } );
             lookupContex.setDn( principalDn );
             
-            userEntry = ServerEntryUtils.toServerEntry( 
-                proxy.lookup( lookupContex, USERLOOKUP_BYPASS ), 
-                principalDn,
-                registries );
+            userEntry = proxy.lookup( lookupContex, USERLOOKUP_BYPASS ); 
 
             if ( userEntry == null )
             {

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java?rev=615071&r1=615070&r2=615071&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java Thu Jan 24 14:39:32 2008
@@ -72,7 +72,6 @@
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
 import javax.naming.directory.Attribute;
-import javax.naming.directory.Attributes;
 import javax.naming.directory.DirContext;
 import javax.naming.directory.SearchControls;
 import javax.naming.directory.SearchResult;
@@ -298,10 +297,7 @@
         {
             LdapDN parentDn = ( LdapDN ) dn.clone();
             parentDn.remove( dn.size() - 1 );
-            entry = ServerEntryUtils.toServerEntry( 
-                proxy.lookup( new LookupOperationContext( registries, parentDn), PartitionNexusProxy.LOOKUP_BYPASS ),
-                parentDn,
-                registries );
+            entry = proxy.lookup( new LookupOperationContext( registries, parentDn), PartitionNexusProxy.LOOKUP_BYPASS );
         }
 
         ServerAttribute subentries = entry.get( acSubentryType );
@@ -380,12 +376,14 @@
         // will contain the subentryACI attributes that effect subentries
         LdapDN parentDn = ( LdapDN ) dn.clone();
         parentDn.remove( dn.size() - 1 );
-        ServerEntry administrativeEntry = ServerEntryUtils.toServerEntry( 
+        ServerEntry administrativeEntry =  
             proxy.lookup( 
-        		new LookupOperationContext( registries, parentDn, new String[]
-            { SchemaConstants.SUBENTRY_ACI_AT }) , PartitionNexusProxy.LOOKUP_BYPASS ),
-            parentDn,
-            registries );
+        		new LookupOperationContext( 
+        		    registries, 
+        		    parentDn, 
+        		    new String[]
+        		               { SchemaConstants.SUBENTRY_ACI_AT }) , 
+        		PartitionNexusProxy.LOOKUP_BYPASS );
         
         ServerAttribute subentryAci = administrativeEntry.get( subentryAciType );
 
@@ -520,10 +518,7 @@
         // Access the principal requesting the operation, and bypass checks if it is the admin
         Invocation invocation = InvocationStack.getInstance().peek();
         PartitionNexusProxy proxy = invocation.getProxy();
-        ServerEntry entry = ServerEntryUtils.toServerEntry( 
-            proxy.lookup( new LookupOperationContext( registries, name ) , PartitionNexusProxy.LOOKUP_BYPASS ),
-            name,
-            registries );
+        ServerEntry entry = proxy.lookup( new LookupOperationContext( registries, name ) , PartitionNexusProxy.LOOKUP_BYPASS );
 
         LdapPrincipal principal = ( ( ServerContext ) invocation.getCaller() ).getPrincipal();
         LdapDN principalDn = principal.getJndiName();
@@ -569,10 +564,7 @@
         LdapDN name = opContext.getDn();
 
         // Access the principal requesting the operation, and bypass checks if it is the admin
-        ServerEntry entry = ServerEntryUtils.toServerEntry( 
-            proxy.lookup( new LookupOperationContext( registries, name ), PartitionNexusProxy.LOOKUP_BYPASS ),
-            name,
-            registries );
+        ServerEntry entry = proxy.lookup( new LookupOperationContext( registries, name ), PartitionNexusProxy.LOOKUP_BYPASS );
         
         LdapPrincipal principal = ( ( ServerContext ) invocation.getCaller() ).getPrincipal();
         LdapDN principalDn = principal.getJndiName();
@@ -593,8 +585,8 @@
             /**
              * @TODO: A virtual entry can be created here for not hitting the backend again.
              */
-            Attributes modifiedEntry = proxy.lookup( new LookupOperationContext( registries, name ), PartitionNexusProxy.LOOKUP_BYPASS );
-            tupleCache.subentryModified( name, mods, ServerEntryUtils.toServerEntry( modifiedEntry, name, registries ) );
+            ServerEntry modifiedEntry = proxy.lookup( new LookupOperationContext( registries, name ), PartitionNexusProxy.LOOKUP_BYPASS );
+            tupleCache.subentryModified( name, mods, modifiedEntry );
             groupCache.groupModified( name, mods, entry, registries );
             return;
         }
@@ -680,8 +672,8 @@
         /**
          * @TODO: A virtual entry can be created here for not hitting the backend again.
          */
-        Attributes modifiedEntry = proxy.lookup( new LookupOperationContext( registries, name ), PartitionNexusProxy.LOOKUP_BYPASS );
-        tupleCache.subentryModified( name, mods, ServerEntryUtils.toServerEntry( modifiedEntry, name, registries ) );
+        ServerEntry modifiedEntry = proxy.lookup( new LookupOperationContext( registries, name ), PartitionNexusProxy.LOOKUP_BYPASS );
+        tupleCache.subentryModified( name, mods, modifiedEntry );
         groupCache.groupModified( name, mods, entry, registries );
     }
 
@@ -691,10 +683,8 @@
         Invocation invocation = InvocationStack.getInstance().peek();
         PartitionNexusProxy proxy = invocation.getProxy();
         
-        ServerEntry entry = ServerEntryUtils.toServerEntry( 
-            proxy.lookup( new LookupOperationContext( registries, name ), PartitionNexusProxy.LOOKUP_BYPASS ),
-            name,
-            registries );
+        ServerEntry entry = proxy.lookup( new LookupOperationContext( registries, name ), PartitionNexusProxy.LOOKUP_BYPASS );
+            
         
         LdapPrincipal principal = ( ( ServerContext ) invocation.getCaller() ).getPrincipal();
         LdapDN principalDn = principal.getJndiName();
@@ -778,7 +768,7 @@
     }
 
 
-    public Attributes lookup( NextInterceptor next, LookupOperationContext lookupContext ) throws NamingException
+    public ServerEntry lookup( NextInterceptor next, LookupOperationContext lookupContext ) throws NamingException
     {
         Invocation invocation = InvocationStack.getInstance().peek();
         LdapPrincipal principal = ( ( ServerContext ) invocation.getCaller() ).getPrincipal();
@@ -795,10 +785,8 @@
         }
 
         PartitionNexusProxy proxy = invocation.getProxy();
-        ServerEntry entry = ServerEntryUtils.toServerEntry( 
-            proxy.lookup( lookupContext, PartitionNexusProxy.LOOKUP_BYPASS ),
-            lookupContext.getDn(),
-            registries );
+        ServerEntry entry = proxy.lookup( lookupContext, PartitionNexusProxy.LOOKUP_BYPASS );
+
         checkLookupAccess( principal, lookupContext.getDn(), entry );
         return next.lookup( lookupContext );
     }
@@ -811,10 +799,7 @@
         Invocation invocation = InvocationStack.getInstance().peek();
         PartitionNexusProxy proxy = invocation.getProxy();
         
-        ServerEntry entry = ServerEntryUtils.toServerEntry( 
-            proxy.lookup( new LookupOperationContext( registries, name ), PartitionNexusProxy.LOOKUP_BYPASS ),
-            name,
-            registries );
+        ServerEntry entry = proxy.lookup( new LookupOperationContext( registries, name ), PartitionNexusProxy.LOOKUP_BYPASS );
         
         LdapPrincipal principal = ( ( ServerContext ) invocation.getCaller() ).getPrincipal();
         LdapDN principalDn = principal.getJndiName();
@@ -869,10 +854,7 @@
         Invocation invocation = InvocationStack.getInstance().peek();
         PartitionNexusProxy proxy = invocation.getProxy();
         
-        ServerEntry entry = ServerEntryUtils.toServerEntry(
-            proxy.lookup( new LookupOperationContext( registries, oriChildName ), PartitionNexusProxy.LOOKUP_BYPASS ),
-            oriChildName,
-            registries );
+        ServerEntry entry = proxy.lookup( new LookupOperationContext( registries, oriChildName ), PartitionNexusProxy.LOOKUP_BYPASS );
         
             LdapPrincipal principal = ( ( ServerContext ) invocation.getCaller() ).getPrincipal();
         LdapDN principalDn = principal.getJndiName();
@@ -911,11 +893,9 @@
         // will not be valid at the new location.
         // This will certainly be fixed by the SubentryInterceptor,
         // but after this service.
-        ServerEntry importedEntry = ServerEntryUtils.toServerEntry( 
-            proxy.lookup( new LookupOperationContext( registries, oriChildName ), 
-                PartitionNexusProxy.LOOKUP_EXCLUDING_OPR_ATTRS_BYPASS ),
-            oriChildName,
-            registries );
+        ServerEntry importedEntry = proxy.lookup( 
+            new LookupOperationContext( registries, oriChildName ), 
+                PartitionNexusProxy.LOOKUP_EXCLUDING_OPR_ATTRS_BYPASS );
             
         
         // As the target entry does not exist yet and so
@@ -954,11 +934,8 @@
         // Access the principal requesting the operation, and bypass checks if it is the admin
         Invocation invocation = InvocationStack.getInstance().peek();
         PartitionNexusProxy proxy = invocation.getProxy();
-        ServerEntry entry = ServerEntryUtils.toServerEntry( 
-            proxy.lookup( new LookupOperationContext( registries, oriChildName ), PartitionNexusProxy.LOOKUP_BYPASS ),
-            oriChildName,
-            registries );
-        
+        ServerEntry entry = proxy.lookup( new LookupOperationContext( registries, oriChildName ), PartitionNexusProxy.LOOKUP_BYPASS );
+       
         LdapDN newName = ( LdapDN ) newParentName.clone();
         newName.add( oriChildName.get( oriChildName.size() - 1 ) );
         LdapPrincipal principal = ( ( ServerContext ) invocation.getCaller() ).getPrincipal();
@@ -996,11 +973,9 @@
         // will not be valid at the new location.
         // This will certainly be fixed by the SubentryInterceptor,
         // but after this service.
-        ServerEntry importedEntry = ServerEntryUtils.toServerEntry( 
-            proxy.lookup( new LookupOperationContext( registries, oriChildName ), 
-                PartitionNexusProxy.LOOKUP_EXCLUDING_OPR_ATTRS_BYPASS ),
-            oriChildName,
-            registries );
+        ServerEntry importedEntry = proxy.lookup( 
+            new LookupOperationContext( registries, oriChildName ), 
+                PartitionNexusProxy.LOOKUP_EXCLUDING_OPR_ATTRS_BYPASS );
             
         // As the target entry does not exist yet and so
         // its subentry operational attributes are not there,
@@ -1083,12 +1058,9 @@
         // Access the principal requesting the operation, and bypass checks if it is the admin
         Invocation invocation = InvocationStack.getInstance().peek();
         PartitionNexusProxy proxy = invocation.getProxy();
-        ServerEntry entry = ServerEntryUtils.toServerEntry( 
-            proxy.lookup( 
+        ServerEntry entry = proxy.lookup( 
         		new LookupOperationContext( registries, name ), 
-        		PartitionNexusProxy.LOOKUP_BYPASS ),
-        	name,
-        	registries );
+        		PartitionNexusProxy.LOOKUP_BYPASS );
 
         LdapPrincipal principal = ( ( ServerContext ) invocation.getCaller() ).getPrincipal();
         LdapDN principalDn = principal.getJndiName();
@@ -1135,10 +1107,7 @@
         // that but if permission is granted then short the process and return the dn
         while ( matched.size() > 0 )
         {
-            entry = ServerEntryUtils.toServerEntry( 
-                proxy.lookup( new LookupOperationContext( registries, matched ), PartitionNexusProxy.GETMATCHEDDN_BYPASS ),
-                matched,
-                registries );
+            entry = proxy.lookup( new LookupOperationContext( registries, matched ), PartitionNexusProxy.GETMATCHEDDN_BYPASS );
             
             Set<LdapDN> userGroups = groupCache.getGroups( principalDn.toString() );
             Collection<ACITuple> tuples = new HashSet<ACITuple>();
@@ -1174,11 +1143,8 @@
          * tests.  If we hasPermission() returns false we immediately short the
          * process and return false.
          */
-        ServerEntry entry = ServerEntryUtils.toServerEntry( 
-            invocation.getProxy().lookup( 
-                new LookupOperationContext( registries, normName ), PartitionNexusProxy.LOOKUP_BYPASS ),
-            normName,
-            registries );
+        ServerEntry entry = invocation.getProxy().lookup( 
+                new LookupOperationContext( registries, normName ), PartitionNexusProxy.LOOKUP_BYPASS );
         
         ServerLdapContext ctx = ( ServerLdapContext ) invocation.getCaller();
         LdapDN userDn = ctx.getPrincipal().getJndiName();

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java?rev=615071&r1=615070&r2=615071&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java Thu Jan 24 14:39:32 2008
@@ -22,6 +22,9 @@
 
 import org.apache.directory.server.constants.ServerDNConstants;
 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.ServerValue;
 import org.apache.directory.server.core.enumeration.SearchResultFilter;
 import org.apache.directory.server.core.enumeration.SearchResultFilteringEnumeration;
 import org.apache.directory.server.core.interceptor.BaseInterceptor;
@@ -47,7 +50,6 @@
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.OidNormalizer;
-import org.apache.directory.shared.ldap.util.AttributeUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -55,8 +57,6 @@
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
 import javax.naming.NoPermissionException;
-import javax.naming.directory.Attribute;
-import javax.naming.directory.Attributes;
 import javax.naming.directory.SearchControls;
 import javax.naming.directory.SearchResult;
 import javax.naming.ldap.LdapContext;
@@ -149,18 +149,18 @@
     {
         // read in the administrators and cache their normalized names
         Set<String> newAdministrators = new HashSet<String>( 2 );
-        Attributes adminGroup = nexus.lookup( new LookupOperationContext( registries, ADMIN_GROUP_DN ) );
+        ServerEntry adminGroup = nexus.lookup( new LookupOperationContext( registries, ADMIN_GROUP_DN ) );
         
         if ( adminGroup == null )
         {
             return;
         }
         
-        Attribute uniqueMember = AttributeUtils.getAttribute( adminGroup, uniqueMemberAT );
+        ServerAttribute uniqueMember = adminGroup.get( uniqueMemberAT );
         
-        for ( int ii = 0; ii < uniqueMember.size(); ii++ )
+        for ( ServerValue<?> value:uniqueMember )
         {
-            LdapDN memberDn = new LdapDN( ( String ) uniqueMember.get( ii ) );
+            LdapDN memberDn = new LdapDN( ( String ) value.get() );
             memberDn.normalize( normalizerMapping );
             newAdministrators.add( memberDn.getNormName() );
         }
@@ -427,17 +427,17 @@
     }
 
 
-    public Attributes lookup( NextInterceptor nextInterceptor, LookupOperationContext opContext ) throws NamingException
+    public ServerEntry lookup( NextInterceptor nextInterceptor, LookupOperationContext opContext ) throws NamingException
     {
-        Attributes attributes = nextInterceptor.lookup( opContext );
+        ServerEntry serverEntry = nextInterceptor.lookup( opContext );
         
-        if ( !enabled || ( attributes == null ) )
+        if ( !enabled || ( serverEntry == null ) )
         {
-            return attributes;
+            return serverEntry;
         }
 
         protectLookUp( opContext.getDn() );
-        return attributes;
+        return serverEntry;
     }
 
 

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/ACDFEngine.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/ACDFEngine.java?rev=615071&r1=615070&r2=615071&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/ACDFEngine.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/ACDFEngine.java Thu Jan 24 14:39:32 2008
@@ -31,7 +31,6 @@
 import org.apache.directory.server.core.authz.AciAuthorizationInterceptor;
 import org.apache.directory.server.core.authz.DefaultAuthorizationInterceptor;
 import org.apache.directory.server.core.entry.ServerEntry;
-import org.apache.directory.server.core.entry.ServerEntryUtils;
 import org.apache.directory.server.core.event.Evaluator;
 import org.apache.directory.server.core.event.EventInterceptor;
 import org.apache.directory.server.core.event.ExpressionEvaluator;
@@ -205,10 +204,7 @@
             throw new NullPointerException( "entryName" );
         }
 
-        ServerEntry userEntry = ServerEntryUtils.toServerEntry( 
-            proxy.lookup( new LookupOperationContext( registries, userName ), USER_LOOKUP_BYPASS ),
-            userName, 
-            registries );
+        ServerEntry userEntry = proxy.lookup( new LookupOperationContext( registries, userName ), USER_LOOKUP_BYPASS );
 
         // Determine the scope of the requested operation.
         OperationScope scope;
@@ -239,14 +235,14 @@
                 proxy, 
                 userGroupNames, 
                 userName, 
-                ServerEntryUtils.toAttributesImpl( userEntry ),
+                userEntry,
                 authenticationLevel, 
                 entryName, 
                 attrId, 
                 attrValue, 
-                ServerEntryUtils.toAttributesImpl( entry ), 
+                entry, 
                 microOperations, 
-                ServerEntryUtils.toAttributesImpl( entryView ) );
+                entryView );
         }
 
         // Deny access if no tuples left.

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/ACITupleFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/ACITupleFilter.java?rev=615071&r1=615070&r2=615071&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/ACITupleFilter.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/ACITupleFilter.java Thu Jan 24 14:39:32 2008
@@ -25,6 +25,7 @@
 import javax.naming.NamingException;
 import javax.naming.directory.Attributes;
 
+import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.partition.PartitionNexusProxy;
 import org.apache.directory.server.schema.registries.Registries;
 import org.apache.directory.shared.ldap.aci.ACITuple;
@@ -70,13 +71,13 @@
             PartitionNexusProxy proxy,
             Collection<LdapDN> userGroupNames, 
             LdapDN userName, 
-            Attributes userEntry,
+            ServerEntry userEntry,
             AuthenticationLevel authenticationLevel, 
             LdapDN entryName, 
             String attrId,
             Object attrValue, 
-            Attributes entry, 
+            ServerEntry entry, 
             Collection<MicroOperation> microOperations,
-            Attributes entryView )
+            ServerEntry entryView )
         throws NamingException;
 }

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/HighestPrecedenceFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/HighestPrecedenceFilter.java?rev=615071&r1=615070&r2=615071&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/HighestPrecedenceFilter.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/HighestPrecedenceFilter.java Thu Jan 24 14:39:32 2008
@@ -24,8 +24,8 @@
 import java.util.Iterator;
 
 import javax.naming.NamingException;
-import javax.naming.directory.Attributes;
 
+import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.partition.PartitionNexusProxy;
 import org.apache.directory.server.schema.registries.Registries;
 import org.apache.directory.shared.ldap.aci.ACITuple;
@@ -50,14 +50,14 @@
     		PartitionNexusProxy proxy,
             Collection<LdapDN> userGroupNames, 
             LdapDN userName, 
-            Attributes userEntry, 
+            ServerEntry userEntry, 
             AuthenticationLevel authenticationLevel,
             LdapDN entryName, 
             String attrId, 
             Object attrValue, 
-            Attributes entry, 
+            ServerEntry entry, 
             Collection<MicroOperation> microOperations,
-            Attributes entryView )
+            ServerEntry entryView )
         throws NamingException
     {
         if ( tuples.size() <= 1 )

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/MaxImmSubFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/MaxImmSubFilter.java?rev=615071&r1=615070&r2=615071&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/MaxImmSubFilter.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/MaxImmSubFilter.java Thu Jan 24 14:39:32 2008
@@ -23,6 +23,7 @@
 import org.apache.directory.server.core.authn.AuthenticationInterceptor;
 import org.apache.directory.server.core.authz.AciAuthorizationInterceptor;
 import org.apache.directory.server.core.authz.DefaultAuthorizationInterceptor;
+import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.event.EventInterceptor;
 import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
 import org.apache.directory.server.core.normalization.NormalizationInterceptor;
@@ -43,7 +44,6 @@
 
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
-import javax.naming.directory.Attributes;
 import javax.naming.directory.SearchControls;
 import javax.naming.directory.SearchResult;
 import java.util.Collection;
@@ -80,14 +80,14 @@
             PartitionNexusProxy proxy,
             Collection<LdapDN> userGroupNames, 
             LdapDN userName, 
-            Attributes userEntry, 
+            ServerEntry userEntry, 
             AuthenticationLevel authenticationLevel,
             LdapDN entryName, 
             String attrId, 
             Object attrValue, 
-            Attributes entry, 
+            ServerEntry entry, 
             Collection<MicroOperation> microOperations,
-            Attributes entryView )
+            ServerEntry entryView )
         throws NamingException
     {
         if ( entryName.size() == 0 )

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/MaxValueCountFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/MaxValueCountFilter.java?rev=615071&r1=615070&r2=615071&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/MaxValueCountFilter.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/MaxValueCountFilter.java Thu Jan 24 14:39:32 2008
@@ -24,9 +24,9 @@
 import java.util.Iterator;
 
 import javax.naming.NamingException;
-import javax.naming.directory.Attribute;
-import javax.naming.directory.Attributes;
 
+import org.apache.directory.server.core.entry.ServerAttribute;
+import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.partition.PartitionNexusProxy;
 import org.apache.directory.server.schema.registries.Registries;
 import org.apache.directory.shared.ldap.aci.ACITuple;
@@ -53,14 +53,14 @@
             PartitionNexusProxy proxy,
             Collection<LdapDN> userGroupNames, 
             LdapDN userName, 
-            Attributes userEntry, 
+            ServerEntry userEntry, 
             AuthenticationLevel authenticationLevel,
             LdapDN entryName, 
             String attrId, 
             Object attrValue, 
-            Attributes entry, 
+            ServerEntry entry, 
             Collection<MicroOperation> microOperations,
-            Attributes entryView )
+            ServerEntry entryView )
         throws NamingException
     {
         if ( scope != OperationScope.ATTRIBUTE_TYPE_AND_VALUE )
@@ -76,6 +76,7 @@
         for ( Iterator<ACITuple> i = tuples.iterator(); i.hasNext(); )
         {
             ACITuple tuple = i.next();
+            
             if ( !tuple.isGrant() )
             {
                 continue;
@@ -84,9 +85,11 @@
             for ( Iterator<ProtectedItem> j = tuple.getProtectedItems().iterator(); j.hasNext(); )
             {
                 ProtectedItem item = j.next();
+                
                 if ( item instanceof ProtectedItem.MaxValueCount )
                 {
                     ProtectedItem.MaxValueCount mvc = ( ProtectedItem.MaxValueCount ) item;
+                    
                     if ( isRemovable( mvc, attrId, entryView ) )
                     {
                         i.remove();
@@ -100,15 +103,16 @@
     }
 
 
-    private boolean isRemovable( ProtectedItem.MaxValueCount mvc, String attrId, Attributes entryView )
+    private boolean isRemovable( ProtectedItem.MaxValueCount mvc, String attrId, ServerEntry entryView ) throws NamingException
     {
         for ( Iterator<ProtectedItem.MaxValueCountItem> k = mvc.iterator(); k.hasNext(); )
         {
             MaxValueCountItem mvcItem = k.next();
             if ( attrId.equalsIgnoreCase( mvcItem.getAttributeType() ) )
             {
-                Attribute attr = entryView.get( attrId );
+                ServerAttribute attr = entryView.get( attrId );
                 int attrCount = attr == null ? 0 : attr.size();
+                
                 if ( attrCount > mvcItem.getMaxCount() )
                 {
                     return true;

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/MicroOperationFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/MicroOperationFilter.java?rev=615071&r1=615070&r2=615071&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/MicroOperationFilter.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/MicroOperationFilter.java Thu Jan 24 14:39:32 2008
@@ -24,8 +24,8 @@
 import java.util.Iterator;
 
 import javax.naming.NamingException;
-import javax.naming.directory.Attributes;
 
+import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.partition.PartitionNexusProxy;
 import org.apache.directory.server.schema.registries.Registries;
 import org.apache.directory.shared.ldap.aci.ACITuple;
@@ -51,14 +51,14 @@
             PartitionNexusProxy proxy,
             Collection<LdapDN> userGroupNames, 
             LdapDN userName, 
-            Attributes userEntry, 
+            ServerEntry userEntry, 
             AuthenticationLevel authenticationLevel,
             LdapDN entryName, 
             String attrId, 
             Object attrValue, 
-            Attributes entry, 
+            ServerEntry entry, 
             Collection<MicroOperation> microOperations,
-            Attributes entryView )
+            ServerEntry entryView )
         throws NamingException
     {
         if ( tuples.size() == 0 )

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/MostSpecificProtectedItemFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/MostSpecificProtectedItemFilter.java?rev=615071&r1=615070&r2=615071&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/MostSpecificProtectedItemFilter.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/MostSpecificProtectedItemFilter.java Thu Jan 24 14:39:32 2008
@@ -24,8 +24,8 @@
 import java.util.Collection;
 
 import javax.naming.NamingException;
-import javax.naming.directory.Attributes;
 
+import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.partition.PartitionNexusProxy;
 import org.apache.directory.server.schema.registries.Registries;
 import org.apache.directory.shared.ldap.aci.ACITuple;
@@ -59,14 +59,14 @@
             PartitionNexusProxy proxy,
             Collection<LdapDN> userGroupNames, 
             LdapDN userName, 
-            Attributes userEntry, 
+            ServerEntry userEntry, 
             AuthenticationLevel authenticationLevel,
             LdapDN entryName, 
             String attrId, 
             Object attrValue, 
-            Attributes entry, 
+            ServerEntry entry, 
             Collection<MicroOperation> microOperations,
-            Attributes entryView )
+            ServerEntry entryView )
         throws NamingException
     {
         if ( tuples.size() <= 1 )

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/MostSpecificUserClassFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/MostSpecificUserClassFilter.java?rev=615071&r1=615070&r2=615071&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/MostSpecificUserClassFilter.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/MostSpecificUserClassFilter.java Thu Jan 24 14:39:32 2008
@@ -24,8 +24,8 @@
 import java.util.Collection;
 
 import javax.naming.NamingException;
-import javax.naming.directory.Attributes;
 
+import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.partition.PartitionNexusProxy;
 import org.apache.directory.server.schema.registries.Registries;
 import org.apache.directory.shared.ldap.aci.ACITuple;
@@ -57,14 +57,14 @@
             PartitionNexusProxy proxy,
             Collection<LdapDN> userGroupNames, 
             LdapDN userName, 
-            Attributes userEntry, 
+            ServerEntry userEntry, 
             AuthenticationLevel authenticationLevel,
             LdapDN entryName, 
             String attrId, 
             Object attrValue, 
-            Attributes entry, 
+            ServerEntry entry, 
             Collection<MicroOperation> microOperations,
-            Attributes entryView )
+            ServerEntry entryView )
         throws NamingException
     {
         if ( tuples.size() <= 1 )

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java?rev=615071&r1=615070&r2=615071&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java Thu Jan 24 14:39:32 2008
@@ -25,8 +25,9 @@
 
 import javax.naming.NamingException;
 import javax.naming.directory.Attribute;
-import javax.naming.directory.Attributes;
 
+import org.apache.directory.server.core.entry.ServerAttribute;
+import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.event.Evaluator;
 import org.apache.directory.server.core.partition.PartitionNexusProxy;
 import org.apache.directory.server.core.subtree.RefinementEvaluator;
@@ -77,14 +78,14 @@
             PartitionNexusProxy proxy,
             Collection<LdapDN> userGroupNames, 
             LdapDN userName, 
-            Attributes userEntry,
+            ServerEntry userEntry,
             AuthenticationLevel authenticationLevel, 
             LdapDN entryName, 
             String attrId,
             Object attrValue, 
-            Attributes entry, 
+            ServerEntry entry, 
             Collection<MicroOperation> microOperations,
-            Attributes entryView )
+            ServerEntry entryView )
         throws NamingException
     {
         if ( tuples.size() == 0 )
@@ -95,6 +96,7 @@
         for ( Iterator<ACITuple> i = tuples.iterator(); i.hasNext(); )
         {
             ACITuple tuple = i.next();
+            
             if ( !isRelated( tuple, scope, userName, entryName, attrId, attrValue, entry ) )
             {
                 i.remove();
@@ -106,9 +108,10 @@
 
 
     private boolean isRelated( ACITuple tuple, OperationScope scope, LdapDN userName, LdapDN entryName, String attrId,
-                               Object attrValue, Attributes entry ) throws NamingException, InternalError
+                               Object attrValue, ServerEntry entry ) throws NamingException, InternalError
     {
         String oid = null;
+        
         if ( attrId != null )
         {
             oid = oidRegistry.getOid( attrId );
@@ -225,6 +228,7 @@
             else if ( item instanceof ProtectedItem.RangeOfValues )
             {
                 ProtectedItem.RangeOfValues rov = ( ProtectedItem.RangeOfValues ) item;
+                
                 if ( entryEvaluator.evaluate( rov.getFilter(), entryName.toString(), entry ) )
                 {
                     return true;
@@ -261,11 +265,11 @@
                     if ( oid.equals( oidRegistry.getOid( svItem ) ) )
                     {
                         AttributeType attrType = attrRegistry.lookup( oid );
-                        Attribute attr = AttributeUtils.getAttribute( entry, attrType );
+                        ServerAttribute attr = entry.get( oid );
                         
                         if ( ( attr != null ) && 
-                             ( ( AttributeUtils.containsValue( attr, userName.toNormName(), attrType ) || 
-                               ( AttributeUtils.containsValue( attr, userName.getUpName(), attrType ) ) ) ) )
+                             ( ( attr.contains( userName.toNormName() ) || 
+                               ( attr.contains( userName.getUpName() ) ) ) ) )
                         {
                             return true;
                         }

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedUserClassFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedUserClassFilter.java?rev=615071&r1=615070&r2=615071&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedUserClassFilter.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedUserClassFilter.java Thu Jan 24 14:39:32 2008
@@ -24,10 +24,8 @@
 import java.util.Iterator;
 
 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.partition.PartitionNexusProxy;
 import org.apache.directory.server.core.subtree.SubtreeEvaluator;
 import org.apache.directory.server.schema.registries.Registries;
@@ -66,14 +64,14 @@
             PartitionNexusProxy proxy,
             Collection<LdapDN> userGroupNames, 
             LdapDN userName, 
-            Attributes userEntry, 
+            ServerEntry userEntry, 
             AuthenticationLevel authenticationLevel,
             LdapDN entryName, 
             String attrId, 
             Object attrValue, 
-            Attributes entry, 
+            ServerEntry entry, 
             Collection<MicroOperation> microOperations,
-            Attributes entryView )
+            ServerEntry entryView )
         throws NamingException
     {
         if ( tuples.size() == 0 )
@@ -89,7 +87,7 @@
             {
                 if ( !isRelated( userGroupNames, 
                                  userName, 
-                                 ServerEntryUtils.toServerEntry( userEntry, userName, registries ), 
+                                 userEntry, 
                                  entryName, 
                                  tuple.getUserClasses() )
                     || authenticationLevel.compareTo( tuple.getAuthenticationLevel() ) < 0 )
@@ -102,7 +100,7 @@
             {
                 if ( !isRelated( userGroupNames, 
                                  userName, 
-                                 ServerEntryUtils.toServerEntry( userEntry, userName, registries ), 
+                                 userEntry, 
                                  entryName, 
                                  tuple.getUserClasses() )
                     && authenticationLevel.compareTo( tuple.getAuthenticationLevel() ) >= 0 )

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/RestrictedByFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/RestrictedByFilter.java?rev=615071&r1=615070&r2=615071&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/RestrictedByFilter.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/RestrictedByFilter.java Thu Jan 24 14:39:32 2008
@@ -24,9 +24,9 @@
 import java.util.Iterator;
 
 import javax.naming.NamingException;
-import javax.naming.directory.Attribute;
-import javax.naming.directory.Attributes;
 
+import org.apache.directory.server.core.entry.ServerAttribute;
+import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.partition.PartitionNexusProxy;
 import org.apache.directory.server.schema.registries.Registries;
 import org.apache.directory.shared.ldap.aci.ACITuple;
@@ -53,14 +53,14 @@
             PartitionNexusProxy proxy,
             Collection<LdapDN> userGroupNames, 
             LdapDN userName, 
-            Attributes userEntry, 
+            ServerEntry userEntry, 
             AuthenticationLevel authenticationLevel,
             LdapDN entryName, 
             String attrId, 
             Object attrValue, 
-            Attributes entry, 
+            ServerEntry entry, 
             Collection<MicroOperation> microOperations,
-            Attributes entryView )
+            ServerEntry entryView )
         throws NamingException
     {
         if ( scope != OperationScope.ATTRIBUTE_TYPE_AND_VALUE )
@@ -76,6 +76,7 @@
         for ( Iterator<ACITuple> ii = tuples.iterator() ; ii.hasNext(); )
         {
             ACITuple tuple = ii.next();
+            
             if ( !tuple.isGrant() )
             {
                 continue;
@@ -91,7 +92,7 @@
     }
 
 
-    public boolean isRemovable( ACITuple tuple, String attrId, Object attrValue, Attributes entry )
+    public boolean isRemovable( ACITuple tuple, String attrId, Object attrValue, ServerEntry entry ) throws NamingException
     {
         for ( ProtectedItem item : tuple.getProtectedItems() )
         {
@@ -106,7 +107,7 @@
                     // TODO Fix DIRSEVER-832 
                     if ( attrId.equalsIgnoreCase( rbItem.getAttributeType() ) )
                     {
-                        Attribute attr = entry.get( rbItem.getValuesIn() );
+                        ServerAttribute attr = entry.get( rbItem.getValuesIn() );
                         
                         // TODO Fix DIRSEVER-832
                         if ( ( attr == null ) || !attr.contains( attrValue ) )

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java?rev=615071&r1=615070&r2=615071&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java Thu Jan 24 14:39:32 2008
@@ -159,7 +159,7 @@
     private Attributes getAttributes( OperationContext opContext ) throws NamingException
     {
         LdapDN dn = opContext.getDn();
-        Attributes attributes;
+        ServerEntry serverEntry;
 
         // @todo make sure we're not putting in operational attributes that cannot be user modified
         Invocation invocation = InvocationStack.getInstance().peek();
@@ -167,14 +167,14 @@
 
         if ( schemaService.isSchemaSubentry( dn.toNormName() ) )
         {
-            return schemaService.getSubschemaEntryCloned();
+            return ServerEntryUtils.toAttributesImpl( schemaService.getSubschemaEntryCloned() );
         }
         else
         {
-            attributes = proxy.lookup( new LookupOperationContext( opContext.getRegistries(), dn ), PartitionNexusProxy.LOOKUP_BYPASS );
+            serverEntry = proxy.lookup( new LookupOperationContext( opContext.getRegistries(), dn ), PartitionNexusProxy.LOOKUP_BYPASS );
         }
 
-        return attributes;
+        return ServerEntryUtils.toAttributesImpl( serverEntry );
     }
 
 
@@ -250,13 +250,14 @@
     public void moveAndRename( NextInterceptor next, MoveAndRenameOperationContext opCtx )
         throws NamingException
     {
-        Attributes attributes = null;
+        ServerEntry serverEntry = null;
+        
         if ( changeLog.isEnabled() && ! opCtx.isCollateralOperation() )
         {
             // @todo make sure we're not putting in operational attributes that cannot be user modified
             Invocation invocation = InvocationStack.getInstance().peek();
             PartitionNexusProxy proxy = invocation.getProxy();
-            attributes = proxy.lookup( new LookupOperationContext( opCtx.getRegistries(), opCtx.getDn() ),
+            serverEntry = proxy.lookup( new LookupOperationContext( opCtx.getRegistries(), opCtx.getDn() ),
                     PartitionNexusProxy.LOOKUP_BYPASS );
         }
 
@@ -274,7 +275,7 @@
         forward.setNewRdn( opCtx.getNewRdn().getUpName() );
         forward.setNewSuperior( opCtx.getParent().getUpName() );
 
-        Entry reverse = LdifUtils.reverseModifyRdn( attributes, opCtx.getParent(), opCtx.getDn(),
+        Entry reverse = LdifUtils.reverseModifyRdn( ServerEntryUtils.toAttributesImpl( serverEntry ), opCtx.getParent(), opCtx.getDn(),
                 new Rdn( opCtx.getNewRdn() ) );
         changeLog.log( getPrincipal(), forward, reverse );
     }



Mime
View raw message