directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r536259 - /directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/referral/ReferralService.java
Date Tue, 08 May 2007 17:23:57 GMT
Author: elecharny
Date: Tue May  8 10:23:56 2007
New Revision: 536259

URL: http://svn.apache.org/viewvc?view=rev&rev=536259
Log:
Added a isReferral( LdapDN ) method to avoid a DN parsing

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

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/referral/ReferralService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/referral/ReferralService.java?view=diff&rev=536259&r1=536258&r2=536259
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/referral/ReferralService.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/referral/ReferralService.java
Tue May  8 10:23:56 2007
@@ -1079,7 +1079,13 @@
         throw lre;
     }
 
-
+    /**
+     * Check if the given name is a referral or not.
+     * 
+     * @param name The DN to check
+     * @return <code>true</code> if the DN is a referral
+     * @throws NamingException I fthe DN is incorrect
+     */
     public boolean isReferral( String name ) throws NamingException
     {
         if ( lut.isReferral( name ) )
@@ -1090,11 +1096,18 @@
         LdapDN dn = new LdapDN( name );
         dn.normalize( attrRegistry.getNormalizerMapping() );
 
-        if ( lut.isReferral( dn ) )
-        {
-            return true;
-        }
+        return lut.isReferral( dn );
+    }
 
-        return false;
+    /**
+     * Check if the given name is a referral or not.
+     * 
+     * @param name The DN to check
+     * @return <code>true</code> if the DN is a referral
+     * @throws NamingException I fthe DN is incorrect
+     */
+    public boolean isReferral( LdapDN name ) throws NamingException
+    {
+        return lut.isReferral( LdapDN.normalize( name, attrRegistry.getNormalizerMapping()
) );
     }
 }



Mime
View raw message