directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1199802 - in /directory/apacheds/trunk: core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/ core-jndi/src/main/java/org/apache/directory/server/core/jndi/ core-shared/src/main/java/org/apache/directory/server/c...
Date Wed, 09 Nov 2011 15:39:33 GMT
Author: elecharny
Date: Wed Nov  9 15:39:32 2011
New Revision: 1199802

URL: http://svn.apache.org/viewvc?rev=1199802&view=rev
Log:
Small improvement = compute the list of intecreptors into the OperationContext classes, instead
of doing it outside, when we have a session.

Modified:
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/AbstractOperationContext.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/BindOperationContext.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/DeleteOperationContext.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/GetRootDSEOperationContext.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/UnbindOperationContext.java
    directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java
    directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerLdapContext.java
    directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/DefaultCoreSession.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/BindHandler.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/SimpleMechanismHandler.java

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/AbstractOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/AbstractOperationContext.java?rev=1199802&r1=1199801&r2=1199802&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/AbstractOperationContext.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/AbstractOperationContext.java
Wed Nov  9 15:39:32 2011
@@ -355,7 +355,6 @@ public abstract class AbstractOperationC
     {
         DeleteOperationContext deleteContext = new DeleteOperationContext( session, dn );
         setup( deleteContext );
-        deleteContext.setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.DELETE
) );
         session.getDirectoryService().getOperationManager().delete( deleteContext );
     }
     

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/BindOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/BindOperationContext.java?rev=1199802&r1=1199801&r2=1199802&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/BindOperationContext.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/BindOperationContext.java
Wed Nov  9 15:39:32 2011
@@ -22,6 +22,7 @@ package org.apache.directory.server.core
 
 import org.apache.commons.lang.NotImplementedException;
 import org.apache.directory.server.core.api.CoreSession;
+import org.apache.directory.server.core.api.OperationEnum;
 import org.apache.directory.server.core.api.ReferralHandlingMode;
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.shared.ldap.model.constants.AuthenticationLevel;
@@ -68,6 +69,11 @@ public class BindOperationContext extend
     public BindOperationContext( CoreSession session )
     {
         super( session );
+        
+        if ( session != null )
+        {
+        	setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.BIND
) );
+        }
     }
 
     

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/DeleteOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/DeleteOperationContext.java?rev=1199802&r1=1199801&r2=1199802&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/DeleteOperationContext.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/DeleteOperationContext.java
Wed Nov  9 15:39:32 2011
@@ -21,6 +21,7 @@ package org.apache.directory.server.core
 
 
 import org.apache.directory.server.core.api.CoreSession;
+import org.apache.directory.server.core.api.OperationEnum;
 import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.message.DeleteRequest;
 import org.apache.directory.shared.ldap.model.message.MessageTypeEnum;
@@ -42,6 +43,7 @@ public class DeleteOperationContext exte
     public DeleteOperationContext( CoreSession session )
     {
         super( session );
+        setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.DELETE
) );
     }
     
 
@@ -53,12 +55,14 @@ public class DeleteOperationContext exte
     public DeleteOperationContext( CoreSession session, Dn deleteDn )
     {
         super( session, deleteDn );
+        setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.DELETE
) );
     }
 
 
     public DeleteOperationContext( CoreSession session, DeleteRequest deleteRequest )
     {
         super( session, deleteRequest.getName() );
+        setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.DELETE
) );
         requestControls = deleteRequest.getControls();
         
         if ( requestControls.containsKey( ManageDsaIT.OID ) )

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/GetRootDSEOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/GetRootDSEOperationContext.java?rev=1199802&r1=1199801&r2=1199802&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/GetRootDSEOperationContext.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/GetRootDSEOperationContext.java
Wed Nov  9 15:39:32 2011
@@ -21,6 +21,7 @@ package org.apache.directory.server.core
 
 
 import org.apache.directory.server.core.api.CoreSession;
+import org.apache.directory.server.core.api.OperationEnum;
 import org.apache.directory.shared.ldap.model.name.Dn;
 
 
