directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r811856 - /directory/apacheds/branches/apacheds-schema/core-mock/src/main/java/org/apache/directory/server/core/
Date Sun, 06 Sep 2009 18:44:53 GMT
Author: elecharny
Date: Sun Sep  6 18:44:53 2009
New Revision: 811856

URL: http://svn.apache.org/viewvc?rev=811856&view=rev
Log:
Updated the class to have them public

Added:
    directory/apacheds/branches/apacheds-schema/core-mock/src/main/java/org/apache/directory/server/core/MockCoreSession.java
    directory/apacheds/branches/apacheds-schema/core-mock/src/main/java/org/apache/directory/server/core/MockInterceptor.java
    directory/apacheds/branches/apacheds-schema/core-mock/src/main/java/org/apache/directory/server/core/MockOperation.java
Modified:
    directory/apacheds/branches/apacheds-schema/core-mock/src/main/java/org/apache/directory/server/core/MockCursor.java
    directory/apacheds/branches/apacheds-schema/core-mock/src/main/java/org/apache/directory/server/core/MockDirectoryService.java
    directory/apacheds/branches/apacheds-schema/core-mock/src/main/java/org/apache/directory/server/core/MockOperationManager.java

Added: directory/apacheds/branches/apacheds-schema/core-mock/src/main/java/org/apache/directory/server/core/MockCoreSession.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-mock/src/main/java/org/apache/directory/server/core/MockCoreSession.java?rev=811856&view=auto
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-mock/src/main/java/org/apache/directory/server/core/MockCoreSession.java (added)
+++ directory/apacheds/branches/apacheds-schema/core-mock/src/main/java/org/apache/directory/server/core/MockCoreSession.java Sun Sep  6 18:44:53 2009
@@ -0,0 +1,936 @@
+/*
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *   or more contributor license agreements.  See the NOTICE file
+ *   distributed with this work for additional information
+ *   regarding copyright ownership.  The ASF licenses this file
+ *   to you under the Apache License, Version 2.0 (the
+ *   "License"); you may not use this file except in compliance
+ *   with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing,
+ *   software distributed under the License is distributed on an
+ *   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *   KIND, either express or implied.  See the License for the
+ *   specific language governing permissions and limitations
+ *   under the License.
+ *
+ */
+package org.apache.directory.server.core;
+
+
+import java.net.SocketAddress;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
+import javax.naming.NamingException;
+import javax.naming.ldap.Control;
+
+import org.apache.directory.server.constants.ServerDNConstants;
+import org.apache.directory.server.core.changelog.LogChange;
+import org.apache.directory.server.core.entry.ClonedServerEntry;
+import org.apache.directory.server.core.entry.ServerBinaryValue;
+import org.apache.directory.server.core.entry.ServerEntry;
+import org.apache.directory.server.core.entry.ServerModification;
+import org.apache.directory.server.core.entry.ServerStringValue;
+import org.apache.directory.server.core.filtering.EntryFilteringCursor;
+import org.apache.directory.server.core.interceptor.context.AbstractOperationContext;
+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.EntryOperationContext;
+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.server.core.interceptor.context.UnbindOperationContext;
+import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
+import org.apache.directory.shared.ldap.entry.Modification;
+import org.apache.directory.shared.ldap.entry.Value;
+import org.apache.directory.shared.ldap.filter.ExprNode;
+import org.apache.directory.shared.ldap.filter.FilterParser;
+import org.apache.directory.shared.ldap.filter.SearchScope;
+import org.apache.directory.shared.ldap.message.InternalAddRequest;
+import org.apache.directory.shared.ldap.message.AliasDerefMode;
+import org.apache.directory.shared.ldap.message.InternalCompareRequest;
+import org.apache.directory.shared.ldap.message.InternalDeleteRequest;
+import org.apache.directory.shared.ldap.message.InternalModifyDnRequest;
+import org.apache.directory.shared.ldap.message.InternalModifyRequest;
+import org.apache.directory.shared.ldap.message.InternalSearchRequest;
+import org.apache.directory.shared.ldap.message.InternalUnbindRequest;
+import org.apache.directory.shared.ldap.name.LdapDN;
+import org.apache.directory.shared.ldap.name.Rdn;
+import org.apache.directory.shared.ldap.schema.AttributeType;
+import org.apache.directory.shared.ldap.schema.AttributeTypeOptions;
+import org.apache.directory.shared.ldap.util.StringTools;
+
+
+/**
+ * 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$
+ */
+public class MockCoreSession implements CoreSession
+{
+    private DirectoryService directoryService;
+    private final LdapPrincipal authenticatedPrincipal;
+    private LdapPrincipal authorizedPrincipal;
+    
+    
+    public MockCoreSession( LdapPrincipal principal, DirectoryService directoryService )
+    {
+        this.directoryService = directoryService;
+        this.authenticatedPrincipal = principal;
+    }
+
+    
+    /**
+     * Set the ignoreRefferal flag for the current operationContext.
+     *
+     * @param opContext The current operationContext
+     * @param ignoreReferral The flag 
+     */
+    private void setReferralHandling( AbstractOperationContext opContext, boolean ignoreReferral )
+    {
+        if ( ignoreReferral )
+        {
+            opContext.ignoreReferral();
+        }
+        else
+        {
+            opContext.throwReferral();
+        }
+    }
+    
+    
+    /**
+     * {@inheritDoc} 
+     */
+    public void add( ServerEntry entry ) throws Exception
+    {
+        add( entry, LogChange.TRUE );
+    }
+
+
+    /**
+     * {@inheritDoc} 
+     */
+    public void add( ServerEntry entry, boolean ignoreReferral ) throws Exception
+    {
+        add( entry, ignoreReferral, LogChange.TRUE );
+    }
+
+
+    /**
+     * {@inheritDoc} 
+     */
+    public void add( ServerEntry entry, LogChange log ) throws Exception
+    {
+        AddOperationContext opContext = new AddOperationContext( this, entry );
+
+        opContext.setLogChange( log );
+        
+        OperationManager operationManager = directoryService.getOperationManager();
+        operationManager.add( opContext );
+    }
+
+
+    /**
+     * {@inheritDoc} 
+     */
+    public void add( ServerEntry entry, boolean ignoreReferral, LogChange log ) throws Exception
+    {
+        AddOperationContext opContext = new AddOperationContext( this, entry );
+
+        opContext.setLogChange( log );
+        setReferralHandling( opContext, ignoreReferral );
+        
+        OperationManager operationManager = directoryService.getOperationManager();
+        operationManager.add( opContext );
+    }
+
+
+    /**
+     * {@inheritDoc} 
+     */
+    public void add( InternalAddRequest addRequest ) throws Exception
+    {
+        add( addRequest, LogChange.TRUE );
+    }
+
+    
+    /**
+     * {@inheritDoc} 
+     */
+    public void add( InternalAddRequest addRequest, LogChange log ) throws Exception
+    {
+        AddOperationContext opContext = new AddOperationContext( this, addRequest );
+
+        opContext.setLogChange( log );
+        
+        OperationManager operationManager = directoryService.getOperationManager();
+        operationManager.add( opContext );
+        addRequest.getResultResponse().addAll( opContext.getResponseControls() );
+    }
+
+    
+    private Value<?> convertToValue( String oid, Object value ) throws NamingException
+    {
+        Value<?> val = null;
+        
+        AttributeType attributeType = directoryService.getRegistries().getAttributeTypeRegistry().lookup( oid );
+        
+        // make sure we add the request controls to operation
+        if ( attributeType.getSyntax().isHumanReadable() )
+        {
+            if ( value instanceof String )
+            {
+                val = new ServerStringValue( attributeType, (String)value );
+            }
+            else if ( value instanceof byte[] )
+            {
+                val = new ServerStringValue( attributeType, StringTools.utf8ToString( (byte[])value ) );
+            }
+            else
+            {
+                throw new NamingException( "Bad value for the OID " + oid );
+            }
+        }
+        else
+        {
+            if ( value instanceof String )
+            {
+                val = new ServerBinaryValue( attributeType, StringTools.getBytesUtf8( (String)value ) );
+            }
+            else if ( value instanceof byte[] )
+            {
+                val = new ServerBinaryValue( attributeType, (byte[])value );
+            }
+            else
+            {
+                throw new NamingException( "Bad value for the OID " + oid );
+            }
+        }
+        
+        return val;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean compare( LdapDN dn, String oid, Object value ) throws Exception
+    {
+        OperationManager operationManager = directoryService.getOperationManager();
+        
+        return operationManager.compare( 
+            new CompareOperationContext( this, dn, oid, 
+                convertToValue( oid, value ) ) );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean compare( LdapDN dn, String oid, Object value, boolean ignoreReferral ) throws Exception
+    {
+        CompareOperationContext opContext =  
+                new CompareOperationContext( this, dn, oid, 
+                    convertToValue( oid, value ) );
+        
+        setReferralHandling( opContext, ignoreReferral );
+        
+        OperationManager operationManager = directoryService.getOperationManager();
+        return operationManager.compare( opContext );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void delete( LdapDN dn ) throws Exception
+    {
+        delete( dn, LogChange.TRUE );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void delete( LdapDN dn, LogChange log ) throws Exception
+    {
+        DeleteOperationContext opContext = new DeleteOperationContext( this, dn );
+
+        opContext.setLogChange( log );
+
+        OperationManager operationManager = directoryService.getOperationManager();
+        operationManager.delete( opContext );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void delete( LdapDN dn, boolean ignoreReferral  ) throws Exception
+    {
+        delete( dn, ignoreReferral, LogChange.TRUE );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void delete( LdapDN dn, boolean ignoreReferral, LogChange log ) throws Exception
+    {
+        DeleteOperationContext opContext = new DeleteOperationContext( this, dn );
+        
+        opContext.setLogChange( log );
+        setReferralHandling( opContext, ignoreReferral );
+
+        OperationManager operationManager = directoryService.getOperationManager();
+        operationManager.delete( opContext );
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.apache.directory.server.core.CoreSession#getAuthenticatedPrincipal()
+     */
+    public LdapPrincipal getAuthenticatedPrincipal()
+    {
+        return authenticatedPrincipal;
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.apache.directory.server.core.CoreSession#getAuthenticationLevel()
+     */
+    public AuthenticationLevel getAuthenticationLevel()
+    {
+        return getEffectivePrincipal().getAuthenticationLevel();
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.apache.directory.server.core.CoreSession#getClientAddress()
+     */
+    public SocketAddress getClientAddress()
+    {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.apache.directory.server.core.CoreSession#getControls()
+     */
+    public Set<Control> getControls()
+    {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.apache.directory.server.core.CoreSession#getDirectoryService()
+     */
+    public DirectoryService getDirectoryService()
+    {
+        return directoryService;
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.apache.directory.server.core.CoreSession#getEffectivePrincipal()
+     */
+    public LdapPrincipal getEffectivePrincipal()
+    {
+        if ( authorizedPrincipal == null )
+        {
+            return authenticatedPrincipal;
+        }
+        
+        return authorizedPrincipal;
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.apache.directory.server.core.CoreSession#getOutstandingOperations()
+     */
+    public Set<OperationContext> getOutstandingOperations()
+    {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.apache.directory.server.core.CoreSession#getServiceAddress()
+     */
+    public SocketAddress getServiceAddress()
+    {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.apache.directory.server.core.CoreSession#isConfidential()
+     */
+    public boolean isConfidential()
+    {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.apache.directory.server.core.CoreSession#isVirtual()
+     */
+    public boolean isVirtual()
+    {
+        // TODO Auto-generated method stub
+        return true;
+    }
+    
+    
+    /**
+     * TODO - perhaps we should just use a flag that is calculated on creation
+     * of this session
+     *  
+     * @see org.apache.directory.server.core.CoreSession#isAdministrator()
+     */
+    public boolean isAdministrator()
+    {
+        String normName = getEffectivePrincipal().getJndiName().toNormName(); 
+        return normName.equals( ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
+    }
+
+
+    /**
+     * TODO - this method impl does not check to see if the principal is in 
+     * the administrators group - it only returns true of the principal is
+     * the actual admin user.  need to make it check groups.
+     * 
+     * TODO - perhaps we should just use a flag that is calculated on creation
+     * of this session
+     *  
+     * @see org.apache.directory.server.core.CoreSession#isAnAdministrator()
+     */
+    public boolean isAnAdministrator()
+    {
+        if ( isAdministrator() )
+        {
+            return true;
+        }
+        
+        // TODO fix this so it checks groups
+        return false;
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.apache.directory.server.core.CoreSession#list(org.apache.directory.shared.ldap.name.LdapDN, org.apache.directory.shared.ldap.message.AliasDerefMode, java.util.Set)
+     */
+    public EntryFilteringCursor list( LdapDN dn, AliasDerefMode aliasDerefMode,
+        Set<AttributeTypeOptions> returningAttributes ) throws Exception
+    {
+        OperationManager operationManager = directoryService.getOperationManager();
+        return operationManager.list( 
+            new ListOperationContext( this, dn, aliasDerefMode, returningAttributes ) );
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.apache.directory.server.core.CoreSession#list(org.apache.directory.shared.ldap.name.LdapDN, org.apache.directory.shared.ldap.message.AliasDerefMode, java.util.Set, int, int)
+     */
+    public EntryFilteringCursor list( LdapDN dn, AliasDerefMode aliasDerefMode,
+        Set<AttributeTypeOptions> returningAttributes, int sizeLimit, int timeLimit ) throws Exception
+    {
+        ListOperationContext opContext = new ListOperationContext( this, dn, aliasDerefMode, returningAttributes );
+        opContext.setSizeLimit( sizeLimit );
+        opContext.setTimeLimit( timeLimit );
+        OperationManager operationManager = directoryService.getOperationManager();
+        return operationManager.list( opContext );
+    }
+
+
+    /**
+     * {@inheritDoc} 
+     */
+    public ClonedServerEntry lookup( LdapDN dn ) throws Exception
+    {
+        OperationManager operationManager = directoryService.getOperationManager();
+        return operationManager.lookup( new LookupOperationContext( this, dn ) );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public ClonedServerEntry lookup( LdapDN dn, String[] attrId ) throws Exception
+    {
+        OperationManager operationManager = directoryService.getOperationManager();
+        return operationManager.lookup( 
+            new LookupOperationContext( this, dn, attrId ) );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void modify( LdapDN dn, List<Modification> mods ) throws Exception
+    {
+        modify( dn, mods, LogChange.TRUE );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void modify( LdapDN dn, List<Modification> mods, LogChange log ) throws Exception
+    {
+        if ( mods == null )
+        {
+            return;
+        }
+        
+        List<Modification> serverModifications = new ArrayList<Modification>( mods.size() );
+        
+        for ( Modification mod:mods )
+        {
+            serverModifications.add( new ServerModification( directoryService.getRegistries(), mod ) );
+        }
+        
+        ModifyOperationContext opContext = new ModifyOperationContext( this, dn, serverModifications );
+
+        opContext.setLogChange( log );
+
+        OperationManager operationManager = directoryService.getOperationManager();
+        operationManager.modify( opContext );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void modify( LdapDN dn, List<Modification> mods, boolean ignoreReferral ) throws Exception
+    {
+        modify( dn, mods, ignoreReferral, LogChange.TRUE );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void modify( LdapDN dn, List<Modification> mods, boolean ignoreReferral, LogChange log ) throws Exception
+    {
+        if ( mods == null )
+        {
+            return;
+        }
+        
+        List<Modification> serverModifications = new ArrayList<Modification>( mods.size() );
+        
+        for ( Modification mod:mods )
+        {
+            serverModifications.add( new ServerModification( directoryService.getRegistries(), mod ) );
+        }
+
+        ModifyOperationContext opContext = new ModifyOperationContext( this, dn, serverModifications );
+        
+        setReferralHandling( opContext, ignoreReferral );
+        opContext.setLogChange( log );
+
+        OperationManager operationManager = directoryService.getOperationManager();
+        operationManager.modify( opContext );
+    }
+
+
+    /**
+     * {@inheritDoc} 
+     */
+    public void move( LdapDN dn, LdapDN newParent ) throws Exception
+    {
+        move( dn, newParent, LogChange.TRUE );
+    }
+
+
+    /**
+     * {@inheritDoc} 
+     */
+    public void move( LdapDN dn, LdapDN newParent, LogChange log ) throws Exception
+    {
+        MoveOperationContext opContext = new MoveOperationContext( this, dn, newParent );
+        
+        opContext.setLogChange( log );
+
+        OperationManager operationManager = directoryService.getOperationManager();
+        operationManager.move( opContext );
+    }
+
+
+    /**
+     * {@inheritDoc} 
+     */
+    public void move( LdapDN dn, LdapDN newParent, boolean ignoreReferral ) throws Exception
+    {
+        move( dn, newParent, ignoreReferral, LogChange.TRUE );
+    }
+
+
+    /**
+     * {@inheritDoc} 
+     */
+    public void move( LdapDN dn, LdapDN newParent, boolean ignoreReferral, LogChange log ) throws Exception
+    {
+        OperationManager operationManager = directoryService.getOperationManager();
+        MoveOperationContext opContext = new MoveOperationContext( this, dn, newParent );
+        
+        setReferralHandling( opContext, ignoreReferral );
+        opContext.setLogChange( log );
+
+        operationManager.move( opContext );
+    }
+
+
+    /**
+     * {@inheritDoc} 
+     */
+    public void moveAndRename( LdapDN dn, LdapDN newParent, Rdn newRdn, boolean deleteOldRdn ) throws Exception
+    {
+        moveAndRename( dn, newParent, newRdn, deleteOldRdn, LogChange.TRUE );
+    }
+
+
+    /**
+     * {@inheritDoc} 
+     */
+    public void moveAndRename( LdapDN dn, LdapDN newParent, Rdn newRdn, boolean deleteOldRdn, LogChange log ) throws Exception
+    {
+        MoveAndRenameOperationContext opContext = 
+            new MoveAndRenameOperationContext( this, dn, newParent, newRdn, deleteOldRdn );
+        
+        opContext.setLogChange( log );
+
+        OperationManager operationManager = directoryService.getOperationManager();
+        operationManager.moveAndRename( opContext );
+    }
+
+
+    /**
+     * {@inheritDoc} 
+     */
+    public void moveAndRename( LdapDN dn, LdapDN newParent, Rdn newRdn, boolean deleteOldRdn, boolean ignoreReferral ) throws Exception
+    {
+        moveAndRename( dn, newParent, newRdn, deleteOldRdn, ignoreReferral, LogChange.TRUE );
+    }
+
+
+    /**
+     * {@inheritDoc} 
+     */
+    public void moveAndRename( LdapDN dn, LdapDN newParent, Rdn newRdn, boolean deleteOldRdn, boolean ignoreReferral, LogChange log ) throws Exception
+    {
+        OperationManager operationManager = directoryService.getOperationManager();
+        MoveAndRenameOperationContext opContext = new MoveAndRenameOperationContext( this, dn, newParent, newRdn, deleteOldRdn );
+        
+        opContext.setLogChange( log );
+        setReferralHandling( opContext, ignoreReferral );
+
+        operationManager.moveAndRename( opContext );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void rename( LdapDN dn, Rdn newRdn, boolean deleteOldRdn ) throws Exception
+    {
+        rename( dn, newRdn, deleteOldRdn, LogChange.TRUE );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void rename( LdapDN dn, Rdn newRdn, boolean deleteOldRdn, LogChange log ) throws Exception
+    {
+        RenameOperationContext opContext = new RenameOperationContext( this, dn, newRdn, deleteOldRdn );
+        
+        opContext.setLogChange( log );
+
+        OperationManager operationManager = directoryService.getOperationManager();
+        operationManager.rename( opContext );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void rename( LdapDN dn, Rdn newRdn, boolean deleteOldRdn, boolean ignoreReferral ) throws Exception
+    {
+        rename( dn, newRdn, deleteOldRdn, ignoreReferral, LogChange.TRUE );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void rename( LdapDN dn, Rdn newRdn, boolean deleteOldRdn, boolean ignoreReferral, LogChange log ) throws Exception
+    {
+        OperationManager operationManager = directoryService.getOperationManager();
+        RenameOperationContext opContext = new RenameOperationContext( this, dn, newRdn, deleteOldRdn );
+        
+        opContext.setLogChange( log );
+        setReferralHandling( opContext, ignoreReferral );
+
+        operationManager.rename( opContext );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public EntryFilteringCursor search( LdapDN dn, String filter ) throws Exception
+    {
+        return search( dn, filter, true );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public EntryFilteringCursor search( LdapDN dn, String filter, boolean ignoreReferrals ) throws Exception
+    {
+        OperationManager operationManager = directoryService.getOperationManager();
+        ExprNode filterNode = FilterParser.parse( filter ); 
+        
+        SearchOperationContext opContext = new SearchOperationContext( 
+            this, 
+            dn, 
+            SearchScope.OBJECT, 
+            filterNode, 
+            AliasDerefMode.DEREF_ALWAYS, 
+            null );
+        
+        setReferralHandling( opContext, ignoreReferrals );
+
+        return operationManager.search( opContext );
+    }
+    
+
+    /* (non-Javadoc)
+     * @see org.apache.directory.server.core.CoreSession#search(org.apache.directory.shared.ldap.name.LdapDN, org.apache.directory.shared.ldap.filter.SearchScope, org.apache.directory.shared.ldap.filter.ExprNode, org.apache.directory.shared.ldap.message.AliasDerefMode, java.util.Set)
+     */
+    public EntryFilteringCursor search( LdapDN dn, SearchScope scope, ExprNode filter, AliasDerefMode aliasDerefMode,
+        Set<AttributeTypeOptions> returningAttributes ) throws Exception
+    {
+        OperationManager operationManager = directoryService.getOperationManager();
+        return operationManager.search( new SearchOperationContext( this, dn, scope, filter, 
+            aliasDerefMode, returningAttributes ) );
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.apache.directory.server.core.CoreSession#search(org.apache.directory.shared.ldap.name.LdapDN, org.apache.directory.shared.ldap.filter.SearchScope, org.apache.directory.shared.ldap.filter.ExprNode, org.apache.directory.shared.ldap.message.AliasDerefMode, java.util.Set, int, int)
+     */
+    public EntryFilteringCursor search( LdapDN dn, SearchScope scope, ExprNode filter, AliasDerefMode aliasDerefMode,
+        Set<AttributeTypeOptions> returningAttributes, int sizeLimit, int timeLimit ) throws Exception
+    {
+        SearchOperationContext opContext = new SearchOperationContext( this, dn, scope, filter, 
+            aliasDerefMode, returningAttributes );
+        opContext.setSizeLimit( sizeLimit );
+        opContext.setTimeLimit( timeLimit );
+        OperationManager operationManager = directoryService.getOperationManager();
+        return operationManager.search( opContext );
+    }
+
+
+    public boolean isAnonymous()
+    {
+        return getEffectivePrincipal().getJndiName().isEmpty();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean compare( InternalCompareRequest compareRequest ) throws Exception
+    {
+        CompareOperationContext opContext = new CompareOperationContext( this, compareRequest );
+        OperationManager operationManager = directoryService.getOperationManager();
+        boolean result = operationManager.compare( opContext );
+        compareRequest.getResultResponse().addAll( opContext.getResponseControls() );
+        return result;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void delete( InternalDeleteRequest deleteRequest ) throws Exception
+    {
+        delete( deleteRequest, LogChange.TRUE );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void delete( InternalDeleteRequest deleteRequest, LogChange log ) throws Exception
+    {
+        DeleteOperationContext opContext = new DeleteOperationContext( this, deleteRequest );
+        
+        opContext.setLogChange( log );
+
+        OperationManager operationManager = directoryService.getOperationManager();
+        operationManager.delete( opContext );
+        deleteRequest.getResultResponse().addAll( opContext.getResponseControls() );
+    }
+
+
+    public boolean exists( LdapDN dn ) throws Exception
+    {
+        EntryOperationContext opContext = new EntryOperationContext( this, dn );
+        OperationManager operationManager = directoryService.getOperationManager();
+        return operationManager.hasEntry( opContext );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void modify( InternalModifyRequest modifyRequest ) throws Exception
+    {
+        modify( modifyRequest, LogChange.TRUE );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void modify( InternalModifyRequest modifyRequest, LogChange log ) throws Exception
+    {
+        ModifyOperationContext opContext = new ModifyOperationContext( this, modifyRequest );
+
+        opContext.setLogChange( log );
+
+        OperationManager operationManager = directoryService.getOperationManager();
+        operationManager.modify( opContext );
+        modifyRequest.getResultResponse().addAll( opContext.getResponseControls() );
+    }
+
+
+    /**
+     * {@inheritDoc} 
+     */
+    public void move( InternalModifyDnRequest modifyDnRequest ) throws Exception
+    {
+        move( modifyDnRequest, LogChange.TRUE );
+    }
+
+
+    /**
+     * {@inheritDoc} 
+     */
+    public void move( InternalModifyDnRequest modifyDnRequest, LogChange log ) throws Exception
+    {
+        MoveOperationContext opContext = new MoveOperationContext( this, modifyDnRequest );
+        
+        opContext.setLogChange( log );
+
+        OperationManager operationManager = directoryService.getOperationManager();
+        operationManager.move( opContext );
+        modifyDnRequest.getResultResponse().addAll( opContext.getResponseControls() );
+    }
+
+
+    /**
+     * {@inheritDoc} 
+     */
+    public void moveAndRename( InternalModifyDnRequest modifyDnRequest ) throws Exception
+    {
+        moveAndRename( modifyDnRequest, LogChange.TRUE );
+    }
+
+
+    /**
+     * {@inheritDoc} 
+     */
+    public void moveAndRename( InternalModifyDnRequest modifyDnRequest, LogChange log ) throws Exception
+    {
+        MoveAndRenameOperationContext opContext = new MoveAndRenameOperationContext( this, modifyDnRequest );
+
+        opContext.setLogChange( log );
+
+        OperationManager operationManager = directoryService.getOperationManager();
+        operationManager.moveAndRename( opContext );
+        modifyDnRequest.getResultResponse().addAll( opContext.getResponseControls() );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void rename( InternalModifyDnRequest modifyDnRequest ) throws Exception
+    {
+        rename( modifyDnRequest, LogChange.TRUE );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void rename( InternalModifyDnRequest modifyDnRequest, LogChange log ) throws Exception
+    {
+        RenameOperationContext opContext = new RenameOperationContext( this, modifyDnRequest );
+
+        opContext.setLogChange( log );
+
+        OperationManager operationManager = directoryService.getOperationManager();
+        operationManager.rename( opContext );
+        modifyDnRequest.getResultResponse().addAll( opContext.getResponseControls() );
+    }
+
+
+    public EntryFilteringCursor search( InternalSearchRequest searchRequest ) throws Exception
+    {
+        SearchOperationContext opContext = new SearchOperationContext( this, searchRequest );
+        OperationManager operationManager = directoryService.getOperationManager();
+        EntryFilteringCursor cursor = operationManager.search( opContext );
+        searchRequest.getResultResponse().addAll( opContext.getResponseControls() );
+        return cursor;
+    }
+
+
+    public void unbind() throws Exception
+    {
+        OperationManager operationManager = directoryService.getOperationManager();
+        operationManager.unbind( new UnbindOperationContext( this ) );
+    }
+
+
+    public void unbind( InternalUnbindRequest unbindRequest )
+    {
+        // TODO Auto-generated method stub
+        
+    }
+
+
+    /**
+     * @param directoryService the directoryService to set
+     */
+    public void setDirectoryService( DirectoryService directoryService )
+    {
+        this.directoryService = directoryService;
+    }
+}

Modified: directory/apacheds/branches/apacheds-schema/core-mock/src/main/java/org/apache/directory/server/core/MockCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-mock/src/main/java/org/apache/directory/server/core/MockCursor.java?rev=811856&r1=811855&r2=811856&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-mock/src/main/java/org/apache/directory/server/core/MockCursor.java (original)
+++ directory/apacheds/branches/apacheds-schema/core-mock/src/main/java/org/apache/directory/server/core/MockCursor.java Sun Sep  6 18:44:53 2009
@@ -30,12 +30,13 @@
 import org.apache.directory.shared.ldap.cursor.ClosureMonitor;
 import org.apache.directory.shared.ldap.cursor.Cursor;
 import org.apache.directory.shared.ldap.cursor.CursorIterator;
+import org.apache.directory.shared.ldap.schema.registries.Registries;
 
-class MockCursor implements Cursor<ServerEntry>
+public class MockCursor implements Cursor<ServerEntry>
 {
     final int count;
     int ii;
-    DirectoryService directoryService;
+    Registries registries;
 
 
     public MockCursor(int count)
@@ -106,7 +107,7 @@
 
     public ServerEntry get() throws Exception
     {
-        return new DefaultServerEntry( directoryService.getRegistries() );
+        return new DefaultServerEntry( registries );
     }
 
 
@@ -170,14 +171,8 @@
     }
 
 
-    public DirectoryService getDirectoryService()
+    public void setRegistries( Registries registries )
     {
-        return directoryService;
-    }
-
-
-    public void setDirectoryService( DirectoryService directoryService )
-    {
-        this.directoryService = directoryService;
+        this.registries = registries;
     }
 }

Modified: directory/apacheds/branches/apacheds-schema/core-mock/src/main/java/org/apache/directory/server/core/MockDirectoryService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-mock/src/main/java/org/apache/directory/server/core/MockDirectoryService.java?rev=811856&r1=811855&r2=811856&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-mock/src/main/java/org/apache/directory/server/core/MockDirectoryService.java (original)
+++ directory/apacheds/branches/apacheds-schema/core-mock/src/main/java/org/apache/directory/server/core/MockDirectoryService.java Sun Sep  6 18:44:53 2009
@@ -43,7 +43,7 @@
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.registries.Registries;
 
-class MockDirectoryService implements DirectoryService
+public class MockDirectoryService implements DirectoryService
 {
     int count;
     

Added: directory/apacheds/branches/apacheds-schema/core-mock/src/main/java/org/apache/directory/server/core/MockInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-mock/src/main/java/org/apache/directory/server/core/MockInterceptor.java?rev=811856&view=auto
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-mock/src/main/java/org/apache/directory/server/core/MockInterceptor.java (added)
+++ directory/apacheds/branches/apacheds-schema/core-mock/src/main/java/org/apache/directory/server/core/MockInterceptor.java Sun Sep  6 18:44:53 2009
@@ -0,0 +1,236 @@
+/*
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *   or more contributor license agreements.  See the NOTICE file
+ *   distributed with this work for additional information
+ *   regarding copyright ownership.  The ASF licenses this file
+ *   to you under the Apache License, Version 2.0 (the
+ *   "License"); you may not use this file except in compliance
+ *   with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing,
+ *   software distributed under the License is distributed on an
+ *   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *   KIND, either express or implied.  See the License for the
+ *   specific language governing permissions and limitations
+ *   under the License.
+ *
+ */
+package org.apache.directory.server.core;
+
+
+import org.apache.directory.server.core.DirectoryService;
+import org.apache.directory.server.core.entry.ClonedServerEntry;
+import org.apache.directory.server.core.filtering.EntryFilteringCursor;
+import org.apache.directory.server.core.interceptor.Interceptor;
+import org.apache.directory.server.core.interceptor.InterceptorChain;
+import org.apache.directory.server.core.interceptor.NextInterceptor;
+import org.apache.directory.server.core.interceptor.context.AddContextPartitionOperationContext;
+import org.apache.directory.server.core.interceptor.context.AddOperationContext;
+import org.apache.directory.server.core.interceptor.context.BindOperationContext;
+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.EntryOperationContext;
+import org.apache.directory.server.core.interceptor.context.GetMatchedNameOperationContext;
+import org.apache.directory.server.core.interceptor.context.GetRootDSEOperationContext;
+import org.apache.directory.server.core.interceptor.context.GetSuffixOperationContext;
+import org.apache.directory.server.core.interceptor.context.ListOperationContext;
+import org.apache.directory.server.core.interceptor.context.ListSuffixOperationContext;
+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.RemoveContextPartitionOperationContext;
+import org.apache.directory.server.core.interceptor.context.RenameOperationContext;
+import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
+import org.apache.directory.server.core.interceptor.context.UnbindOperationContext;
+import org.apache.directory.shared.ldap.name.LdapDN;
+
+import javax.naming.NamingException;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
+
+public class MockInterceptor implements Interceptor
+{
+    private static final int INTERCEPTOR_COUNT = 5;
+    List<MockInterceptor> interceptors = new ArrayList<MockInterceptor>( INTERCEPTOR_COUNT );
+    InterceptorChain test;
+    String name;
+
+
+    public void setName( String name )
+    {
+        this.name = name;
+    }
+    
+    
+    public void setTest( InterceptorChain test )
+    {
+        this.test = test;
+    }
+    
+
+    public String getName()
+    {
+        return this.name;
+    }
+
+
+    public void init( DirectoryService directoryService )
+        throws NamingException
+    {
+    }
+
+
+    public void destroy()
+    {
+    }
+
+
+    public ClonedServerEntry getRootDSE( NextInterceptor next, GetRootDSEOperationContext opContext ) throws Exception
+    {
+        interceptors.add( this );
+        return next.getRootDSE( opContext );
+    }
+
+
+    public LdapDN getMatchedName ( NextInterceptor next, GetMatchedNameOperationContext opContext ) throws Exception
+    {
+        interceptors.add( this );
+        return next.getMatchedName( opContext );
+    }
+
+
+    public LdapDN getSuffix ( NextInterceptor next, GetSuffixOperationContext opContext ) throws Exception
+    {
+        interceptors.add( this );
+        return next.getSuffix( opContext );
+    }
+
+
+    public Set<String> listSuffixes ( NextInterceptor next, ListSuffixOperationContext opContext ) throws Exception
+    {
+        interceptors.add( this );
+        return next.listSuffixes( opContext );
+    }
+
+
+    public void addContextPartition( NextInterceptor next, AddContextPartitionOperationContext opContext )
+        throws Exception
+    {
+        interceptors.add( this );
+        next.addContextPartition( opContext );
+    }
+
+
+    public void removeContextPartition( NextInterceptor next, RemoveContextPartitionOperationContext opContext ) throws Exception
+    {
+        interceptors.add( this );
+        next.removeContextPartition( opContext );
+    }
+
+
+    public boolean compare( NextInterceptor next, CompareOperationContext opContext ) throws Exception
+    {
+        interceptors.add( this );
+        return next.compare( opContext );
+    }
+
+
+    public void delete( NextInterceptor next, DeleteOperationContext opContext ) throws Exception
+    {
+        interceptors.add( this );
+        next.delete( opContext );
+    }
+
+
+    public void add( NextInterceptor next, AddOperationContext opContext )
+        throws Exception
+    {
+        interceptors.add( this );
+        next.add( opContext );
+    }
+
+
+    public void modify( NextInterceptor next, ModifyOperationContext opContext ) throws Exception
+    {
+        interceptors.add( this );
+        next.modify( opContext );
+    }
+
+
+    public EntryFilteringCursor list( NextInterceptor next, ListOperationContext opContext ) throws Exception
+    {
+        interceptors.add( this );
+        return next.list( opContext );
+    }
+
+
+    public EntryFilteringCursor search( NextInterceptor next, SearchOperationContext opContext ) throws Exception
+    {
+        interceptors.add( this );
+        return next.search( opContext );
+    }
+
+
+    public ClonedServerEntry lookup( NextInterceptor next, LookupOperationContext opContext ) throws Exception
+    {
+        interceptors.add( this );
+        return next.lookup( opContext );
+    }
+
+
+    public boolean hasEntry( NextInterceptor next, EntryOperationContext opContext ) throws Exception
+    {
+        interceptors.add( this );
+        return next.hasEntry( opContext );
+    }
+
+
+    public void rename( NextInterceptor next, RenameOperationContext opContext )
+        throws Exception
+    {
+        interceptors.add( this );
+        next.rename( opContext );
+    }
+
+
+    public void move( NextInterceptor next, MoveOperationContext opContext ) throws Exception
+    {
+        interceptors.add( this );
+        next.move( opContext );
+    }
+
+
+    public void moveAndRename( NextInterceptor next, MoveAndRenameOperationContext opContext )
+        throws Exception
+    {
+        interceptors.add( this );
+        next.moveAndRename( opContext );
+    }
+
+
+    public void bind( NextInterceptor next, BindOperationContext opContext )
+    throws Exception
+    {
+        interceptors.add( this );
+        next.bind( opContext );
+    }
+
+
+    public void unbind( NextInterceptor next, UnbindOperationContext opContext ) throws Exception
+    {
+        interceptors.add( this );
+        next.unbind( opContext );
+    }
+
+
+    public String toString()
+    {
+        return name;
+    }
+}
\ No newline at end of file

Added: directory/apacheds/branches/apacheds-schema/core-mock/src/main/java/org/apache/directory/server/core/MockOperation.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-mock/src/main/java/org/apache/directory/server/core/MockOperation.java?rev=811856&view=auto
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-mock/src/main/java/org/apache/directory/server/core/MockOperation.java (added)
+++ directory/apacheds/branches/apacheds-schema/core-mock/src/main/java/org/apache/directory/server/core/MockOperation.java Sun Sep  6 18:44:53 2009
@@ -0,0 +1,303 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.directory.server.core;
+
+import java.util.Collection;
+import java.util.List;
+
+import javax.naming.NamingException;
+import javax.naming.ldap.Control;
+
+import org.apache.directory.server.core.entry.ClonedServerEntry;
+import org.apache.directory.server.core.entry.ServerEntry;
+import org.apache.directory.server.core.filtering.BaseEntryFilteringCursor;
+import org.apache.directory.server.core.filtering.EntryFilteringCursor;
+import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
+import org.apache.directory.server.core.interceptor.context.OperationContext;
+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.name.LdapDN;
+
+public class MockOperation implements OperationContext
+{
+    final int count;
+    final CoreSession session;
+
+
+    public MockOperation( int count ) throws Exception 
+    {
+        this.count = count;
+        this.session = new MockCoreSession( new LdapPrincipal( new LdapDN(), AuthenticationLevel.STRONG ), 
+            new MockDirectoryService( count ) );
+    }
+
+
+    public EntryFilteringCursor search( SearchOperationContext opContext )
+        throws NamingException
+    {
+        return new BaseEntryFilteringCursor( new MockCursor( count ), opContext );
+    }
+
+
+    public EntryFilteringCursor search( SearchOperationContext opContext, Collection<String> bypass ) throws NamingException
+    {
+        return new BaseEntryFilteringCursor( new MockCursor( count ), opContext );
+    }
+
+
+    public void addRequestControl( Control requestControl )
+    {
+    }
+
+
+    public void addRequestControls( Control[] requestControls )
+    {
+    }
+
+
+    public void addResponseControl( Control responseControl )
+    {
+    }
+
+
+    public Collection<String> getByPassed()
+    {
+        return null;
+    }
+
+
+    public LdapDN getDn()
+    {
+        return null;
+    }
+
+
+    public String getName()
+    {
+        return null;
+    }
+
+
+    public Control getRequestControl( String numericOid )
+    {
+        return null;
+    }
+
+
+    public Control getResponseControl( String numericOid )
+    {
+        return null;
+    }
+
+
+    public int getResponseControlCount()
+    {
+        return 0;
+    }
+
+
+    public Control[] getResponseControls()
+    {
+        return null;
+    }
+
+
+    public CoreSession getSession()
+    {
+        return session;
+    }
+
+
+    public boolean hasBypass()
+    {
+        return false;
+    }
+
+
+    public boolean hasRequestControl( String numericOid )
+    {
+        return false;
+    }
+
+
+    public boolean hasRequestControls()
+    {
+        return false;
+    }
+
+
+    public boolean hasResponseControl( String numericOid )
+    {
+        return false;
+    }
+
+
+    public boolean hasResponseControls()
+    {
+        return false;
+    }
+
+
+    public boolean isBypassed( String interceptorName )
+    {
+        return false;
+    }
+
+
+    public boolean isCollateralOperation()
+    {
+        return false;
+    }
+
+
+    public ClonedServerEntry lookup( LdapDN dn, Collection<String> bypass ) throws Exception
+    {
+        return null;
+    }
+
+
+    public ClonedServerEntry lookup( LookupOperationContext lookupContext ) throws Exception
+    {
+        return null;
+    }
+
+
+    public LookupOperationContext newLookupContext( LdapDN dn )
+    {
+        return null;
+    }
+
+
+    public void setByPassed( Collection<String> byPassed )
+    {
+    }
+
+
+    public void setCollateralOperation( boolean collateralOperation )
+    {
+    }
+
+
+    public void setDn( LdapDN dn )
+    {
+    }
+
+
+    public LdapPrincipal getEffectivePrincipal()
+    {
+        return null;
+    }
+
+
+    public OperationContext getFirstOperation()
+    {
+        return null;
+    }
+
+
+    public OperationContext getLastOperation()
+    {
+        return null;
+    }
+
+
+    public OperationContext getNextOperation()
+    {
+        return null;
+    }
+
+
+    public OperationContext getPreviousOperation()
+    {
+        return null;
+    }
+
+
+    public boolean isFirstOperation()
+    {
+        return false;
+    }
+
+
+    public void add( ServerEntry entry, Collection<String> bypass ) throws Exception
+    {
+    }
+
+
+    public void delete( LdapDN dn, Collection<String> bypass ) throws Exception
+    {
+    }
+
+
+    public void modify( LdapDN dn, List<Modification> mods, Collection<String> bypass ) throws Exception
+    {
+    }
+
+
+    public boolean hasEntry( LdapDN dn, Collection<String> byPass ) throws Exception
+    {
+        return false;
+    }
+
+
+    public ReferralHandlingMode getReferralHandlingMode()
+    {
+        return null;
+    }
+
+
+    public void setReferralHandlingMode( ReferralHandlingMode referralHandlingMode )
+    {
+    }
+
+
+    public ClonedServerEntry getEntry()
+    {
+        return null;
+    }
+
+
+    public void setEntry( ClonedServerEntry entry )
+    {
+    }
+
+
+    public void throwReferral()
+    {
+    }
+    
+    
+    public boolean isReferralThrown()
+    {
+        return false;
+    }
+
+
+    public void ignoreReferral()
+    {
+    }
+
+
+    public boolean isReferralIgnored()
+    {
+        return false;
+    }
+}

Modified: directory/apacheds/branches/apacheds-schema/core-mock/src/main/java/org/apache/directory/server/core/MockOperationManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-mock/src/main/java/org/apache/directory/server/core/MockOperationManager.java?rev=811856&r1=811855&r2=811856&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-mock/src/main/java/org/apache/directory/server/core/MockOperationManager.java (original)
+++ directory/apacheds/branches/apacheds-schema/core-mock/src/main/java/org/apache/directory/server/core/MockOperationManager.java Sun Sep  6 18:44:53 2009
@@ -43,7 +43,7 @@
 import org.apache.directory.server.core.interceptor.context.UnbindOperationContext;
 import org.apache.directory.shared.ldap.name.LdapDN;
 
-class MockOperationManager implements OperationManager
+public class MockOperationManager implements OperationManager
 {
     int count;
     
@@ -125,7 +125,9 @@
 
     public EntryFilteringCursor search( SearchOperationContext opContext ) throws Exception
     {
-        return new BaseEntryFilteringCursor( new MockCursor( count ), opContext );
+        MockCursor cursor = new MockCursor( count );
+        cursor.setRegistries( opContext.getSession().getDirectoryService().getRegistries() );
+        return new BaseEntryFilteringCursor( cursor, opContext );
     }
 
 



Mime
View raw message