directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r159383 - directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/GlobalOidRegistry.java
Date Tue, 29 Mar 2005 15:52:10 GMT
Author: akarasulu
Date: Tue Mar 29 07:52:09 2005
New Revision: 159383

URL: http://svn.apache.org/viewcvs?view=rev&rev=159383
Log:
applying 

Modified:
    directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/GlobalOidRegistry.java

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/GlobalOidRegistry.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/GlobalOidRegistry.java?view=diff&r1=159382&r2=159383
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/GlobalOidRegistry.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/GlobalOidRegistry.java
Tue Mar 29 07:52:09 2005
@@ -142,16 +142,34 @@
          * returned on a getNameSet.
          */
         String lowerCase = name.trim().toLowerCase();
-        if ( ! name.equals( lowerCase )
-        && byName.containsKey( lowerCase ) )
-        {
-            String oid = ( String ) byName.get( lowerCase );
-            monitor.oidResolved( name, lowerCase, oid );
+        if ( ! name.equals( lowerCase ) )
+		{
+			if ( byName.containsKey( lowerCase ) )
+	        {
+	            String oid = ( String ) byName.get( lowerCase );
+	            monitor.oidResolved( name, lowerCase, oid );
+	
+	            // We expect to see this version of the key again so we add it
+	            byName.put( name, oid );
+	            return oid;
+	        }
+			
+			/*
+			 * Some LDAP servers (MS Active Directory) tend to use some of the
+			 * bootstrap oid names as all caps, like OU. This should resolve that.
+			 * Lets stash this in the byName if we find it.
+			 */
+			
+			if ( bootstrap.hasOid( lowerCase) )
+			{
+	            String oid = bootstrap.getOid( name );
+	            monitor.oidResolved( name, oid );
 
-            // We expect to see this version of the key again so we add it
-            byName.put( name, oid );
-            return oid;
-        }
+	            // We expect to see this version of the key again so we add it
+				byName.put( name, oid );
+	            return oid;
+			}
+		}
 
         NamingException fault = new NamingException ( "OID for name '"
                 + name + "' was not " + "found within the OID registry" );



Mime
View raw message