directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1446117 - /directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/request/BindRequestHandler.java
Date Thu, 14 Feb 2013 11:08:53 GMT
Author: elecharny
Date: Thu Feb 14 11:08:53 2013
New Revision: 1446117

URL: http://svn.apache.org/r1446117
Log:
Declared a variable directoryService to avoid many indirections

Modified:
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/request/BindRequestHandler.java

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/request/BindRequestHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/request/BindRequestHandler.java?rev=1446117&r1=1446116&r2=1446117&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/request/BindRequestHandler.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/request/BindRequestHandler.java
Thu Feb 14 11:08:53 2013
@@ -92,6 +92,8 @@ public class BindRequestHandler extends 
     @SuppressWarnings("PMD.EmptyCatchBlock")
     public void handleSimpleAuth( LdapSession ldapSession, BindRequest bindRequest ) throws
Exception
     {
+        DirectoryService directoryService = ldapServer.getDirectoryService();
+
         // if the user is already bound, we have to unbind him
         if ( ldapSession.isAuthenticated() )
         {
@@ -113,7 +115,7 @@ public class BindRequestHandler extends 
         bindContext.setDn( bindRequest.getDn() );
         bindContext.setCredentials( bindRequest.getCredentials() );
         bindContext.setIoSession( ldapSession.getIoSession() );
-        bindContext.setInterceptors( ldapServer.getDirectoryService().getInterceptors( OperationEnum.BIND
) );
+        bindContext.setInterceptors( directoryService.getInterceptors( OperationEnum.BIND
) );
 
         // Stores the request controls into the operation context
         LdapProtocolUtils.setRequestControls( bindContext, bindRequest );
@@ -141,7 +143,7 @@ public class BindRequestHandler extends 
 
             try
             {
-                principalEntry = getLdapServer().getDirectoryService().getAdminSession().lookup(
bindRequest.getDn() );
+                principalEntry = directoryService.getAdminSession().lookup( bindRequest.getDn()
);
             }
             catch ( LdapException le )
             {
@@ -172,8 +174,8 @@ public class BindRequestHandler extends 
             // opContext.setEntry( principalEntry );
 
             // And call the OperationManager bind operation.
-            bindContext.setInterceptors( getLdapServer().getDirectoryService().getInterceptors(
OperationEnum.BIND ) );
-            getLdapServer().getDirectoryService().getOperationManager().bind( bindContext
);
+            bindContext.setInterceptors( directoryService.getInterceptors( OperationEnum.BIND
) );
+            directoryService.getOperationManager().bind( bindContext );
 
             // As a result, store the created session in the Core Session
             ldapSession.setCoreSession( bindContext.getSession() );
@@ -341,7 +343,7 @@ public class BindRequestHandler extends 
 
                 // Build the response
                 result.setResultCode( ResultCodeEnum.SASL_BIND_IN_PROGRESS );
-                BindResponse resp = ( BindResponse ) bindRequest.getResultResponse();
+                BindResponse resp = bindRequest.getResultResponse();
 
                 // Store the challenge
                 resp.setServerSaslCreds( tokenBytes );
@@ -421,7 +423,7 @@ public class BindRequestHandler extends 
     private void sendBindSuccess( LdapSession ldapSession, BindRequest bindRequest, byte[]
tokenBytes )
     {
         // Return the successful response
-        BindResponse response = ( BindResponse ) bindRequest.getResultResponse();
+        BindResponse response = bindRequest.getResultResponse();
         response.getLdapResult().setResultCode( ResultCodeEnum.SUCCESS );
         response.setServerSaslCreds( tokenBytes );
 



Mime
View raw message