Modified: directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java?rev=411860&r1=411859&r2=411860&view=diff
==============================================================================
--- directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java (original)
+++ directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java Mon Jun 5 10:15:23 2006
@@ -20,7 +20,6 @@
import java.util.*;
import javax.naming.ConfigurationException;
-import javax.naming.Name;
import javax.naming.NamingEnumeration;
import javax.naming.NamingException;
import javax.naming.directory.Attributes;
@@ -68,7 +67,7 @@
}
- public boolean compare( NextInterceptor next, Name name, String oid, Object value ) throws NamingException
+ public boolean compare( NextInterceptor next, LdapDN name, String oid, Object value ) throws NamingException
{
return nexus.compare( name, oid, value );
}
@@ -80,21 +79,21 @@
}
- public Name getMatchedName( NextInterceptor next, Name dn, boolean normalized ) throws NamingException
+ public LdapDN getMatchedName ( NextInterceptor next, LdapDN dn ) throws NamingException
{
- return ( Name ) nexus.getMatchedName( dn, normalized ).clone();
+ return ( LdapDN ) nexus.getMatchedName( dn ).clone();
}
- public Name getSuffix( NextInterceptor next, Name dn, boolean normalized ) throws NamingException
+ public LdapDN getSuffix ( NextInterceptor next, LdapDN dn ) throws NamingException
{
- return ( Name ) nexus.getSuffix( dn, normalized ).clone();
+ return ( LdapDN ) nexus.getSuffix( dn ).clone();
}
- public Iterator listSuffixes( NextInterceptor next, boolean normalized ) throws NamingException
+ public Iterator listSuffixes ( NextInterceptor next ) throws NamingException
{
- return nexus.listSuffixes( normalized );
+ return nexus.listSuffixes();
}
@@ -122,38 +121,38 @@
}
- public NamingEnumeration list( NextInterceptor next, Name base ) throws NamingException
+ public NamingEnumeration list( NextInterceptor next, LdapDN base ) throws NamingException
{
return nexus.list( base );
}
- public NamingEnumeration search( NextInterceptor next, Name base, Map env, ExprNode filter,
+ public NamingEnumeration search( NextInterceptor next, LdapDN base, Map env, ExprNode filter,
SearchControls searchCtls ) throws NamingException
{
return nexus.search( base, env, filter, searchCtls );
}
- public Attributes lookup( NextInterceptor next, Name name ) throws NamingException
+ public Attributes lookup( NextInterceptor next, LdapDN name ) throws NamingException
{
return ( Attributes ) nexus.lookup( name ).clone();
}
- public Attributes lookup( NextInterceptor next, Name dn, String[] attrIds ) throws NamingException
+ public Attributes lookup( NextInterceptor next, LdapDN dn, String[] attrIds ) throws NamingException
{
return ( Attributes ) nexus.lookup( dn, attrIds ).clone();
}
- public boolean hasEntry( NextInterceptor next, Name name ) throws NamingException
+ public boolean hasEntry( NextInterceptor next, LdapDN name ) throws NamingException
{
return nexus.hasEntry( name );
}
- public boolean isSuffix( NextInterceptor next, Name name ) throws NamingException
+ public boolean isSuffix( NextInterceptor next, LdapDN name ) throws NamingException
{
return nexus.isSuffix( name );
}
@@ -186,20 +185,20 @@
}
- public void removeContextPartition( NextInterceptor next, Name suffix ) throws NamingException
+ public void removeContextPartition( NextInterceptor next, LdapDN suffix ) throws NamingException
{
nexus.removeContextPartition( suffix );
}
- public void bind( NextInterceptor next, Name bindDn, byte[] credentials, List mechanisms, String saslAuthId )
+ public void bind( NextInterceptor next, LdapDN bindDn, byte[] credentials, List mechanisms, String saslAuthId )
throws NamingException
{
nexus.bind( bindDn, credentials, mechanisms, saslAuthId );
}
- public void unbind( NextInterceptor next, Name bindDn ) throws NamingException
+ public void unbind( NextInterceptor next, LdapDN bindDn ) throws NamingException
{
nexus.unbind( bindDn );
}
@@ -545,14 +544,14 @@
}
- public Name getMatchedName( Name name, boolean normalized ) throws NamingException
+ public LdapDN getMatchedName( LdapDN name ) throws NamingException
{
Entry entry = getStartingEntry();
Interceptor head = entry.configuration.getInterceptor();
NextInterceptor next = entry.nextInterceptor;
try
{
- return head.getMatchedName( next, name, normalized );
+ return head.getMatchedName( next, name );
}
catch ( NamingException ne )
{
@@ -566,14 +565,14 @@
}
- public Name getSuffix( Name name, boolean normalized ) throws NamingException
+ public LdapDN getSuffix ( LdapDN name ) throws NamingException
{
Entry entry = getStartingEntry();
Interceptor head = entry.configuration.getInterceptor();
NextInterceptor next = entry.nextInterceptor;
try
{
- return head.getSuffix( next, name, normalized );
+ return head.getSuffix( next, name );
}
catch ( NamingException ne )
{
@@ -587,7 +586,7 @@
}
- public boolean compare( Name name, String oid, Object value ) throws NamingException
+ public boolean compare( LdapDN name, String oid, Object value ) throws NamingException
{
Entry entry = getStartingEntry();
Interceptor head = entry.configuration.getInterceptor();
@@ -608,14 +607,14 @@
}
- public Iterator listSuffixes( boolean normalized ) throws NamingException
+ public Iterator listSuffixes() throws NamingException
{
Entry entry = getStartingEntry();
Interceptor head = entry.configuration.getInterceptor();
NextInterceptor next = entry.nextInterceptor;
try
{
- return head.listSuffixes( next, normalized );
+ return head.listSuffixes( next );
}
catch ( NamingException ne )
{
@@ -650,7 +649,7 @@
}
- public void removeContextPartition( Name suffix ) throws NamingException
+ public void removeContextPartition( LdapDN suffix ) throws NamingException
{
Entry entry = getStartingEntry();
Interceptor head = entry.configuration.getInterceptor();
@@ -711,7 +710,7 @@
}
- public void bind( Name bindDn, byte[] credentials, List mechanisms, String saslAuthId ) throws NamingException
+ public void bind( LdapDN bindDn, byte[] credentials, List mechanisms, String saslAuthId ) throws NamingException
{
Entry node = getStartingEntry();
Interceptor head = node.configuration.getInterceptor();
@@ -731,7 +730,7 @@
}
- public void unbind( Name bindDn ) throws NamingException
+ public void unbind( LdapDN bindDn ) throws NamingException
{
Entry node = getStartingEntry();
Interceptor head = node.configuration.getInterceptor();
@@ -791,7 +790,7 @@
}
- public NamingEnumeration list( Name base ) throws NamingException
+ public NamingEnumeration list( LdapDN base ) throws NamingException
{
Entry entry = getStartingEntry();
Interceptor head = entry.configuration.getInterceptor();
@@ -812,7 +811,7 @@
}
- public NamingEnumeration search( Name base, Map env, ExprNode filter, SearchControls searchCtls )
+ public NamingEnumeration search( LdapDN base, Map env, ExprNode filter, SearchControls searchCtls )
throws NamingException
{
Entry entry = getStartingEntry();
@@ -834,7 +833,7 @@
}
- public Attributes lookup( Name name ) throws NamingException
+ public Attributes lookup( LdapDN name ) throws NamingException
{
Entry entry = getStartingEntry();
Interceptor head = entry.configuration.getInterceptor();
@@ -855,7 +854,7 @@
}
- public Attributes lookup( Name dn, String[] attrIds ) throws NamingException
+ public Attributes lookup( LdapDN dn, String[] attrIds ) throws NamingException
{
Entry entry = getStartingEntry();
Interceptor head = entry.configuration.getInterceptor();
@@ -876,7 +875,7 @@
}
- public boolean hasEntry( Name name ) throws NamingException
+ public boolean hasEntry( LdapDN name ) throws NamingException
{
Entry entry = getStartingEntry();
Interceptor head = entry.configuration.getInterceptor();
@@ -897,7 +896,7 @@
}
- public boolean isSuffix( Name name ) throws NamingException
+ public boolean isSuffix( LdapDN name ) throws NamingException
{
Entry entry = getStartingEntry();
Interceptor head = entry.configuration.getInterceptor();
@@ -1041,7 +1040,7 @@
}
- public boolean compare( Name name, String oid, Object value ) throws NamingException
+ public boolean compare( LdapDN name, String oid, Object value ) throws NamingException
{
Entry next = getNextEntry();
Interceptor interceptor = next.configuration.getInterceptor();
@@ -1083,14 +1082,14 @@
}
- public Name getMatchedName( Name dn, boolean normalized ) throws NamingException
+ public LdapDN getMatchedName ( LdapDN dn ) throws NamingException
{
Entry next = getNextEntry();
Interceptor interceptor = next.configuration.getInterceptor();
try
{
- return interceptor.getMatchedName( next.nextInterceptor, dn, normalized );
+ return interceptor.getMatchedName( next.nextInterceptor, dn );
}
catch ( NamingException ne )
{
@@ -1104,14 +1103,14 @@
}
- public Name getSuffix( Name dn, boolean normalized ) throws NamingException
+ public LdapDN getSuffix ( LdapDN dn ) throws NamingException
{
Entry next = getNextEntry();
Interceptor interceptor = next.configuration.getInterceptor();
try
{
- return interceptor.getSuffix( next.nextInterceptor, dn, normalized );
+ return interceptor.getSuffix( next.nextInterceptor, dn );
}
catch ( NamingException ne )
{
@@ -1125,14 +1124,14 @@
}
- public Iterator listSuffixes( boolean normalized ) throws NamingException
+ public Iterator listSuffixes () throws NamingException
{
Entry next = getNextEntry();
Interceptor interceptor = next.configuration.getInterceptor();
try
{
- return interceptor.listSuffixes( next.nextInterceptor, normalized );
+ return interceptor.listSuffixes( next.nextInterceptor );
}
catch ( NamingException ne )
{
@@ -1226,7 +1225,7 @@
}
- public NamingEnumeration list( Name base ) throws NamingException
+ public NamingEnumeration list( LdapDN base ) throws NamingException
{
Entry next = getNextEntry();
Interceptor interceptor = next.configuration.getInterceptor();
@@ -1247,7 +1246,7 @@
}
- public NamingEnumeration search( Name base, Map env, ExprNode filter, SearchControls searchCtls )
+ public NamingEnumeration search( LdapDN base, Map env, ExprNode filter, SearchControls searchCtls )
throws NamingException
{
Entry next = getNextEntry();
@@ -1269,7 +1268,7 @@
}
- public Attributes lookup( Name name ) throws NamingException
+ public Attributes lookup( LdapDN name ) throws NamingException
{
Entry next = getNextEntry();
Interceptor interceptor = next.configuration.getInterceptor();
@@ -1290,7 +1289,7 @@
}
- public Attributes lookup( Name dn, String[] attrIds ) throws NamingException
+ public Attributes lookup( LdapDN dn, String[] attrIds ) throws NamingException
{
Entry next = getNextEntry();
Interceptor interceptor = next.configuration.getInterceptor();
@@ -1311,7 +1310,7 @@
}
- public boolean hasEntry( Name name ) throws NamingException
+ public boolean hasEntry( LdapDN name ) throws NamingException
{
Entry next = getNextEntry();
Interceptor interceptor = next.configuration.getInterceptor();
@@ -1332,7 +1331,7 @@
}
- public boolean isSuffix( Name name ) throws NamingException
+ public boolean isSuffix( LdapDN name ) throws NamingException
{
Entry next = getNextEntry();
Interceptor interceptor = next.configuration.getInterceptor();
@@ -1414,7 +1413,7 @@
}
- public void bind( Name bindDn, byte[] credentials, List mechanisms, String saslAuthId )
+ public void bind( LdapDN bindDn, byte[] credentials, List mechanisms, String saslAuthId )
throws NamingException
{
Entry next = getNextEntry();
@@ -1435,7 +1434,7 @@
}
- public void unbind( Name bindDn ) throws NamingException
+ public void unbind( LdapDN bindDn ) throws NamingException
{
Entry next = getNextEntry();
Interceptor interceptor = next.configuration.getInterceptor();
@@ -1476,7 +1475,7 @@
}
- public void removeContextPartition( Name suffix ) throws NamingException
+ public void removeContextPartition( LdapDN suffix ) throws NamingException
{
Entry next = getNextEntry();
Interceptor interceptor = next.configuration.getInterceptor();
Modified: directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/interceptor/NextInterceptor.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/interceptor/NextInterceptor.java?rev=411860&r1=411859&r2=411860&view=diff
==============================================================================
--- directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/interceptor/NextInterceptor.java (original)
+++ directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/interceptor/NextInterceptor.java Mon Jun 5 10:15:23 2006
@@ -21,7 +21,6 @@
import java.util.List;
import java.util.Map;
-import javax.naming.Name;
import javax.naming.NamingEnumeration;
import javax.naming.NamingException;
import javax.naming.directory.Attributes;
@@ -45,9 +44,9 @@
public interface NextInterceptor
{
/**
- * Calls the next interceptor's {@link Interceptor#compare(NextInterceptor,Name,String,Object)}.
+ * Calls the next interceptor's {@link Interceptor#compare(NextInterceptor,org.apache.directory.shared.ldap.name.LdapDN,String,Object)}.
*/
- boolean compare( Name name, String oid, Object value ) throws NamingException;
+ boolean compare( LdapDN name, String oid, Object value ) throws NamingException;
/**
@@ -57,21 +56,21 @@
/**
- * Calls the next interceptor's {@link Interceptor#getMatchedName(NextInterceptor, Name, boolean)}.
+ * Calls the next interceptor's {@link Interceptor#getMatchedName(NextInterceptor,org.apache.directory.shared.ldap.name.LdapDN)}.
*/
- Name getMatchedName( Name name, boolean normalized ) throws NamingException;
+ LdapDN getMatchedName ( LdapDN name ) throws NamingException;
/**
- * Calls the next interceptor's {@link Interceptor#getSuffix(NextInterceptor, Name, boolean)}.
+ * Calls the next interceptor's {@link Interceptor#getSuffix(NextInterceptor,org.apache.directory.shared.ldap.name.LdapDN)}.
*/
- Name getSuffix( Name name, boolean normalized ) throws NamingException;
+ LdapDN getSuffix ( LdapDN name ) throws NamingException;
/**
- * Calls the next interceptor's {@link Interceptor#listSuffixes(NextInterceptor, boolean)}.
+ * Calls the next interceptor's {@link Interceptor#listSuffixes(NextInterceptor)}.
*/
- Iterator listSuffixes( boolean normalized ) throws NamingException;
+ Iterator listSuffixes () throws NamingException;
/**
@@ -81,9 +80,9 @@
/**
- * Calls the next interceptor's {@link DirectoryPartitionNexus#removeContextPartition(Name)}.
+ * Calls the next interceptor's {@link DirectoryPartitionNexus#removeContextPartition(org.apache.directory.shared.ldap.name.LdapDN)}.
*/
- void removeContextPartition( Name suffix ) throws NamingException;
+ void removeContextPartition( LdapDN suffix ) throws NamingException;
/**
@@ -111,40 +110,40 @@
/**
- * Calls the next interceptor's {@link Interceptor#list(NextInterceptor, Name)}.
+ * Calls the next interceptor's {@link Interceptor#list(NextInterceptor,org.apache.directory.shared.ldap.name.LdapDN)}.
*/
- NamingEnumeration list( Name baseName ) throws NamingException;
+ NamingEnumeration list( LdapDN baseName ) throws NamingException;
/**
- * Calls the next interceptor's {@link Interceptor#search(NextInterceptor, Name, Map, ExprNode, SearchControls)}.
+ * Calls the next interceptor's {@link Interceptor#search(NextInterceptor,org.apache.directory.shared.ldap.name.LdapDN,java.util.Map,org.apache.directory.shared.ldap.filter.ExprNode,javax.naming.directory.SearchControls)}.
*/
- NamingEnumeration search( Name baseName, Map environment, ExprNode filter, SearchControls searchControls )
+ NamingEnumeration search( LdapDN baseName, Map environment, ExprNode filter, SearchControls searchControls )
throws NamingException;
/**
- * Calls the next interceptor's {@link Interceptor#lookup(NextInterceptor, Name)}.
+ * Calls the next interceptor's {@link Interceptor#lookup(NextInterceptor,org.apache.directory.shared.ldap.name.LdapDN)}.
*/
- Attributes lookup( Name name ) throws NamingException;
+ Attributes lookup( LdapDN name ) throws NamingException;
/**
- * Calls the next interceptor's {@link Interceptor#lookup(NextInterceptor, Name, String[])}.
+ * Calls the next interceptor's {@link Interceptor#lookup(NextInterceptor,org.apache.directory.shared.ldap.name.LdapDN,String[])}.
*/
- Attributes lookup( Name name, String[] attrIds ) throws NamingException;
+ Attributes lookup( LdapDN name, String[] attrIds ) throws NamingException;
/**
- * Calls the next interceptor's {@link Interceptor#hasEntry(NextInterceptor, Name)}.
+ * Calls the next interceptor's {@link Interceptor#hasEntry(NextInterceptor,org.apache.directory.shared.ldap.name.LdapDN)}.
*/
- boolean hasEntry( Name name ) throws NamingException;
+ boolean hasEntry( LdapDN name ) throws NamingException;
/**
- * Calls the next interceptor's {@link Interceptor#isSuffix(NextInterceptor, Name)}.
+ * Calls the next interceptor's {@link Interceptor#isSuffix(NextInterceptor,org.apache.directory.shared.ldap.name.LdapDN)}.
*/
- boolean isSuffix( Name name ) throws NamingException;
+ boolean isSuffix( LdapDN name ) throws NamingException;
/**
@@ -166,13 +165,13 @@
/**
- * Calls the next interceptor's {@link Interceptor#bind(NextInterceptor, Name, byte[], List, String)
+ * Calls the next interceptor's {@link Interceptor#bind(NextInterceptor,org.apache.directory.shared.ldap.name.LdapDN,byte[],java.util.List,String)
*/
- void bind( Name bindDn, byte[] credentials, List mechanisms, String saslAuthId ) throws NamingException;
+ void bind( LdapDN bindDn, byte[] credentials, List mechanisms, String saslAuthId ) throws NamingException;
/**
- * Calls the next interceptor's {@link Interceptor#unbind(NextInterceptor, Name)
+ * Calls the next interceptor's {@link Interceptor#unbind(NextInterceptor,org.apache.directory.shared.ldap.name.LdapDN)
*/
- void unbind( Name bindDn ) throws NamingException;
+ void unbind( LdapDN bindDn ) throws NamingException;
}
Modified: directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java?rev=411860&r1=411859&r2=411860&view=diff
==============================================================================
--- directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java (original)
+++ directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java Mon Jun 5 10:15:23 2006
@@ -660,7 +660,7 @@
public NamingEnumeration listBindings( Name name ) throws NamingException
{
// Conduct a special one level search at base for all objects
- Name base = buildTarget( name );
+ LdapDN base = buildTarget( name );
PresenceNode filter = new PresenceNode( "objectClass" );
SearchControls ctls = new SearchControls();
ctls.setSearchScope( SearchControls.ONELEVEL_SCOPE );
Modified: directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java?rev=411860&r1=411859&r2=411860&view=diff
==============================================================================
--- directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java (original)
+++ directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java Mon Jun 5 10:15:23 2006
@@ -432,7 +432,7 @@
throws NamingException
{
SearchControls ctls = new SearchControls();
- Name target = buildTarget( name );
+ LdapDN target = buildTarget( name );
// If we need to return specific attributes add em to the SearchControls
if ( null != attributesToReturn )
@@ -520,7 +520,7 @@
newName = LdapDN.oidToName( newName, DnOidContainer.getOids() );
Name target = buildTarget( ((LdapDN)newName).toLdapName() );*/
- Name target = buildTarget( name );
+ LdapDN target = buildTarget( name );
return getNexusProxy().search( target, getEnvironment(), filter, cons );
}
@@ -532,7 +532,7 @@
public NamingEnumeration search( Name name, String filter, SearchControls cons ) throws NamingException
{
ExprNode filterNode;
- Name target = buildTarget( name );
+ LdapDN target = buildTarget( name );
try
{
Modified: directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/jndi/ServerLdapContext.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/jndi/ServerLdapContext.java?rev=411860&r1=411859&r2=411860&view=diff
==============================================================================
--- directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/jndi/ServerLdapContext.java (original)
+++ directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/jndi/ServerLdapContext.java Mon Jun 5 10:15:23 2006
@@ -66,8 +66,6 @@
* set the PROVIDER_URL to the distinguished name for this context.
*
* @param principal the directory user principal that is propagated
- * @param nexusProxy the intercepting proxy to the nexus
- * @param env the environment properties used by this context
* @param dn the distinguished name of this context
*/
ServerLdapContext(DirectoryService service, LdapPrincipal principal, Name dn) throws NamingException
@@ -161,7 +159,7 @@
* permission is not allowed for this operation or the oid is not recognized,
* or the attribute is not present in the entry ... you get the picture.
*/
- public boolean compare( Name name, String oid, Object value ) throws NamingException
+ public boolean compare( LdapDN name, String oid, Object value ) throws NamingException
{
return super.getNexusProxy().compare( name, oid, value );
}
Modified: directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationService.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationService.java?rev=411860&r1=411859&r2=411860&view=diff
==============================================================================
--- directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationService.java (original)
+++ directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationService.java Mon Jun 5 10:15:23 2006
@@ -19,7 +19,6 @@
import java.util.Map;
-import javax.naming.Name;
import javax.naming.NamingEnumeration;
import javax.naming.NamingException;
import javax.naming.directory.Attributes;
@@ -32,12 +31,10 @@
import org.apache.directory.server.core.interceptor.NextInterceptor;
import org.apache.directory.server.core.partition.DirectoryPartitionNexus;
import org.apache.directory.server.core.schema.AttributeTypeRegistry;
+
import org.apache.directory.shared.ldap.filter.BranchNode;
import org.apache.directory.shared.ldap.filter.ExprNode;
import org.apache.directory.shared.ldap.filter.LeafNode;
-
-// TODO get rid of the use of DnParser with LdapDN
-import org.apache.directory.shared.ldap.name.DnParser;
import org.apache.directory.shared.ldap.name.NameComponentNormalizer;
import org.apache.directory.shared.ldap.name.LdapDN;
import org.apache.directory.shared.ldap.schema.AttributeType;
@@ -60,8 +57,6 @@
/** logger used by this class */
private static final Logger log = LoggerFactory.getLogger( NormalizationService.class );
- /** the parser used for normalizing distinguished names */
- private DnParser parser;
/** a filter node value normalizer and undefined node remover */
private ValueNormalizingVisitor visitor;
/** the attributeType registry used for normalization and determining if some filter nodes are undefined */
@@ -72,7 +67,6 @@
{
registry = factoryCfg.getGlobalRegistries().getAttributeTypeRegistry();
NameComponentNormalizer ncn = new PerComponentNormalizer();
- parser = new DnParser( ncn );
visitor = new ValueNormalizingVisitor( ncn );
}
@@ -141,10 +135,10 @@
}
- public NamingEnumeration search( NextInterceptor nextInterceptor, Name base, Map env, ExprNode filter,
+ public NamingEnumeration search( NextInterceptor nextInterceptor, LdapDN base, Map env, ExprNode filter,
SearchControls searchCtls ) throws NamingException
{
- base = parser.parse( base.toString() );
+ base = LdapDN.normalize( base, registry.getNormalizerMapping() );
if ( filter.isLeaf() )
{
@@ -185,37 +179,37 @@
}
- public boolean hasEntry( NextInterceptor nextInterceptor, Name name ) throws NamingException
+ public boolean hasEntry( NextInterceptor nextInterceptor, LdapDN name ) throws NamingException
{
- name = parser.parse( name.toString() );
+ name = LdapDN.normalize( name, registry.getNormalizerMapping() );
return nextInterceptor.hasEntry( name );
}
- public boolean isSuffix( NextInterceptor nextInterceptor, Name name ) throws NamingException
+ public boolean isSuffix( NextInterceptor nextInterceptor, LdapDN name ) throws NamingException
{
- name = parser.parse( name.toString() );
+ name = LdapDN.normalize( name, registry.getNormalizerMapping() );
return nextInterceptor.isSuffix( name );
}
- public NamingEnumeration list( NextInterceptor nextInterceptor, Name base ) throws NamingException
+ public NamingEnumeration list( NextInterceptor nextInterceptor, LdapDN base ) throws NamingException
{
- base = parser.parse( base.toString() );
+ base = LdapDN.normalize( base, registry.getNormalizerMapping() );
return nextInterceptor.list( base );
}
- public Attributes lookup( NextInterceptor nextInterceptor, Name name ) throws NamingException
+ public Attributes lookup( NextInterceptor nextInterceptor, LdapDN name ) throws NamingException
{
- name = parser.parse( name.toString() );
+ name = LdapDN.normalize( name, registry.getNormalizerMapping() );
return nextInterceptor.lookup( name );
}
- public Attributes lookup( NextInterceptor nextInterceptor, Name name, String[] attrIds ) throws NamingException
+ public Attributes lookup( NextInterceptor nextInterceptor, LdapDN name, String[] attrIds ) throws NamingException
{
- name = parser.parse( name.toString() );
+ name = LdapDN.normalize( name, registry.getNormalizerMapping() );
return nextInterceptor.lookup( name, attrIds );
}
@@ -224,23 +218,23 @@
// Normalize all Name based arguments for other interface operations
// ------------------------------------------------------------------------
- public Name getMatchedName( NextInterceptor nextInterceptor, Name name, boolean normalized ) throws NamingException
+ public LdapDN getMatchedName ( NextInterceptor nextInterceptor, LdapDN name ) throws NamingException
{
- name = parser.parse( name.toString() );
- return nextInterceptor.getMatchedName( name, normalized );
+ name = LdapDN.normalize( name, registry.getNormalizerMapping() );
+ return nextInterceptor.getMatchedName( name );
}
- public Name getSuffix( NextInterceptor nextInterceptor, Name name, boolean normalized ) throws NamingException
+ public LdapDN getSuffix ( NextInterceptor nextInterceptor, LdapDN name ) throws NamingException
{
- name = parser.parse( name.toString() );
- return nextInterceptor.getSuffix( name, normalized );
+ name = LdapDN.normalize( name, registry.getNormalizerMapping() );
+ return nextInterceptor.getSuffix( name );
}
- public boolean compare( NextInterceptor next, Name name, String oid, Object value ) throws NamingException
+ public boolean compare( NextInterceptor next, LdapDN name, String oid, Object value ) throws NamingException
{
- name = parser.parse( name.toString() );
+ name = LdapDN.normalize( name, registry.getNormalizerMapping() );
return next.compare( name, oid, value );
}
Modified: directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeService.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeService.java?rev=411860&r1=411859&r2=411860&view=diff
==============================================================================
--- directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeService.java (original)
+++ directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeService.java Mon Jun 5 10:15:23 2006
@@ -219,7 +219,7 @@
}
- public Attributes lookup( NextInterceptor nextInterceptor, Name name ) throws NamingException
+ public Attributes lookup( NextInterceptor nextInterceptor, LdapDN name ) throws NamingException
{
Attributes result = nextInterceptor.lookup( name );
if ( result == null )
@@ -231,7 +231,7 @@
}
- public Attributes lookup( NextInterceptor nextInterceptor, Name name, String[] attrIds ) throws NamingException
+ public Attributes lookup( NextInterceptor nextInterceptor, LdapDN name, String[] attrIds ) throws NamingException
{
Attributes result = nextInterceptor.lookup( name, attrIds );
if ( result == null )
@@ -244,7 +244,7 @@
}
- public NamingEnumeration list( NextInterceptor nextInterceptor, Name base ) throws NamingException
+ public NamingEnumeration list( NextInterceptor nextInterceptor, LdapDN base ) throws NamingException
{
NamingEnumeration e = nextInterceptor.list( base );
Invocation invocation = InvocationStack.getInstance().peek();
@@ -252,7 +252,7 @@
}
- public NamingEnumeration search( NextInterceptor nextInterceptor, Name base, Map env, ExprNode filter,
+ public NamingEnumeration search( NextInterceptor nextInterceptor, LdapDN base, Map env, ExprNode filter,
SearchControls searchCtls ) throws NamingException
{
Invocation invocation = InvocationStack.getInstance().peek();
Modified: directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/AbstractDirectoryPartition.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/AbstractDirectoryPartition.java?rev=411860&r1=411859&r2=411860&view=diff
==============================================================================
--- directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/AbstractDirectoryPartition.java (original)
+++ directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/AbstractDirectoryPartition.java Mon Jun 5 10:15:23 2006
@@ -21,7 +21,6 @@
import java.util.List;
import java.util.Map;
-import javax.naming.Name;
import javax.naming.NameNotFoundException;
import javax.naming.NamingEnumeration;
import javax.naming.NamingException;
@@ -178,7 +177,7 @@
}
- public final boolean isSuffix( Name name ) throws NamingException
+ public final boolean isSuffix( LdapDN name ) throws NamingException
{
return getSuffix().equals( name );
}
@@ -193,11 +192,11 @@
/**
- * This method calls {@link #lookup(Name)} and return <tt>true</tt>
+ * This method calls {@link DirectoryPartition#lookup(org.apache.directory.shared.ldap.name.LdapDN)} and return <tt>true</tt>
* if it returns an entry by default. Please override this method if
* there is more effective way for your implementation.
*/
- public boolean hasEntry( Name name ) throws NamingException
+ public boolean hasEntry( LdapDN name ) throws NamingException
{
try
{
@@ -211,11 +210,11 @@
/**
- * This method calls {@link DirectoryPartition#lookup(Name, String[])}
+ * This method calls {@link DirectoryPartition#lookup(org.apache.directory.shared.ldap.name.LdapDN,String[])}
* with null <tt>attributeIds</tt> by default. Please override
* this method if there is more effective way for your implementation.
*/
- public Attributes lookup( Name name ) throws NamingException
+ public Attributes lookup( LdapDN name ) throws NamingException
{
return lookup( name, null );
}
Modified: directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/DefaultDirectoryPartitionNexus.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/DefaultDirectoryPartitionNexus.java?rev=411860&r1=411859&r2=411860&view=diff
==============================================================================
--- directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/DefaultDirectoryPartitionNexus.java (original)
+++ directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/DefaultDirectoryPartitionNexus.java Mon Jun 5 10:15:23 2006
@@ -348,7 +348,7 @@
// ContextPartitionNexus Method Implementations
// ------------------------------------------------------------------------
- public boolean compare( Name name, String oid, Object value ) throws NamingException
+ public boolean compare( LdapDN name, String oid, Object value ) throws NamingException
{
DirectoryPartition partition = getBackend( name );
AttributeTypeRegistry registry = factoryCfg.getGlobalRegistries().getAttributeTypeRegistry();
@@ -432,7 +432,7 @@
}
- public synchronized void removeContextPartition( Name suffix ) throws NamingException
+ public synchronized void removeContextPartition( LdapDN suffix ) throws NamingException
{
String key = suffix.toString();
DirectoryPartition partition = ( DirectoryPartition ) partitions.get( key );
@@ -466,11 +466,11 @@
/**
- * @see DirectoryPartitionNexus#getMatchedName(javax.naming.Name, boolean)
+ * @see DirectoryPartitionNexus#getMatchedName(org.apache.directory.shared.ldap.name.LdapDN)
*/
- public Name getMatchedName( Name dn, boolean normalized ) throws NamingException
+ public LdapDN getMatchedName ( LdapDN dn ) throws NamingException
{
- dn = ( Name ) dn.clone();
+ dn = ( LdapDN ) dn.clone();
while ( dn.size() > 0 )
{
if ( hasEntry( dn ) )
@@ -478,7 +478,7 @@
return dn;
}
- dn = dn.getPrefix( 1 );
+ dn = ( LdapDN ) dn.getPrefix( 1 );
}
return dn;
@@ -492,9 +492,9 @@
/**
- * @see org.apache.directory.server.core.partition.DirectoryPartitionNexus#getSuffix(javax.naming.Name, boolean)
+ * @see DirectoryPartitionNexus#getSuffix(org.apache.directory.shared.ldap.name.LdapDN)
*/
- public Name getSuffix( Name dn, boolean normalized ) throws NamingException
+ public LdapDN getSuffix ( LdapDN dn ) throws NamingException
{
DirectoryPartition backend = getBackend( dn );
return backend.getSuffix();
@@ -502,9 +502,9 @@
/**
- * @see org.apache.directory.server.core.partition.DirectoryPartitionNexus#listSuffixes(boolean)
+ * @see DirectoryPartitionNexus#listSuffixes()
*/
- public Iterator listSuffixes( boolean normalized ) throws NamingException
+ public Iterator listSuffixes () throws NamingException
{
return Collections.unmodifiableSet( partitions.keySet() ).iterator();
}
@@ -540,14 +540,14 @@
// DirectoryPartition Interface Method Implementations
// ------------------------------------------------------------------------
- public void bind( Name bindDn, byte[] credentials, List mechanisms, String saslAuthId ) throws NamingException
+ public void bind( LdapDN bindDn, byte[] credentials, List mechanisms, String saslAuthId ) throws NamingException
{
DirectoryPartition partition = getBackend( bindDn );
partition.bind( bindDn, credentials, mechanisms, saslAuthId );
}
- public void unbind( Name bindDn ) throws NamingException
+ public void unbind( LdapDN bindDn ) throws NamingException
{
DirectoryPartition partition = getBackend( bindDn );
partition.unbind( bindDn );
@@ -601,9 +601,9 @@
/**
- * @see DirectoryPartition#list(javax.naming.Name)
+ * @see DirectoryPartition#list(org.apache.directory.shared.ldap.name.LdapDN)
*/
- public NamingEnumeration list( Name base ) throws NamingException
+ public NamingEnumeration list( LdapDN base ) throws NamingException
{
DirectoryPartition backend = getBackend( base );
return backend.list( base );
@@ -611,9 +611,9 @@
/**
- * @see DirectoryPartition#search(Name, Map, ExprNode, SearchControls)
+ * @see DirectoryPartition#search(org.apache.directory.shared.ldap.name.LdapDN,java.util.Map,org.apache.directory.shared.ldap.filter.ExprNode,javax.naming.directory.SearchControls)
*/
- public NamingEnumeration search( Name base, Map env, ExprNode filter, SearchControls searchCtls )
+ public NamingEnumeration search( LdapDN base, Map env, ExprNode filter, SearchControls searchCtls )
throws NamingException
{
@@ -669,9 +669,9 @@
/**
- * @see DirectoryPartition#lookup(javax.naming.Name)
+ * @see DirectoryPartition#lookup(org.apache.directory.shared.ldap.name.LdapDN)
*/
- public Attributes lookup( Name dn ) throws NamingException
+ public Attributes lookup( LdapDN dn ) throws NamingException
{
if ( dn.size() == 0 )
{
@@ -684,9 +684,9 @@
/**
- * @see org.apache.directory.server.core.partition.DirectoryPartition#lookup(javax.naming.Name, String[])
+ * @see DirectoryPartition#lookup(org.apache.directory.shared.ldap.name.LdapDN,String[])
*/
- public Attributes lookup( Name dn, String[] attrIds ) throws NamingException
+ public Attributes lookup( LdapDN dn, String[] attrIds ) throws NamingException
{
if ( dn.size() == 0 )
{
@@ -707,9 +707,9 @@
/**
- * @see DirectoryPartition#hasEntry(javax.naming.Name)
+ * @see DirectoryPartition#hasEntry(org.apache.directory.shared.ldap.name.LdapDN)
*/
- public boolean hasEntry( Name dn ) throws NamingException
+ public boolean hasEntry( LdapDN dn ) throws NamingException
{
if ( log.isDebugEnabled() )
{
@@ -727,9 +727,9 @@
/**
- * @see DirectoryPartition#isSuffix(javax.naming.Name)
+ * @see DirectoryPartition#isSuffix(org.apache.directory.shared.ldap.name.LdapDN)
*/
- public boolean isSuffix( Name dn )
+ public boolean isSuffix( LdapDN dn )
{
return partitions.containsKey( dn.toString() );
}
Modified: directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/DirectoryPartition.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/DirectoryPartition.java?rev=411860&r1=411859&r2=411860&view=diff
==============================================================================
--- directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/DirectoryPartition.java (original)
+++ directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/DirectoryPartition.java Mon Jun 5 10:15:23 2006
@@ -154,7 +154,7 @@
* @return a NamingEnumeration containing objects of type {@link SearchResult}
* @throws NamingException if there are any problems
*/
- NamingEnumeration list( Name baseName ) throws NamingException;
+ NamingEnumeration list( LdapDN baseName ) throws NamingException;
/**
@@ -174,7 +174,7 @@
* <a href="http://java.sun.com/j2se/1.4.2/docs/api/
* javax/naming/directory/SearchResult.html">SearchResult</a>.
*/
- NamingEnumeration search( Name baseName, Map environment, ExprNode filter, SearchControls searchControls )
+ NamingEnumeration search( LdapDN baseName, Map environment, ExprNode filter, SearchControls searchControls )
throws NamingException;
@@ -187,7 +187,7 @@
* @return an Attributes object representing the entry
* @throws NamingException if there are any problems
*/
- Attributes lookup( Name name ) throws NamingException;
+ Attributes lookup( LdapDN name ) throws NamingException;
/**
@@ -201,7 +201,7 @@
* @return an Attributes object representing the entry
* @throws NamingException if there are any problems
*/
- Attributes lookup( Name name, String[] attrIds ) throws NamingException;
+ Attributes lookup( LdapDN name, String[] attrIds ) throws NamingException;
/**
@@ -212,7 +212,7 @@
* @return true if the entry exists, false if it does not
* @throws NamingException if there are any problems
*/
- boolean hasEntry( Name name ) throws NamingException;
+ boolean hasEntry( LdapDN name ) throws NamingException;
/**
@@ -222,7 +222,7 @@
* @return true if the name is a context suffix, false if it is not.
* @throws NamingException if there are any problems
*/
- boolean isSuffix( Name name ) throws NamingException;
+ boolean isSuffix( LdapDN name ) throws NamingException;
/**
@@ -279,14 +279,14 @@
* need not support this operation. This operation is here to enable those
* interested in implementing virtual directories with ApacheDS.
*
- * @param bindDn the normalized dn of the principal
+ * @param bindDn the normalized dn of the principal
* @param credentials the credentials of the principal
* @param mechanisms the mechanisms requested by the JNDI caller or a single
* mechanism representing the SASL bind mechanism used by a networked client (Strings)
* @param saslAuthId the SASL authentication (may be null)
* @throws NamingException if something goes wrong
*/
- void bind( Name bindDn, byte[] credentials, List mechanisms, String saslAuthId ) throws NamingException;
+ void bind( LdapDN bindDn, byte[] credentials, List mechanisms, String saslAuthId ) throws NamingException;
/**
@@ -297,5 +297,5 @@
* @param bindDn the normalized dn of the principal attempting to unbind
* @throws NamingException if something goes wrong
*/
- void unbind( Name bindDn ) throws NamingException;
+ void unbind( LdapDN bindDn ) throws NamingException;
}
Modified: directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/DirectoryPartitionNexus.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/DirectoryPartitionNexus.java?rev=411860&r1=411859&r2=411860&view=diff
==============================================================================
--- directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/DirectoryPartitionNexus.java (original)
+++ directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/DirectoryPartitionNexus.java Mon Jun 5 10:15:23 2006
@@ -152,13 +152,13 @@
* @return true if the entry contains an attribute with the value, false otherwise
* @throws NamingException if there is a problem accessing the entry and its values
*/
- public abstract boolean compare( Name name, String oid, Object value ) throws NamingException;
+ public abstract boolean compare( LdapDN name, String oid, Object value ) throws NamingException;
public abstract void addContextPartition( DirectoryPartitionConfiguration config ) throws NamingException;
- public abstract void removeContextPartition( Name suffix ) throws NamingException;
+ public abstract void removeContextPartition( LdapDN suffix ) throws NamingException;
public abstract DirectoryPartition getSystemPartition();
@@ -181,15 +181,12 @@
* Gets the most significant Dn that exists within the server for any Dn.
*
* @param name the normalized distinguished name to use for matching.
- * @param normalized boolean if true cause the return of a normalized Dn,
- * if false it returns the original user provided distinguished name for
- * the matched portion of the Dn as it was provided on entry creation.
* @return a distinguished name representing the matching portion of dn,
* as originally provided by the user on creation of the matched entry or
* the empty string distinguished name if no match was found.
* @throws NamingException if there are any problems
*/
- public abstract Name getMatchedName( Name name, boolean normalized ) throws NamingException;
+ public abstract LdapDN getMatchedName ( LdapDN name ) throws NamingException;
/**
@@ -198,27 +195,21 @@
* fall under a partition suffix then the empty string Dn is returned.
*
* @param name the normalized distinguished name to use for finding a suffix.
- * @param normalized if true causes the return of a normalized Dn, but
- * if false it returns the original user provided distinguished name for
- * the suffix Dn as it was provided on suffix entry creation.
* @return the suffix portion of dn, or the valid empty string Dn if no
* naming context was found for dn.
* @throws NamingException if there are any problems
*/
- public abstract Name getSuffix( Name name, boolean normalized ) throws NamingException;
+ public abstract LdapDN getSuffix ( LdapDN name ) throws NamingException;
/**
* Gets an iteration over the Name suffixes of the partitions managed by this
* {@link DirectoryPartitionNexus}.
*
- * @param normalized if true the returned Iterator contains normalized Dn
- * but, if false, it returns the original user provided distinguished names
- * in the Iterator.
* @return Iteration over ContextPartition suffix names as Names.
* @throws NamingException if there are any problems
*/
- public abstract Iterator listSuffixes( boolean normalized ) throws NamingException;
+ public abstract Iterator listSuffixes () throws NamingException;
/**
Modified: directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/DirectoryPartitionNexusProxy.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/DirectoryPartitionNexusProxy.java?rev=411860&r1=411859&r2=411860&view=diff
==============================================================================
--- directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/DirectoryPartitionNexusProxy.java (original)
+++ directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/DirectoryPartitionNexusProxy.java Mon Jun 5 10:15:23 2006
@@ -172,22 +172,21 @@
}
- public Name getMatchedName( Name dn, boolean normalized ) throws NamingException
+ public LdapDN getMatchedName ( LdapDN dn ) throws NamingException
{
- return getMatchedName( dn, normalized, null );
+ return getMatchedName( dn, null );
}
- public Name getMatchedName( Name dn, boolean normalized, Collection bypass ) throws NamingException
+ public LdapDN getMatchedName( LdapDN dn, Collection bypass ) throws NamingException
{
ensureStarted();
InvocationStack stack = InvocationStack.getInstance();
- Object[] args = new Object[]
- { dn, normalized ? Boolean.TRUE : Boolean.FALSE };
+ Object[] args = new Object[] { dn };
stack.push( new Invocation( this, caller, "getMatchedDn", args, bypass ) );
try
{
- return this.configuration.getInterceptorChain().getMatchedName( dn, normalized );
+ return this.configuration.getInterceptorChain().getMatchedName( dn );
}
finally
{
@@ -196,22 +195,21 @@
}
- public Name getSuffix( Name dn, boolean normalized ) throws NamingException
+ public LdapDN getSuffix ( LdapDN dn ) throws NamingException
{
- return getSuffix( dn, normalized, null );
+ return getSuffix( dn, null );
}
- public Name getSuffix( Name dn, boolean normalized, Collection bypass ) throws NamingException
+ public LdapDN getSuffix( LdapDN dn, Collection bypass ) throws NamingException
{
ensureStarted();
InvocationStack stack = InvocationStack.getInstance();
- Object[] args = new Object[]
- { dn, normalized ? Boolean.TRUE : Boolean.FALSE };
+ Object[] args = new Object[] { dn };
stack.push( new Invocation( this, caller, "getSuffix", args, bypass ) );
try
{
- return this.configuration.getInterceptorChain().getSuffix( dn, normalized );
+ return this.configuration.getInterceptorChain().getSuffix( dn );
}
finally
{
@@ -220,22 +218,21 @@
}
- public Iterator listSuffixes( boolean normalized ) throws NamingException
+ public Iterator listSuffixes () throws NamingException
{
- return listSuffixes( normalized, null );
+ return listSuffixes( null );
}
- public Iterator listSuffixes( boolean normalized, Collection bypass ) throws NamingException
+ public Iterator listSuffixes( Collection bypass ) throws NamingException
{
ensureStarted();
InvocationStack stack = InvocationStack.getInstance();
- Object[] args = new Object[]
- { normalized ? Boolean.TRUE : Boolean.FALSE };
+ Object[] args = new Object[] { };
stack.push( new Invocation( this, caller, "listSuffixes", args, bypass ) );
try
{
- return this.configuration.getInterceptorChain().listSuffixes( normalized );
+ return this.configuration.getInterceptorChain().listSuffixes();
}
finally
{
@@ -244,13 +241,13 @@
}
- public boolean compare( Name name, String oid, Object value ) throws NamingException
+ public boolean compare( LdapDN name, String oid, Object value ) throws NamingException
{
return compare( name, oid, value, null );
}
- public boolean compare( Name name, String oid, Object value, Collection bypass ) throws NamingException
+ public boolean compare( LdapDN name, String oid, Object value, Collection bypass ) throws NamingException
{
ensureStarted();
InvocationStack stack = InvocationStack.getInstance();
@@ -376,13 +373,13 @@
}
- public NamingEnumeration list( Name base ) throws NamingException
+ public NamingEnumeration list( LdapDN base ) throws NamingException
{
return list( base, null );
}
- public NamingEnumeration list( Name base, Collection bypass ) throws NamingException
+ public NamingEnumeration list( LdapDN base, Collection bypass ) throws NamingException
{
ensureStarted();
InvocationStack stack = InvocationStack.getInstance();
@@ -399,7 +396,7 @@
}
- public NamingEnumeration search( Name base, Map env, ExprNode filter, SearchControls searchCtls )
+ public NamingEnumeration search( LdapDN base, Map env, ExprNode filter, SearchControls searchCtls )
throws NamingException
{
NamingEnumeration ne = search( base, env, filter, searchCtls, null );
@@ -448,7 +445,7 @@
}
- public NamingEnumeration search( Name base, Map env, ExprNode filter, SearchControls searchCtls, Collection bypass )
+ public NamingEnumeration search( LdapDN base, Map env, ExprNode filter, SearchControls searchCtls, Collection bypass )
throws NamingException
{
ensureStarted();
@@ -466,13 +463,13 @@
}
- public Attributes lookup( Name name ) throws NamingException
+ public Attributes lookup( LdapDN name ) throws NamingException
{
return lookup( name, ( Collection ) null );
}
- public Attributes lookup( Name name, Collection bypass ) throws NamingException
+ public Attributes lookup( LdapDN name, Collection bypass ) throws NamingException
{
ensureStarted();
InvocationStack stack = InvocationStack.getInstance();
@@ -489,13 +486,13 @@
}
- public Attributes lookup( Name dn, String[] attrIds ) throws NamingException
+ public Attributes lookup( LdapDN dn, String[] attrIds ) throws NamingException
{
return lookup( dn, attrIds, null );
}
- public Attributes lookup( Name dn, String[] attrIds, Collection bypass ) throws NamingException
+ public Attributes lookup( LdapDN dn, String[] attrIds, Collection bypass ) throws NamingException
{
ensureStarted();
InvocationStack stack = InvocationStack.getInstance();
@@ -512,13 +509,13 @@
}
- public boolean hasEntry( Name name ) throws NamingException
+ public boolean hasEntry( LdapDN name ) throws NamingException
{
return hasEntry( name, null );
}
- public boolean hasEntry( Name name, Collection bypass ) throws NamingException
+ public boolean hasEntry( LdapDN name, Collection bypass ) throws NamingException
{
ensureStarted();
InvocationStack stack = InvocationStack.getInstance();
@@ -535,13 +532,13 @@
}
- public boolean isSuffix( Name name ) throws NamingException
+ public boolean isSuffix( LdapDN name ) throws NamingException
{
return isSuffix( name, null );
}
- public boolean isSuffix( Name name, Collection bypass ) throws NamingException
+ public boolean isSuffix( LdapDN name, Collection bypass ) throws NamingException
{
ensureStarted();
InvocationStack stack = InvocationStack.getInstance();
@@ -630,7 +627,7 @@
}
- public void bind( Name bindDn, byte[] credentials, List mechanisms, String saslAuthId, Collection bypass )
+ public void bind( LdapDN bindDn, byte[] credentials, List mechanisms, String saslAuthId, Collection bypass )
throws NamingException
{
ensureStarted();
@@ -649,7 +646,7 @@
}
- public void unbind( Name bindDn, Collection bypass ) throws NamingException
+ public void unbind( LdapDN bindDn, Collection bypass ) throws NamingException
{
ensureStarted();
InvocationStack stack = InvocationStack.getInstance();
@@ -667,13 +664,13 @@
}
- public void bind( Name bindDn, byte[] credentials, List mechanisms, String saslAuthId ) throws NamingException
+ public void bind( LdapDN bindDn, byte[] credentials, List mechanisms, String saslAuthId ) throws NamingException
{
bind( bindDn, credentials, mechanisms, saslAuthId, null );
}
- public void unbind( Name bindDn ) throws NamingException
+ public void unbind( LdapDN bindDn ) throws NamingException
{
unbind( bindDn, null );
}
@@ -724,13 +721,13 @@
}
- public void removeContextPartition( Name suffix ) throws NamingException
+ public void removeContextPartition( LdapDN suffix ) throws NamingException
{
removeContextPartition( suffix, null );
}
- public void removeContextPartition( Name suffix, Collection bypass ) throws NamingException
+ public void removeContextPartition( LdapDN suffix, Collection bypass ) throws NamingException
{
ensureStarted();
InvocationStack stack = InvocationStack.getInstance();
Modified: directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeDirectoryPartition.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeDirectoryPartition.java?rev=411860&r1=411859&r2=411860&view=diff
==============================================================================
--- directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeDirectoryPartition.java (original)
+++ directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeDirectoryPartition.java Mon Jun 5 10:15:23 2006
@@ -22,7 +22,6 @@
import java.util.Iterator;
import java.util.Map;
-import javax.naming.Name;
import javax.naming.NamingEnumeration;
import javax.naming.NamingException;
import javax.naming.directory.Attribute;
@@ -241,7 +240,7 @@
public abstract void modify( LdapDN dn, ModificationItem[] mods ) throws NamingException;
- public NamingEnumeration list( Name base ) throws NamingException
+ public NamingEnumeration list( LdapDN base ) throws NamingException
{
SearchResultEnumeration list;
list = new BTreeSearchResultEnumeration( ArrayUtils.EMPTY_STRING_ARRAY, list( getEntryId( base.toString() ) ),
@@ -250,7 +249,7 @@
}
- public NamingEnumeration search( Name base, Map env, ExprNode filter, SearchControls searchCtls )
+ public NamingEnumeration search( LdapDN base, Map env, ExprNode filter, SearchControls searchCtls )
throws NamingException
{
String[] attrIds = searchCtls.getReturningAttributes();
@@ -262,13 +261,13 @@
}
- public Attributes lookup( Name dn ) throws NamingException
+ public Attributes lookup( LdapDN dn ) throws NamingException
{
return lookup( getEntryId( dn.toString() ) );
}
- public Attributes lookup( Name dn, String[] attrIds ) throws NamingException
+ public Attributes lookup( LdapDN dn, String[] attrIds ) throws NamingException
{
if ( attrIds == null || attrIds.length == 0 )
{
@@ -292,7 +291,7 @@
}
- public boolean hasEntry( Name dn ) throws NamingException
+ public boolean hasEntry( LdapDN dn ) throws NamingException
{
return null != getEntryId( dn.toString() );
}
@@ -317,7 +316,7 @@
public abstract boolean isInitialized();
- public boolean isSuffix( Name dn ) throws NamingException
+ public boolean isSuffix( LdapDN dn ) throws NamingException
{
return getSuffix().equals( dn );
}
Modified: directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmDirectoryPartition.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmDirectoryPartition.java?rev=411860&r1=411859&r2=411860&view=diff
==============================================================================
--- directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmDirectoryPartition.java (original)
+++ directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmDirectoryPartition.java Mon Jun 5 10:15:23 2006
@@ -1542,7 +1542,7 @@
}
- public void bind( Name bindDn, byte[] credentials, List mechanisms, String saslAuthId ) throws NamingException
+ public void bind( LdapDN bindDn, byte[] credentials, List mechanisms, String saslAuthId ) throws NamingException
{
// does nothing
throw new LdapAuthenticationNotSupportedException(
@@ -1552,7 +1552,7 @@
}
- public void unbind( Name bindDn ) throws NamingException
+ public void unbind( LdapDN bindDn ) throws NamingException
{
// does nothing
}
Modified: directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/referral/ReferralLut.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/referral/ReferralLut.java?rev=411860&r1=411859&r2=411860&view=diff
==============================================================================
--- directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/referral/ReferralLut.java (original)
+++ directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/referral/ReferralLut.java Mon Jun 5 10:15:23 2006
@@ -21,7 +21,6 @@
import java.util.Set;
import javax.naming.InvalidNameException;
-import javax.naming.Name;
import org.apache.directory.shared.ldap.name.LdapDN;
import org.slf4j.Logger;
@@ -51,7 +50,7 @@
*
* @param dn the normalized name of the referral
*/
- public boolean isReferral( Name dn )
+ public boolean isReferral( LdapDN dn )
{
if ( dn == null )
throw new IllegalArgumentException( "dn cannot be null" );
@@ -79,11 +78,11 @@
* @param dn the name to get the farthest ancestor referral name for
* @return the farthest referral ancestor
*/
- public Name getFarthestReferralAncestor( Name dn )
+ public LdapDN getFarthestReferralAncestor( LdapDN dn )
{
if ( dn == null )
throw new IllegalArgumentException( "dn cannot be null" );
- Name farthest = new LdapDN();
+ LdapDN farthest = new LdapDN();
for ( int ii = 0; ii < dn.size(); ii++ )
{
try
@@ -111,11 +110,11 @@
* @param dn the name to get the nearest ancestor referral name for
* @return the nearest referral ancestor or null if one does not exist
*/
- public Name getNearestReferralAncestor( Name dn )
+ public LdapDN getNearestReferralAncestor( LdapDN dn )
{
if ( dn == null )
throw new IllegalArgumentException( "dn cannot be null" );
- Name cloned = ( Name ) dn.clone();
+ LdapDN cloned = ( LdapDN ) dn.clone();
// do not return the argument dn if it is a referral (skip it)
if ( cloned.size() > 0 )
@@ -158,7 +157,7 @@
*
* @param dn the normalized name of the added referral
*/
- public void referralAdded( Name dn )
+ public void referralAdded( LdapDN dn )
{
if ( dn == null )
throw new IllegalArgumentException( "dn cannot be null" );
@@ -190,7 +189,7 @@
*
* @param dn the normalized name of the deleted referral
*/
- public void referralDeleted( Name dn )
+ public void referralDeleted( LdapDN dn )
{
if ( dn == null )
throw new IllegalArgumentException( "dn cannot be null" );
@@ -224,7 +223,7 @@
* @param oldDn the normalized old name for the referral
* @param newDn the normalized new name for the referral
*/
- public void referralChanged( Name oldDn, Name newDn )
+ public void referralChanged( LdapDN oldDn, LdapDN newDn )
{
if ( oldDn == null || newDn == null )
throw new IllegalArgumentException( "old or new dn cannot be null" );
@@ -268,7 +267,7 @@
* @param oldDn the normalized old name for the referral
* @param newDn the normalized new name for the referral
*/
- public void referralChanged( Name oldDn, String newDn )
+ public void referralChanged( LdapDN oldDn, String newDn )
{
if ( oldDn == null || newDn == null )
throw new IllegalArgumentException( "old or new dn cannot be null" );
@@ -290,7 +289,7 @@
* @param oldDn the normalized old name for the referral
* @param newDn the normalized new name for the referral
*/
- public void referralChanged( String oldDn, Name newDn )
+ public void referralChanged( String oldDn, LdapDN newDn )
{
if ( oldDn == null || newDn == null )
throw new IllegalArgumentException( "old or new dn cannot be null" );
Modified: directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/referral/ReferralService.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/referral/ReferralService.java?rev=411860&r1=411859&r2=411860&view=diff
==============================================================================
--- directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/referral/ReferralService.java (original)
+++ directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/referral/ReferralService.java Mon Jun 5 10:15:23 2006
@@ -27,7 +27,6 @@
import java.util.Map;
import javax.naming.Context;
-import javax.naming.Name;
import javax.naming.NamingEnumeration;
import javax.naming.NamingException;
import javax.naming.directory.Attribute;
@@ -52,7 +51,6 @@
import org.apache.directory.server.core.partition.DirectoryPartitionNexus;
import org.apache.directory.server.core.partition.DirectoryPartitionNexusProxy;
import org.apache.directory.server.core.schema.AttributeTypeRegistry;
-import org.apache.directory.server.core.schema.ConcreteNameComponentNormalizer;
import org.apache.directory.shared.ldap.codec.util.LdapURL;
import org.apache.directory.shared.ldap.NotImplementedException;
@@ -63,9 +61,6 @@
import org.apache.directory.shared.ldap.filter.LeafNode;
import org.apache.directory.shared.ldap.filter.SimpleNode;
import org.apache.directory.shared.ldap.message.ResultCodeEnum;
-
-// TODO remove the need for the parser by using LdapDN
-import org.apache.directory.shared.ldap.name.DnParser;
import org.apache.directory.shared.ldap.name.LdapDN;
import org.slf4j.Logger;
@@ -95,8 +90,8 @@
private ReferralLut lut = new ReferralLut();
private DirectoryPartitionNexus nexus;
- private DnParser parser;
private Hashtable env;
+ private AttributeTypeRegistry registry;
static
{
@@ -161,20 +156,19 @@
public void init( DirectoryServiceConfiguration dsConfig, InterceptorConfiguration cfg ) throws NamingException
{
nexus = dsConfig.getPartitionNexus();
- AttributeTypeRegistry atr = dsConfig.getGlobalRegistries().getAttributeTypeRegistry();
- parser = new DnParser( new ConcreteNameComponentNormalizer( atr ) );
+ registry = dsConfig.getGlobalRegistries().getAttributeTypeRegistry();
env = dsConfig.getEnvironment();
- Iterator suffixes = nexus.listSuffixes( true );
+ Iterator suffixes = nexus.listSuffixes();
while ( suffixes.hasNext() )
{
- Name suffix = new LdapDN( ( String ) suffixes.next() );
+ LdapDN suffix = new LdapDN( ( String ) suffixes.next() );
addReferrals( nexus.search( suffix, env, getReferralFilter(), getControls() ), suffix );
}
}
- public void doReferralException( Name farthest, Name targetUpdn, Attribute refs ) throws NamingException
+ public void doReferralException( LdapDN farthest, LdapDN targetUpdn, Attribute refs ) throws NamingException
{
// handle referral here
List list = new ArrayList( refs.size() );
@@ -200,7 +194,8 @@
log.error( "Bad URL (" + val + ") for ref in " + farthest + ". Reference will be ignored." );
}
- Name urlDn = parser.parse( ldapUrl.getDn().toString() );
+ LdapDN urlDn = new LdapDN( ldapUrl.getDn().toNormName() );
+ urlDn = LdapDN.normalize( urlDn, registry.getNormalizerMapping() );
if ( urlDn.equals( farthest ) )
{
// according to the protocol there is no need for the dn since it is the same as this request
@@ -223,7 +218,7 @@
* name past the farthest referral DN which the target name extends.
*/
int diff = targetUpdn.size() - farthest.size();
- Name extra = new LdapDN();
+ LdapDN extra = new LdapDN();
for ( int jj = 0; jj < diff; jj++ )
{
extra.add( targetUpdn.get( farthest.size() + jj ) );
@@ -266,7 +261,7 @@
if ( refval.equals( THROW ) )
{
- Name farthest = lut.getFarthestReferralAncestor( normName );
+ LdapDN farthest = lut.getFarthestReferralAncestor( normName );
if ( farthest == null )
{
next.add(normName, entry );
@@ -293,7 +288,7 @@
}
- public boolean compare( NextInterceptor next, Name normName, String oid, Object value ) throws NamingException
+ public boolean compare( NextInterceptor next, LdapDN normName, String oid, Object value ) throws NamingException
{
Invocation invocation = InvocationStack.getInstance().peek();
ServerLdapContext caller = ( ServerLdapContext ) invocation.getCaller();
@@ -307,7 +302,7 @@
if ( refval.equals( THROW ) )
{
- Name farthest = lut.getFarthestReferralAncestor( normName );
+ LdapDN farthest = lut.getFarthestReferralAncestor( normName );
if ( farthest == null )
{
return next.compare( normName, oid, value );
@@ -351,7 +346,7 @@
if ( refval.equals( THROW ) )
{
- Name farthest = lut.getFarthestReferralAncestor( normName );
+ LdapDN farthest = lut.getFarthestReferralAncestor( normName );
if ( farthest == null )
{
next.delete( normName );
@@ -398,7 +393,7 @@
Invocation invocation = InvocationStack.getInstance().peek();
ServerLdapContext caller = ( ServerLdapContext ) invocation.getCaller();
String refval = ( String ) caller.getEnvironment().get( Context.REFERRAL );
- Name newName = ( Name ) newParent.clone();
+ LdapDN newName = ( LdapDN ) newParent.clone();
newName.add( oldName.get( oldName.size() - 1 ) );
// handle a normal modify without following referrals
@@ -414,8 +409,8 @@
if ( refval.equals( THROW ) )
{
- Name farthestSrc = lut.getFarthestReferralAncestor( oldName );
- Name farthestDst = lut.getFarthestReferralAncestor( newName ); // note will not return newName so safe
+ LdapDN farthestSrc = lut.getFarthestReferralAncestor( oldName );
+ LdapDN farthestDst = lut.getFarthestReferralAncestor( newName ); // note will not return newName so safe
if ( farthestSrc == null && farthestDst == null && !lut.isReferral( newName ) )
{
next.move( oldName, newParent );
@@ -465,7 +460,7 @@
Invocation invocation = InvocationStack.getInstance().peek();
ServerLdapContext caller = ( ServerLdapContext ) invocation.getCaller();
String refval = ( String ) caller.getEnvironment().get( Context.REFERRAL );
- Name newName = ( Name ) newParent.clone();
+ LdapDN newName = ( LdapDN ) newParent.clone();
newName.add( newRdn );
// handle a normal modify without following referrals
@@ -481,8 +476,8 @@
if ( refval.equals( THROW ) )
{
- Name farthestSrc = lut.getFarthestReferralAncestor( oldName );
- Name farthestDst = lut.getFarthestReferralAncestor( newName ); // safe to use - does not return newName
+ LdapDN farthestSrc = lut.getFarthestReferralAncestor( oldName );
+ LdapDN farthestDst = lut.getFarthestReferralAncestor( newName ); // safe to use - does not return newName
if ( farthestSrc == null && farthestDst == null && !lut.isReferral( newName ) )
{
next.move( oldName, newParent, newRdn, deleteOldRdn );
@@ -532,9 +527,12 @@
Invocation invocation = InvocationStack.getInstance().peek();
ServerLdapContext caller = ( ServerLdapContext ) invocation.getCaller();
String refval = ( String ) caller.getEnvironment().get( Context.REFERRAL );
- Name newName = ( Name ) oldName.clone();
+ LdapDN newName = ( LdapDN ) oldName.clone();
newName.remove( oldName.size() - 1 );
- newName.add( parser.parse( newRdn ).toString() );
+
+ LdapDN newRdnName = new LdapDN( newRdn );
+ newRdnName = LdapDN.normalize( newRdnName, registry.getNormalizerMapping() );
+ newName.add( newRdnName.toNormName() );
// handle a normal modify without following referrals
if ( refval == null || refval.equals( IGNORE ) )
@@ -549,8 +547,8 @@
if ( refval.equals( THROW ) )
{
- Name farthestSrc = lut.getFarthestReferralAncestor( oldName );
- Name farthestDst = lut.getFarthestReferralAncestor( newName );
+ LdapDN farthestSrc = lut.getFarthestReferralAncestor( oldName );
+ LdapDN farthestDst = lut.getFarthestReferralAncestor( newName );
if ( farthestSrc == null && farthestDst == null && !lut.isReferral( newName ) )
{
next.modifyRn( oldName, newRdn, deleteOldRdn );
@@ -594,7 +592,7 @@
}
- private void checkModify( Name name, int modOp, Attributes mods ) throws NamingException
+ private void checkModify( LdapDN name, int modOp, Attributes mods ) throws NamingException
{
// -------------------------------------------------------------------
// Check and update lut if we change the objectClass
@@ -668,7 +666,7 @@
if ( refval.equals( THROW ) )
{
- Name farthest = lut.getFarthestReferralAncestor( name );
+ LdapDN farthest = lut.getFarthestReferralAncestor( name );
if ( farthest == null )
{
next.modify( name, modOp, mods );
@@ -692,7 +690,7 @@
}
- private void checkModify( Name name, ModificationItem[] mods ) throws NamingException
+ private void checkModify( LdapDN name, ModificationItem[] mods ) throws NamingException
{
boolean isTargetReferral = lut.isReferral( name );
@@ -772,7 +770,7 @@
if ( refval.equals( THROW ) )
{
- Name farthest = lut.getFarthestReferralAncestor( name );
+ LdapDN farthest = lut.getFarthestReferralAncestor( name );
if ( farthest == null )
{
next.modify( name, mods );
@@ -817,7 +815,7 @@
// add referrals immediately after adding the new partition
DirectoryPartition partition = cfg.getContextPartition();
- Name suffix = partition.getSuffix();
+ LdapDN suffix = partition.getSuffix();
Invocation invocation = InvocationStack.getInstance().peek();
NamingEnumeration list = invocation.getProxy().search( suffix, env, getReferralFilter(), getControls(),
SEARCH_BYPASS );
@@ -825,7 +823,7 @@
}
- public void removeContextPartition( NextInterceptor next, Name suffix ) throws NamingException
+ public void removeContextPartition( NextInterceptor next, LdapDN suffix ) throws NamingException
{
// remove referrals immediately before removing the partition
Invocation invocation = InvocationStack.getInstance().peek();
@@ -837,45 +835,50 @@
}
- private void addReferrals( NamingEnumeration referrals, Name base ) throws NamingException
+ private void addReferrals( NamingEnumeration referrals, LdapDN base ) throws NamingException
{
while ( referrals.hasMore() )
{
SearchResult r = ( SearchResult ) referrals.next();
- Name referral = null;
+ LdapDN referral = null;
+ LdapDN result = new LdapDN( r.getName() );
+ result = LdapDN.normalize( result, registry.getNormalizerMapping() );
if ( r.isRelative() )
{
- referral = ( Name ) base.clone();
- referral.addAll( parser.parse( r.getName() ) );
+ referral = ( LdapDN ) base.clone();
+ referral.addAll( result );
}
else
{
- referral = parser.parse( r.getName() );
+ referral = result;
}
}
}
- private void deleteReferrals( NamingEnumeration referrals, Name base ) throws NamingException
+ private void deleteReferrals( NamingEnumeration referrals, LdapDN base ) throws NamingException
{
while ( referrals.hasMore() )
{
SearchResult r = ( SearchResult ) referrals.next();
- Name referral = null;
+ LdapDN referral = null;
+ LdapDN result = new LdapDN( r.getName() );
+ result = LdapDN.normalize( result, registry.getNormalizerMapping() );
+
if ( r.isRelative() )
{
- referral = ( Name ) base.clone();
- referral.addAll( parser.parse( r.getName() ) );
+ referral = ( LdapDN ) base.clone();
+ referral.addAll( result );
}
else
{
- referral = parser.parse( r.getName() );
+ referral = result;
}
}
}
- public NamingEnumeration search( NextInterceptor next, Name base, Map env, ExprNode filter, SearchControls controls )
+ public NamingEnumeration search( NextInterceptor next, LdapDN base, Map env, ExprNode filter, SearchControls controls )
throws NamingException
{
Invocation invocation = InvocationStack.getInstance().peek();
@@ -902,7 +905,7 @@
doReferralExceptionOnSearchBase( base, refs, controls.getSearchScope() );
}
- Name farthest = lut.getFarthestReferralAncestor( base );
+ LdapDN farthest = lut.getFarthestReferralAncestor( base );
if ( farthest == null )
{
return next.search( base, env, filter, controls );
@@ -922,12 +925,12 @@
doReferralExceptionOnSearchBase( base, refs, controls.getSearchScope() );
}
- Name farthest = lut.getFarthestReferralAncestor( base );
+ LdapDN farthest = lut.getFarthestReferralAncestor( base );
if ( farthest == null )
{
SearchResultFilteringEnumeration srfe = ( SearchResultFilteringEnumeration ) next.search( base, env,
filter, controls );
- return new ReferralHandlingEnumeration( srfe, lut, parser, nexus, controls.getSearchScope(), true );
+ return new ReferralHandlingEnumeration( srfe, lut, registry, nexus, controls.getSearchScope(), true );
}
Attributes referral = invocation.getProxy().lookup( farthest, DirectoryPartitionNexusProxy.LOOKUP_BYPASS );
@@ -956,7 +959,7 @@
}
- public void doReferralExceptionOnSearchBase( Name base, Attribute refs, int scope ) throws NamingException
+ public void doReferralExceptionOnSearchBase( LdapDN base, Attribute refs, int scope ) throws NamingException
{
// handle referral here
List list = new ArrayList( refs.size() );
@@ -1016,7 +1019,7 @@
}
- public void doReferralExceptionOnSearchBase( Name farthest, Name targetUpdn, Attribute refs, int scope )
+ public void doReferralExceptionOnSearchBase( LdapDN farthest, LdapDN targetUpdn, Attribute refs, int scope )
throws NamingException
{
// handle referral here
@@ -1043,9 +1046,10 @@
log.error( "Bad URL (" + val + ") for ref in " + farthest + ". Reference will be ignored." );
}
- Name urlDn = parser.parse( ldapUrl.getDn().toString() );
+ LdapDN urlDn = new LdapDN( ldapUrl.getDn().toNormName() );
+ urlDn = LdapDN.normalize( urlDn, registry.getNormalizerMapping() );
int diff = targetUpdn.size() - farthest.size();
- Name extra = new LdapDN();
+ LdapDN extra = new LdapDN();
for ( int jj = 0; jj < diff; jj++ )
{
extra.add( targetUpdn.get( farthest.size() + jj ) );
@@ -1092,7 +1096,10 @@
return true;
}
- if ( lut.isReferral( parser.parse( name ) ) )
+ LdapDN dn = new LdapDN( name );
+ dn = LdapDN.normalize( dn, registry.getNormalizerMapping() );
+
+ if ( lut.isReferral( dn ) )
{
return true;
}
Modified: directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java?rev=411860&r1=411859&r2=411860&view=diff
==============================================================================
--- directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java (original)
+++ directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java Mon Jun 5 10:15:23 2006
@@ -24,7 +24,6 @@
import java.util.Map;
import java.util.Set;
-import javax.naming.Name;
import javax.naming.NamingEnumeration;
import javax.naming.NamingException;
import javax.naming.directory.*;
@@ -154,7 +153,7 @@
}
- public NamingEnumeration list( NextInterceptor nextInterceptor, Name base ) throws NamingException
+ public NamingEnumeration list( NextInterceptor nextInterceptor, LdapDN base ) throws NamingException
{
NamingEnumeration e = nextInterceptor.list( base );
Invocation invocation = InvocationStack.getInstance().peek();
@@ -162,7 +161,7 @@
}
- public NamingEnumeration search( NextInterceptor nextInterceptor, Name base, Map env, ExprNode filter,
+ public NamingEnumeration search( NextInterceptor nextInterceptor, LdapDN base, Map env, ExprNode filter,
SearchControls searchCtls ) throws NamingException
{
// check to make sure the DN searched for is a subentry
@@ -395,7 +394,7 @@
}
- public Attributes lookup( NextInterceptor nextInterceptor, Name name ) throws NamingException
+ public Attributes lookup( NextInterceptor nextInterceptor, LdapDN name ) throws NamingException
{
Attributes result = nextInterceptor.lookup( name );
filterBinaryAttributes( result );
@@ -404,7 +403,7 @@
}
- public Attributes lookup( NextInterceptor nextInterceptor, Name name, String[] attrIds ) throws NamingException
+ public Attributes lookup( NextInterceptor nextInterceptor, LdapDN name, String[] attrIds ) throws NamingException
{
Attributes result = nextInterceptor.lookup( name, attrIds );
if ( result == null )
|