You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ak...@apache.org on 2008/06/06 22:37:14 UTC

svn commit: r664115 - in /directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core: ./ interceptor/context/

Author: akarasulu
Date: Fri Jun  6 13:37:14 2008
New Revision: 664115

URL: http://svn.apache.org/viewvc?rev=664115&view=rev
Log:
filling in missing CoreSession operations which were making the ChangeLog revert operations fail

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/ListOperationContext.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/SearchOperationContext.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/SearchingOperationContext.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=664115&r1=664114&r2=664115&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 Fri Jun  6 13:37:14 2008
@@ -225,23 +225,6 @@
     
 
     /**
-     * Modifies an entry within the server by applying a list of modifications 
-     * to the entry as a collateral operation.  This means such operations 
-     * avoid certain house keeping operations.
-     * 
-     * TODO determine if this overload should even be here since this is used 
-     * internally by services in the server.
-     *
-     * @param dn the distinguished name of the entry to modify
-     * @param mods the list of modifications to apply
-     * @param collateral whether or not the operation is a side effect of 
-     * another modify
-     * @throws Exception if there are failures while modifying the entry
-     */
-    void modify( LdapDN dn, List<Modification> mods, boolean collateral ) throws Exception;
-    
-
-    /**
      * Moves an entry or a branch of entries at a specified distinguished name
      * to a position under a new parent.
      * 

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=664115&r1=664114&r2=664115&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 Fri Jun  6 13:37:14 2008
@@ -30,8 +30,17 @@
 import org.apache.directory.server.core.entry.ClonedServerEntry;
 import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.filtering.EntryFilteringCursor;
+import org.apache.directory.server.core.interceptor.context.AddOperationContext;
+import org.apache.directory.server.core.interceptor.context.CompareOperationContext;
+import org.apache.directory.server.core.interceptor.context.DeleteOperationContext;
+import org.apache.directory.server.core.interceptor.context.ListOperationContext;
 import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
+import org.apache.directory.server.core.interceptor.context.ModifyOperationContext;
+import org.apache.directory.server.core.interceptor.context.MoveAndRenameOperationContext;
+import org.apache.directory.server.core.interceptor.context.MoveOperationContext;
 import org.apache.directory.server.core.interceptor.context.OperationContext;
+import org.apache.directory.server.core.interceptor.context.RenameOperationContext;
+import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
 import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
 import org.apache.directory.shared.ldap.entry.Modification;
 import org.apache.directory.shared.ldap.filter.ExprNode;
@@ -46,6 +55,7 @@
  * The default CoreSession implementation.
  * 
  * TODO - has not been completed yet
+ * TODO - need to supply controls and other parameters to setup opContexts
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
@@ -70,8 +80,7 @@
      */
     public void add( ServerEntry entry ) throws Exception
     {
-        // TODO Auto-generated method stub
-
+        directoryService.getOperationManager().add( new AddOperationContext( this, entry ) );
     }
 
 
@@ -80,8 +89,7 @@
      */
     public void compare( LdapDN dn, String oid, Object value ) throws Exception
     {
-        // TODO Auto-generated method stub
-
+        directoryService.getOperationManager().compare( new CompareOperationContext( this, dn, oid, value ) );
     }
 
 
@@ -90,8 +98,7 @@
      */
     public void delete( LdapDN dn ) throws Exception
     {
-        // TODO Auto-generated method stub
-
+        directoryService.getOperationManager().delete( new DeleteOperationContext( this, dn ) );
     }
 
 
@@ -202,8 +209,8 @@
     public EntryFilteringCursor list( LdapDN dn, AliasDerefMode aliasDerefMode,
         Set<AttributeTypeOptions> returningAttributes ) throws Exception
     {
-        // TODO Auto-generated method stub
-        return null;
+        return directoryService.getOperationManager().list( 
+            new ListOperationContext( this, dn, aliasDerefMode, returningAttributes ) );
     }
 
 
