directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r536268 - /directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/jndi/ServerLdapContext.java
Date Tue, 08 May 2007 17:33:17 GMT
Author: elecharny
Date: Tue May  8 10:33:16 2007
New Revision: 536268

URL: http://svn.apache.org/viewvc?view=rev&rev=536268
Log:
Added a isReferral( LdapDN ) method.
Removed the initialization of the private refService in these isReferral() methods, moved
it to the constructor.

Modified:
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/jndi/ServerLdapContext.java

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/jndi/ServerLdapContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/jndi/ServerLdapContext.java?view=diff&rev=536268&r1=536267&r2=536268
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/jndi/ServerLdapContext.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/jndi/ServerLdapContext.java
Tue May  8 10:33:16 2007
@@ -51,6 +51,9 @@
     private Control[] responseControls = EMPTY_CONTROLS;
     private Control[] connectControls = EMPTY_CONTROLS;
 
+    /** A reference to the RTeferralService interceptor */
+    private transient ReferralService refService = null; 
+    
 
     /**
      * Creates an instance of an ServerLdapContext.
@@ -62,6 +65,7 @@
     public ServerLdapContext( DirectoryService service, Hashtable env ) throws NamingException
     {
         super( service, env );
+        refService = (( ReferralService )service.getConfiguration().getInterceptorChain().get(
ReferralService.NAME ) );        
     }
 
 
@@ -185,18 +189,27 @@
     }
 
 
-    private transient ReferralService refService;
+    /**
+     * Check if a Name is a referral
+     * @param name The Name to check
+     * @return <code>true</code> if the Name is a referral.
+     * @throws NamingException If the Name is incorrect
+     */
     public boolean isReferral( String name ) throws NamingException
     {
-        if ( refService == null )
-        {
-            refService = ( ReferralService ) getService().getConfiguration().getInterceptorChain().get(
-                ReferralService.NAME );
-        }
-
         return refService.isReferral( name );
     }
 
+    /**
+     * Check if a Name is a referral
+     * @param name The Name to check
+     * @return <code>true</code> if the Name is a referral.
+     * @throws NamingException If the Name is incorrect
+     */
+    public boolean isReferral( LdapDN name ) throws NamingException
+    {
+        return refService.isReferral( name );
+    }
 
     public ServerContext getRootContext() throws NamingException
     {



Mime
View raw message