|
|
Author: elecharny
Date: Tue Jun 6 15:37:37 2006
New Revision: 412233
URL: http://svn.apache.org/viewvc?rev=412233&view=rev
Log:
Many fixes... Tests ar ok now.
Modified:
directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/authz/AuthorizationService.java
directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationService.java
directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/enumeration/ReferralHandlingEnumeration.java
directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationService.java
directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/AbstractDirectoryPartition.java
directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/DefaultDirectoryPartitionNexus.java
directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/DirectoryPartition.java
directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/DirectoryPartitionNexus.java
directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/DirectoryPartitionNexusProxy.java
directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeDirectoryPartition.java
directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmDirectoryPartition.java
directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/referral/ReferralService.java
directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/subtree/SubentryService.java
Modified:
directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
URL:
http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java?rev=412233&r1=412232&r2=412233&view=diff
==============================================================================
---
directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
(original)
+++
directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
Tue Jun 6 15:37:37 2006
@@ -23,7 +23,6 @@
import java.util.HashSet;
import javax.naming.Context;
-import javax.naming.Name;
import javax.naming.NamingException;
import javax.naming.directory.Attribute;
import javax.naming.directory.Attributes;
@@ -449,7 +448,10 @@
// create system users area
// -------------------------------------------------------------------
- if ( !partitionNexus.hasEntry( new LdapDN( "ou=users,ou=system" ) ) )
+ LdapDN userDn = new LdapDN( "ou=users,ou=system" );
+ userDn.normalize();
+
+ if ( !partitionNexus.hasEntry( userDn ) )
{
firstStart = true;
@@ -463,14 +465,17 @@
attributes.put( "creatorsName",
DirectoryPartitionNexus.ADMIN_PRINCIPAL );
attributes.put( "createTimestamp", DateUtils.getGeneralizedTime()
);
- partitionNexus.add(new LdapDN( "ou=users,ou=system" ), attributes
);
+ partitionNexus.add( userDn, attributes );
}
// -------------------------------------------------------------------
// create system groups area
// -------------------------------------------------------------------
- if ( !partitionNexus.hasEntry( new LdapDN( "ou=groups,ou=system" ) ) )
+ LdapDN groupDn = new LdapDN( "ou=groups,ou=system" );
+ groupDn.normalize();
+
+ if ( !partitionNexus.hasEntry( groupDn ) )
{
firstStart = true;
@@ -484,7 +489,7 @@
attributes.put( "creatorsName",
DirectoryPartitionNexus.ADMIN_PRINCIPAL );
attributes.put( "createTimestamp", DateUtils.getGeneralizedTime()
);
- partitionNexus.add(new LdapDN( "ou=groups,ou=system" ), attributes
);
+ partitionNexus.add( groupDn, attributes );
}
// -------------------------------------------------------------------
@@ -493,6 +498,8 @@
String upName = "cn=Administrators,ou=groups,ou=system";
LdapDN normName = new LdapDN( "cn=administrators,ou=groups,ou=system"
);
+ normName.normalize();
+
if ( !partitionNexus.hasEntry( normName ) )
{
firstStart = true;
@@ -516,7 +523,10 @@
// create system configuration area
// -------------------------------------------------------------------
- if ( !partitionNexus.hasEntry( new LdapDN(
"ou=configuration,ou=system" ) ) )
+ LdapDN configurationDn = new LdapDN( "ou=configuration,ou=system" );
+ configurationDn.normalize();
+
+ if ( !partitionNexus.hasEntry( configurationDn ) )
{
firstStart = true;
@@ -530,14 +540,17 @@
attributes.put( "creatorsName",
DirectoryPartitionNexus.ADMIN_PRINCIPAL );
attributes.put( "createTimestamp", DateUtils.getGeneralizedTime()
);
- partitionNexus.add(new LdapDN( "ou=configuration,ou=system" ),
attributes );
+ partitionNexus.add( configurationDn, attributes );
}
// -------------------------------------------------------------------
// create system configuration area for partition information
// -------------------------------------------------------------------
- if ( !partitionNexus.hasEntry( new LdapDN(
"ou=partitions,ou=configuration,ou=system" ) ) )
+ LdapDN partitionsDn = new LdapDN(
"ou=partitions,ou=configuration,ou=system" );
+ partitionsDn.normalize();
+
+ if ( !partitionNexus.hasEntry( partitionsDn ) )
{
firstStart = true;
@@ -551,15 +564,17 @@
attributes.put( "creatorsName",
DirectoryPartitionNexus.ADMIN_PRINCIPAL );
attributes.put( "createTimestamp", DateUtils.getGeneralizedTime()
);
- partitionNexus.add(new LdapDN(
- "ou=partitions,ou=configuration,ou=system" ), attributes );
+ partitionNexus.add( partitionsDn, attributes );
}
// -------------------------------------------------------------------
// create system configuration area for services
// -------------------------------------------------------------------
- if ( !partitionNexus.hasEntry( new LdapDN(
"ou=services,ou=configuration,ou=system" ) ) )
+ LdapDN servicesDn = new LdapDN(
"ou=services,ou=configuration,ou=system" );
+ servicesDn.normalize();
+
+ if ( !partitionNexus.hasEntry( servicesDn ) )
{
firstStart = true;
@@ -573,15 +588,17 @@
attributes.put( "creatorsName",
DirectoryPartitionNexus.ADMIN_PRINCIPAL );
attributes.put( "createTimestamp", DateUtils.getGeneralizedTime()
);
- partitionNexus.add(new LdapDN(
- "ou=services,ou=configuration,ou=system" ), attributes );
+ partitionNexus.add( servicesDn, attributes );
}
// -------------------------------------------------------------------
// create system configuration area for interceptors
// -------------------------------------------------------------------
- if ( !partitionNexus.hasEntry( new LdapDN(
"ou=interceptors,ou=configuration,ou=system" ) ) )
+ LdapDN interceptorsDn = new LdapDN(
"ou=interceptors,ou=configuration,ou=system" );
+ interceptorsDn.normalize();
+
+ if ( !partitionNexus.hasEntry( interceptorsDn ) )
{
firstStart = true;
@@ -595,15 +612,17 @@
attributes.put( "creatorsName",
DirectoryPartitionNexus.ADMIN_PRINCIPAL );
attributes.put( "createTimestamp", DateUtils.getGeneralizedTime()
);
- partitionNexus.add(new LdapDN(
- "ou=interceptors,ou=configuration,ou=system" ), attributes );
+ partitionNexus.add( interceptorsDn, attributes );
}
// -------------------------------------------------------------------
// create system preferences area
// -------------------------------------------------------------------
- if ( !partitionNexus.hasEntry( new LdapDN(
"prefNodeName=sysPrefRoot,ou=system" ) ) )
+ LdapDN sysPrefRootDn = new LdapDN(
"prefNodeName=sysPrefRoot,ou=system");
+ sysPrefRootDn.normalize();
+
+ if ( !partitionNexus.hasEntry( sysPrefRootDn ) )
{
firstStart = true;
@@ -618,9 +637,7 @@
attributes.put( "creatorsName",
DirectoryPartitionNexus.ADMIN_PRINCIPAL );
attributes.put( "createTimestamp", DateUtils.getGeneralizedTime()
);
- LdapDN dn = new LdapDN( "prefNodeName=sysPrefRoot,ou=system" );
-
- partitionNexus.add(dn, attributes );
+ partitionNexus.add( sysPrefRootDn, attributes );
}
return firstStart;
@@ -635,7 +652,10 @@
// Warn if the default password is not changed.
boolean needToChangeAdminPassword = false;
- Attributes adminEntry = partitionNexus.lookup( new LdapDN(
DirectoryPartitionNexus.ADMIN_PRINCIPAL ) );
+ LdapDN adminDn = new LdapDN( DirectoryPartitionNexus.ADMIN_PRINCIPAL );
+ adminDn.normalize();
+
+ Attributes adminEntry = partitionNexus.lookup( adminDn );
Object userPassword = adminEntry.get( "userPassword" ).get();
if ( userPassword instanceof byte[] )
{
Modified:
directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/authz/AuthorizationService.java
URL:
http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/authz/AuthorizationService.java?rev=412233&r1=412232&r2=412233&view=diff
==============================================================================
---
directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/authz/AuthorizationService.java
(original)
+++
directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/authz/AuthorizationService.java
Tue Jun 6 15:37:37 2006
@@ -173,7 +173,8 @@
private LdapDN parseNormalized( String name ) throws NamingException
{
LdapDN dn = new LdapDN( name );
- return LdapDN.normalize( dn, attrRegistry.getNormalizerMapping() );
+ dn.normalize();
+ return dn;
}
Modified:
directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationService.java
URL:
http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationService.java?rev=412233&r1=412232&r2=412233&view=diff
==============================================================================
---
directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationService.java
(original)
+++
directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationService.java
Tue Jun 6 15:37:37 2006
@@ -40,11 +40,8 @@
import org.apache.directory.server.core.invocation.InvocationStack;
import org.apache.directory.server.core.jndi.ServerContext;
import org.apache.directory.server.core.partition.DirectoryPartitionNexus;
-import org.apache.directory.server.core.schema.AttributeTypeRegistry;
-import org.apache.directory.server.core.schema.ConcreteNameComponentNormalizer;
import org.apache.directory.shared.ldap.exception.LdapNoPermissionException;
import org.apache.directory.shared.ldap.filter.ExprNode;
-import org.apache.directory.shared.ldap.name.DnParser;
import org.apache.directory.shared.ldap.name.LdapDN;
@@ -62,22 +59,22 @@
/**
* the administrator's distinguished {@link Name}
*/
- private static final Name ADMIN_DN =
DirectoryPartitionNexus.getAdminName();
+ private static Name ADMIN_DN;
/**
* the base distinguished {@link Name} for all users
*/
- private static final Name USER_BASE_DN =
DirectoryPartitionNexus.getUsersBaseName();
+ private static Name USER_BASE_DN;
/**
* the base distinguished {@link Name} for all groups
*/
- private static final Name GROUP_BASE_DN =
DirectoryPartitionNexus.getGroupsBaseName();
+ private static Name GROUP_BASE_DN;
/**
* the name parser used by this service
*/
- private DnParser dnParser;
+ //private DnParser dnParser;
private boolean enabled = true;
@@ -91,11 +88,14 @@
public void init( DirectoryServiceConfiguration factoryCfg,
InterceptorConfiguration cfg ) throws NamingException
{
- AttributeTypeRegistry atr =
factoryCfg.getGlobalRegistries().getAttributeTypeRegistry();
- dnParser = new DnParser( new ConcreteNameComponentNormalizer( atr ) );
+ //AttributeTypeRegistry atr =
factoryCfg.getGlobalRegistries().getAttributeTypeRegistry();
+ //dnParser = new DnParser( new ConcreteNameComponentNormalizer( atr )
);
// disable this static module if basic access control mechanisms are
enabled
enabled =
!factoryCfg.getStartupConfiguration().isAccessControlEnabled();
+ ADMIN_DN = DirectoryPartitionNexus.getAdminName();
+ USER_BASE_DN = DirectoryPartitionNexus.getUsersBaseName();
+ GROUP_BASE_DN = DirectoryPartitionNexus.getGroupsBaseName();
}
@@ -445,11 +445,8 @@
Name dn;
Name principalDn = ( ( ServerContext ) invocation.getCaller()
).getPrincipal().getJndiName();
- synchronized ( dnParser )
- {
- dn = dnParser.parse( result.getName() );
- principalDn = dnParser.parse( principalDn.toString() );
- }
+ dn = new LdapDN( result.getName() );
+ principalDn = new LdapDN( principalDn.toString() );
if ( !principalDn.equals( ADMIN_DN ) )
{
Modified:
directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/enumeration/ReferralHandlingEnumeration.java
URL:
http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/enumeration/ReferralHandlingEnumeration.java?rev=412233&r1=412232&r2=412233&view=diff
==============================================================================
---
directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/enumeration/ReferralHandlingEnumeration.java
(original)
+++
directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/enumeration/ReferralHandlingEnumeration.java
Tue Jun 6 15:37:37 2006
@@ -21,7 +21,6 @@
import java.util.List;
import java.util.NoSuchElementException;
-import javax.naming.Name;
import javax.naming.NamingEnumeration;
import javax.naming.NamingException;
import javax.naming.directory.Attribute;
@@ -80,7 +79,8 @@
{
SearchResult result = ( SearchResult ) underlying.next();
LdapDN dn = new LdapDN( result.getName() );
- dn = LdapDN.normalize( dn, registry.getNormalizerMapping() );
+ dn.normalize();
+
if ( lut.isReferral( dn ) )
{
referrals.add( result );
@@ -167,7 +167,7 @@
if ( refs == null )
{
LdapDN prefetchedDn = new LdapDN( prefetched.getName() );
- prefetchedDn = LdapDN.normalize( prefetchedDn,
registry.getNormalizerMapping() );
+ prefetchedDn.normalize();
refs = nexus.lookup( prefetchedDn ).get( REF_ATTR );
}
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=412233&r1=412232&r2=412233&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
Tue Jun 6 15:37:37 2006
@@ -83,14 +83,14 @@
public void add(NextInterceptor nextInterceptor, LdapDN name, Attributes
attrs)
throws NamingException
{
- LdapDN normalized = LdapDN.normalize( name,
registry.getNormalizerMapping() );
+ LdapDN normalized = LdapDN.normalize( name );
nextInterceptor.add( normalized, attrs );
}
public void delete( NextInterceptor nextInterceptor, LdapDN name ) throws
NamingException
{
- LdapDN normalized = LdapDN.normalize( name,
registry.getNormalizerMapping() );
+ LdapDN normalized = LdapDN.normalize( name );
nextInterceptor.delete( normalized );
}
@@ -98,14 +98,14 @@
public void modify( NextInterceptor nextInterceptor, LdapDN name, int
modOp, Attributes attrs )
throws NamingException
{
- LdapDN normalized = LdapDN.normalize( name,
registry.getNormalizerMapping() );
+ LdapDN normalized = LdapDN.normalize( name );
nextInterceptor.modify( normalized, modOp, attrs );
}
public void modify( NextInterceptor nextInterceptor, LdapDN name,
ModificationItem[] items ) throws NamingException
{
- LdapDN normalized = LdapDN.normalize( name,
registry.getNormalizerMapping() );
+ LdapDN normalized = LdapDN.normalize( name );
nextInterceptor.modify( normalized, items );
}
@@ -113,15 +113,15 @@
public void modifyRn( NextInterceptor nextInterceptor, LdapDN name, String
newRn, boolean deleteOldRn )
throws NamingException
{
- LdapDN normalized = LdapDN.normalize( name,
registry.getNormalizerMapping() );
+ LdapDN normalized = LdapDN.normalize( name );
nextInterceptor.modifyRn( normalized, newRn, deleteOldRn );
}
public void move( NextInterceptor nextInterceptor, LdapDN name, LdapDN
newParentName ) throws NamingException
{
- LdapDN normalized = LdapDN.normalize( name,
registry.getNormalizerMapping() );
- newParentName = LdapDN.normalize( newParentName,
registry.getNormalizerMapping() );
+ LdapDN normalized = LdapDN.normalize( name );
+ newParentName.normalize();
nextInterceptor.move( normalized, newParentName );
}
@@ -129,8 +129,8 @@
public void move( NextInterceptor nextInterceptor, LdapDN name, LdapDN
newParentName, String newRn, boolean deleteOldRn )
throws NamingException
{
- LdapDN normalized = LdapDN.normalize( name,
registry.getNormalizerMapping() );
- newParentName = LdapDN.normalize( newParentName,
registry.getNormalizerMapping() );
+ LdapDN normalized = LdapDN.normalize( name );
+ newParentName.normalize();
nextInterceptor.move( normalized, newParentName, newRn, deleteOldRn );
}
@@ -138,7 +138,7 @@
public NamingEnumeration search( NextInterceptor nextInterceptor, LdapDN
base, Map env, ExprNode filter,
SearchControls searchCtls ) throws NamingException
{
- base = LdapDN.normalize( base, registry.getNormalizerMapping() );
+ base.normalize();
if ( filter.isLeaf() )
{
@@ -181,35 +181,35 @@
public boolean hasEntry( NextInterceptor nextInterceptor, LdapDN name )
throws NamingException
{
- name = LdapDN.normalize( name, registry.getNormalizerMapping() );
+ name = LdapDN.normalize( name );
return nextInterceptor.hasEntry( name );
}
public boolean isSuffix( NextInterceptor nextInterceptor, LdapDN name )
throws NamingException
{
- name = LdapDN.normalize( name, registry.getNormalizerMapping() );
+ name = LdapDN.normalize( name );
return nextInterceptor.isSuffix( name );
}
public NamingEnumeration list( NextInterceptor nextInterceptor, LdapDN
base ) throws NamingException
{
- base = LdapDN.normalize( base, registry.getNormalizerMapping() );
+ base = LdapDN.normalize( base );
return nextInterceptor.list( base );
}
public Attributes lookup( NextInterceptor nextInterceptor, LdapDN name )
throws NamingException
{
- name = LdapDN.normalize( name, registry.getNormalizerMapping() );
+ name = LdapDN.normalize( name );
return nextInterceptor.lookup( name );
}
public Attributes lookup( NextInterceptor nextInterceptor, LdapDN name,
String[] attrIds ) throws NamingException
{
- name = LdapDN.normalize( name, registry.getNormalizerMapping() );
+ name = LdapDN.normalize( name );
return nextInterceptor.lookup( name, attrIds );
}
@@ -220,21 +220,21 @@
public LdapDN getMatchedName ( NextInterceptor nextInterceptor, LdapDN
name ) throws NamingException
{
- name = LdapDN.normalize( name, registry.getNormalizerMapping() );
+ name = LdapDN.normalize( name );
return nextInterceptor.getMatchedName( name );
}
public LdapDN getSuffix ( NextInterceptor nextInterceptor, LdapDN name )
throws NamingException
{
- name = LdapDN.normalize( name, registry.getNormalizerMapping() );
+ name = LdapDN.normalize( name );
return nextInterceptor.getSuffix( name );
}
public boolean compare( NextInterceptor next, LdapDN name, String oid,
Object value ) throws NamingException
{
- name = LdapDN.normalize( name, registry.getNormalizerMapping() );
+ name = LdapDN.normalize( name );
return next.compare( name, oid, value );
}
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=412233&r1=412232&r2=412233&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
Tue Jun 6 15:37:37 2006
@@ -19,7 +19,6 @@
import java.util.ArrayList;
import java.util.List;
-import java.util.Map;
import javax.naming.NameNotFoundException;
import javax.naming.NamingEnumeration;
@@ -168,9 +167,7 @@
if ( suffixDn == null )
{
suffixDn = new LdapDN( cfg.getSuffix() );
- Map oids =
getFactoryConfiguration().getGlobalRegistries().getAttributeTypeRegistry()
- .getNormalizerMapping();
- suffixDn = LdapDN.normalize( suffixDn, oids );
+ suffixDn.normalize();
}
return suffixDn;
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=412233&r1=412232&r2=412233&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
Tue Jun 6 15:37:37 2006
@@ -267,7 +267,7 @@
partitions.put( key, system );
Attribute namingContexts = rootDSE.get( NAMINGCTXS_ATTR );
- namingContexts.add( system.getSuffix().toString() );
+ namingContexts.add( system.getUpSuffix().toString() );
return systemCfg;
}
@@ -486,6 +486,11 @@
public LdapDN getSuffix()
+ {
+ return LdapDN.EMPTY_LDAPDN;
+ }
+
+ public LdapDN getUpSuffix()
{
return LdapDN.EMPTY_LDAPDN;
}
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=412233&r1=412232&r2=412233&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
Tue Jun 6 15:37:37 2006
@@ -21,7 +21,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.Attributes;
@@ -91,6 +90,14 @@
*/
LdapDN getSuffix() throws NamingException;
+ /**
+ * Gets the distinguished/absolute name of the suffix for all entries
+ * stored within this ContextPartition.
+ *
+ * @return Name representing the distinguished/absolute name of this
+ * ContextPartitions root context.
+ */
+ LdapDN getUpSuffix() throws NamingException;
/**
* Deletes a leaf entry from this ContextPartition: non-leaf entries
cannot be
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=412233&r1=412232&r2=412233&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
Tue Jun 6 15:37:37 2006
@@ -20,6 +20,7 @@
import java.util.Iterator;
import java.util.Set;
+import javax.naming.InvalidNameException;
import javax.naming.Name;
import javax.naming.NamingException;
import javax.naming.directory.Attributes;
@@ -75,6 +76,19 @@
catch ( NamingException e )
{
throw new InternalError();
+ }
+
+ try
+ {
+ adminDn.normalize();
+ }
+ catch ( InvalidNameException ine )
+ {
+ // Nothing we can do ...
+ }
+ catch ( NamingException ne )
+ {
+ // Nothing we can do ...
}
return adminDn;
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=412233&r1=412232&r2=412233&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
Tue Jun 6 15:37:37 2006
@@ -153,6 +153,11 @@
return this.configuration.getPartitionNexus().getSuffix();
}
+ public LdapDN getUpSuffix() throws NamingException
+ {
+ return this.configuration.getPartitionNexus().getUpSuffix();
+ }
+
public void sync() throws NamingException
{
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=412233&r1=412232&r2=412233&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
Tue Jun 6 15:37:37 2006
@@ -181,9 +181,8 @@
Attributes suffixOnDisk = getSuffixEntry();
if ( suffixOnDisk == null )
{
- Map oids =
factoryCfg.getGlobalRegistries().getAttributeTypeRegistry().getNormalizerMapping();
LdapDN suffix = new LdapDN( cfg.getSuffix() );
- LdapDN normalizedSuffix = LdapDN.normalize( suffix, oids );
+ LdapDN normalizedSuffix = LdapDN.normalize( suffix );
add( normalizedSuffix, cfg.getContextEntry() );
}
}
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=412233&r1=412232&r2=412233&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
Tue Jun 6 15:37:37 2006
@@ -124,9 +124,10 @@
public synchronized void init( DirectoryServiceConfiguration factoryCfg,
DirectoryPartitionConfiguration cfg )
throws NamingException
{
- this.upSuffix = new LdapDN( cfg.getSuffix() );
Map oids =
factoryCfg.getGlobalRegistries().getAttributeTypeRegistry().getNormalizerMapping();
- this.normSuffix = LdapDN.normalize( upSuffix, oids );
+ LdapDN.setOidsMap( oids );
+ this.upSuffix = new LdapDN( cfg.getSuffix() );
+ this.normSuffix = LdapDN.normalize( upSuffix );
File workingDirectory = new File(
factoryCfg.getStartupConfiguration().getWorkingDirectory().getPath()
+ File.separator + cfg.getName() );
@@ -866,6 +867,11 @@
public LdapDN getSuffix()
{
return normSuffix;
+ }
+
+ public LdapDN getUpSuffix()
+ {
+ return upSuffix;
}
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=412233&r1=412232&r2=412233&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
Tue Jun 6 15:37:37 2006
@@ -195,7 +195,7 @@
}
LdapDN urlDn = new LdapDN( ldapUrl.getDn().toNormName() );
- urlDn = LdapDN.normalize( urlDn, registry.getNormalizerMapping() );
+ urlDn.normalize();
if ( urlDn.equals( farthest ) )
{
// according to the protocol there is no need for the dn since
it is the same as this request
@@ -531,7 +531,7 @@
newName.remove( oldName.size() - 1 );
LdapDN newRdnName = new LdapDN( newRdn );
- newRdnName = LdapDN.normalize( newRdnName,
registry.getNormalizerMapping() );
+ newRdnName.normalize();
newName.add( newRdnName.toNormName() );
// handle a normal modify without following referrals
@@ -842,7 +842,9 @@
SearchResult r = ( SearchResult ) referrals.next();
LdapDN referral = null;
LdapDN result = new LdapDN( r.getName() );
- result = LdapDN.normalize( result, registry.getNormalizerMapping()
);
+ //result = LdapDN.normalize( result,
registry.getNormalizerMapping() );
+ result.normalize();
+
if ( r.isRelative() )
{
referral = ( LdapDN ) base.clone();
@@ -863,7 +865,7 @@
SearchResult r = ( SearchResult ) referrals.next();
LdapDN referral = null;
LdapDN result = new LdapDN( r.getName() );
- result = LdapDN.normalize( result, registry.getNormalizerMapping()
);
+ result.normalize();
if ( r.isRelative() )
{
@@ -1047,7 +1049,7 @@
}
LdapDN urlDn = new LdapDN( ldapUrl.getDn().toNormName() );
- urlDn = LdapDN.normalize( urlDn, registry.getNormalizerMapping() );
+ urlDn.normalize();
int diff = targetUpdn.size() - farthest.size();
LdapDN extra = new LdapDN();
for ( int jj = 0; jj < diff; jj++ )
@@ -1097,7 +1099,7 @@
}
LdapDN dn = new LdapDN( name );
- dn = LdapDN.normalize( dn, registry.getNormalizerMapping() );
+ dn.normalize();
if ( lut.isReferral( dn ) )
{
Modified:
directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/subtree/SubentryService.java
URL:
http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/subtree/SubentryService.java?rev=412233&r1=412232&r2=412233&view=diff
==============================================================================
---
directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/subtree/SubentryService.java
(original)
+++
directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/subtree/SubentryService.java
Tue Jun 6 15:37:37 2006
@@ -123,7 +123,8 @@
while ( suffixes.hasNext() )
{
LdapDN suffix = new LdapDN( ( String ) suffixes.next() );
- suffix = LdapDN.normalize( suffix, registry.getNormalizerMapping()
);
+ //suffix = LdapDN.normalize( suffix,
registry.getNormalizerMapping() );
+ suffix.normalize();
NamingEnumeration subentries = nexus.search( suffix,
factoryCfg.getEnvironment(), filter, controls );
while ( subentries.hasMore() )
{
@@ -144,7 +145,8 @@
}
LdapDN dnName = new LdapDN( dn );
- dnName = LdapDN.normalize( dnName,
registry.getNormalizerMapping() );
+ //dnName = LdapDN.normalize( dnName,
registry.getNormalizerMapping() );
+ dnName.normalize();
subtrees.put( dnName.toString(), ss );
}
}
@@ -393,7 +395,7 @@
SearchResult result = ( SearchResult ) subentries.next();
Attributes candidate = result.getAttributes();
LdapDN dn = new LdapDN( result.getName() );
- dn = LdapDN.normalize( dn, registry.getNormalizerMapping() );
+ dn.normalize();
if ( evaluator.evaluate( ss, apName, dn, candidate.get(
"objectClass" ) ) )
{
@@ -521,7 +523,7 @@
SearchResult result = ( SearchResult ) subentries.next();
Attributes candidate = result.getAttributes();
LdapDN dn = new LdapDN( result.getName() );
- dn = LdapDN.normalize( dn, registry.getNormalizerMapping() );
+ dn.normalize();
if ( evaluator.evaluate( ss, apName, dn, candidate.get(
"objectClass" ) ) )
{
@@ -655,7 +657,7 @@
newName.remove( newName.size() - 1 );
LdapDN rdn = new LdapDN( newRn );
- rdn = LdapDN.normalize( rdn, registry.getNormalizerMapping() );
+ rdn.normalize();
newName.addAll( rdn );
subtrees.put( newName.toString(), ss );
@@ -674,7 +676,7 @@
SearchResult result = ( SearchResult ) subentries.next();
Attributes candidate = result.getAttributes();
LdapDN dn = new LdapDN( result.getName() );
- dn = LdapDN.normalize( dn, registry.getNormalizerMapping() );
+ dn.normalize();
if ( evaluator.evaluate( ss, apName, dn, candidate.get(
"objectClass" ) ) )
{
@@ -724,7 +726,7 @@
newName.remove( newName.size() - 1 );
LdapDN rdn = new LdapDN( newRn );
- rdn = LdapDN.normalize( rdn, registry.getNormalizerMapping() );
+ rdn.normalize();
newName.addAll( rdn );
subtrees.put( newName.toString(), ss );
@@ -744,7 +746,7 @@
SearchResult result = ( SearchResult ) subentries.next();
Attributes candidate = result.getAttributes();
LdapDN dn = new LdapDN( result.getName() );
- dn = LdapDN.normalize( dn, registry.getNormalizerMapping() );
+ dn.normalize();
if ( evaluator.evaluate( ss, apName, dn, candidate.get(
"objectClass" ) ) )
{
@@ -810,7 +812,7 @@
SearchResult result = ( SearchResult ) subentries.next();
Attributes candidate = result.getAttributes();
LdapDN dn = new LdapDN( result.getName() );
- dn = LdapDN.normalize( dn, registry.getNormalizerMapping() );
+ dn.normalize();
if ( evaluator.evaluate( ss, apName, dn, candidate.get(
"objectClass" ) ) )
{
@@ -887,7 +889,7 @@
SearchResult result = ( SearchResult ) subentries.next();
Attributes candidate = result.getAttributes();
LdapDN dn = new LdapDN( result.getName() );
- dn = LdapDN.normalize( dn, registry.getNormalizerMapping() );
+ dn.normalize();
if ( evaluator.evaluate( ssOld, apName, dn, candidate.get(
"objectClass" ) ) )
{
@@ -907,7 +909,7 @@
SearchResult result = ( SearchResult ) subentries.next();
Attributes candidate = result.getAttributes();
LdapDN dn = new LdapDN( result.getName() );
- dn = LdapDN.normalize( dn, registry.getNormalizerMapping() );
+ dn.normalize();
if ( evaluator.evaluate( ssNew, apName, dn, candidate.get(
"objectClass" ) ) )
{
@@ -973,7 +975,7 @@
SearchResult result = ( SearchResult ) subentries.next();
Attributes candidate = result.getAttributes();
LdapDN dn = new LdapDN( result.getName() );
- dn = LdapDN.normalize( dn, registry.getNormalizerMapping() );
+ dn.normalize();
if ( evaluator.evaluate( ssOld, apName, dn, candidate.get(
"objectClass" ) ) )
{
@@ -993,7 +995,7 @@
SearchResult result = ( SearchResult ) subentries.next();
Attributes candidate = result.getAttributes();
LdapDN dn = new LdapDN( result.getName() );
- dn = LdapDN.normalize( dn, registry.getNormalizerMapping() );
+ dn.normalize();
if ( evaluator.evaluate( ssNew, apName, dn, candidate.get(
"objectClass" ) ) )
{
@@ -1305,16 +1307,16 @@
if ( !result.isRelative() )
{
LdapDN ndn = new LdapDN( dn );
- ndn = LdapDN.normalize( ndn, registry.getNormalizerMapping() );
+ ndn.normalize();
String normalizedDn = ndn.toString();
return !subtrees.containsKey( normalizedDn );
}
LdapDN name = new LdapDN(
invocation.getCaller().getNameInNamespace() );
- name = LdapDN.normalize( name, registry.getNormalizerMapping() );
+ name.normalize();
LdapDN rest = new LdapDN( result.getName() );
- rest = LdapDN.normalize( rest, registry.getNormalizerMapping() );
+ rest.normalize();
name.addAll( rest );
return !subtrees.containsKey( name.toString() );
}
@@ -1366,15 +1368,15 @@
if ( !result.isRelative() )
{
LdapDN ndn = new LdapDN( dn );
- ndn = LdapDN.normalize( ndn, registry.getNormalizerMapping() );
+ ndn.normalize();
return subtrees.containsKey( ndn.toNormName() );
}
LdapDN name = new LdapDN(
invocation.getCaller().getNameInNamespace() );
- name = LdapDN.normalize( name, registry.getNormalizerMapping() );
+ name.normalize();
LdapDN rest = new LdapDN( result.getName() );
- rest = LdapDN.normalize( rest, registry.getNormalizerMapping() );
+ rest.normalize();
name.addAll( rest );
return subtrees.containsKey( name.toNormName() );
}
|
|