@@ -213,8 +220,10 @@
     public EntryFilteringCursor list( LdapDN dn, AliasDerefMode aliasDerefMode,
         Set<AttributeTypeOptions> returningAttributes, int sizeLimit, int timeLimit ) throws Exception
     {
-        // TODO Auto-generated method stub
-        return null;
+        ListOperationContext opContext = new ListOperationContext( this, dn, aliasDerefMode, returningAttributes );
+        opContext.setSizeLimit( sizeLimit );
+        opContext.setTimeLimit( timeLimit );
+        return directoryService.getOperationManager().list( opContext );
     }
 
 
@@ -223,8 +232,7 @@
      */
     public ClonedServerEntry lookup( LdapDN dn ) throws Exception
     {
-        LookupOperationContext opContext = new LookupOperationContext( this, dn );
-        return directoryService.getOperationManager().lookup( opContext );
+        return directoryService.getOperationManager().lookup( new LookupOperationContext( this, dn ) );
     }
 
 
@@ -233,18 +241,7 @@
      */
     public void modify( LdapDN dn, List<Modification> mods ) throws Exception
     {
-        // TODO Auto-generated method stub
-
-    }
-
-
-    /* (non-Javadoc)
-     * @see org.apache.directory.server.core.CoreSession#modify(org.apache.directory.shared.ldap.name.LdapDN, java.util.List, boolean)
-     */
-    public void modify( LdapDN dn, List<Modification> mods, boolean collateral ) throws Exception
-    {
-        // TODO Auto-generated method stub
-
+        directoryService.getOperationManager().modify( new ModifyOperationContext( this, dn, mods ) );
     }
 
 
@@ -253,8 +250,7 @@
      */
     public void move( LdapDN dn, LdapDN newParent ) throws Exception
     {
-        // TODO Auto-generated method stub
-
+        directoryService.getOperationManager().move( new MoveOperationContext( this, dn, newParent ) );
     }
 
 
@@ -263,8 +259,8 @@
      */
     public void moveAndRename( LdapDN dn, LdapDN newParent, Rdn newRdn, boolean deleteOldRdn ) throws Exception
     {
-        // TODO Auto-generated method stub
-
+        directoryService.getOperationManager().moveAndRename( 
+            new MoveAndRenameOperationContext( this, dn, newParent, newRdn, deleteOldRdn ) );
     }
 
 
@@ -273,8 +269,7 @@
      */
     public void rename( LdapDN dn, Rdn newRdn, boolean deleteOldRdn ) throws Exception
     {
-        // TODO Auto-generated method stub
-
+        directoryService.getOperationManager().rename( new RenameOperationContext( this, dn, newRdn, deleteOldRdn ) );
     }
 
 
@@ -284,8 +279,8 @@
     public EntryFilteringCursor search( LdapDN dn, SearchScope scope, ExprNode filter, AliasDerefMode aliasDerefMode,
         Set<AttributeTypeOptions> returningAttributes ) throws Exception
     {
-        // TODO Auto-generated method stub
-        return null;
+        return directoryService.getOperationManager().search( new SearchOperationContext( this, dn, scope, filter, 
+            aliasDerefMode, returningAttributes ) );
     }
 
 
@@ -295,8 +290,11 @@
     public EntryFilteringCursor search( LdapDN dn, SearchScope scope, ExprNode filter, AliasDerefMode aliasDerefMode,
         Set<AttributeTypeOptions> returningAttributes, int sizeLimit, int timeLimit ) throws Exception
     {
-        // TODO Auto-generated method stub
-        return null;
+        SearchOperationContext opContext = new SearchOperationContext( this, dn, scope, filter, 
+            aliasDerefMode, returningAttributes );
+        opContext.setSizeLimit( sizeLimit );
+        opContext.setTimeLimit( timeLimit );
+        return directoryService.getOperationManager().search( opContext );
     }
 
 

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/ListOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/ListOperationContext.java?rev=664115&r1=664114&r2=664115&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/ListOperationContext.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/ListOperationContext.java Fri Jun  6 13:37:14 2008
@@ -20,8 +20,11 @@
 package org.apache.directory.server.core.interceptor.context;
 
 
+import java.util.Set;
+
 import org.apache.directory.server.core.CoreSession;
 import org.apache.directory.shared.ldap.name.LdapDN;
