directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r413396 - /directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/referral/ReferralService.java
Date Sun, 11 Jun 2006 01:23:48 GMT
Author: akarasulu
Date: Sat Jun 10 18:23:47 2006
New Revision: 413396

URL: http://svn.apache.org/viewvc?rev=413396&view=rev
Log:
fixed all failing integration tests in ReferralTest by fixing bugs associated with normalization

Modified:
    directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/referral/ReferralService.java

Modified: directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/referral/ReferralService.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/referral/ReferralService.java?rev=413396&r1=413395&r2=413396&view=diff
==============================================================================
--- directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/referral/ReferralService.java
(original)
+++ directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/referral/ReferralService.java
Sat Jun 10 18:23:47 2006
@@ -37,6 +37,7 @@
 import javax.naming.directory.SearchResult;
 
 import org.apache.directory.server.core.DirectoryServiceConfiguration;
+import org.apache.directory.server.core.ServerUtils;
 import org.apache.directory.server.core.configuration.DirectoryPartitionConfiguration;
 import org.apache.directory.server.core.configuration.InterceptorConfiguration;
 import org.apache.directory.server.core.enumeration.ReferralHandlingEnumeration;
@@ -51,6 +52,7 @@
 import org.apache.directory.server.core.partition.DirectoryPartitionNexus;
 import org.apache.directory.server.core.partition.DirectoryPartitionNexusProxy;
 import org.apache.directory.server.core.schema.AttributeTypeRegistry;
+import org.apache.directory.server.core.schema.OidRegistry;
 
 import org.apache.directory.shared.ldap.codec.util.LdapURL;
 import org.apache.directory.shared.ldap.NotImplementedException;
@@ -62,6 +64,7 @@
 import org.apache.directory.shared.ldap.filter.SimpleNode;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.LdapDN;
+import org.apache.directory.shared.ldap.schema.AttributeType;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -91,8 +94,10 @@
     private ReferralLut lut = new ReferralLut();
     private DirectoryPartitionNexus nexus;
     private Hashtable env;
-    private AttributeTypeRegistry registry;
+    private AttributeTypeRegistry attrRegistry;
+    private OidRegistry oidRegistry;
 
