directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r664445 - in /directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core: ./ interceptor/context/
Date Sun, 08 Jun 2008 05:27:10 GMT
Author: akarasulu
Date: Sat Jun  7 22:27:09 2008
New Revision: 664445

URL: http://svn.apache.org/viewvc?rev=664445&view=rev
Log:
added ability to determine the referral handling mode from the LDAP request object in OperationContexts

Modified:
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/CoreSession.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/DefaultCoreSession.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/AbstractOperationContext.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/AddOperationContext.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/CompareOperationContext.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/DeleteOperationContext.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/SearchOperationContext.java

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/CoreSession.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/CoreSession.java?rev=664445&r1=664444&r2=664445&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/CoreSession.java
(original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/CoreSession.java
Sat Jun  7 22:27:09 2008
@@ -37,7 +37,6 @@
 import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.filter.SearchScope;
 import org.apache.directory.shared.ldap.message.AddRequest;
-import org.apache.directory.shared.ldap.message.AddResponse;
 import org.apache.directory.shared.ldap.message.AliasDerefMode;
 import org.apache.directory.shared.ldap.message.CompareRequest;
 import org.apache.directory.shared.ldap.message.DeleteRequest;
@@ -206,7 +205,7 @@
     void add( ServerEntry entry ) throws Exception;
     
     
-    AddResponse add( AddRequest addRequest, ReferralHandlingMode referralHandlingMode ) throws
Exception;
+    void add( AddRequest addRequest ) throws Exception;
     
     
     /**
@@ -220,7 +219,7 @@
     void compare( LdapDN dn, String oid, Object value ) throws Exception;
     
     
-    void compare( CompareRequest compareRequest ) throws Exception;
+    boolean compare( CompareRequest compareRequest ) throws Exception;
 
     
     /**

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/DefaultCoreSession.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/DefaultCoreSession.java?rev=664445&r1=664444&r2=664445&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/DefaultCoreSession.java
(original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/DefaultCoreSession.java
Sat Jun  7 22:27:09 2008
@@ -46,7 +46,6 @@
 import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.filter.SearchScope;
 import org.apache.directory.shared.ldap.message.AddRequest;
-import org.apache.directory.shared.ldap.message.AddResponse;
 import org.apache.directory.shared.ldap.message.AliasDerefMode;
 import org.apache.directory.shared.ldap.message.CompareRequest;
 import org.apache.directory.shared.ldap.message.DeleteRequest;
@@ -329,25 +328,28 @@
     }
 
 
-    public AddResponse add( AddRequest addRequest, ReferralHandlingMode referralHandlingMode
) throws Exception
+    public void add( AddRequest addRequest ) throws Exception
     {
         AddOperationContext opContext = new AddOperationContext( this, addRequest );
-        opContext.setReferralHandlingMode( referralHandlingMode );
         directoryService.getOperationManager().add( opContext );
         addRequest.getResultResponse().addAll( opContext.getResponseControls() );
-        return ( AddResponse ) addRequest.getResultResponse();
     }
 
 
-    public void compare( CompareRequest compareRequest ) throws Exception
+    public boolean compare( CompareRequest compareRequest ) throws Exception
     {
-        directoryService.getOperationManager().compare( new CompareOperationContext( this,
compareRequest ) );
+        CompareOperationContext opContext = new CompareOperationContext( this, compareRequest
);
+        boolean result = directoryService.getOperationManager().compare( opContext );
+        compareRequest.getResultResponse().addAll( opContext.getResponseControls() );
+        return result;
     }
 
 
     public void delete( DeleteRequest deleteRequest ) throws Exception
     {
-        directoryService.getOperationManager().delete( new DeleteOperationContext( this,
deleteRequest ) );
+        DeleteOperationContext opContext = new DeleteOperationContext( this, deleteRequest
);
+        directoryService.getOperationManager().delete( opContext );
+        deleteRequest.getResultResponse().addAll( opContext.getResponseControls() );
     }
 
 

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/AbstractOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/AbstractOperationContext.java?rev=664445&r1=664444&r2=664445&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/AbstractOperationContext.java
(original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/AbstractOperationContext.java
Sat Jun  7 22:27:09 2008
@@ -34,6 +34,8 @@
 import org.apache.directory.server.core.entry.ClonedServerEntry;
 import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.shared.ldap.entry.Modification;
+import org.apache.directory.shared.ldap.message.ManageDsaITControl;
+import org.apache.directory.shared.ldap.message.Request;
 import org.apache.directory.shared.ldap.name.LdapDN;
 
 
@@ -423,4 +425,17 @@
     {
         return referralHandlingMode;
     }
+    
+    
+    protected void setReferralHandlingMode( Request req )
+    {
+        if ( req.hasControl( ManageDsaITControl.CONTROL_OID ) )
+        {
+            this.referralHandlingMode = ReferralHandlingMode.IGNORE;
+        }
+        else
+        {
+            this.referralHandlingMode = ReferralHandlingMode.THROW;
+        }
+    }
 }

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/AddOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/AddOperationContext.java?rev=664445&r1=664444&r2=664445&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/AddOperationContext.java
(original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/AddOperationContext.java
Sat Jun  7 22:27:09 2008
@@ -98,6 +98,7 @@
             session.getDirectoryService().getRegistries() );
         this.dn = addRequest.getEntry();
         this.requestControls = addRequest.getControls();
+        setReferralHandlingMode( addRequest );
     }
 
 

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/CompareOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/CompareOperationContext.java?rev=664445&r1=664444&r2=664445&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/CompareOperationContext.java
(original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/CompareOperationContext.java
Sat Jun  7 22:27:09 2008
@@ -108,6 +108,7 @@
         this.oid = compareRequest.getAttributeId();
         this.value = compareRequest.getAssertionValue();
         this.requestControls = compareRequest.getControls();
+        setReferralHandlingMode( compareRequest );
     }
 
 

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/DeleteOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/DeleteOperationContext.java?rev=664445&r1=664444&r2=664445&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/DeleteOperationContext.java
(original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/DeleteOperationContext.java
Sat Jun  7 22:27:09 2008
@@ -59,9 +59,10 @@
     {
         super( session, deleteRequest.getName() );
         this.requestControls = deleteRequest.getControls();
+        super.setReferralHandlingMode( deleteRequest );
     }
-
-
+    
+    
     /**
      * @return the operation name
      */

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/SearchOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/SearchOperationContext.java?rev=664445&r1=664444&r2=664445&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/SearchOperationContext.java
(original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/SearchOperationContext.java
Sat Jun  7 22:27:09 2008
@@ -89,6 +89,7 @@
         this.timeLimit = searchRequest.getTimeLimit();
         this.noAttributes = searchRequest.getTypesOnly();
         setReturningAttributes( searchRequest.getAttributes() );
+        setReferralHandlingMode( searchRequest );
     }
 
 



Mime
View raw message