+import org.apache.directory.shared.ldap.schema.AttributeTypeOptions;
 import org.apache.directory.shared.ldap.message.AliasDerefMode;
 
 
@@ -67,6 +70,21 @@
 
     
     /**
+     * Creates a new instance of ListOperationContext with attributes to return.
+     *
+     * @param session the session associated with this {@link OperationContext}
+     * @param dn the base DN 
+     * @param aliasDerefMode the alias dereferencing mode to use
+     * @param returningAttributes the attributes to return
+     */
+    public ListOperationContext( CoreSession session, LdapDN dn, AliasDerefMode aliasDerefMode,
+        Set<AttributeTypeOptions> returningAttributes )
+    {
+        super( session, dn, aliasDerefMode, returningAttributes );
+    }
+
+
+    /**
      * @return the operation name
      */
     public String getName()

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=664115&r1=664114&r2=664115&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 Fri Jun  6 13:37:14 2008
@@ -20,14 +20,17 @@
 package org.apache.directory.server.core.interceptor.context;
 
 
-import javax.naming.NamingException;
+import java.util.Set;
+
 import javax.naming.directory.SearchControls;
 
 import org.apache.directory.server.core.CoreSession;
 import org.apache.directory.shared.ldap.filter.ExprNode;
+import org.apache.directory.shared.ldap.filter.SearchScope;
 import org.apache.directory.shared.ldap.message.AliasDerefMode;
 import org.apache.directory.shared.ldap.message.MessageTypeEnum;
 import org.apache.directory.shared.ldap.name.LdapDN;
+import org.apache.directory.shared.ldap.schema.AttributeTypeOptions;
 
 
 /**
@@ -54,14 +57,14 @@
 
     /**
      * Creates a new instance of SearchOperationContext.
+     * 
      * @param aliasDerefMode the alias dereferencing mode
      * @param dn the dn of the search base
      * @param filter the filter AST to use for the search
      * @param searchControls the search controls
-     * @throws NamingException 
      */
     public SearchOperationContext( CoreSession session, LdapDN dn, AliasDerefMode aliasDerefMode, ExprNode filter,
-                                   SearchControls searchControls ) throws NamingException
+                                   SearchControls searchControls ) throws Exception
     {
         super( session, dn, aliasDerefMode, searchControls );
         this.filter = filter;
@@ -69,6 +72,25 @@
 
 
     /**
+     * Creates a new instance of SearchOperationContext.
+     * 
+     * @param session the session this operation is associated with
+     * @param dn the search base
+     * @param scope the search scope
+     * @param filter the filter AST to use for the search
+     * @param aliasDerefMode the alias dereferencing mode
+     * @param returningAttributes the attributes to return
+     */
+    public SearchOperationContext( CoreSession session, LdapDN dn, SearchScope scope,
+        ExprNode filter, AliasDerefMode aliasDerefMode, Set<AttributeTypeOptions> returningAttributes )
+    {
+        super( session, dn, aliasDerefMode, returningAttributes );
+        super.setScope( scope );
+        this.filter = filter;
+    }
+
+
+    /**
      * @return The filter
      */
     public ExprNode getFilter()

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/SearchingOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/SearchingOperationContext.java?rev=664115&r1=664114&r2=664115&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/SearchingOperationContext.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/SearchingOperationContext.java Fri Jun  6 13:37:14 2008
@@ -176,8 +176,23 @@
     }
 
     
-    
-    
+    /**
+     * Creates a new instance of a SearchingOperationContext using one level 
+     * scope, with attributes to return.
+     *
+     * @param dn The DN to get the suffix from
+     * @param aliasDerefMode the alias dereferencing mode to use
+     * @throws NamingException 
+     */
+    public SearchingOperationContext( CoreSession session, LdapDN dn, AliasDerefMode aliasDerefMode,
+        Set<AttributeTypeOptions> returningAttributes )
+    {
+        super( session, dn );
+        this.aliasDerefMode = aliasDerefMode;
+        this.returningAttributes = returningAttributes;
+    }
+
+
     /**
      * @see Object#toString()
      */