+    
     static
     {
         /*
@@ -156,7 +161,8 @@
     public void init( DirectoryServiceConfiguration dsConfig, InterceptorConfiguration cfg
) throws NamingException
     {
         nexus = dsConfig.getPartitionNexus();
-        registry = dsConfig.getGlobalRegistries().getAttributeTypeRegistry();
+        attrRegistry = dsConfig.getGlobalRegistries().getAttributeTypeRegistry();
+        oidRegistry = dsConfig.getGlobalRegistries().getOidRegistry();
         env = dsConfig.getEnvironment();
 
         Iterator suffixes = nexus.listSuffixes();
@@ -234,7 +240,7 @@
                 buf.append( ldapUrl.getPort() );
             }
             buf.append( "/" );
-            buf.append( urlDn );
+            buf.append( urlDn.toUpName() );
             list.add( buf.toString() );
         }
         LdapReferralException lre = new LdapReferralException( list );
@@ -273,7 +279,8 @@
             }
 
             Attributes referral = invocation.getProxy().lookup( farthest, DirectoryPartitionNexusProxy.LOOKUP_BYPASS
);
-            Attribute refs = referral.get( REF_ATTR );
+            AttributeType refsType = attrRegistry.lookup( oidRegistry.getOid( REF_ATTR )
);
+            Attribute refs = ServerUtils.getAttribute( refsType, referral );
             doReferralException( farthest, new LdapDN( normName.toUpName() ), refs );
         }
         else if ( refval.equals( FOLLOW ) )
@@ -310,7 +317,7 @@
 
             Attributes referral = invocation.getProxy().lookup( farthest, DirectoryPartitionNexusProxy.LOOKUP_BYPASS
);
             Attribute refs = referral.get( REF_ATTR );
-            doReferralException( farthest, normName, refs );
+            doReferralException( farthest, new LdapDN( normName.toUpName() ), refs );
 
             // we really can't get here since doReferralException will throw an exception
             return false;
@@ -359,7 +366,7 @@
 
             Attributes referral = invocation.getProxy().lookup( farthest, DirectoryPartitionNexusProxy.LOOKUP_BYPASS
);
             Attribute refs = referral.get( REF_ATTR );
-            doReferralException( farthest, normName, refs );
+            doReferralException( farthest, new LdapDN( normName.toUpName() ), refs );
         }
         else if ( refval.equals( FOLLOW ) )
         {
@@ -425,7 +432,7 @@
                 Attributes referral = invocation.getProxy().lookup( farthestSrc,
                     DirectoryPartitionNexusProxy.LOOKUP_BYPASS );
                 Attribute refs = referral.get( REF_ATTR );
-                doReferralException( farthestSrc, oldName, refs );
+                doReferralException( farthestSrc, new LdapDN( oldName.toUpName() ), refs
);
             }
             else if ( farthestDst != null )
             {
@@ -492,7 +499,7 @@
                 Attributes referral = invocation.getProxy().lookup( farthestSrc,
                     DirectoryPartitionNexusProxy.LOOKUP_BYPASS );
                 Attribute refs = referral.get( REF_ATTR );
-                doReferralException( farthestSrc, oldName, refs );
+                doReferralException( farthestSrc, new LdapDN( oldName.toUpName() ), refs
);
             }
             else if ( farthestDst != null )
             {
@@ -563,7 +570,7 @@
                 Attributes referral = invocation.getProxy().lookup( farthestSrc,
                     DirectoryPartitionNexusProxy.LOOKUP_BYPASS );
                 Attribute refs = referral.get( REF_ATTR );
-                doReferralException( farthestSrc, oldName, refs );
+                doReferralException( farthestSrc, new LdapDN( oldName.toUpName() ), refs
);
             }
             else if ( farthestDst != null )
             {
@@ -676,7 +683,7 @@
 
             Attributes referral = invocation.getProxy().lookup( farthest, DirectoryPartitionNexusProxy.LOOKUP_BYPASS
);
             Attribute refs = referral.get( REF_ATTR );
-            doReferralException( farthest, name, refs );
+            doReferralException( farthest, new LdapDN( name.toUpName() ), refs );
         }
         else if ( refval.equals( FOLLOW ) )
         {
@@ -780,7 +787,7 @@
 
             Attributes referral = invocation.getProxy().lookup( farthest, DirectoryPartitionNexusProxy.LOOKUP_BYPASS
);
             Attribute refs = referral.get( REF_ATTR );
-            doReferralException( farthest, name, refs );
+            doReferralException( farthest, new LdapDN( name.toUpName() ), refs );
         }
         else if ( refval.equals( FOLLOW ) )
         {
@@ -932,12 +939,12 @@
             {
                 SearchResultFilteringEnumeration srfe = ( SearchResultFilteringEnumeration
) next.search( base, env,
                     filter, controls );
-                return new ReferralHandlingEnumeration( srfe, lut, registry, nexus, controls.getSearchScope(),
true );
+                return new ReferralHandlingEnumeration( srfe, lut, attrRegistry, nexus, controls.getSearchScope(),
true );
             }
 
             Attributes referral = invocation.getProxy().lookup( farthest, DirectoryPartitionNexusProxy.LOOKUP_BYPASS
);
             Attribute refs = referral.get( REF_ATTR );
-            doReferralExceptionOnSearchBase( farthest, base, refs, controls.getSearchScope()
);
+            doReferralExceptionOnSearchBase( farthest, new LdapDN( base.toUpName() ), refs,
controls.getSearchScope() );
             throw new IllegalStateException( "Should never get here: shutting up compiler"
);
         }
         else if ( refval.equals( FOLLOW ) )
@@ -1067,7 +1074,7 @@
                 buf.append( ldapUrl.getPort() );
             }
             buf.append( "/" );
-            buf.append( urlDn );
+            buf.append( urlDn.toUpName() );
             buf.append( "??" );
 
             switch ( scope )



Mime
View raw message