directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r584661 - in /directory/apacheds/branches/bigbang: core/src/main/java/org/apache/directory/server/core/ core/src/main/java/org/apache/directory/server/core/authz/ core/src/main/java/org/apache/directory/server/core/authz/support/ core/src/m...
Date Mon, 15 Oct 2007 03:49:50 GMT
Author: akarasulu
Date: Sun Oct 14 20:49:47 2007
New Revision: 584661

URL: http://svn.apache.org/viewvc?rev=584661&view=rev
Log:
removed environment from DirectoryServer and using type safe enum for dereferencing mode for aliases

Modified:
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/DirectoryService.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/MaxImmSubFilter.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/jndi/ServerContext.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultSearchEngine.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/SearchEngine.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/PartitionFrame.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDao.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/trigger/TriggerSpecCache.java
    directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/operation/OperationFactory.java
    directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationInterceptor.java
    directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationClientContextHandler.java

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java?rev=584661&r1=584660&r2=584661&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java Sun Oct 14 20:49:47 2007
@@ -76,13 +76,11 @@
 import org.apache.directory.server.schema.bootstrap.SystemSchema;
 import org.apache.directory.server.schema.bootstrap.partition.DbFileListing;
 import org.apache.directory.server.schema.bootstrap.partition.SchemaPartitionExtractor;
-import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.server.schema.registries.DefaultOidRegistry;
 import org.apache.directory.server.schema.registries.DefaultRegistries;
 import org.apache.directory.server.schema.registries.OidRegistry;
 import org.apache.directory.server.schema.registries.Registries;
 import org.apache.directory.shared.ldap.aci.AuthenticationLevel;
-import org.apache.directory.shared.ldap.constants.JndiPropertyConstants;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.constants.ServerDNConstants;
 import org.apache.directory.shared.ldap.exception.LdapAuthenticationNotSupportedException;
@@ -96,7 +94,6 @@
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.OidNormalizer;
 import org.apache.directory.shared.ldap.util.DateUtils;
-import org.apache.directory.shared.ldap.util.StringTools;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -110,13 +107,9 @@
 public class DefaultDirectoryService extends DirectoryService
 {
     private static final Logger LOG = LoggerFactory.getLogger( DefaultDirectoryService.class );
-    private static final String BINARY_KEY = JndiPropertyConstants.JNDI_LDAP_ATTRIBUTES_BINARY;
 
     private SchemaManager schemaManager;
 
-    /** the initial context environment that fired up the backend subsystem */
-    private Hashtable<String, Object> environment;
-
     /** the registries for system schema objects */
     private Registries registries;
 
@@ -143,7 +136,6 @@
      */
     public DefaultDirectoryService()
     {
-        environment = new Hashtable<String,Object>();
         setDefaultInterceptorConfigurations();
     }
 
@@ -531,7 +523,7 @@
         }
 
         //noinspection unchecked
-        Hashtable<String, Object> environment = ( Hashtable<String, Object> ) getEnvironment().clone();
+        Hashtable<String, Object> environment = new Hashtable<String, Object>();
         environment.remove( Context.SECURITY_PRINCIPAL );
         environment.remove( Context.SECURITY_CREDENTIALS );
         environment.remove( Context.SECURITY_AUTHENTICATION );
@@ -637,20 +629,6 @@
         this.interceptorChain.destroy();
         this.started = false;
         setDefaultInterceptorConfigurations();
-        this.environment = new Hashtable<String,Object>();
-    }
-
-
-    @SuppressWarnings("unchecked")
-    public Hashtable<String, Object> getEnvironment()
-    {
-        return ( Hashtable ) environment.clone();
-    }
-
-
-    public void setEnvironment( Hashtable<String, Object> environment )
-    {
-        this.environment = environment;
     }
 
 
@@ -1067,8 +1045,9 @@
 
 
     /**
-     * @todo need to re-enable this after removing JNDI and creating means to pump
-     * requests into the core to add entries.
+     * Adds test entries into the core.
+     *
+     * @todo this may no longer be needed when JNDI is not used for bootstrapping
      * 
      * @throws NamingException if the creation of test entries fails.
      */
@@ -1248,55 +1227,8 @@
         registries = globalRegistries;
         SerializableComparator.setRegistry( globalRegistries.getComparatorRegistry() );
         
