You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ak...@apache.org on 2006/07/31 18:28:07 UTC
svn commit: r427156 [3/5] - in /directory/branches/apacheds/1.0: benchmarks/
benchmarks/src/ benchmarks/src/main/ benchmarks/src/main/java/
benchmarks/src/main/java/org/ benchmarks/src/main/java/org/apache/
benchmarks/src/main/java/org/apache/directory...
Modified: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/interceptor/Interceptor.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/interceptor/Interceptor.java?rev=427156&r1=427155&r2=427156&view=diff
==============================================================================
--- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/interceptor/Interceptor.java (original)
+++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/interceptor/Interceptor.java Mon Jul 31 09:27:52 2006
@@ -28,17 +28,17 @@
import javax.naming.directory.SearchControls;
import org.apache.directory.server.core.DirectoryServiceConfiguration;
-import org.apache.directory.server.core.configuration.DirectoryPartitionConfiguration;
+import org.apache.directory.server.core.configuration.PartitionConfiguration;
import org.apache.directory.server.core.configuration.InterceptorConfiguration;
-import org.apache.directory.server.core.partition.DirectoryPartition;
-import org.apache.directory.server.core.partition.DirectoryPartitionNexus;
+import org.apache.directory.server.core.partition.Partition;
+import org.apache.directory.server.core.partition.PartitionNexus;
import org.apache.directory.shared.ldap.filter.ExprNode;
import org.apache.directory.shared.ldap.name.LdapDN;
/**
- * Filters invocations on {@link DirectoryPartitionNexus}. {@link Interceptor}
- * filters most method calls performed on {@link DirectoryPartitionNexus} just
+ * Filters invocations on {@link PartitionNexus}. {@link Interceptor}
+ * filters most method calls performed on {@link PartitionNexus} just
* like Servlet filters do.
* <p/>
* <h2>Interceptor Chaining</h2>
@@ -116,136 +116,136 @@
/**
- * Filters {@link DirectoryPartitionNexus#getRootDSE()} call.
+ * Filters {@link PartitionNexus#getRootDSE()} call.
*/
Attributes getRootDSE( NextInterceptor next ) throws NamingException;
/**
- * Filters {@link DirectoryPartitionNexus#getMatchedName(org.apache.directory.shared.ldap.name.LdapDN)} call.
+ * Filters {@link PartitionNexus#getMatchedName(org.apache.directory.shared.ldap.name.LdapDN)} call.
*/
LdapDN getMatchedName ( NextInterceptor next, LdapDN name ) throws NamingException;
/**
- * Filters {@link DirectoryPartitionNexus#getSuffix(org.apache.directory.shared.ldap.name.LdapDN)} call.
+ * Filters {@link PartitionNexus#getSuffix(org.apache.directory.shared.ldap.name.LdapDN)} call.
*/
LdapDN getSuffix ( NextInterceptor next, LdapDN name ) throws NamingException;
/**
- * Filters {@link DirectoryPartitionNexus#listSuffixes()} call.
+ * Filters {@link PartitionNexus#listSuffixes()} call.
*/
Iterator listSuffixes ( NextInterceptor next ) throws NamingException;
/**
- * Filters {@link DirectoryPartitionNexus#addContextPartition(DirectoryPartitionConfiguration)} call.
+ * Filters {@link PartitionNexus#addContextPartition(PartitionConfiguration)} call.
*/
- void addContextPartition( NextInterceptor next, DirectoryPartitionConfiguration cfg ) throws NamingException;
+ void addContextPartition( NextInterceptor next, PartitionConfiguration cfg ) throws NamingException;
/**
- * Filters {@link DirectoryPartitionNexus#removeContextPartition(org.apache.directory.shared.ldap.name.LdapDN)} call.
+ * Filters {@link PartitionNexus#removeContextPartition(org.apache.directory.shared.ldap.name.LdapDN)} call.
*/
void removeContextPartition( NextInterceptor next, LdapDN suffix ) throws NamingException;
/**
- * Filters {@link DirectoryPartitionNexus#compare(org.apache.directory.shared.ldap.name.LdapDN,String,Object)} call.
+ * Filters {@link PartitionNexus#compare(org.apache.directory.shared.ldap.name.LdapDN,String,Object)} call.
*/
boolean compare( NextInterceptor next, LdapDN name, String oid, Object value ) throws NamingException;
/**
- * Filters {@link DirectoryPartition#delete(org.apache.directory.shared.ldap.name.LdapDN)} call.
+ * Filters {@link Partition#delete(org.apache.directory.shared.ldap.name.LdapDN)} call.
*/
void delete( NextInterceptor next, LdapDN name ) throws NamingException;
/**
- * Filters {@link DirectoryPartition#add(org.apache.directory.shared.ldap.name.LdapDN,javax.naming.directory.Attributes)} call.
+ * Filters {@link Partition#add(org.apache.directory.shared.ldap.name.LdapDN,javax.naming.directory.Attributes)} call.
*/
void add( NextInterceptor next, LdapDN name, Attributes entry ) throws NamingException;
/**
- * Filters {@link DirectoryPartition#modify(org.apache.directory.shared.ldap.name.LdapDN,int,javax.naming.directory.Attributes)} call.
+ * Filters {@link Partition#modify(org.apache.directory.shared.ldap.name.LdapDN,int,javax.naming.directory.Attributes)} call.
*/
void modify( NextInterceptor next, LdapDN name, int modOp, Attributes attributes ) throws NamingException;
/**
- * Filters {@link DirectoryPartition#modify(org.apache.directory.shared.ldap.name.LdapDN,javax.naming.directory.ModificationItem[])} call.
+ * Filters {@link Partition#modify(org.apache.directory.shared.ldap.name.LdapDN,javax.naming.directory.ModificationItem[])} call.
*/
void modify( NextInterceptor next, LdapDN name, ModificationItem[] items ) throws NamingException;
/**
- * Filters {@link DirectoryPartition#list(org.apache.directory.shared.ldap.name.LdapDN)} call.
+ * Filters {@link Partition#list(org.apache.directory.shared.ldap.name.LdapDN)} call.
*/
NamingEnumeration list( NextInterceptor next, LdapDN baseName ) throws NamingException;
/**
- * Filters {@link DirectoryPartition#search(org.apache.directory.shared.ldap.name.LdapDN,java.util.Map,org.apache.directory.shared.ldap.filter.ExprNode,javax.naming.directory.SearchControls)} call.
+ * Filters {@link Partition#search(org.apache.directory.shared.ldap.name.LdapDN,java.util.Map,org.apache.directory.shared.ldap.filter.ExprNode,javax.naming.directory.SearchControls)} call.
*/
NamingEnumeration search( NextInterceptor next, LdapDN baseName, Map environment, ExprNode filter,
SearchControls searchControls ) throws NamingException;
/**
- * Filters {@link DirectoryPartition#lookup(org.apache.directory.shared.ldap.name.LdapDN)} call.
+ * Filters {@link Partition#lookup(org.apache.directory.shared.ldap.name.LdapDN)} call.
*/
Attributes lookup( NextInterceptor next, LdapDN name ) throws NamingException;
/**
- * Filters {@link DirectoryPartition#lookup(org.apache.directory.shared.ldap.name.LdapDN,String[])} call.
+ * Filters {@link Partition#lookup(org.apache.directory.shared.ldap.name.LdapDN,String[])} call.
*/
Attributes lookup( NextInterceptor next, LdapDN dn, String[] attrIds ) throws NamingException;
/**
- * Filters {@link DirectoryPartition#lookup(org.apache.directory.shared.ldap.name.LdapDN,String[])} call.
+ * Filters {@link Partition#lookup(org.apache.directory.shared.ldap.name.LdapDN,String[])} call.
*/
boolean hasEntry( NextInterceptor next, LdapDN name ) throws NamingException;
/**
- * Filters {@link DirectoryPartition#isSuffix(org.apache.directory.shared.ldap.name.LdapDN)} call.
+ * Filters {@link Partition#isSuffix(org.apache.directory.shared.ldap.name.LdapDN)} call.
*/
boolean isSuffix( NextInterceptor next, LdapDN name ) throws NamingException;
/**
- * Filters {@link DirectoryPartition#modifyRn(org.apache.directory.shared.ldap.name.LdapDN,String,boolean)} call.
+ * Filters {@link Partition#modifyRn(org.apache.directory.shared.ldap.name.LdapDN,String,boolean)} call.
*/
void modifyRn( NextInterceptor next, LdapDN name, String newRn, boolean deleteOldRn ) throws NamingException;
/**
- * Filters {@link DirectoryPartition#move(org.apache.directory.shared.ldap.name.LdapDN,org.apache.directory.shared.ldap.name.LdapDN)} call.
+ * Filters {@link Partition#move(org.apache.directory.shared.ldap.name.LdapDN,org.apache.directory.shared.ldap.name.LdapDN)} call.
*/
void move( NextInterceptor next, LdapDN oldName, LdapDN newParentName ) throws NamingException;
/**
- * Filters {@link DirectoryPartition#move(org.apache.directory.shared.ldap.name.LdapDN,org.apache.directory.shared.ldap.name.LdapDN,String,boolean)} call.
+ * Filters {@link Partition#move(org.apache.directory.shared.ldap.name.LdapDN,org.apache.directory.shared.ldap.name.LdapDN,String,boolean)} call.
*/
void move( NextInterceptor next, LdapDN oldName, LdapDN newParentName, String newRn, boolean deleteOldRn )
throws NamingException;
/**
- * Filters {@link DirectoryPartition#bind(org.apache.directory.shared.ldap.name.LdapDN,byte[],java.util.List,String)} call.
+ * Filters {@link Partition#bind(org.apache.directory.shared.ldap.name.LdapDN,byte[],java.util.List,String)} call.
*/
void bind( NextInterceptor next, LdapDN bindDn, byte[] credentials, List mechanisms, String saslAuthId )
throws NamingException;
/**
- * Filters {@link DirectoryPartition#unbind(org.apache.directory.shared.ldap.name.LdapDN)} call.
+ * Filters {@link Partition#unbind(org.apache.directory.shared.ldap.name.LdapDN)} call.
*/
void unbind( NextInterceptor next, LdapDN bindDn ) throws NamingException;
}
Modified: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java?rev=427156&r1=427155&r2=427156&view=diff
==============================================================================
--- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java (original)
+++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java Mon Jul 31 09:27:52 2006
@@ -27,13 +27,13 @@
import javax.naming.directory.SearchControls;
import org.apache.directory.server.core.DirectoryServiceConfiguration;
-import org.apache.directory.server.core.configuration.DirectoryPartitionConfiguration;
+import org.apache.directory.server.core.configuration.PartitionConfiguration;
import org.apache.directory.server.core.configuration.InterceptorConfiguration;
import org.apache.directory.server.core.configuration.MutableInterceptorConfiguration;
import org.apache.directory.server.core.invocation.Invocation;
import org.apache.directory.server.core.invocation.InvocationStack;
-import org.apache.directory.server.core.partition.DirectoryPartitionNexus;
-import org.apache.directory.server.core.partition.DirectoryPartitionNexusProxy;
+import org.apache.directory.server.core.partition.PartitionNexus;
+import org.apache.directory.server.core.partition.PartitionNexusProxy;
import org.apache.directory.shared.ldap.filter.ExprNode;
import org.apache.directory.shared.ldap.name.LdapDN;
import org.slf4j.Logger;
@@ -50,9 +50,12 @@
{
private static final Logger log = LoggerFactory.getLogger( InterceptorChain.class );
+ /** Speedup for logs */
+ private static final boolean IS_DEBUG = log.isDebugEnabled();
+
private final Interceptor FINAL_INTERCEPTOR = new Interceptor()
{
- private DirectoryPartitionNexus nexus;
+ private PartitionNexus nexus;
public void init( DirectoryServiceConfiguration factoryCfg, InterceptorConfiguration cfg )
@@ -178,7 +181,7 @@
}
- public void addContextPartition( NextInterceptor next, DirectoryPartitionConfiguration cfg )
+ public void addContextPartition( NextInterceptor next, PartitionConfiguration cfg )
throws NamingException
{
nexus.addContextPartition( cfg );
@@ -246,7 +249,7 @@
{
InterceptorConfiguration cfg = ( InterceptorConfiguration ) i.next();
- if ( log.isDebugEnabled() )
+ if ( IS_DEBUG )
{
log.debug( "Adding interceptor " + cfg.getName() );
}
@@ -501,7 +504,7 @@
return head;
}
- if ( invocation.isBypassed( DirectoryPartitionNexusProxy.BYPASS_ALL ) )
+ if ( invocation.isBypassed( PartitionNexusProxy.BYPASS_ALL ) )
{
return tail;
}
@@ -628,7 +631,7 @@
}
- public void addContextPartition( DirectoryPartitionConfiguration cfg ) throws NamingException
+ public void addContextPartition( PartitionConfiguration cfg ) throws NamingException
{
Entry entry = getStartingEntry();
Interceptor head = entry.configuration.getInterceptor();
@@ -1454,7 +1457,7 @@
}
- public void addContextPartition( DirectoryPartitionConfiguration cfg ) throws NamingException
+ public void addContextPartition( PartitionConfiguration cfg ) throws NamingException
{
Entry next = getNextEntry();
Interceptor interceptor = next.configuration.getInterceptor();
Modified: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/interceptor/NextInterceptor.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/interceptor/NextInterceptor.java?rev=427156&r1=427155&r2=427156&view=diff
==============================================================================
--- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/interceptor/NextInterceptor.java (original)
+++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/interceptor/NextInterceptor.java Mon Jul 31 09:27:52 2006
@@ -27,8 +27,8 @@
import javax.naming.directory.ModificationItem;
import javax.naming.directory.SearchControls;
-import org.apache.directory.server.core.configuration.DirectoryPartitionConfiguration;
-import org.apache.directory.server.core.partition.DirectoryPartitionNexus;
+import org.apache.directory.server.core.configuration.PartitionConfiguration;
+import org.apache.directory.server.core.partition.PartitionNexus;
import org.apache.directory.shared.ldap.filter.ExprNode;
import org.apache.directory.shared.ldap.name.LdapDN;
@@ -74,13 +74,13 @@
/**
- * Calls the next interceptor's {@link DirectoryPartitionNexus#addContextPartition(DirectoryPartitionConfiguration)}.
+ * Calls the next interceptor's {@link PartitionNexus#addContextPartition(PartitionConfiguration)}.
*/
- void addContextPartition( DirectoryPartitionConfiguration cfg ) throws NamingException;
+ void addContextPartition( PartitionConfiguration cfg ) throws NamingException;
/**
- * Calls the next interceptor's {@link DirectoryPartitionNexus#removeContextPartition(org.apache.directory.shared.ldap.name.LdapDN)}.
+ * Calls the next interceptor's {@link PartitionNexus#removeContextPartition(org.apache.directory.shared.ldap.name.LdapDN)}.
*/
void removeContextPartition( LdapDN suffix ) throws NamingException;
Modified: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/invocation/Invocation.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/invocation/Invocation.java?rev=427156&r1=427155&r2=427156&view=diff
==============================================================================
--- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/invocation/Invocation.java (original)
+++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/invocation/Invocation.java Mon Jul 31 09:27:52 2006
@@ -24,12 +24,12 @@
import javax.naming.Context;
-import org.apache.directory.server.core.partition.DirectoryPartitionNexus;
-import org.apache.directory.server.core.partition.DirectoryPartitionNexusProxy;
+import org.apache.directory.server.core.partition.PartitionNexus;
+import org.apache.directory.server.core.partition.PartitionNexusProxy;
/**
- * Represents a call from JNDI {@link Context} to {@link DirectoryPartitionNexus}.
+ * Represents a call from JNDI {@link Context} to {@link PartitionNexus}.
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
* @version $Rev$, $Date$
@@ -40,7 +40,7 @@
private final String name;
private final List parameters;
private final Collection bypassed;
- private final DirectoryPartitionNexusProxy proxy;
+ private final PartitionNexusProxy proxy;
/**
@@ -49,7 +49,7 @@
* @param caller the JNDI {@link Context} that made this invocation
* @param name the name of the called method
*/
- public Invocation(DirectoryPartitionNexusProxy proxy, Context caller, String name)
+ public Invocation(PartitionNexusProxy proxy, Context caller, String name)
{
this( proxy, caller, name, null, Collections.EMPTY_SET );
}
@@ -62,7 +62,7 @@
* @param name the name of the called method
* @param parameters the array of parameters passed to the called method
*/
- public Invocation(DirectoryPartitionNexusProxy proxy, Context caller, String name, Object[] parameters)
+ public Invocation(PartitionNexusProxy proxy, Context caller, String name, Object[] parameters)
{
this( proxy, caller, name, parameters, Collections.EMPTY_SET );
}
@@ -76,7 +76,7 @@
* @param parameters the array of parameters passed to the called method
* @param bypassed the set of bypassed Interceptor names
*/
- public Invocation(DirectoryPartitionNexusProxy proxy, Context caller, String name, Object[] parameters,
+ public Invocation(PartitionNexusProxy proxy, Context caller, String name, Object[] parameters,
Collection bypassed)
{
if ( proxy == null )
@@ -121,9 +121,9 @@
/**
- * Returns the proxy object to the {@link DirectoryPartitionNexus}.
+ * Returns the proxy object to the {@link PartitionNexus}.
*/
- public DirectoryPartitionNexusProxy getProxy()
+ public PartitionNexusProxy getProxy()
{
return proxy;
}
Modified: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/jndi/AbstractContextFactory.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/jndi/AbstractContextFactory.java?rev=427156&r1=427155&r2=427156&view=diff
==============================================================================
--- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/jndi/AbstractContextFactory.java (original)
+++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/jndi/AbstractContextFactory.java Mon Jul 31 09:27:52 2006
@@ -27,13 +27,14 @@
import org.apache.directory.server.core.DirectoryService;
import org.apache.directory.server.core.DirectoryServiceListener;
-import org.apache.directory.server.core.configuration.AddDirectoryPartitionConfiguration;
+import org.apache.directory.server.core.configuration.AddPartitionConfiguration;
import org.apache.directory.server.core.configuration.Configuration;
-import org.apache.directory.server.core.configuration.RemoveDirectoryPartitionConfiguration;
+import org.apache.directory.server.core.configuration.RemovePartitionConfiguration;
import org.apache.directory.server.core.configuration.ShutdownConfiguration;
import org.apache.directory.server.core.configuration.StartupConfiguration;
import org.apache.directory.server.core.configuration.SyncConfiguration;
-import org.apache.directory.server.core.partition.DirectoryPartitionNexusProxy;
+import org.apache.directory.server.core.partition.PartitionNexusProxy;
+import org.apache.directory.shared.ldap.name.LdapDN;
/**
@@ -82,6 +83,16 @@
{
Configuration cfg = Configuration.toConfiguration( env );
env = ( Hashtable ) env.clone();
+
+ LdapDN principalDn = null;
+ if ( env.containsKey( Context.SECURITY_PRINCIPAL ) )
+ {
+ if ( env.get( Context.SECURITY_PRINCIPAL ) instanceof LdapDN )
+ {
+ principalDn = ( LdapDN ) env.get( Context.SECURITY_PRINCIPAL );
+ }
+ }
+
String principal = getPrincipal( env );
byte[] credential = getCredential( env );
String authentication = getAuthentication( env );
@@ -102,24 +113,25 @@
{
service.startup( this, env );
}
- else if ( cfg instanceof AddDirectoryPartitionConfiguration )
+ else if ( cfg instanceof AddPartitionConfiguration )
{
- new DirectoryPartitionNexusProxy( service.getJndiContext( principal, credential, authentication, "" ),
- service ).addContextPartition( ( ( AddDirectoryPartitionConfiguration ) cfg )
+ new PartitionNexusProxy(
+ service.getJndiContext( principalDn, principal, credential, authentication, "" ),
+ service ).addContextPartition( ( ( AddPartitionConfiguration ) cfg )
.getDirectoryPartitionConfiguration() );
}
- else if ( cfg instanceof RemoveDirectoryPartitionConfiguration )
+ else if ( cfg instanceof RemovePartitionConfiguration )
{
- Context ctx = service.getJndiContext( principal, credential, authentication, "" );
- DirectoryPartitionNexusProxy proxy = new DirectoryPartitionNexusProxy( ctx, service );
- proxy.removeContextPartition( ( ( RemoveDirectoryPartitionConfiguration ) cfg ).getSuffix() );
+ Context ctx = service.getJndiContext( principalDn, principal, credential, authentication, "" );
+ PartitionNexusProxy proxy = new PartitionNexusProxy( ctx, service );
+ proxy.removeContextPartition( ( ( RemovePartitionConfiguration ) cfg ).getSuffix() );
}
else if ( service == null )
{
throw new NamingException( "Unknown configuration: " + cfg );
}
- return service.getJndiContext( principal, credential, authentication, providerUrl );
+ return service.getJndiContext( principalDn, principal, credential, authentication, providerUrl );
}
Modified: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/jndi/LdapJndiProperties.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/jndi/LdapJndiProperties.java?rev=427156&r1=427155&r2=427156&view=diff
==============================================================================
--- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/jndi/LdapJndiProperties.java (original)
+++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/jndi/LdapJndiProperties.java Mon Jul 31 09:27:52 2006
@@ -190,25 +190,35 @@
// Figure out and set the security principal bindDn and saslAuthId
// -------------------------------------------------------------------
- if ( principal == null )
+ if ( env.containsKey( PropertyKeys.PARSED_BIND_DN ) )
{
- throw new LdapConfigurationException( Context.SECURITY_PRINCIPAL + " cannot be null." );
- }
-
- if ( !( principal instanceof String ) )
- {
- throw new LdapConfigurationException( "Don't know how to interpret " + principal.getClass()
- + " objects for environment property " + Context.SECURITY_PRINCIPAL );
- }
-
- if ( ( ( String ) principal ).trim().equals( "" ) )
- {
- props.bindDn = LdapDN.EMPTY_LDAPDN;
+ props.bindDn = ( LdapDN ) env.get( PropertyKeys.PARSED_BIND_DN );
}
else
{
- props.bindDn = new LdapDN( ( String ) principal );
+ if ( principal == null )
+ {
+ throw new LdapConfigurationException( Context.SECURITY_PRINCIPAL + " cannot be null." );
+ }
+
+ if ( !( principal instanceof String ) )
+ {
+ throw new LdapConfigurationException( "Don't know how to interpret " + principal.getClass()
+ + " objects for environment property " + Context.SECURITY_PRINCIPAL );
+ }
+
+ if ( ( ( String ) principal ).trim().equals( "" ) )
+ {
+ props.bindDn = LdapDN.EMPTY_LDAPDN;
+ }
+ else
+ {
+ props.bindDn = new LdapDN( ( String ) principal );
+ }
}
+
+
+
if ( env.get( SASL_AUTHID ) != null && props.level == AuthenticationLevel.STRONG )
{
Modified: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java?rev=427156&r1=427155&r2=427156&view=diff
==============================================================================
--- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java (original)
+++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java Mon Jul 31 09:27:52 2006
@@ -46,8 +46,8 @@
import org.apache.directory.server.core.DirectoryServiceConfiguration;
import org.apache.directory.server.core.authn.AuthenticationService;
import org.apache.directory.server.core.authn.LdapPrincipal;
-import org.apache.directory.server.core.partition.DirectoryPartitionNexus;
-import org.apache.directory.server.core.partition.DirectoryPartitionNexusProxy;
+import org.apache.directory.server.core.partition.PartitionNexus;
+import org.apache.directory.server.core.partition.PartitionNexusProxy;
import org.apache.directory.shared.ldap.exception.LdapNoPermissionException;
import org.apache.directory.shared.ldap.filter.ExprNode;
import org.apache.directory.shared.ldap.filter.PresenceNode;
@@ -72,7 +72,7 @@
private final DirectoryService service;
/** The interceptor proxy to the backend nexus */
- private final DirectoryPartitionNexus nexusProxy;
+ private final PartitionNexus nexusProxy;
/** The cloned environment used by this Context */
private final Hashtable env;
@@ -110,7 +110,7 @@
this.service = service;
// set references to cloned env and the proxy
- this.nexusProxy = new DirectoryPartitionNexusProxy( this, service );
+ this.nexusProxy = new PartitionNexusProxy( this, service );
DirectoryServiceConfiguration cfg = service.getConfiguration();
this.env = ( Hashtable ) cfg.getEnvironment().clone();
@@ -122,14 +122,14 @@
this.nexusProxy.bind( props.getBindDn(), props.getCredentials(), props.getAuthenticationMechanisms(), props
.getSaslAuthId() );
- if ( dn.size() == 0 )
+ if ( ! nexusProxy.hasEntry( dn ) )
{
- return;
+ throw new NameNotFoundException( dn + " does not exist" );
}
-
- if ( !nexusProxy.hasEntry( dn ) )
+
+ if ( dn.size() == 0 )
{
- throw new NameNotFoundException( dn + " does not exist" );
+ return;
}
}
@@ -149,7 +149,7 @@
this.env = ( Hashtable ) service.getConfiguration().getEnvironment().clone();
this.env.put( PROVIDER_URL, dn.toString() );
- this.nexusProxy = new DirectoryPartitionNexusProxy( this, service );
+ this.nexusProxy = new PartitionNexusProxy( this, service );
;
this.principal = principal;
}
@@ -199,7 +199,7 @@
*
* @return the proxy to the backend nexus.
*/
- protected DirectoryPartitionNexus getNexusProxy()
+ protected PartitionNexus getNexusProxy()
{
return nexusProxy;
}
@@ -228,7 +228,7 @@
Iterator list = listeners.iterator();
while ( list.hasNext() )
{
- ( ( DirectoryPartitionNexusProxy ) this.nexusProxy ).removeNamingListener( this, ( NamingListener ) list
+ ( ( PartitionNexusProxy ) this.nexusProxy ).removeNamingListener( this, ( NamingListener ) list
.next() );
}
}
@@ -757,7 +757,7 @@
ExprNode filter = new PresenceNode( "objectClass" );
SearchControls controls = new SearchControls();
controls.setSearchScope( scope );
- ( ( DirectoryPartitionNexusProxy ) this.nexusProxy ).addNamingListener( this, buildTarget( name ), filter,
+ ( ( PartitionNexusProxy ) this.nexusProxy ).addNamingListener( this, buildTarget( name ), filter,
controls, namingListener );
listeners.add( namingListener );
}
@@ -771,7 +771,7 @@
public void removeNamingListener( NamingListener namingListener ) throws NamingException
{
- ( ( DirectoryPartitionNexusProxy ) this.nexusProxy ).removeNamingListener( this, namingListener );
+ ( ( PartitionNexusProxy ) this.nexusProxy ).removeNamingListener( this, namingListener );
listeners.remove( namingListener );
}
Modified: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java?rev=427156&r1=427155&r2=427156&view=diff
==============================================================================
--- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java (original)
+++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java Mon Jul 31 09:27:52 2006
@@ -40,7 +40,7 @@
import org.apache.directory.server.core.DirectoryService;
import org.apache.directory.server.core.authn.LdapPrincipal;
-import org.apache.directory.server.core.partition.DirectoryPartitionNexusProxy;
+import org.apache.directory.server.core.partition.PartitionNexusProxy;
import org.apache.directory.shared.ldap.filter.BranchNode;
import org.apache.directory.shared.ldap.filter.ExprNode;
import org.apache.directory.shared.ldap.filter.FilterParserImpl;
@@ -643,7 +643,7 @@
throw e2;
}
- ( ( DirectoryPartitionNexusProxy ) getNexusProxy() ).addNamingListener( this, buildTarget( name ), filter,
+ ( ( PartitionNexusProxy ) getNexusProxy() ).addNamingListener( this, buildTarget( name ), filter,
searchControls, namingListener );
getListeners().add( namingListener );
}
Modified: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationService.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationService.java?rev=427156&r1=427155&r2=427156&view=diff
==============================================================================
--- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationService.java (original)
+++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationService.java Mon Jul 31 09:27:52 2006
@@ -17,6 +17,7 @@
package org.apache.directory.server.core.normalization;
+import java.util.List;
import java.util.Map;
import javax.naming.NamingEnumeration;
@@ -26,11 +27,11 @@
import javax.naming.directory.SearchControls;
import org.apache.directory.server.core.DirectoryServiceConfiguration;
-import org.apache.directory.server.core.configuration.DirectoryPartitionConfiguration;
+import org.apache.directory.server.core.configuration.PartitionConfiguration;
import org.apache.directory.server.core.configuration.InterceptorConfiguration;
import org.apache.directory.server.core.interceptor.BaseInterceptor;
import org.apache.directory.server.core.interceptor.NextInterceptor;
-import org.apache.directory.server.core.partition.DirectoryPartitionNexus;
+import org.apache.directory.server.core.partition.PartitionNexus;
import org.apache.directory.server.core.schema.AttributeTypeRegistry;
import org.apache.directory.server.core.schema.ConcreteNameComponentNormalizer;
import org.apache.directory.server.core.schema.OidRegistry;
@@ -49,7 +50,7 @@
/**
* A name normalization service. This service makes sure all relative and distinuished
* names are normalized before calls are made against the respective interface methods
- * on {@link DirectoryPartitionNexus}.
+ * on {@link PartitionNexus}.
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
* @version $Rev$
@@ -86,14 +87,14 @@
public void add(NextInterceptor nextInterceptor, LdapDN name, Attributes attrs)
throws NamingException
{
- LdapDN normalized = LdapDN.normalize( name );
+ LdapDN normalized = LdapDN.normalize( name, attributeRegistry.getNormalizerMapping() );
nextInterceptor.add( normalized, attrs );
}
public void delete( NextInterceptor nextInterceptor, LdapDN name ) throws NamingException
{
- LdapDN normalized = LdapDN.normalize( name );
+ LdapDN normalized = LdapDN.normalize( name, attributeRegistry.getNormalizerMapping() );
nextInterceptor.delete( normalized );
}
@@ -101,14 +102,14 @@
public void modify( NextInterceptor nextInterceptor, LdapDN name, int modOp, Attributes attrs )
throws NamingException
{
- LdapDN normalized = LdapDN.normalize( name );
+ LdapDN normalized = LdapDN.normalize( name, attributeRegistry.getNormalizerMapping() );
nextInterceptor.modify( normalized, modOp, attrs );
}
public void modify( NextInterceptor nextInterceptor, LdapDN name, ModificationItem[] items ) throws NamingException
{
- LdapDN normalized = LdapDN.normalize( name );
+ LdapDN normalized = LdapDN.normalize( name, attributeRegistry.getNormalizerMapping() );
nextInterceptor.modify( normalized, items );
}
@@ -116,15 +117,15 @@
public void modifyRn( NextInterceptor nextInterceptor, LdapDN name, String newRn, boolean deleteOldRn )
throws NamingException
{
- LdapDN normalized = LdapDN.normalize( name );
+ LdapDN normalized = LdapDN.normalize( name, attributeRegistry.getNormalizerMapping() );
nextInterceptor.modifyRn( normalized, newRn, deleteOldRn );
}
public void move( NextInterceptor nextInterceptor, LdapDN name, LdapDN newParentName ) throws NamingException
{
- LdapDN normalized = LdapDN.normalize( name );
- newParentName.normalize();
+ LdapDN normalized = LdapDN.normalize( name, attributeRegistry.getNormalizerMapping() );
+ newParentName.normalize( attributeRegistry.getNormalizerMapping());
nextInterceptor.move( normalized, newParentName );
}
@@ -132,8 +133,8 @@
public void move( NextInterceptor nextInterceptor, LdapDN name, LdapDN newParentName, String newRn, boolean deleteOldRn )
throws NamingException
{
- LdapDN normalized = LdapDN.normalize( name );
- newParentName.normalize();
+ LdapDN normalized = LdapDN.normalize( name, attributeRegistry.getNormalizerMapping() );
+ newParentName.normalize( attributeRegistry.getNormalizerMapping());
nextInterceptor.move( normalized, newParentName, newRn, deleteOldRn );
}
@@ -141,7 +142,7 @@
public NamingEnumeration search( NextInterceptor nextInterceptor, LdapDN base, Map env, ExprNode filter,
SearchControls searchCtls ) throws NamingException
{
- base.normalize();
+ base.normalize( attributeRegistry.getNormalizerMapping());
if ( filter.isLeaf() )
{
@@ -229,35 +230,35 @@
public boolean hasEntry( NextInterceptor nextInterceptor, LdapDN name ) throws NamingException
{
- name = LdapDN.normalize( name );
+ name = LdapDN.normalize( name, attributeRegistry.getNormalizerMapping() );
return nextInterceptor.hasEntry( name );
}
public boolean isSuffix( NextInterceptor nextInterceptor, LdapDN name ) throws NamingException
{
- name = LdapDN.normalize( name );
+ name = LdapDN.normalize( name, attributeRegistry.getNormalizerMapping() );
return nextInterceptor.isSuffix( name );
}
public NamingEnumeration list( NextInterceptor nextInterceptor, LdapDN base ) throws NamingException
{
- base = LdapDN.normalize( base );
+ base = LdapDN.normalize( base, attributeRegistry.getNormalizerMapping() );
return nextInterceptor.list( base );
}
public Attributes lookup( NextInterceptor nextInterceptor, LdapDN name ) throws NamingException
{
- name = LdapDN.normalize( name );
+ name = LdapDN.normalize( name, attributeRegistry.getNormalizerMapping() );
return nextInterceptor.lookup( name );
}
public Attributes lookup( NextInterceptor nextInterceptor, LdapDN name, String[] attrIds ) throws NamingException
{
- name = LdapDN.normalize( name );
+ name = LdapDN.normalize( name, attributeRegistry.getNormalizerMapping() );
return nextInterceptor.lookup( name, attrIds );
}
@@ -268,26 +269,34 @@
public LdapDN getMatchedName ( NextInterceptor nextInterceptor, LdapDN name ) throws NamingException
{
- name = LdapDN.normalize( name );
+ name = LdapDN.normalize( name, attributeRegistry.getNormalizerMapping() );
return nextInterceptor.getMatchedName( name );
}
public LdapDN getSuffix ( NextInterceptor nextInterceptor, LdapDN name ) throws NamingException
{
- name = LdapDN.normalize( name );
+ name = LdapDN.normalize( name, attributeRegistry.getNormalizerMapping() );
return nextInterceptor.getSuffix( name );
}
public boolean compare( NextInterceptor next, LdapDN name, String oid, Object value ) throws NamingException
{
- name = LdapDN.normalize( name );
+ name = LdapDN.normalize( name, attributeRegistry.getNormalizerMapping() );
return next.compare( name, oid, value );
}
+
+
+ public void bind( NextInterceptor next, LdapDN bindDn, byte[] credentials, List mechanisms, String saslAuthId )
+ throws NamingException
+ {
+ bindDn = LdapDN.normalize( bindDn, attributeRegistry.getNormalizerMapping() );
+ next.bind( bindDn, credentials, mechanisms, saslAuthId );
+ }
- public void addContextPartition( NextInterceptor next, DirectoryPartitionConfiguration cfg ) throws NamingException
+ public void addContextPartition( NextInterceptor next, PartitionConfiguration cfg ) throws NamingException
{
next.addContextPartition( cfg );
}
@@ -295,7 +304,7 @@
public void removeContextPartition( NextInterceptor next, LdapDN suffix ) throws NamingException
{
- suffix = LdapDN.normalize( suffix );
+ suffix = LdapDN.normalize( suffix, attributeRegistry.getNormalizerMapping() );
next.removeContextPartition( suffix );
}
}
Modified: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeService.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeService.java?rev=427156&r1=427155&r2=427156&view=diff
==============================================================================
--- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeService.java (original)
+++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeService.java Mon Jul 31 09:27:52 2006
@@ -40,7 +40,7 @@
import org.apache.directory.server.core.interceptor.NextInterceptor;
import org.apache.directory.server.core.invocation.Invocation;
import org.apache.directory.server.core.invocation.InvocationStack;
-import org.apache.directory.server.core.partition.DirectoryPartitionNexus;
+import org.apache.directory.server.core.partition.PartitionNexus;
import org.apache.directory.server.core.schema.AttributeTypeRegistry;
import org.apache.directory.shared.ldap.filter.ExprNode;
import org.apache.directory.shared.ldap.schema.AttributeType;
@@ -80,7 +80,7 @@
/**
* the root nexus of the system
*/
- private DirectoryPartitionNexus nexus;
+ private PartitionNexus nexus;
private AttributeTypeRegistry registry;
@@ -180,7 +180,7 @@
LdapDN newDn = ( LdapDN ) name.clone();
newDn.remove( name.size() - 1 );
newDn.add( newRn );
- newDn.normalize();
+ newDn.normalize( registry.getNormalizerMapping() );
nexus.modify( newDn, DirContext.REPLACE_ATTRIBUTE, attributes );
}
Modified: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeSearchResultEnumeration.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeSearchResultEnumeration.java?rev=427156&r1=427155&r2=427156&view=diff
==============================================================================
--- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeSearchResultEnumeration.java (original)
+++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeSearchResultEnumeration.java Mon Jul 31 09:27:52 2006
@@ -43,7 +43,7 @@
public class BTreeSearchResultEnumeration implements SearchResultEnumeration
{
/** Database used to lookup entries from */
- private BTreeDirectoryPartition partition = null;
+ private BTreePartition partition = null;
/** the attributes to return */
private final String[] attrIds;
/** underlying enumeration over IndexRecords */
@@ -61,7 +61,7 @@
* @param attrIds the returned attributes
* @param underlying the enumeration over IndexRecords
*/
- public BTreeSearchResultEnumeration(String[] attrIds, NamingEnumeration underlying, BTreeDirectoryPartition db,
+ public BTreeSearchResultEnumeration(String[] attrIds, NamingEnumeration underlying, BTreePartition db,
AttributeTypeRegistry registry)
{
this.partition = db;
Modified: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultOptimizer.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultOptimizer.java?rev=427156&r1=427155&r2=427156&view=diff
==============================================================================
--- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultOptimizer.java (original)
+++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultOptimizer.java Mon Jul 31 09:27:52 2006
@@ -43,7 +43,7 @@
/** the maximum size for a count Integer.MAX_VALUE as a BigInteger */
private static final BigInteger MAX = BigInteger.valueOf( Integer.MAX_VALUE );
/** the database this optimizer operates on */
- private BTreeDirectoryPartition db;
+ private BTreePartition db;
/**
@@ -51,7 +51,7 @@
*
* @param db the database this optimizer works for.
*/
- public DefaultOptimizer(BTreeDirectoryPartition db)
+ public DefaultOptimizer(BTreePartition db)
{
this.db = db;
}
Modified: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultSearchEngine.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultSearchEngine.java?rev=427156&r1=427155&r2=427156&view=diff
==============================================================================
--- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultSearchEngine.java (original)
+++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultSearchEngine.java Mon Jul 31 09:27:52 2006
@@ -45,7 +45,7 @@
/** the Optimizer used by this DefaultSearchEngine */
private final Optimizer optimizer;
/** the Database this DefaultSearchEngine operates on */
- private BTreeDirectoryPartition db;
+ private BTreePartition db;
/** Evaluator flyweight used for filter expression assertions */
private ExpressionEvaluator evaluator;
/** Enumerator flyweight that creates enumerations on filter expressions */
@@ -60,13 +60,13 @@
* Creates a DefaultSearchEngine for searching a Database without setting
* up the database.
*/
- public DefaultSearchEngine(BTreeDirectoryPartition db, ExpressionEvaluator evaluator,
- ExpressionEnumerator enumerator)
+ public DefaultSearchEngine( BTreePartition db, ExpressionEvaluator evaluator,
+ ExpressionEnumerator enumerator, Optimizer optimizer )
{
this.db = db;
this.evaluator = evaluator;
this.enumerator = enumerator;
- optimizer = new DefaultOptimizer( db );
+ this.optimizer = optimizer;
}
Modified: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ExpressionEnumerator.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ExpressionEnumerator.java?rev=427156&r1=427155&r2=427156&view=diff
==============================================================================
--- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ExpressionEnumerator.java (original)
+++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ExpressionEnumerator.java Mon Jul 31 09:27:52 2006
@@ -43,7 +43,7 @@
public class ExpressionEnumerator implements Enumerator
{
/** The database used by this enumerator */
- private BTreeDirectoryPartition db = null;
+ private BTreePartition db = null;
/** Enumerator flyweight for evaulating filter scope assertions */
private ScopeEnumerator scopeEnumerator;
/** Enumerator flyweight for evaulating filter substring assertions */
@@ -58,7 +58,7 @@
* @param db database used by this enumerator
* @param evaluator
*/
- public ExpressionEnumerator(BTreeDirectoryPartition db, AttributeTypeRegistry attributeTypeRegistry,
+ public ExpressionEnumerator(BTreePartition db, AttributeTypeRegistry attributeTypeRegistry,
ExpressionEvaluator evaluator)
{
this.db = db;
Modified: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ExpressionEvaluator.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ExpressionEvaluator.java?rev=427156&r1=427155&r2=427156&view=diff
==============================================================================
--- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ExpressionEvaluator.java (original)
+++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ExpressionEvaluator.java Mon Jul 31 09:27:52 2006
@@ -63,7 +63,7 @@
* @param oidRegistry the oid reg used for attrID to oid resolution
* @param attributeTypeRegistry the attribtype reg used for value comparison
*/
- public ExpressionEvaluator(BTreeDirectoryPartition db, OidRegistry oidRegistry,
+ public ExpressionEvaluator(BTreePartition db, OidRegistry oidRegistry,
AttributeTypeRegistry attributeTypeRegistry)
{
ScopeEvaluator scopeEvaluator = null;
Modified: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/LeafEvaluator.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/LeafEvaluator.java?rev=427156&r1=427155&r2=427156&view=diff
==============================================================================
--- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/LeafEvaluator.java (original)
+++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/LeafEvaluator.java Mon Jul 31 09:27:52 2006
@@ -55,7 +55,7 @@
private static final int SUBSTRING_MATCH = 3;
/** Database used to evaluate leaf with */
- private BTreeDirectoryPartition db;
+ private BTreePartition db;
/** Oid Registry used to translate attributeIds to OIDs */
private OidRegistry oidRegistry;
/** AttributeType registry needed for normalizing and comparing values */
@@ -73,7 +73,7 @@
* @param scopeEvaluator
* @param substringEvaluator
*/
- public LeafEvaluator(BTreeDirectoryPartition db, OidRegistry oidRegistry,
+ public LeafEvaluator(BTreePartition db, OidRegistry oidRegistry,
AttributeTypeRegistry attributeTypeRegistry, ScopeEvaluator scopeEvaluator,
SubstringEvaluator substringEvaluator)
{
Modified: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ScopeEnumerator.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ScopeEnumerator.java?rev=427156&r1=427155&r2=427156&view=diff
==============================================================================
--- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ScopeEnumerator.java (original)
+++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ScopeEnumerator.java Mon Jul 31 09:27:52 2006
@@ -37,12 +37,12 @@
public class ScopeEnumerator implements Enumerator
{
/** Database used to enumerate based on scope */
- private BTreeDirectoryPartition db = null;
+ private BTreePartition db = null;
/** Filter scope expression evaluator */
private ScopeEvaluator evaluator = null;
- public ScopeEnumerator(BTreeDirectoryPartition db, ScopeEvaluator evaluator)
+ public ScopeEnumerator(BTreePartition db, ScopeEvaluator evaluator)
{
this.db = db;
this.evaluator = evaluator;
Modified: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ScopeEvaluator.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ScopeEvaluator.java?rev=427156&r1=427155&r2=427156&view=diff
==============================================================================
--- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ScopeEvaluator.java (original)
+++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ScopeEvaluator.java Mon Jul 31 09:27:52 2006
@@ -46,7 +46,7 @@
public class ScopeEvaluator implements Evaluator
{
/** Database used to evaluate scope with */
- private BTreeDirectoryPartition db;
+ private BTreePartition db;
/**
@@ -54,7 +54,7 @@
*
* @param db the database used to evaluate scope node
*/
- public ScopeEvaluator(BTreeDirectoryPartition db)
+ public ScopeEvaluator(BTreePartition db)
{
this.db = db;
}
Modified: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/SubstringEnumerator.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/SubstringEnumerator.java?rev=427156&r1=427155&r2=427156&view=diff
==============================================================================
--- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/SubstringEnumerator.java (original)
+++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/SubstringEnumerator.java Mon Jul 31 09:27:52 2006
@@ -50,7 +50,7 @@
public class SubstringEnumerator implements Enumerator
{
/** Database used */
- private final BTreeDirectoryPartition db;
+ private final BTreePartition db;
/** Evaluator used is an Avalon dependent object */
private final SubstringEvaluator evaluator;
/** the attribute type registry */
@@ -63,7 +63,7 @@
* @param db the database
* @param evaluator a substring evaluator
*/
- public SubstringEnumerator(BTreeDirectoryPartition db, AttributeTypeRegistry attributeTypeRegistry,
+ public SubstringEnumerator(BTreePartition db, AttributeTypeRegistry attributeTypeRegistry,
SubstringEvaluator evaluator)
{
this.db = db;
Modified: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/SubstringEvaluator.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/SubstringEvaluator.java?rev=427156&r1=427155&r2=427156&view=diff
==============================================================================
--- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/SubstringEvaluator.java (original)
+++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/SubstringEvaluator.java Mon Jul 31 09:27:52 2006
@@ -43,7 +43,7 @@
public class SubstringEvaluator implements Evaluator
{
/** Database used while evaluating candidates */
- private BTreeDirectoryPartition db;
+ private BTreePartition db;
/** Oid Registry used to translate attributeIds to OIDs */
private OidRegistry oidRegistry;
/** AttributeType registry needed for normalizing and comparing values */
@@ -57,7 +57,7 @@
* @param oidRegistry the OID registry for name to OID mapping
* @param attributeTypeRegistry the attributeType registry
*/
- public SubstringEvaluator(BTreeDirectoryPartition db, OidRegistry oidRegistry,
+ public SubstringEvaluator(BTreePartition db, OidRegistry oidRegistry,
AttributeTypeRegistry attributeTypeRegistry)
{
this.db = db;
Modified: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/EntryNode.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/EntryNode.java?rev=427156&r1=427155&r2=427156&view=diff
==============================================================================
--- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/EntryNode.java (original)
+++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/EntryNode.java Mon Jul 31 09:27:52 2006
@@ -29,7 +29,7 @@
import javax.naming.directory.Attributes;
import javax.swing.tree.TreeNode;
-import org.apache.directory.server.core.partition.impl.btree.BTreeDirectoryPartition;
+import org.apache.directory.server.core.partition.impl.btree.BTreePartition;
import org.apache.directory.server.core.partition.impl.btree.IndexRecord;
import org.apache.directory.server.core.partition.impl.btree.SearchEngine;
import org.apache.directory.shared.ldap.filter.ExprNode;
@@ -44,20 +44,20 @@
*/
public class EntryNode implements TreeNode
{
- private final BTreeDirectoryPartition partition;
+ private final BTreePartition partition;
private final EntryNode parent;
private final Attributes entry;
private final ArrayList children;
private final BigInteger id;
- public EntryNode(BigInteger id, EntryNode parent, BTreeDirectoryPartition partition, Attributes entry, HashMap map)
+ public EntryNode(BigInteger id, EntryNode parent, BTreePartition partition, Attributes entry, HashMap map)
{
this( id, parent, partition, entry, map, null, null );
}
- public EntryNode(BigInteger id, EntryNode parent, BTreeDirectoryPartition db, Attributes entry, HashMap map,
+ public EntryNode(BigInteger id, EntryNode parent, BTreePartition db, Attributes entry, HashMap map,
ExprNode exprNode, SearchEngine engine)
{
this.partition = db;
Modified: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/IndexDialog.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/IndexDialog.java?rev=427156&r1=427155&r2=427156&view=diff
==============================================================================
--- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/IndexDialog.java (original)
+++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/IndexDialog.java Mon Jul 31 09:27:52 2006
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2006 The Apache Software Foundation
+ *
+ * Licensed 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.partition.impl.btree.gui;
Modified: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/PartitionFrame.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/PartitionFrame.java?rev=427156&r1=427155&r2=427156&view=diff
==============================================================================
--- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/PartitionFrame.java (original)
+++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/PartitionFrame.java Mon Jul 31 09:27:52 2006
@@ -59,7 +59,7 @@
import javax.swing.tree.TreeNode;
import javax.swing.tree.TreePath;
-import org.apache.directory.server.core.partition.impl.btree.BTreeDirectoryPartition;
+import org.apache.directory.server.core.partition.impl.btree.BTreePartition;
import org.apache.directory.server.core.partition.impl.btree.Index;
import org.apache.directory.server.core.partition.impl.btree.IndexRecord;
import org.apache.directory.server.core.partition.impl.btree.SearchEngine;
@@ -109,7 +109,7 @@
private JMenu indices = new JMenu();
// Non Swing Stuff
- private BTreeDirectoryPartition partition = null;
+ private BTreePartition partition = null;
private boolean doCleanUp = false;
private HashMap nodes = new HashMap();
private EntryNode root = null;
@@ -119,7 +119,7 @@
/**
* Creates new form JFrame
*/
- public PartitionFrame(BTreeDirectoryPartition db, SearchEngine eng) throws NamingException
+ public PartitionFrame(BTreePartition db, SearchEngine eng) throws NamingException
{
partition = db;
this.eng = eng;
@@ -802,7 +802,7 @@
}
- public void buildIndicesMenu( BTreeDirectoryPartition partition )
+ public void buildIndicesMenu( BTreePartition partition )
{
JMenuItem item = null;
Modified: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/PartitionViewer.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/PartitionViewer.java?rev=427156&r1=427155&r2=427156&view=diff
==============================================================================
--- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/PartitionViewer.java (original)
+++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/PartitionViewer.java Mon Jul 31 09:27:52 2006
@@ -22,7 +22,7 @@
import javax.naming.NamingException;
-import org.apache.directory.server.core.partition.impl.btree.BTreeDirectoryPartition;
+import org.apache.directory.server.core.partition.impl.btree.BTreePartition;
import org.apache.directory.server.core.partition.impl.btree.SearchEngine;
import org.slf4j.Logger;
@@ -40,11 +40,11 @@
private static final Logger log = LoggerFactory.getLogger( PartitionViewer.class );
/** A handle on the atomic partition */
- private BTreeDirectoryPartition partition;
+ private BTreePartition partition;
private SearchEngine eng;
- public PartitionViewer(BTreeDirectoryPartition db, SearchEngine eng)
+ public PartitionViewer(BTreePartition db, SearchEngine eng)
{
this.partition = db;
this.eng = eng;
Modified: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java?rev=427156&r1=427155&r2=427156&view=diff
==============================================================================
--- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java (original)
+++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java Mon Jul 31 09:27:52 2006
@@ -82,27 +82,27 @@
* @param recMan the record manager
* @throws NamingException if we fail to create B+Trees using recMan
*/
- public JdbmIndex( AttributeType attribute, RecordManager recMan ) throws NamingException
- {
- this.attribute = attribute;
- keyCache = new SynchronizedLRUMap( 1000 );
- this.recMan = recMan;
- initTables();
- }
+// public JdbmIndex( AttributeType attribute, RecordManager recMan ) throws NamingException
+// {
+// this.attribute = attribute;
+// keyCache = new SynchronizedLRUMap( 1000 );
+// this.recMan = recMan;
+// initTables();
+// }
- public JdbmIndex( AttributeType attribute, File wkDirPath ) throws NamingException
+ public JdbmIndex( AttributeType attribute, File wkDirPath, int cacheSize ) throws NamingException
{
File file = new File( wkDirPath.getPath() + File.separator + attribute.getName() );
this.attribute = attribute;
- keyCache = new SynchronizedLRUMap( 1000 );
+ keyCache = new SynchronizedLRUMap( cacheSize );
try
{
String path = file.getAbsolutePath();
BaseRecordManager base = new BaseRecordManager( path );
base.disableTransactions();
- recMan = new CacheRecordManager( base, new MRU( 1000 ) );
+ recMan = new CacheRecordManager( base, new MRU( cacheSize ) );
}
catch ( IOException e )
{
Modified: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTable.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTable.java?rev=427156&r1=427155&r2=427156&view=diff
==============================================================================
--- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTable.java (original)
+++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTable.java Mon Jul 31 09:27:52 2006
@@ -87,7 +87,7 @@
* @param comparator a tuple comparator
* @throws NamingException if the table's file cannot be created
*/
- public JdbmTable(String name, boolean allowsDuplicates, RecordManager manager, TupleComparator comparator)
+ public JdbmTable( String name, boolean allowsDuplicates, RecordManager manager, TupleComparator comparator )
throws NamingException
{
this.name = name;
@@ -148,7 +148,7 @@
* @param keyComparator a tuple comparator
* @throws NamingException if the table's file cannot be created
*/
- public JdbmTable(String name, RecordManager manager, SerializableComparator keyComparator) throws NamingException
+ public JdbmTable( String name, RecordManager manager, SerializableComparator keyComparator ) throws NamingException
{
this( name, false, manager, new KeyOnlyComparator( keyComparator ) );
}
Modified: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/referral/ReferralService.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/referral/ReferralService.java?rev=427156&r1=427155&r2=427156&view=diff
==============================================================================
--- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/referral/ReferralService.java (original)
+++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/referral/ReferralService.java Mon Jul 31 09:27:52 2006
@@ -38,7 +38,7 @@
import org.apache.directory.server.core.DirectoryServiceConfiguration;
import org.apache.directory.server.core.ServerUtils;
-import org.apache.directory.server.core.configuration.DirectoryPartitionConfiguration;
+import org.apache.directory.server.core.configuration.PartitionConfiguration;
import org.apache.directory.server.core.configuration.InterceptorConfiguration;
import org.apache.directory.server.core.enumeration.ReferralHandlingEnumeration;
import org.apache.directory.server.core.enumeration.SearchResultFilter;
@@ -48,9 +48,9 @@
import org.apache.directory.server.core.invocation.Invocation;
import org.apache.directory.server.core.invocation.InvocationStack;
import org.apache.directory.server.core.jndi.ServerLdapContext;
-import org.apache.directory.server.core.partition.DirectoryPartition;
-import org.apache.directory.server.core.partition.DirectoryPartitionNexus;
-import org.apache.directory.server.core.partition.DirectoryPartitionNexusProxy;
+import org.apache.directory.server.core.partition.Partition;
+import org.apache.directory.server.core.partition.PartitionNexus;
+import org.apache.directory.server.core.partition.PartitionNexusProxy;
import org.apache.directory.server.core.schema.AttributeTypeRegistry;
import org.apache.directory.server.core.schema.OidRegistry;
@@ -92,7 +92,7 @@
private static final String REF_ATTR = "ref";
private ReferralLut lut = new ReferralLut();
- private DirectoryPartitionNexus nexus;
+ private PartitionNexus nexus;
private Hashtable env;
private AttributeTypeRegistry attrRegistry;
private OidRegistry oidRegistry;
@@ -201,7 +201,7 @@
}
LdapDN urlDn = new LdapDN( ldapUrl.getDn().toNormName() );
- urlDn.normalize();
+ urlDn.normalize( attrRegistry.getNormalizerMapping() );
if ( urlDn.equals( farthest ) )
{
// according to the protocol there is no need for the dn since it is the same as this request
@@ -240,7 +240,7 @@
buf.append( ldapUrl.getPort() );
}
buf.append( "/" );
- buf.append( urlDn.toUpName() );
+ buf.append( urlDn.getUpName() );
list.add( buf.toString() );
}
LdapReferralException lre = new LdapReferralException( list );
@@ -278,10 +278,10 @@
return;
}
- Attributes referral = invocation.getProxy().lookup( farthest, DirectoryPartitionNexusProxy.LOOKUP_BYPASS );
+ Attributes referral = invocation.getProxy().lookup( farthest, PartitionNexusProxy.LOOKUP_BYPASS );
AttributeType refsType = attrRegistry.lookup( oidRegistry.getOid( REF_ATTR ) );
Attribute refs = ServerUtils.getAttribute( refsType, referral );
- doReferralException( farthest, new LdapDN( normName.toUpName() ), refs );
+ doReferralException( farthest, new LdapDN( normName.getUpName() ), refs );
}
else if ( refval.equals( FOLLOW ) )
{
@@ -315,9 +315,9 @@
return next.compare( normName, oid, value );
}
- Attributes referral = invocation.getProxy().lookup( farthest, DirectoryPartitionNexusProxy.LOOKUP_BYPASS );
+ Attributes referral = invocation.getProxy().lookup( farthest, PartitionNexusProxy.LOOKUP_BYPASS );
Attribute refs = referral.get( REF_ATTR );
- doReferralException( farthest, new LdapDN( normName.toUpName() ), refs );
+ doReferralException( farthest, new LdapDN( normName.getUpName() ), refs );
// we really can't get here since doReferralException will throw an exception
return false;
@@ -364,9 +364,9 @@
return;
}
- Attributes referral = invocation.getProxy().lookup( farthest, DirectoryPartitionNexusProxy.LOOKUP_BYPASS );
+ Attributes referral = invocation.getProxy().lookup( farthest, PartitionNexusProxy.LOOKUP_BYPASS );
Attribute refs = referral.get( REF_ATTR );
- doReferralException( farthest, new LdapDN( normName.toUpName() ), refs );
+ doReferralException( farthest, new LdapDN( normName.getUpName() ), refs );
}
else if ( refval.equals( FOLLOW ) )
{
@@ -430,9 +430,9 @@
else if ( farthestSrc != null )
{
Attributes referral = invocation.getProxy().lookup( farthestSrc,
- DirectoryPartitionNexusProxy.LOOKUP_BYPASS );
+ PartitionNexusProxy.LOOKUP_BYPASS );
Attribute refs = referral.get( REF_ATTR );
- doReferralException( farthestSrc, new LdapDN( oldName.toUpName() ), refs );
+ doReferralException( farthestSrc, new LdapDN( oldName.getUpName() ), refs );
}
else if ( farthestDst != null )
{
@@ -497,9 +497,9 @@
else if ( farthestSrc != null )
{
Attributes referral = invocation.getProxy().lookup( farthestSrc,
- DirectoryPartitionNexusProxy.LOOKUP_BYPASS );
+ PartitionNexusProxy.LOOKUP_BYPASS );
Attribute refs = referral.get( REF_ATTR );
- doReferralException( farthestSrc, new LdapDN( oldName.toUpName() ), refs );
+ doReferralException( farthestSrc, new LdapDN( oldName.getUpName() ), refs );
}
else if ( farthestDst != null )
{
@@ -538,7 +538,7 @@
newName.remove( oldName.size() - 1 );
LdapDN newRdnName = new LdapDN( newRdn );
- newRdnName.normalize();
+ newRdnName.normalize( attrRegistry.getNormalizerMapping() );
newName.add( newRdnName.toNormName() );
// handle a normal modify without following referrals
@@ -568,9 +568,9 @@
if ( farthestSrc != null )
{
Attributes referral = invocation.getProxy().lookup( farthestSrc,
- DirectoryPartitionNexusProxy.LOOKUP_BYPASS );
+ PartitionNexusProxy.LOOKUP_BYPASS );
Attribute refs = referral.get( REF_ATTR );
- doReferralException( farthestSrc, new LdapDN( oldName.toUpName() ), refs );
+ doReferralException( farthestSrc, new LdapDN( oldName.getUpName() ), refs );
}
else if ( farthestDst != null )
{
@@ -681,9 +681,9 @@
return;
}
- Attributes referral = invocation.getProxy().lookup( farthest, DirectoryPartitionNexusProxy.LOOKUP_BYPASS );
+ Attributes referral = invocation.getProxy().lookup( farthest, PartitionNexusProxy.LOOKUP_BYPASS );
Attribute refs = referral.get( REF_ATTR );
- doReferralException( farthest, new LdapDN( name.toUpName() ), refs );
+ doReferralException( farthest, new LdapDN( name.getUpName() ), refs );
}
else if ( refval.equals( FOLLOW ) )
{
@@ -785,9 +785,9 @@
return;
}
- Attributes referral = invocation.getProxy().lookup( farthest, DirectoryPartitionNexusProxy.LOOKUP_BYPASS );
+ Attributes referral = invocation.getProxy().lookup( farthest, PartitionNexusProxy.LOOKUP_BYPASS );
Attribute refs = referral.get( REF_ATTR );
- doReferralException( farthest, new LdapDN( name.toUpName() ), refs );
+ doReferralException( farthest, new LdapDN( name.getUpName() ), refs );
}
else if ( refval.equals( FOLLOW ) )
{
@@ -816,12 +816,12 @@
}
- public void addContextPartition( NextInterceptor next, DirectoryPartitionConfiguration cfg ) throws NamingException
+ public void addContextPartition( NextInterceptor next, PartitionConfiguration cfg ) throws NamingException
{
next.addContextPartition( cfg );
// add referrals immediately after adding the new partition
- DirectoryPartition partition = cfg.getContextPartition();
+ Partition partition = cfg.getContextPartition();
LdapDN suffix = partition.getSuffix();
Invocation invocation = InvocationStack.getInstance().peek();
NamingEnumeration list = invocation.getProxy().search( suffix, env, getReferralFilter(), getControls(),
@@ -850,7 +850,7 @@
LdapDN referral = null;
LdapDN result = new LdapDN( r.getName() );
//result = LdapDN.normalize( result, registry.getNormalizerMapping() );
- result.normalize();
+ result.normalize( attrRegistry.getNormalizerMapping() );
if ( r.isRelative() )
{
@@ -872,7 +872,7 @@
SearchResult r = ( SearchResult ) referrals.next();
LdapDN referral = null;
LdapDN result = new LdapDN( r.getName() );
- result.normalize();
+ result.normalize( attrRegistry.getNormalizerMapping() );
if ( r.isRelative() )
{
@@ -909,7 +909,7 @@
{
if ( lut.isReferral( base ) )
{
- Attributes referral = invocation.getProxy().lookup( base, DirectoryPartitionNexusProxy.LOOKUP_BYPASS );
+ Attributes referral = invocation.getProxy().lookup( base, PartitionNexusProxy.LOOKUP_BYPASS );
Attribute refs = referral.get( REF_ATTR );
doReferralExceptionOnSearchBase( base, refs, controls.getSearchScope() );
}
@@ -920,16 +920,16 @@
return next.search( base, env, filter, controls );
}
- Attributes referral = invocation.getProxy().lookup( farthest, DirectoryPartitionNexusProxy.LOOKUP_BYPASS );
+ Attributes referral = invocation.getProxy().lookup( farthest, PartitionNexusProxy.LOOKUP_BYPASS );
Attribute refs = referral.get( REF_ATTR );
- doReferralExceptionOnSearchBase( farthest, new LdapDN( base.toUpName() ), refs, controls.getSearchScope() );
+ doReferralExceptionOnSearchBase( farthest, new LdapDN( base.getUpName() ), refs, controls.getSearchScope() );
throw new IllegalStateException( "Should never get here: shutting up compiler" );
}
if ( refval.equals( THROW ) )
{
if ( lut.isReferral( base ) )
{
- Attributes referral = invocation.getProxy().lookup( base, DirectoryPartitionNexusProxy.LOOKUP_BYPASS );
+ Attributes referral = invocation.getProxy().lookup( base, PartitionNexusProxy.LOOKUP_BYPASS );
Attribute refs = referral.get( REF_ATTR );
doReferralExceptionOnSearchBase( base, refs, controls.getSearchScope() );
}
@@ -942,9 +942,9 @@
return new ReferralHandlingEnumeration( srfe, lut, attrRegistry, nexus, controls.getSearchScope(), true );
}
- Attributes referral = invocation.getProxy().lookup( farthest, DirectoryPartitionNexusProxy.LOOKUP_BYPASS );
+ Attributes referral = invocation.getProxy().lookup( farthest, PartitionNexusProxy.LOOKUP_BYPASS );
Attribute refs = referral.get( REF_ATTR );
- doReferralExceptionOnSearchBase( farthest, new LdapDN( base.toUpName() ), refs, controls.getSearchScope() );
+ doReferralExceptionOnSearchBase( farthest, new LdapDN( base.getUpName() ), refs, controls.getSearchScope() );
throw new IllegalStateException( "Should never get here: shutting up compiler" );
}
else if ( refval.equals( FOLLOW ) )
@@ -1056,7 +1056,7 @@
}
LdapDN urlDn = new LdapDN( ldapUrl.getDn().toNormName() );
- urlDn.normalize();
+ urlDn.normalize( attrRegistry.getNormalizerMapping() );
int diff = targetUpdn.size() - farthest.size();
LdapDN extra = new LdapDN();
for ( int jj = 0; jj < diff; jj++ )
@@ -1074,7 +1074,7 @@
buf.append( ldapUrl.getPort() );
}
buf.append( "/" );
- buf.append( urlDn.toUpName() );
+ buf.append( urlDn.getUpName() );
buf.append( "??" );
switch ( scope )
@@ -1106,7 +1106,7 @@
}
LdapDN dn = new LdapDN( name );
- dn.normalize();
+ dn.normalize( attrRegistry.getNormalizerMapping() );
if ( lut.isReferral( dn ) )
{
Modified: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/schema/DnComparator.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/schema/DnComparator.java?rev=427156&r1=427155&r2=427156&view=diff
==============================================================================
--- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/schema/DnComparator.java (original)
+++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/schema/DnComparator.java Mon Jul 31 09:27:52 2006
@@ -67,17 +67,17 @@
LdapDN dn = null;
if ( obj instanceof LdapDN )
{
- dn = LdapDN.normalize( ( LdapDN ) obj );
+ dn = LdapDN.normalize( ( LdapDN ) obj, attrRegistry.getNormalizerMapping() );
}
else if ( obj instanceof Name )
{
dn = new LdapDN( ( Name ) obj );
- dn.normalize();
+ dn.normalize( attrRegistry.getNormalizerMapping() );
}
else if ( obj instanceof String )
{
dn = new LdapDN( ( String ) obj );
- dn.normalize();
+ dn.normalize( attrRegistry.getNormalizerMapping() );
}
else
{
Modified: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/schema/DnNormalizer.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/schema/DnNormalizer.java?rev=427156&r1=427155&r2=427156&view=diff
==============================================================================
--- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/schema/DnNormalizer.java (original)
+++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/schema/DnNormalizer.java Mon Jul 31 09:27:52 2006
@@ -58,7 +58,7 @@
dn = new LdapDN( ( String ) value );
}
- dn.normalize();
+ dn.normalize( attrRegistry.getNormalizerMapping() );
return dn;
}
}
Modified: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/schema/GlobalOidRegistry.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/schema/GlobalOidRegistry.java?rev=427156&r1=427155&r2=427156&view=diff
==============================================================================
--- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/schema/GlobalOidRegistry.java (original)
+++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/schema/GlobalOidRegistry.java Mon Jul 31 09:27:52 2006
@@ -27,6 +27,7 @@
import javax.naming.NamingException;
import org.apache.directory.server.core.schema.bootstrap.BootstrapOidRegistry;
+import org.apache.directory.shared.ldap.util.StringTools;
/**
@@ -100,18 +101,18 @@
*/
public String getOid( String name ) throws NamingException
{
- if ( name == null )
+ if ( StringTools.isEmpty( name ) )
{
- throw new NamingException( "name should not be null" );
+ throw new NamingException( "name should not be empty" );
}
/* If name is an OID than we return it back since inherently the
* OID is another name for the object referred to by OID and the
* caller does not know that the argument is an OID String.
*/
- if ( Character.isDigit( name.charAt( 0 ) ) )
+ if ( StringTools.isDigit( name.charAt( 0 ) ) )
{
- monitor.getOidWithOid( name );
+ //monitor.getOidWithOid( name );
return name;
}