@@ -38,8 +39,10 @@ public class GetRootDSEOperationContext 
     public GetRootDSEOperationContext( CoreSession session )
     {
         super( session );
+        setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.GET_ROOT_DSE
) );
     }
     
+    
     /**
      * Creates a new instance of GetRootDSEOperationContext.
      *
@@ -48,8 +51,10 @@ public class GetRootDSEOperationContext 
     public GetRootDSEOperationContext( CoreSession session, Dn dn )
     {
         super( session, dn );
+        setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.GET_ROOT_DSE
) );
     }
     
+    
     /**
      * @return the operation name
      */

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/UnbindOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/UnbindOperationContext.java?rev=1199802&r1=1199801&r2=1199802&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/UnbindOperationContext.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/UnbindOperationContext.java
Wed Nov  9 15:39:32 2011
@@ -21,6 +21,7 @@ package org.apache.directory.server.core
 
 
 import org.apache.directory.server.core.api.CoreSession;
+import org.apache.directory.server.core.api.OperationEnum;
 import org.apache.directory.shared.ldap.model.message.MessageTypeEnum;
 import org.apache.directory.shared.ldap.model.message.UnbindRequest;
 
@@ -39,13 +40,15 @@ public class UnbindOperationContext exte
     public UnbindOperationContext( CoreSession session )
     {
         super( session, session.getEffectivePrincipal().getDn() );
+        setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.UNBIND
) );
     }
     
 
     public UnbindOperationContext( CoreSession session, UnbindRequest unbindRequest )
     {
         super( session, session.getEffectivePrincipal().getDn() );
-        this.setRequestControls( unbindRequest.getControls() );
+        setRequestControls( unbindRequest.getControls() );
+        setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.UNBIND
) );
     }
 
     

Modified: directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java?rev=1199802&r1=1199801&r2=1199802&view=diff
==============================================================================
--- directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java
(original)
+++ directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java
Wed Nov  9 15:39:32 2011
@@ -366,9 +366,6 @@ public abstract class ServerContext impl
         // Inject the referral handling into the operation context
         injectReferralControl( deleteContext );
 
-        // We should get this list from the DS
-        deleteContext.setInterceptors( service.getInterceptors( OperationEnum.DELETE ) );
-
         // execute delete operation
         OperationManager operationManager = service.getOperationManager();
         operationManager.delete( deleteContext );
@@ -608,9 +605,6 @@ public abstract class ServerContext impl
         GetRootDSEOperationContext getRootDseContext = new GetRootDSEOperationContext( session,
target );
         getRootDseContext.addRequestControls( convertControls( true, requestControls ) );
         
-        // We should get this list from the DS
-        getRootDseContext.setInterceptors( service.getInterceptors( OperationEnum.GET_ROOT_DSE
) );
-
         // do not reset request controls since this is not an external
         // operation and not do bother setting the response controls either
         OperationManager operationManager = service.getOperationManager();
@@ -682,6 +676,7 @@ public abstract class ServerContext impl
         bindContext.setSaslMechanism( saslMechanism );
         bindContext.setSaslAuthId( saslAuthId );
         bindContext.addRequestControls( convertControls( true, requestControls ) );
+        bindContext.setInterceptors( getDirectoryService().getInterceptors( OperationEnum.BIND
) );
 
         // execute bind operation
         OperationManager operationManager = service.getOperationManager();