-        Set<String> binaries = new HashSet<String>();
-        if ( this.environment.containsKey( BINARY_KEY ) )
-        {
-            if ( LOG.isInfoEnabled() )
-            {
-                LOG.info( "Startup environment contains " + BINARY_KEY );
-            }
-
-            String binaryIds = ( String ) this.environment.get( BINARY_KEY );
-            if ( binaryIds == null )
-            {
-                if ( LOG.isWarnEnabled() )
-                {
-                    LOG.warn( BINARY_KEY + " in startup environment contains null value.  "
-                        + "Using only schema info to set binary attributeTypes." );
-                }
-            }
-            else
-            {
-                if ( !StringTools.isEmpty( binaryIds ) )
-                {
-                    String[] binaryArray = binaryIds.split( " " );
-
-                    for ( String binary : binaryArray )
-                    {
-                        binaries.add( StringTools.lowerCaseAscii( StringTools.trim( binary ) ) );
-                    }
-                }
-
-                if ( LOG.isInfoEnabled() )
-                {
-                    LOG.info( "Setting binaries to union of schema defined binaries and those provided in "
-                        + BINARY_KEY );
-                }
-            }
-        }
-        
-        schemaManager = new SchemaManager( globalRegistries, schemaLoader, 
+        schemaManager = new SchemaManager( globalRegistries, schemaLoader,
             new SchemaPartitionDao( schemaPartition, registries ) );
-
-        // now get all the attributeTypes that are binary from the registry
-        AttributeTypeRegistry registry = registries.getAttributeTypeRegistry();
-        binaries.addAll( registry.getBinaryAttributes() );
-        this.environment.put( BINARY_KEY, binaries );
-        
-        if ( LOG.isDebugEnabled() )
-        {
-            LOG.debug( "binary ids used: " + binaries );
-        }
 
         partitionNexus = new DefaultPartitionNexus( new AttributesImpl() );
         partitionNexus.init( this );

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/DirectoryService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/DirectoryService.java?rev=584661&r1=584660&r2=584661&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/DirectoryService.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/DirectoryService.java Sun Oct 14 20:49:47 2007
@@ -36,7 +36,6 @@
 import javax.naming.directory.Attributes;
 import javax.naming.directory.DirContext;
 import java.io.File;
-import java.util.Hashtable;
 import java.util.List;
 import java.util.Set;
 
@@ -50,10 +49,6 @@
 public abstract class DirectoryService
 {
     public static final String JNDI_KEY = DirectoryService.class.getName();
-
-    public abstract Hashtable<String,Object> getEnvironment();
-
-    public abstract void setEnvironment( Hashtable<String,Object> environment );
 
     public abstract PartitionNexus getPartitionNexus();
 

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java?rev=584661&r1=584660&r2=584661&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java Sun Oct 14 20:49:47 2007
@@ -28,6 +28,7 @@
 import org.apache.directory.shared.ldap.filter.BranchNode;
 import org.apache.directory.shared.ldap.filter.EqualityNode;
 import org.apache.directory.shared.ldap.filter.OrNode;
+import org.apache.directory.shared.ldap.message.DerefAliasesEnum;
 import org.apache.directory.shared.ldap.message.ModificationItemImpl;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
@@ -63,9 +64,6 @@
     /** a handle on the partition nexus */
     private final PartitionNexus nexus;
     
-    /** the env to use for searching */
-    private final Map<?, ?> env;
-
     /** A storage for the member attributeType */
     private AttributeType memberAT;
 
@@ -92,7 +90,6 @@
     {
     	normalizerMap = directoryService.getRegistries().getAttributeTypeRegistry().getNormalizerMapping();
         nexus = directoryService.getPartitionNexus();
-        env = ( Map<?, ?> ) directoryService.getEnvironment().clone();
         AttributeTypeRegistry attributeTypeRegistry = directoryService.getRegistries().getAttributeTypeRegistry();
         
         memberAT = attributeTypeRegistry.lookup( SchemaConstants.MEMBER_AT_OID ); 
@@ -130,8 +127,8 @@
             LdapDN baseDn = new LdapDN( suffix );
             SearchControls ctls = new SearchControls();
             ctls.setSearchScope( SearchControls.SUBTREE_SCOPE );
-            NamingEnumeration<SearchResult> results = 
-                nexus.search( new SearchOperationContext( baseDn, env, filter, ctls ) );
+            NamingEnumeration<SearchResult> results = nexus.search(
+                    new SearchOperationContext( baseDn, DerefAliasesEnum.DEREF_ALWAYS, filter, ctls ) );
 
             while ( results.hasMore() )
             {

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java?rev=584661&r1=584660&r2=584661&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java Sun Oct 14 20:49:47 2007
@@ -32,6 +32,7 @@
 import org.apache.directory.shared.ldap.exception.LdapSchemaViolationException;
 import org.apache.directory.shared.ldap.filter.EqualityNode;
 import org.apache.directory.shared.ldap.filter.ExprNode;
+import org.apache.directory.shared.ldap.message.DerefAliasesEnum;
 import org.apache.directory.shared.ldap.message.ModificationItemImpl;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.LdapDN;
@@ -45,7 +46,10 @@
 import javax.naming.Name;
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
-import javax.naming.directory.*;
+import javax.naming.directory.Attribute;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.SearchControls;
+import javax.naming.directory.SearchResult;
 import java.text.ParseException;
 import java.util.*;
 
@@ -63,9 +67,6 @@
     /** the logger for this class */
     private static final Logger LOG = LoggerFactory.getLogger( TupleCache.class );
 
-    /** cloned startup environment properties we use for subentry searching */
-    private final Map<?, ?> env;
-    
     /** a map of strings to ACITuple collections */
     private final Map<String,List<ACITuple>> tuples = new HashMap<String,List<ACITuple>>();
     
@@ -97,8 +98,7 @@
         OidRegistry oidRegistry = directoryService.getRegistries().getOidRegistry();
         NameComponentNormalizer ncn = new ConcreteNameComponentNormalizer( attributeTypeRegistry, oidRegistry );
         aciParser = new ACIItemParser( ncn, normalizerMap );
-        env = ( Map<?, ?> ) directoryService.getEnvironment().clone();
-        prescriptiveAciAT = attributeTypeRegistry.lookup( SchemaConstants.PRESCRIPTIVE_ACI_AT ); 
+        prescriptiveAciAT = attributeTypeRegistry.lookup( SchemaConstants.PRESCRIPTIVE_ACI_AT );
         initialize();
     }
 
@@ -122,11 +122,12 @@
         {
             String suffix = suffixes.next();
             LdapDN baseDn = parseNormalized( suffix );
-            ExprNode filter = new EqualityNode( SchemaConstants.OBJECT_CLASS_AT, SchemaConstants.ACCESS_CONTROL_SUBENTRY_OC );
+            ExprNode filter = new EqualityNode( SchemaConstants.OBJECT_CLASS_AT,
+                    SchemaConstants.ACCESS_CONTROL_SUBENTRY_OC );
             SearchControls ctls = new SearchControls();
             ctls.setSearchScope( SearchControls.SUBTREE_SCOPE );
-            NamingEnumeration<SearchResult> results = 
-                nexus.search( new SearchOperationContext( baseDn, env, filter, ctls ) );
+            NamingEnumeration<SearchResult> results = nexus.search( new SearchOperationContext( baseDn,
+                    DerefAliasesEnum.NEVER_DEREF_ALIASES, filter, ctls ) );
             
             while ( results.hasMore() )
             {
@@ -136,7 +137,8 @@
                 
                 if ( aci == null )
                 {
-                    LOG.warn( "Found accessControlSubentry '" + subentryDn + "' without any " + SchemaConstants.PRESCRIPTIVE_ACI_AT );
+                    LOG.warn( "Found accessControlSubentry '" + subentryDn
+                            + "' without any " + SchemaConstants.PRESCRIPTIVE_ACI_AT );
                     continue;
                 }
 

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/MaxImmSubFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/MaxImmSubFilter.java?rev=584661&r1=584660&r2=584661&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/MaxImmSubFilter.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/MaxImmSubFilter.java Sun Oct 14 20:49:47 2007
@@ -20,29 +20,16 @@
 package org.apache.directory.server.core.authz.support;
 
 
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-
-import javax.naming.Name;
-import javax.naming.NamingEnumeration;
-import javax.naming.NamingException;
-import javax.naming.directory.Attributes;
-import javax.naming.directory.SearchControls;
-import javax.naming.directory.SearchResult;
-
-import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
-import org.apache.directory.server.core.partition.PartitionNexusProxy;
-import org.apache.directory.server.core.normalization.NormalizationInterceptor;
 import org.apache.directory.server.core.authn.AuthenticationInterceptor;
 import org.apache.directory.server.core.authz.AciAuthorizationInterceptor;
 import org.apache.directory.server.core.authz.DefaultAuthorizationInterceptor;
+import org.apache.directory.server.core.event.EventInterceptor;
+import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
+import org.apache.directory.server.core.normalization.NormalizationInterceptor;
 import org.apache.directory.server.core.operational.OperationalAttributeInterceptor;
+import org.apache.directory.server.core.partition.PartitionNexusProxy;
 import org.apache.directory.server.core.schema.SchemaInterceptor;
 import org.apache.directory.server.core.subtree.SubentryInterceptor;
-import org.apache.directory.server.core.event.EventInterceptor;
 import org.apache.directory.shared.ldap.aci.ACITuple;
 import org.apache.directory.shared.ldap.aci.AuthenticationLevel;
 import org.apache.directory.shared.ldap.aci.MicroOperation;
@@ -50,8 +37,20 @@
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.filter.PresenceNode;
+import org.apache.directory.shared.ldap.message.DerefAliasesEnum;
 import org.apache.directory.shared.ldap.name.LdapDN;
 
+import javax.naming.Name;
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.SearchControls;
+import javax.naming.directory.SearchResult;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Iterator;
+
 
 /**
  * An {@link ACITupleFilter} that discards all tuples that doesn't satisfy
@@ -164,9 +163,8 @@
         
         try
         {
-            e = proxy.search( 
-                new SearchOperationContext( ( LdapDN ) entryName.getPrefix( 1 ), 
-                    new HashMap<String,Object>(), childrenFilter, childrenSearchControls ), SEARCH_BYPASS );
+            e = proxy.search( new SearchOperationContext( ( LdapDN ) entryName.getPrefix( 1 ),
+                    DerefAliasesEnum.DEREF_ALWAYS, childrenFilter, childrenSearchControls ), SEARCH_BYPASS );
 
             while ( e.hasMore() )
             {

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=584661&r1=584660&r2=584661&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 Sun Oct 14 20:49:47 2007
@@ -20,6 +20,7 @@
 package org.apache.directory.server.core.interceptor.context;
 
 import org.apache.directory.shared.ldap.name.LdapDN;
+import org.apache.directory.shared.ldap.message.DerefAliasesEnum;
 
 /**
  * A ListContext context used for Interceptors. It contains all the informations
@@ -30,6 +31,9 @@
  */
 public class ListOperationContext  extends AbstractOperationContext
 {
+    private DerefAliasesEnum aliasDerefMode = DerefAliasesEnum.DEREF_ALWAYS;
+
+
     /**
      * Creates a new instance of ListOperationContext.
      */
@@ -37,7 +41,8 @@
     {
         super();
     }
-    
+
+
     /**
      * Creates a new instance of ListOperationContext.
      *
@@ -47,6 +52,20 @@
     {
         super( dn );
     }
+
+
+    /**
+     * Creates a new instance of ListOperationContext.
+     *
+     * @param dn The DN to get the suffix from
+     * @param aliasDerefMode the alias dereferencing mode to use
+     */
+    public ListOperationContext( LdapDN dn, DerefAliasesEnum aliasDerefMode )
+    {
+        super( dn );
+        this.aliasDerefMode = aliasDerefMode;
+    }
+
     
     /**
      * @see Object#toString()
@@ -54,5 +73,11 @@
     public String toString()
     {
         return "ListOperationContext with DN '" + getDn().getUpName() + "'";
+    }
+
+
+    public DerefAliasesEnum getAliasDerefMode()
+    {
+        return aliasDerefMode;
     }
 }

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=584661&r1=584660&r2=584661&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 Sun Oct 14 20:49:47 2007
@@ -19,13 +19,14 @@
  */
 package org.apache.directory.server.core.interceptor.context;
 
-import java.util.Map;
-
-import javax.naming.directory.SearchControls;
 
 import org.apache.directory.shared.ldap.filter.ExprNode;
+import org.apache.directory.shared.ldap.message.DerefAliasesEnum;
 import org.apache.directory.shared.ldap.name.LdapDN;
 
+import javax.naming.directory.SearchControls;
+
+
 /**
  * A Search context used for Interceptors. It contains all the informations
  * needed for the search operation, and used by all the interceptors
@@ -35,68 +36,65 @@
  */
 public class SearchOperationContext extends AbstractOperationContext
 {
-    /** The search environment type */
-    private Map<?, ?> env;
-    
     /** The filter */
     private ExprNode filter;
     
     /** The controls */
     private SearchControls searchControls;
 
+    private DerefAliasesEnum aliasDerefMode;
+
+
     /**
-     * 
      * Creates a new instance of SearchOperationContext.
-     *
      */
     public SearchOperationContext()
     {
     	super();
     }
 
+
     /**
-     * 
      * 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
      */
-    public SearchOperationContext( LdapDN dn, Map<?, ?> env, ExprNode filter, SearchControls searchControls )
+    public SearchOperationContext( LdapDN dn, DerefAliasesEnum aliasDerefMode, ExprNode filter,
+                                   SearchControls searchControls )
     {
         super( dn );
-        this.env = env;
         this.filter = filter;
+        this.aliasDerefMode = aliasDerefMode;
         this.searchControls = searchControls;
     }
 
-    public Map<?, ?> getEnv()
-    {
-        return env;
-    }
-
-    public void setEnv( Map<String, Object> env )
-    {
-        this.env = env;
-    }
 
     public ExprNode getFilter()
     {
         return filter;
     }
 
+
     public void setFilter( ExprNode filter )
     {
         this.filter = filter;
     }
 
+
     public SearchControls getSearchControls()
     {
         return searchControls;
     }
 
+
     public void setSearchControls( SearchControls searchControls )
     {
         this.searchControls = searchControls;
     }
 
+
     /**
      * @see Object#toString()
      */
@@ -106,4 +104,15 @@
         + filter + "'"; 
     }
 
+
+    public DerefAliasesEnum getAliasDerefMode()
+    {
+        return aliasDerefMode;
+    }
+
+
+    public void setAliasDerefMode( DerefAliasesEnum aliasDerefMode )
+    {
+        this.aliasDerefMode = aliasDerefMode;
+    }
 }

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java?rev=584661&r1=584660&r2=584661&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java Sun Oct 14 20:49:47 2007
@@ -32,10 +32,7 @@
 import org.apache.directory.shared.ldap.exception.LdapSchemaViolationException;
 import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.filter.PresenceNode;
-import org.apache.directory.shared.ldap.message.AttributeImpl;
-import org.apache.directory.shared.ldap.message.AttributesImpl;
-import org.apache.directory.shared.ldap.message.ModificationItemImpl;
-import org.apache.directory.shared.ldap.message.ResultCodeEnum;
+import org.apache.directory.shared.ldap.message.*;
 import org.apache.directory.shared.ldap.name.AttributeTypeAndValue;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.name.Rdn;
@@ -121,8 +118,7 @@
         // set references to cloned env and the proxy
         this.nexusProxy = new PartitionNexusProxy( this, service );
 
-        this.env = ( Hashtable<String, Object> ) service.getEnvironment().clone();
-        this.env.putAll( env );
+        this.env = env;
         LdapJndiProperties props = LdapJndiProperties.getLdapJndiProperties( this.env );
         dn = props.getProviderDn();
         
@@ -153,7 +149,6 @@
         this.dn = ( LdapDN ) dn.clone();
 
         this.env = new Hashtable<String, Object>();
-        this.env.putAll( service.getEnvironment() );
         this.env.put( PROVIDER_URL, dn.toString() );
         this.env.put( DirectoryService.JNDI_KEY, service );
         this.nexusProxy = new PartitionNexusProxy( this, service );
@@ -214,16 +209,17 @@
     /**
      * Used to encapsulate [de]marshalling of controls before and after list operations.
      * @param dn
-     * @param env
+     * @param aliasDerefMode
      * @param filter
      * @param searchControls
      * @return
      */
-    protected NamingEnumeration<SearchResult> doSearchOperation( LdapDN dn, Map env, ExprNode filter, SearchControls searchControls )
+    protected NamingEnumeration<SearchResult> doSearchOperation( LdapDN dn, DerefAliasesEnum aliasDerefMode,
+                                                                 ExprNode filter, SearchControls searchControls )
         throws NamingException
     {
         // setup the op context and populate with request controls
-        SearchOperationContext opCtx = new SearchOperationContext( dn, env, filter, searchControls );
+        SearchOperationContext opCtx = new SearchOperationContext( dn, aliasDerefMode, filter, searchControls );
         opCtx.addRequestControls( requestControls );
         
         // execute search operation
@@ -1009,7 +1005,8 @@
         PresenceNode filter = new PresenceNode( SchemaConstants.OBJECT_CLASS_AT );
         SearchControls ctls = new SearchControls();
         ctls.setSearchScope( SearchControls.ONELEVEL_SCOPE );
-        return doSearchOperation( base, getEnvironment(), filter, ctls );
+        DerefAliasesEnum aliasDerefMode = DerefAliasesEnum.getEnum( getEnvironment() );
+        return doSearchOperation( base, aliasDerefMode, filter, ctls );
     }
 
 

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java?rev=584661&r1=584660&r2=584661&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java Sun Oct 14 20:49:47 2007
@@ -20,42 +20,13 @@
 package org.apache.directory.server.core.jndi;
 
 
-import java.io.Serializable;
-import java.text.ParseException;
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.naming.Name;
-import javax.naming.NamingEnumeration;
-import javax.naming.NamingException;
-import javax.naming.Reference;
-import javax.naming.Referenceable;
-import javax.naming.directory.Attribute;
-import javax.naming.directory.Attributes;
-import javax.naming.directory.DirContext;
-import javax.naming.directory.InvalidSearchFilterException;
-import javax.naming.directory.ModificationItem;
-import javax.naming.directory.SearchControls;
-import javax.naming.directory.SearchResult;
-import javax.naming.event.EventDirContext;
-import javax.naming.event.NamingListener;
-import javax.naming.spi.DirStateFactory;
-import javax.naming.spi.DirectoryManager;
-
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.authn.LdapPrincipal;
 import org.apache.directory.server.core.interceptor.context.EntryOperationContext;
 import org.apache.directory.server.core.partition.PartitionNexusProxy;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
-import org.apache.directory.shared.ldap.filter.AndNode;
-import org.apache.directory.shared.ldap.filter.BranchNode;
-import org.apache.directory.shared.ldap.filter.EqualityNode;
-import org.apache.directory.shared.ldap.filter.ExprNode;
-import org.apache.directory.shared.ldap.filter.FilterParser;
-import org.apache.directory.shared.ldap.filter.PresenceNode;
-import org.apache.directory.shared.ldap.filter.SimpleNode;
+import org.apache.directory.shared.ldap.filter.*;
+import org.apache.directory.shared.ldap.message.DerefAliasesEnum;
 import org.apache.directory.shared.ldap.message.ModificationItemImpl;
 import org.apache.directory.shared.ldap.name.AttributeTypeAndValue;
 import org.apache.directory.shared.ldap.name.LdapDN;
@@ -63,6 +34,19 @@
 import org.apache.directory.shared.ldap.util.AttributeUtils;
 import org.apache.directory.shared.ldap.util.StringTools;
 
+import javax.naming.*;
+import javax.naming.directory.*;
+import javax.naming.event.EventDirContext;
+import javax.naming.event.NamingListener;
+import javax.naming.spi.DirStateFactory;
+import javax.naming.spi.DirectoryManager;
+import java.io.Serializable;
+import java.text.ParseException;
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.List;
+
 
 /**
  * The DirContext implementation for the Server Side JNDI LDAP provider.
@@ -543,7 +527,8 @@
         if ( ( null == matchingAttributes ) || ( matchingAttributes.size() <= 0 ) )
         {
             PresenceNode filter = new PresenceNode( SchemaConstants.OBJECT_CLASS_AT );
-            return doSearchOperation( target, getEnvironment(), filter, ctls );
+            DerefAliasesEnum aliasDerefMode = DerefAliasesEnum.getEnum( getEnvironment() );
+            return doSearchOperation( target, aliasDerefMode, filter, ctls );
         }
 
         // Handle simple filter expressions without multiple terms
@@ -567,7 +552,8 @@
                     node = new EqualityNode( attr.getID(), ( String ) value );
                 }
 
-                return doSearchOperation( target, getEnvironment(), node, ctls );
+                DerefAliasesEnum aliasDerefMode = DerefAliasesEnum.getEnum( getEnvironment() );
+                return doSearchOperation( target, aliasDerefMode, node, ctls );
             }
         }
         
@@ -613,7 +599,8 @@
             }
         }
 
-        return doSearchOperation( target, getEnvironment(), filter, ctls );
+        DerefAliasesEnum aliasDerefMode = DerefAliasesEnum.getEnum( getEnvironment() );
+        return doSearchOperation( target, aliasDerefMode, filter, ctls );
     }
 
 
@@ -641,7 +628,8 @@
     public NamingEnumeration<SearchResult> search( Name name, ExprNode filter, SearchControls cons ) throws NamingException
     {
         LdapDN target = buildTarget( name );
-        return doSearchOperation( target, getEnvironment(), filter, cons );
+        DerefAliasesEnum aliasDerefMode = DerefAliasesEnum.getEnum( getEnvironment() );
+        return doSearchOperation( target, aliasDerefMode, filter, cons );
     }
 
 
@@ -666,7 +654,8 @@
             throw isfe;
         }
 
-        return doSearchOperation( target, getEnvironment(), filterNode, cons );
+        DerefAliasesEnum aliasDerefMode = DerefAliasesEnum.getEnum( getEnvironment() );
+        return doSearchOperation( target, aliasDerefMode, filterNode, cons );
     }
 
 

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java?rev=584661&r1=584660&r2=584661&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java Sun Oct 14 20:49:47 2007
@@ -256,8 +256,8 @@
         NamingEnumeration underlying;
 
         underlying = searchEngine.search( 
-            opContext.getDn(), 
-            opContext.getEnv(), 
+            opContext.getDn(),
+            opContext.getAliasDerefMode(),
             opContext.getFilter(), 
             searchCtls );
 

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultSearchEngine.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultSearchEngine.java?rev=584661&r1=584660&r2=584661&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultSearchEngine.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultSearchEngine.java Sun Oct 14 20:49:47 2007
@@ -20,8 +20,6 @@
 package org.apache.directory.server.core.partition.impl.btree;
 
 
-import java.util.Map;
-
 import javax.naming.Name;
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
@@ -61,6 +59,10 @@
     /**
      * Creates a DefaultSearchEngine for searching a Database without setting
      * up the database.
+     * @param db the btree based partition
+     * @param enumerator an expression enumerator
+     * @param evaluator an expression evaluator
+     * @param optimizer an optimizer to use during search
      */
     public DefaultSearchEngine( BTreePartition db, ExpressionEvaluator evaluator,
         ExpressionEnumerator enumerator, Optimizer optimizer )
@@ -83,16 +85,12 @@
     }
 
 
-    /**
-     * @see SearchEngine#search(Name, Map, ExprNode,SearchControls)
-     */
-    public NamingEnumeration search( Name base, Map env, ExprNode filter, SearchControls searchCtls )
+    public NamingEnumeration search( Name base, DerefAliasesEnum aliasDerefMode, ExprNode filter, SearchControls searchCtls )
         throws NamingException
     {
-        Name effectiveBase = null;
+        Name effectiveBase;
         Long baseId = db.getEntryId( base.toString() );
         String aliasedBase = ( String ) db.getAliasIndex().reverseLookup( baseId );
-        DerefAliasesEnum mode = DerefAliasesEnum.getEnum( env );
 
         // --------------------------------------------------------------------
         // Determine the eective base with aliases
@@ -103,30 +101,24 @@
          * occur on finding the base then we set the effective base to the
          * given base.
          */
-        if ( ( null == aliasedBase ) || !mode.isDerefFindingBase() )
+        if ( ( null == aliasedBase ) || ! aliasDerefMode.isDerefFindingBase() )
         {
             effectiveBase = base;
         }
+
         /*
-         * I the base is an alias and alias dereerencing does occur on
+         * If the base is an alias and alias dereerencing does occur on
          * inding the base then we set the eective base to the alias target
          * gotten rom the alias index.
          */
-        else if ( null != aliasedBase ) // mode = FINDING || ALWAYS
-        {
-            effectiveBase = new LdapDN( aliasedBase );
-        }
-        /*
-         * I the base not an alias the we just set the base to the given base
-         */
         else
         {
-            effectiveBase = base;
+            effectiveBase = new LdapDN( aliasedBase );
         }
-
+        
         // Add the scope node using the eective base to the ilter
         BranchNode root = new AndNode();
-        ExprNode node = new ScopeNode( env, effectiveBase.toString(), searchCtls.getSearchScope() );
+        ExprNode node = new ScopeNode( aliasDerefMode, effectiveBase.toString(), searchCtls.getSearchScope() );
         root.getChildren().add( node );
         root.getChildren().add( filter );
 
@@ -137,7 +129,7 @@
 
 
     /**
-     * @see SearchEngine#evaluate(ExprNode, BigInteger)
+     * @see SearchEngine#evaluate(ExprNode, Long)
      */
     public boolean evaluate( ExprNode ilter, Long id ) throws NamingException
     {

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/SearchEngine.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/SearchEngine.java?rev=584661&r1=584660&r2=584661&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/SearchEngine.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/SearchEngine.java Sun Oct 14 20:49:47 2007
@@ -20,16 +20,15 @@
 package org.apache.directory.server.core.partition.impl.btree;
 
 
-import java.util.Map;
+import org.apache.directory.shared.ldap.constants.JndiPropertyConstants;
+import org.apache.directory.shared.ldap.filter.ExprNode;
+import org.apache.directory.shared.ldap.message.DerefAliasesEnum;
 
 import javax.naming.Name;
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
 import javax.naming.directory.SearchControls;
 
-import org.apache.directory.shared.ldap.constants.JndiPropertyConstants;
-import org.apache.directory.shared.ldap.filter.ExprNode;
-
 
 /**
  * Given a search filter and a scope the search engine identifies valid
@@ -79,13 +78,14 @@
      * Conducts a search on a database.
      * 
      * @param base the search base
-     * @param env the environment for the search
+     * @param aliasDerefMode the alias dereferencing mode to use
      * @param filter the search filter AST root
      * @param searchCtls the JNDI search controls
      * @return enumeration over SearchResults
      * @throws NamingException if the search fails
      */
-    NamingEnumeration search( Name base, Map<?, ?> env, ExprNode filter, SearchControls searchCtls ) throws NamingException;
+    NamingEnumeration search( Name base, DerefAliasesEnum aliasDerefMode, ExprNode filter,
+                              SearchControls searchCtls ) throws NamingException;
 
 
     /**

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/PartitionFrame.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/PartitionFrame.java?rev=584661&r1=584660&r2=584661&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/PartitionFrame.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/PartitionFrame.java Sun Oct 14 20:49:47 2007
@@ -645,11 +645,7 @@
             limitMax = Integer.parseInt( limit );
         }
 
-        Hashtable<String, Object> env = new Hashtable<String, Object>();
-
-        env.put( JndiPropertyConstants.JNDI_LDAP_DAP_DEREF_ALIASES, DerefAliasesEnum.DEREF_ALWAYS );
-
-        NamingEnumeration cursor = eng.search( new LdapDN( base ), env, root, ctls );
+        NamingEnumeration cursor = eng.search( new LdapDN( base ), DerefAliasesEnum.DEREF_ALWAYS, root, ctls );
         String[] cols = new String[2];
         cols[0] = "id";
         cols[1] = "dn";

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java?rev=584661&r1=584660&r2=584661&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java Sun Oct 14 20:49:47 2007
@@ -52,6 +52,7 @@
 import org.apache.directory.shared.ldap.exception.LdapReferralException;
 import org.apache.directory.shared.ldap.filter.EqualityNode;
 import org.apache.directory.shared.ldap.filter.ExprNode;
+import org.apache.directory.shared.ldap.message.DerefAliasesEnum;
 import org.apache.directory.shared.ldap.message.ModificationItemImpl;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.LdapDN;
@@ -89,7 +90,6 @@
 
     private ReferralLut lut = new ReferralLut();
     private PartitionNexus nexus;
-    private Hashtable<String, Object> env;
     private AttributeTypeRegistry attrRegistry;
     private OidRegistry oidRegistry;
 
@@ -263,16 +263,14 @@
         nexus = directoryService.getPartitionNexus();
         attrRegistry = directoryService.getRegistries().getAttributeTypeRegistry();
         oidRegistry = directoryService.getRegistries().getOidRegistry();
-        env = directoryService.getEnvironment();
 
         Iterator<String> suffixes = nexus.listSuffixes( null );
         
         while ( suffixes.hasNext() )
         {
             LdapDN suffix = new LdapDN( suffixes.next() );
-            addReferrals( 
-                nexus.search( 
-                    new SearchOperationContext( suffix, env, getReferralFilter(), getControls() ) ), suffix );
+            addReferrals( nexus.search( new SearchOperationContext(
+                    suffix, DerefAliasesEnum.DEREF_ALWAYS, getReferralFilter(), getControls() ) ), suffix );
         }
     }
 
@@ -877,9 +875,8 @@
         Partition partition = opContext.getPartition();
         LdapDN suffix = partition.getSuffixDn();
         Invocation invocation = InvocationStack.getInstance().peek();
-        NamingEnumeration<SearchResult> list = invocation.getProxy().search( 
-            new SearchOperationContext( suffix, env, getReferralFilter(), getControls() ),
-            SEARCH_BYPASS );
+        NamingEnumeration<SearchResult> list = invocation.getProxy().search( new SearchOperationContext( suffix,
+                DerefAliasesEnum.DEREF_ALWAYS, getReferralFilter(), getControls() ), SEARCH_BYPASS );
         addReferrals( list, suffix );
     }
 
@@ -889,15 +886,10 @@
         // remove referrals immediately before removing the partition
         Invocation invocation = InvocationStack.getInstance().peek();
         NamingEnumeration<SearchResult> list = invocation.getProxy().search( 
-            new SearchOperationContext( 
-                opContext.getDn(), 
-                env, 
-                getReferralFilter(), 
-                getControls() ),
-            SEARCH_BYPASS );
+            new SearchOperationContext( opContext.getDn(), DerefAliasesEnum.DEREF_ALWAYS,
+                    getReferralFilter(), getControls() ), SEARCH_BYPASS );
         
         deleteReferrals( list, opContext.getDn() );
-
         next.removeContextPartition( opContext );
     }
 

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java?rev=584661&r1=584660&r2=584661&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java Sun Oct 14 20:49:47 2007
@@ -101,8 +101,6 @@
      */
     private Registries registries;
 
-    private Set<String> binaries;
-
     /** A normalized form for the SubschemaSubentry DN */
     private String subschemaSubentryDnNorm;
 
@@ -148,14 +146,6 @@
         topFilter = new TopFilter();
         filters.add( binaryAttributeFilter );
         filters.add( topFilter );
-        binaries = ( Set<String> ) directoryService.getEnvironment().get( BINARY_KEY );
-
-        if ( binaries == null )
-        {
-            binaries = new HashSet<String>();
-        }
-
-
 
         schemaBaseDN = new LdapDN( "ou=schema" );
         schemaBaseDN.normalize( registries.getAttributeTypeRegistry().getNormalizerMapping() );
@@ -1575,7 +1565,6 @@
         {
             String id = ( String ) list.next();
             AttributeType type = null;
-            boolean asBinary = false;
 
             if ( registries.getAttributeTypeRegistry().hasAttributeType( id ) )
             {
@@ -1586,11 +1575,7 @@
                 continue;
             }
 
-            asBinary = !type.getSyntax().isHumanReadable();
-            asBinary = asBinary || ( ( binaries != null ) && ( binaries.contains( type ) ) );
-            asBinary = asBinary || binaries.contains( type );
-
-            if ( asBinary )
+            if ( !type.getSyntax().isHumanReadable() )
             {
                 Attribute attribute = entry.get( id );
                 Attribute binary = new AttributeImpl( id );
@@ -1615,6 +1600,7 @@
         }
     }
 
+    
     /**
      * A special filter over entry attributes which replaces Attribute String values with their respective byte[]
      * representations using schema information and the value held in the JNDI environment property:

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDao.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDao.java?rev=584661&r1=584660&r2=584661&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDao.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDao.java Sun Oct 14 20:49:47 2007
@@ -20,23 +20,6 @@
 package org.apache.directory.server.core.schema;
 
 
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-
-import javax.naming.NamingEnumeration;
-import javax.naming.NamingException;
-import javax.naming.directory.Attribute;
-import javax.naming.directory.Attributes;
-import javax.naming.directory.DirContext;
-import javax.naming.directory.ModificationItem;
-import javax.naming.directory.SearchControls;
-import javax.naming.directory.SearchResult;
-
 import org.apache.directory.server.constants.MetaSchemaConstants;
 import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
 import org.apache.directory.server.core.interceptor.context.ModifyOperationContext;
@@ -48,14 +31,9 @@
 import org.apache.directory.server.schema.registries.OidRegistry;
 import org.apache.directory.server.schema.registries.Registries;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
-import org.apache.directory.shared.ldap.filter.AndNode;
-import org.apache.directory.shared.ldap.filter.BranchNode;
-import org.apache.directory.shared.ldap.filter.EqualityNode;
-import org.apache.directory.shared.ldap.filter.ExprNode;
-import org.apache.directory.shared.ldap.filter.OrNode;
-import org.apache.directory.shared.ldap.filter.PresenceNode;
-import org.apache.directory.shared.ldap.filter.SimpleNode;
+import org.apache.directory.shared.ldap.filter.*;
 import org.apache.directory.shared.ldap.message.AttributeImpl;
+import org.apache.directory.shared.ldap.message.DerefAliasesEnum;
 import org.apache.directory.shared.ldap.message.ModificationItemImpl;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.name.Rdn;
@@ -65,10 +43,14 @@
 import org.apache.directory.shared.ldap.schema.syntax.NumericOidSyntaxChecker;
 import org.apache.directory.shared.ldap.util.AttributeUtils;
 import org.apache.directory.shared.ldap.util.DateUtils;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
+import javax.naming.directory.*;
+import java.util.*;
+
 
 /**
  * A specialized data access object for managing schema objects in the
@@ -91,8 +73,8 @@
 public class SchemaPartitionDao
 {
     /** static class logger */
-    private final static Logger log = LoggerFactory.getLogger( SchemaPartitionDao.class );
-    private final static NumericOidSyntaxChecker NUMERIC_OID_CHECKER = new NumericOidSyntaxChecker();
+    private static final Logger LOG = LoggerFactory.getLogger( SchemaPartitionDao.class );
+    private static final NumericOidSyntaxChecker NUMERIC_OID_CHECKER = new NumericOidSyntaxChecker();
     private static final String[] SCHEMA_ATTRIBUTES = new String[] { 
         SchemaConstants.CREATORS_NAME_AT, 
         "m-dependencies", 
@@ -102,7 +84,6 @@
 
 
     private final Partition partition;
-    private final Registries bootstrapRegistries;
     private final SchemaEntityFactory factory;
     private final OidRegistry oidRegistry;
     private final AttributeTypeRegistry attrRegistry;
@@ -129,16 +110,16 @@
     /**
      * Creates a schema dao object backing information within a schema partition.
      * 
-     * @param partition
-     * @throws NamingException 
+     * @param partition the schema partition
+     * @param bootstrapRegistries the bootstrap registries that were used to start up the schema partition
+     * @throws NamingException if there are problems initializing this schema partion dao
      */
     public SchemaPartitionDao( Partition partition, Registries bootstrapRegistries ) throws NamingException
     {
         this.partition = partition;
-        this.bootstrapRegistries = bootstrapRegistries;
-        this.factory = new SchemaEntityFactory( this.bootstrapRegistries );
-        this.oidRegistry = this.bootstrapRegistries.getOidRegistry();
-        this.attrRegistry = this.bootstrapRegistries.getAttributeTypeRegistry();
+        this.factory = new SchemaEntityFactory( bootstrapRegistries );
+        this.oidRegistry = bootstrapRegistries.getOidRegistry();
+        this.attrRegistry = bootstrapRegistries.getAttributeTypeRegistry();
         
         this.M_NAME_OID = oidRegistry.getOid( MetaSchemaConstants.M_NAME_AT );
         this.CN_OID = oidRegistry.getOid( SchemaConstants.CN_AT );
@@ -197,7 +178,7 @@
         searchControls.setSearchScope( SearchControls.ONELEVEL_SCOPE );
         searchControls.setReturningAttributes( SCHEMA_ATTRIBUTES );
         return partition.search( 
-            new SearchOperationContext( base, new HashMap(), filter, searchControls ) );
+            new SearchOperationContext( base, DerefAliasesEnum.DEREF_ALWAYS, filter, searchControls ) );
     }
 
 
@@ -209,12 +190,6 @@
     }
 
 
-    public Schema getSchema( String schemaName, Properties schemaProperties ) throws NamingException
-    {
-        return getSchema( schemaName ); 
-    }
-    
-    
     public boolean hasMatchingRule( String oid ) throws NamingException
     {
         BranchNode filter = new AndNode();
@@ -235,8 +210,8 @@
 
         try
         {
-            ne = partition.search( 
-                new SearchOperationContext( partition.getSuffixDn(), new HashMap(), filter, searchControls ) );
+            ne = partition.search( new SearchOperationContext( partition.getSuffixDn(),
+                    DerefAliasesEnum.DEREF_ALWAYS, filter, searchControls ) );
             
             if ( ! ne.hasMore() )
             {
@@ -253,7 +228,10 @@
         }
         finally
         {
-            ne.close();
+            if ( ne != null )
+            {
+                ne.close();
+            }
         }
     }
     
@@ -278,8 +256,8 @@
 
         try
         {
-            ne = partition.search( 
-                new SearchOperationContext( partition.getSuffixDn(), new HashMap(), filter, searchControls ) );
+            ne = partition.search( new SearchOperationContext(
+                    partition.getSuffixDn(), DerefAliasesEnum.DEREF_ALWAYS, filter, searchControls ) );
             
             if ( ! ne.hasMore() )
             {
@@ -296,7 +274,10 @@
         }
         finally
         {
-            ne.close();
+            if ( ne != null )
+            {
+                ne.close();
+            }
         }
     }
     
@@ -321,8 +302,8 @@
 
         try
         {
-            ne = partition.search( 
-                new SearchOperationContext( partition.getSuffixDn(), new HashMap(), filter, searchControls ) );
+            ne = partition.search( new SearchOperationContext( partition.getSuffixDn(),
+                    DerefAliasesEnum.DEREF_ALWAYS, filter, searchControls ) );
             
             if ( ! ne.hasMore() )
             {
@@ -339,7 +320,10 @@
         }
         finally
         {
-            ne.close();
+            if ( ne != null )
+            {
+                ne.close();
+            }
         }
     }
     
@@ -364,8 +348,8 @@
 
         try
         {
-            ne = partition.search( 
-                new SearchOperationContext( partition.getSuffixDn(), new HashMap(), filter, searchControls ) );
+            ne = partition.search( new SearchOperationContext( partition.getSuffixDn(),
+                    DerefAliasesEnum.DEREF_ALWAYS, filter, searchControls ) );
             
             if ( ! ne.hasMore() )
             {
@@ -382,7 +366,10 @@
         }
         finally
         {
-            ne.close();
+            if ( ne != null )
+            {
+                ne.close();
+            }
         }
     }
     
@@ -407,8 +394,8 @@
 
         try
         {
-            ne = partition.search( 
-                new SearchOperationContext( partition.getSuffixDn(), new HashMap(), filter, searchControls ) );
+            ne = partition.search( new SearchOperationContext( partition.getSuffixDn(), DerefAliasesEnum.DEREF_ALWAYS,
+                        filter, searchControls ) );
             
             if ( ! ne.hasMore() )
             {
@@ -425,7 +412,10 @@
         }
         finally
         {
-            ne.close();
+            if ( ne != null )
+            {
+                ne.close();
+            }
         }
     }
     
@@ -499,8 +489,8 @@
         
         try
         {
-            ne = partition.search( 
-                new SearchOperationContext( partition.getSuffixDn(), new HashMap(), filter, searchControls ) );
+            ne = partition.search( new SearchOperationContext( partition.getSuffixDn(),
+                    DerefAliasesEnum.DEREF_ALWAYS, filter, searchControls ) );
             
             if ( ! ne.hasMore() )
             {
@@ -565,14 +555,14 @@
         
         if ( disabledAttr == null )
         {
-            log.warn( "Does not make sense: you're trying to enable {} schema which is already enabled", schemaName );
+            LOG.warn( "Does not make sense: you're trying to enable {} schema which is already enabled", schemaName );
             return;
         }
         
         boolean isDisabled = ( ( String ) disabledAttr.get() ).equalsIgnoreCase( "TRUE" );
         if ( ! isDisabled )
         {
-            log.warn( "Does not make sense: you're trying to enable {} schema which is already enabled", schemaName );
+            LOG.warn( "Does not make sense: you're trying to enable {} schema which is already enabled", schemaName );
             return;
         }
         
@@ -594,7 +584,8 @@
      * provided syntax.
      *
      * @param numericOid the numeric identifier for the entity
-     * @return
+     * @return the set of matchingRules and attributeTypes depending on a syntax
+     * @throws NamingException if the dao fails to perform search operations
      */
     public Set<SearchResult> listSyntaxDependents( String numericOid ) throws NamingException
     {
@@ -617,8 +608,8 @@
         
         try
         {
-            ne = partition.search( 
-                new SearchOperationContext( partition.getSuffixDn(), new HashMap(), filter, searchControls ) );
+            ne = partition.search( new SearchOperationContext( partition.getSuffixDn(),
+                    DerefAliasesEnum.DEREF_ALWAYS, filter, searchControls ) );
             while( ne.hasMore() )
             {
                 set.add( ne.next() );
@@ -666,8 +657,8 @@
         
         try
         {
-            ne = partition.search( 
-                new SearchOperationContext( partition.getSuffixDn(), new HashMap(), filter, searchControls ) );
+            ne = partition.search( new SearchOperationContext( partition.getSuffixDn(),
+                     DerefAliasesEnum.DEREF_ALWAYS, filter, searchControls ) );
             while( ne.hasMore() )
             {
                 set.add( ne.next() );
@@ -694,8 +685,8 @@
         // (& (m-oid=*) (m-name=*) )
         filter.addNode( new PresenceNode( M_OID_OID ) );
         filter.addNode( new PresenceNode( M_NAME_OID ) );
-        return partition.search( 
-            new SearchOperationContext( partition.getSuffixDn(), new HashMap(), filter, searchControls ) );
+        return partition.search( new SearchOperationContext( partition.getSuffixDn(),
+                 DerefAliasesEnum.DEREF_ALWAYS, filter, searchControls ) );
     }
 
 
@@ -743,8 +734,8 @@
         
         try
         {
-            ne = partition.search( 
-                new SearchOperationContext( partition.getSuffixDn(), new HashMap(), filter, searchControls ) );
+            ne = partition.search( new SearchOperationContext( partition.getSuffixDn(),
+                    DerefAliasesEnum.DEREF_ALWAYS, filter, searchControls ) );
             while( ne.hasMore() )
             {
                 set.add( ne.next() );
@@ -791,8 +782,8 @@
         
         try
         {
-            ne = partition.search( 
-                new SearchOperationContext( partition.getSuffixDn(), new HashMap(), filter, searchControls ) );
+            ne = partition.search( new SearchOperationContext( partition.getSuffixDn(),
+                    DerefAliasesEnum.DEREF_ALWAYS, filter, searchControls ) );
             while( ne.hasMore() )
             {
                 set.add( ne.next() );
@@ -833,8 +824,8 @@
         
         try
         {
-            ne = partition.search( 
-                new SearchOperationContext( partition.getSuffixDn(), new HashMap(), filter, searchControls ) );
+            ne = partition.search( new SearchOperationContext( partition.getSuffixDn(),
+                     DerefAliasesEnum.DEREF_ALWAYS, filter, searchControls ) );
             while( ne.hasMore() )
             {
                 SearchResult sr = ne.next();
@@ -913,8 +904,8 @@
         
         try
         {
-            ne = partition.search( 
-                new SearchOperationContext( partition.getSuffixDn(), new HashMap(), filter, searchControls ) );
+            ne = partition.search( new SearchOperationContext( partition.getSuffixDn(),
+                    DerefAliasesEnum.DEREF_ALWAYS, filter, searchControls ) );
             while( ne.hasMore() )
             {
                 set.add( ne.next() );

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java?rev=584661&r1=584660&r2=584661&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java Sun Oct 14 20:49:47 2007
@@ -102,7 +102,6 @@
     /** the hash mapping the DN of a subentry to its SubtreeSpecification/types */
     private final SubentryCache subentryCache = new SubentryCache();
     
-    private DirectoryService directoryService;
     private SubtreeSpecificationParser ssParser;
     private SubtreeEvaluator evaluator;
     private PartitionNexus nexus;
@@ -116,7 +115,6 @@
     {
         super.init( directoryService );
         this.nexus = directoryService.getPartitionNexus();
-        this.directoryService = directoryService;
         this.attrRegistry = directoryService.getRegistries().getAttributeTypeRegistry();
         this.oidRegistry = directoryService.getRegistries().getOidRegistry();
         
@@ -147,7 +145,7 @@
             //suffix = LdapDN.normalize( suffix, registry.getNormalizerMapping() );
             suffix.normalize( attrRegistry.getNormalizerMapping() );
             NamingEnumeration<SearchResult> subentries = nexus.search( 
-                new SearchOperationContext( suffix, directoryService.getEnvironment(), filter, controls ) );
+                new SearchOperationContext( suffix, DerefAliasesEnum.NEVER_DEREF_ALIASES, filter, controls ) );
             
             while ( subentries.hasMore() )
             {
@@ -442,9 +440,8 @@
             controls.setReturningAttributes( new String[]
                 { SchemaConstants.ALL_OPERATIONAL_ATTRIBUTES, SchemaConstants.ALL_USER_ATTRIBUTES } );
 
-            NamingEnumeration<SearchResult> subentries = 
-                nexus.search( 
-                    new SearchOperationContext( baseDn, directoryService.getEnvironment(), filter, controls ) );
+            NamingEnumeration<SearchResult> subentries = nexus.search(
+                    new SearchOperationContext( baseDn, DerefAliasesEnum.NEVER_DEREF_ALIASES, filter, controls ) );
 
             while ( subentries.hasMore() )
             {
@@ -569,9 +566,8 @@
             controls.setReturningAttributes( new String[]
                 { SchemaConstants.ALL_OPERATIONAL_ATTRIBUTES, SchemaConstants.ALL_USER_ATTRIBUTES } );
 
-            NamingEnumeration<SearchResult> subentries = 
-                nexus.search( 
-                    new SearchOperationContext( baseDn, directoryService.getEnvironment(), filter, controls ) );
+            NamingEnumeration<SearchResult> subentries = nexus.search(
+                    new SearchOperationContext( baseDn, DerefAliasesEnum.NEVER_DEREF_ALIASES, filter, controls ) );
             
             while ( subentries.hasMore() )
             {
@@ -611,9 +607,8 @@
         ExprNode filter = new PresenceNode( "administrativeRole" );
         SearchControls controls = new SearchControls();
         controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
-        NamingEnumeration<SearchResult> aps = 
-            nexus.search( 
-                new SearchOperationContext( name, directoryService.getEnvironment(), filter, controls ) );
+        NamingEnumeration<SearchResult> aps = nexus.search(
+                new SearchOperationContext( name, DerefAliasesEnum.NEVER_DEREF_ALIASES, filter, controls ) );
 
         if ( aps.hasMore() )
         {
@@ -731,9 +726,8 @@
             SearchControls controls = new SearchControls();
             controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
             controls.setReturningAttributes( new String[] { SchemaConstants.ALL_OPERATIONAL_ATTRIBUTES, SchemaConstants.ALL_USER_ATTRIBUTES } );
-            NamingEnumeration<SearchResult> subentries = 
-                nexus.search( 
-                    new SearchOperationContext( baseDn, directoryService.getEnvironment(), filter, controls ) );
+            NamingEnumeration<SearchResult> subentries = nexus.search(
+                    new SearchOperationContext( baseDn, DerefAliasesEnum.NEVER_DEREF_ALIASES, filter, controls ) );
             
             while ( subentries.hasMore() )
             {
@@ -812,9 +806,8 @@
             SearchControls controls = new SearchControls();
             controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
             controls.setReturningAttributes( new String[] { SchemaConstants.ALL_OPERATIONAL_ATTRIBUTES, SchemaConstants.ALL_USER_ATTRIBUTES } );
-            NamingEnumeration<SearchResult> subentries = 
-                nexus.search( 
-                    new SearchOperationContext( baseDn, directoryService.getEnvironment(), filter, controls ) );
+            NamingEnumeration<SearchResult> subentries = nexus.search(
+                    new SearchOperationContext( baseDn, DerefAliasesEnum.NEVER_DEREF_ALIASES, filter, controls ) );
             
             while ( subentries.hasMore() )
             {
@@ -887,9 +880,8 @@
             controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
             controls.setReturningAttributes( new String[]
                 { SchemaConstants.ALL_OPERATIONAL_ATTRIBUTES, SchemaConstants.ALL_USER_ATTRIBUTES } );
-            NamingEnumeration<SearchResult> subentries = 
-                nexus.search( 
-                    new SearchOperationContext( baseDn, directoryService.getEnvironment(), filter, controls ) );
+            NamingEnumeration<SearchResult> subentries = nexus.search(
+                    new SearchOperationContext( baseDn, DerefAliasesEnum.NEVER_DEREF_ALIASES, filter, controls ) );
             
             while ( subentries.hasMore() )
             {
@@ -1019,9 +1011,8 @@
             controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
             controls.setReturningAttributes( new String[]
                 { SchemaConstants.ALL_OPERATIONAL_ATTRIBUTES, SchemaConstants.ALL_USER_ATTRIBUTES } );
-            NamingEnumeration<SearchResult> subentries = 
-                nexus.search( 
-                    new SearchOperationContext( oldBaseDn, directoryService.getEnvironment(), filter, controls ) );
+            NamingEnumeration<SearchResult> subentries = nexus.search(
+                    new SearchOperationContext( oldBaseDn, DerefAliasesEnum.NEVER_DEREF_ALIASES, filter, controls ) );
             
             while ( subentries.hasMore() )
             {
@@ -1041,11 +1032,11 @@
             Attributes operational = getSubentryOperatationalAttributes( name, subentry );
             LdapDN newBaseDn = ( LdapDN ) apName.clone();
             newBaseDn.addAll( ssNew.getBase() );
-            subentries = nexus.search( 
-                new SearchOperationContext( newBaseDn, directoryService.getEnvironment(), filter, controls ) );
+            subentries = nexus.search(
+                    new SearchOperationContext( newBaseDn, DerefAliasesEnum.NEVER_DEREF_ALIASES, filter, controls ) );
             while ( subentries.hasMore() )
             {
-                SearchResult result = ( SearchResult ) subentries.next();
+                SearchResult result = subentries.next();
                 Attributes candidate = result.getAttributes();
                 LdapDN dn = new LdapDN( result.getName() );
                 dn.normalize( attrRegistry.getNormalizerMapping() );

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/trigger/TriggerSpecCache.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/trigger/TriggerSpecCache.java?rev=584661&r1=584660&r2=584661&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/trigger/TriggerSpecCache.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/trigger/TriggerSpecCache.java Sun Oct 14 20:49:47 2007
@@ -29,6 +29,7 @@
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.filter.EqualityNode;
 import org.apache.directory.shared.ldap.filter.ExprNode;
+import org.apache.directory.shared.ldap.message.DerefAliasesEnum;
 import org.apache.directory.shared.ldap.message.ModificationItemImpl;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.NormalizerMappingResolver;
@@ -40,7 +41,10 @@
 
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
-import javax.naming.directory.*;
+import javax.naming.directory.Attribute;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.SearchControls;
+import javax.naming.directory.SearchResult;
 import java.text.ParseException;
 import java.util.*;
 
@@ -86,12 +90,11 @@
                     return registry.getNormalizerMapping();
                 }
             });
-        Hashtable env = ( Hashtable ) directoryService.getEnvironment().clone();
-        initialize( registry, env );
+        initialize( registry );
     }
 
 
-    private void initialize(AttributeTypeRegistry registry, Hashtable<String, Object> env) throws NamingException
+    private void initialize( AttributeTypeRegistry registry ) throws NamingException
     {
         // search all naming contexts for trigger subentenries
         // generate TriggerSpecification arrays for each subentry
@@ -106,8 +109,7 @@
             SearchControls ctls = new SearchControls();
             ctls.setSearchScope( SearchControls.SUBTREE_SCOPE );
             NamingEnumeration results = 
-                nexus.search( 
-                    new SearchOperationContext( baseDn, env, filter, ctls ) );
+                nexus.search( new SearchOperationContext( baseDn, DerefAliasesEnum.DEREF_ALWAYS, filter, ctls ) );
             
             while ( results.hasMore() )
             {

Modified: directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/operation/OperationFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/operation/OperationFactory.java?rev=584661&r1=584660&r2=584661&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/operation/OperationFactory.java (original)
+++ directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/operation/OperationFactory.java Sun Oct 14 20:49:47 2007
@@ -32,6 +32,7 @@
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.filter.PresenceNode;
 import org.apache.directory.shared.ldap.message.AttributeImpl;
+import org.apache.directory.shared.ldap.message.DerefAliasesEnum;
 import org.apache.directory.shared.ldap.message.ModificationItemImpl;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.util.NamespaceTools;
@@ -41,7 +42,6 @@
 import javax.naming.NamingException;
 import javax.naming.directory.*;
 import java.util.List;
-import java.util.Map;
 
 
 /**
@@ -71,7 +71,6 @@
 public class OperationFactory
 {
     private final ReplicaId replicaId;
-    private final Map<String, Object> environment;
     private final PartitionNexus nexus;
     private final UUIDFactory uuidFactory;
     private final CSNFactory csnFactory;
@@ -81,7 +80,6 @@
     public OperationFactory( DirectoryService directoryService, ReplicationConfiguration cfg )
     {
         this.replicaId = cfg.getReplicaId();
-        this.environment = directoryService.getEnvironment();
         this.nexus = directoryService.getPartitionNexus();
         this.uuidFactory = cfg.getUuidFactory();
         this.csnFactory = cfg.getCsnFactory();
@@ -240,7 +238,8 @@
         SearchControls ctrl = new SearchControls();
         ctrl.setSearchScope( SearchControls.SUBTREE_SCOPE );
         NamingEnumeration<SearchResult> e = nexus.search( 
-            new SearchOperationContext( oldName, environment, new PresenceNode( SchemaConstants.OBJECT_CLASS_AT_OID ), ctrl ) );
+            new SearchOperationContext( oldName, DerefAliasesEnum.DEREF_ALWAYS,
+                    new PresenceNode( SchemaConstants.OBJECT_CLASS_AT_OID ), ctrl ) );
 
         while ( e.hasMore() )
         {

Modified: directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationInterceptor.java?rev=584661&r1=584660&r2=584661&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationInterceptor.java (original)
+++ directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationInterceptor.java Sun Oct 14 20:49:47 2007
@@ -43,6 +43,7 @@
 import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.filter.FilterParser;
 import org.apache.directory.shared.ldap.filter.PresenceNode;
+import org.apache.directory.shared.ldap.message.DerefAliasesEnum;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.mina.common.IoAcceptor;
 import org.apache.mina.filter.LoggingFilter;
@@ -336,7 +337,7 @@
         ctrl.setReturningAttributes( new String[] { "entryCSN", "entryDeleted" } );
 
         NamingEnumeration<SearchResult> e = nexus.search(
-            new SearchOperationContext( contextName, directoryService.getEnvironment(), filter, ctrl ) );
+            new SearchOperationContext( contextName, DerefAliasesEnum.DEREF_ALWAYS, filter, ctrl ) );
 
         List<LdapDN> names = new ArrayList<LdapDN>();
         try
@@ -485,7 +486,7 @@
 
     	NamingEnumeration<SearchResult> result = nextInterceptor.search(
 	            new SearchOperationContext(
-	                opContext.getDn(), ctx.getEnvironment(),
+	                opContext.getDn(), opContext.getAliasDerefMode(),
 	                new PresenceNode( SchemaConstants.OBJECT_CLASS_AT_OID ),
 	                new SearchControls() ) );
 
@@ -509,7 +510,7 @@
         }
 
     	NamingEnumeration<SearchResult> result = nextInterceptor.search(
-            new SearchOperationContext( opContext.getDn(), opContext.getEnv(), opContext.getFilter(), searchControls ) );
+            new SearchOperationContext( opContext.getDn(), opContext.getAliasDerefMode(), opContext.getFilter(), searchControls ) );
         return new SearchResultFilteringEnumeration( result, searchControls, InvocationStack.getInstance().peek(),
             Constants.DELETED_ENTRIES_FILTER, "Search Replication filter" );
     }

Modified: directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationClientContextHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationClientContextHandler.java?rev=584661&r1=584660&r2=584661&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationClientContextHandler.java (original)
+++ directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationClientContextHandler.java Sun Oct 14 20:49:47 2007
@@ -33,6 +33,7 @@
 import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.filter.PresenceNode;
+import org.apache.directory.shared.ldap.message.DerefAliasesEnum;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.OidNormalizer;
 import org.apache.mina.common.IdleStatus;
@@ -377,8 +378,7 @@
         SearchControls ctrl = new SearchControls();
         ctrl.setSearchScope( SearchControls.SUBTREE_SCOPE );
         NamingEnumeration e = ctx.getDirectoryService().getPartitionNexus().search(
-            new SearchOperationContext( contextName,
-            ctx.getDirectoryService().getEnvironment(),
+            new SearchOperationContext( contextName, DerefAliasesEnum.DEREF_ALWAYS,
             new PresenceNode( SchemaConstants.OBJECT_CLASS_AT_OID ), ctrl ) );
 
         try



Mime
View raw message