Modified: directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerLdapContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerLdapContext.java?rev=1199802&r1=1199801&r2=1199802&view=diff
==============================================================================
--- directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerLdapContext.java
(original)
+++ directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerLdapContext.java
Wed Nov  9 15:39:32 2011
@@ -285,6 +285,7 @@ public class ServerLdapContext extends S
     public void ldapUnbind() throws NamingException
     {
         UnbindOperationContext opCtx = new UnbindOperationContext( getSession() );
+        
         try
         {
             opCtx.addRequestControls( JndiUtils.fromJndiControls( getDirectoryService().getLdapCodecService(),


Modified: directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/DefaultCoreSession.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/DefaultCoreSession.java?rev=1199802&r1=1199801&r2=1199802&view=diff
==============================================================================
--- directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/DefaultCoreSession.java
(original)
+++ directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/DefaultCoreSession.java
Wed Nov  9 15:39:32 2011
@@ -298,9 +298,6 @@ public class DefaultCoreSession implemen
 
         deleteContext.setLogChange( log );
 
-        // Gets the list of interceptors from the DS
-        deleteContext.setInterceptors( directoryService.getInterceptors( OperationEnum.DELETE
) );
-
         OperationManager operationManager = directoryService.getOperationManager();
         operationManager.delete( deleteContext );
     }
@@ -325,9 +322,6 @@ public class DefaultCoreSession implemen
         deleteContext.setLogChange( log );
         setReferralHandling( deleteContext, ignoreReferral );
 
-        // Gets the list of interceptors from the DS
-        deleteContext.setInterceptors( directoryService.getInterceptors( OperationEnum.DELETE
) );
-
         OperationManager operationManager = directoryService.getOperationManager();
         operationManager.delete( deleteContext );
     }
@@ -895,9 +889,6 @@ public class DefaultCoreSession implemen
 
         deleteContext.setLogChange( log );
 
-        // Gets the list of interceptors from the DS
-        deleteContext.setInterceptors( directoryService.getInterceptors( OperationEnum.DELETE
) );
-
         OperationManager operationManager = directoryService.getOperationManager();
         
         try
@@ -1101,9 +1092,6 @@ public class DefaultCoreSession implemen
     {
     	UnbindOperationContext unbindContext = new UnbindOperationContext( this );
     	
-        // Gets the list of interceptors from the DS
-        unbindContext.setInterceptors( directoryService.getInterceptors( OperationEnum.UNBIND
) );
-
         OperationManager operationManager = directoryService.getOperationManager();
         operationManager.unbind( unbindContext );
     }
@@ -1116,9 +1104,6 @@ public class DefaultCoreSession implemen
     {
     	UnbindOperationContext unbindContext = new UnbindOperationContext( this, unbindRequest
);
     	
-        // Gets the list of interceptors from the DS
-        unbindContext.setInterceptors( directoryService.getInterceptors( OperationEnum.UNBIND
) );
-
         OperationManager operationManager = directoryService.getOperationManager();
         operationManager.unbind( unbindContext );
     }

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/BindHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/BindHandler.java?rev=1199802&r1=1199801&r2=1199802&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/BindHandler.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/BindHandler.java
Wed Nov  9 15:39:32 2011
@@ -112,6 +112,7 @@ public class BindHandler extends LdapReq
         bindContext.setDn( bindRequest.getName() );
         bindContext.setCredentials( bindRequest.getCredentials() );
         bindContext.setIoSession( ldapSession.getIoSession() );
+        bindContext.setInterceptors( ldapServer.getDirectoryService().getInterceptors( OperationEnum.BIND
) );
 
         // Stores the request controls into the operation context
         LdapProtocolUtils.setRequestControls( bindContext, bindRequest );

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/SimpleMechanismHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/SimpleMechanismHandler.java?rev=1199802&r1=1199801&r2=1199802&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/SimpleMechanismHandler.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/SimpleMechanismHandler.java
Wed Nov  9 15:39:32 2011
@@ -24,6 +24,7 @@ import javax.security.sasl.SaslServer;
 
 import org.apache.commons.lang.exception.ExceptionUtils;
 import org.apache.directory.server.core.api.CoreSession;
+import org.apache.directory.server.core.api.OperationEnum;
 import org.apache.directory.server.core.api.interceptor.context.BindOperationContext;
 import org.apache.directory.server.ldap.LdapProtocolUtils;
 import org.apache.directory.server.ldap.LdapSession;
@@ -60,6 +61,7 @@ public class SimpleMechanismHandler impl
         // Stores the Dn of the user to check, and its password
         bindContext.setDn( bindRequest.getName() );
         bindContext.setCredentials( bindRequest.getCredentials() );
+        bindContext.setInterceptors( ldapSession.getLdapServer().getDirectoryService().getInterceptors(
OperationEnum.BIND ) );
 
         // Stores the request controls into the operation context
         LdapProtocolUtils.setRequestControls( bindContext, bindRequest );



Mime
View raw message