You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2010/07/22 09:36:14 UTC
svn commit: r966528 [1/3] - in /directory:
apacheds/branches/apacheds-subtree/core-api/
apacheds/branches/apacheds-subtree/core-api/src/main/java/org/apache/directory/server/core/schema/
apacheds/branches/apacheds-subtree/core-api/src/main/java/org/apa...
Author: elecharny
Date: Thu Jul 22 07:36:11 2010
New Revision: 966528
URL: http://svn.apache.org/viewvc?rev=966528&view=rev
Log:
Merged changes done in trunk into the branch
Modified:
directory/apacheds/branches/apacheds-subtree/core-api/ (props changed)
directory/apacheds/branches/apacheds-subtree/core-api/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java
directory/apacheds/branches/apacheds-subtree/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartition.java
directory/apacheds/branches/apacheds-subtree/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDaoImpl.java
directory/apacheds/branches/apacheds-subtree/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SchemaSynchronizer.java
directory/apacheds/branches/apacheds-subtree/core-integ/ (props changed)
directory/apacheds/branches/apacheds-subtree/core-integ/src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java
directory/apacheds/branches/apacheds-subtree/core-integ/src/test/java/org/apache/directory/server/core/authn/ppolicy/PasswordPolicyTest.java
directory/apacheds/branches/apacheds-subtree/core-integ/src/test/java/org/apache/directory/server/core/authz/AuthorizationServiceAsNonAdminIT.java
directory/apacheds/branches/apacheds-subtree/core-integ/src/test/java/org/apache/directory/server/core/collective/CollectiveAttributeServiceIT.java
directory/apacheds/branches/apacheds-subtree/core-integ/src/test/java/org/apache/directory/server/core/configuration/PartitionConfigurationIT.java
directory/apacheds/branches/apacheds-subtree/core-integ/src/test/java/org/apache/directory/server/core/operational/OperationalAttributeServiceIT.java
directory/apacheds/branches/apacheds-subtree/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxHandlerIT.java
directory/apacheds/branches/apacheds-subtree/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java
directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java (contents, props changed)
directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/ReferralManagerImpl.java (contents, props changed)
directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/authz/ (props changed)
directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java
directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java
directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java
directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/exception/ (props changed)
directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java
directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/operational/ (props changed)
directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java
directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/partition/ (props changed)
directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/prefs/ (props changed)
directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/prefs/ServerSystemPreferences.java
directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/referral/ (props changed)
directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java
directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/schema/ (props changed)
directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/schema/DefaultSchemaService.java
directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/security/ (props changed)
directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/security/CoreKeyStoreSpi.java
directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/sp/ (props changed)
directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/sp/LdapClassLoader.java
directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/subtree/ (props changed)
directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/subtree/SubentryCache.java (props changed)
directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java (contents, props changed)
directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/trigger/ (props changed)
directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/trigger/TriggerSpecCache.java
directory/apacheds/branches/apacheds-subtree/core/src/test/java/ (props changed)
directory/apacheds/branches/apacheds-subtree/core/src/test/java/org/apache/directory/server/core/schema/SchemaCheckerTest.java
directory/apacheds/branches/apacheds-subtree/jdbm-partition/ (props changed)
directory/apacheds/branches/apacheds-subtree/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java
directory/apacheds/branches/apacheds-subtree/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/tree/ (props changed)
directory/apacheds/branches/apacheds-subtree/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/tree/PartitionTreeTest.java (props changed)
directory/apacheds/branches/apacheds-subtree/jdbm-partition/src/test/java/org/apache/directory/server/core/schema/ (props changed)
directory/apacheds/branches/apacheds-subtree/jdbm-partition/src/test/java/org/apache/directory/server/core/schema/PartitionSchemaLoaderTest.java (props changed)
directory/apacheds/branches/apacheds-subtree/ldif-partition/ (props changed)
directory/apacheds/branches/apacheds-subtree/ldif-partition/src/test/java/org/apache/directory/server/core/partition/LdifPartitionTest.java
directory/apacheds/branches/apacheds-subtree/protocol-ldap/ (props changed)
directory/apacheds/branches/apacheds-subtree/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/ModifyDnHandler.java
directory/apacheds/branches/apacheds-subtree/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchHandler.java
directory/apacheds/branches/apacheds-subtree/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplConsumer.java (contents, props changed)
directory/apacheds/branches/apacheds-subtree/server-config/ (props changed)
directory/apacheds/branches/apacheds-subtree/server-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java (contents, props changed)
directory/apacheds/branches/apacheds-subtree/server-config/src/main/resources/ (props changed)
directory/apacheds/branches/apacheds-subtree/server-config/src/test/java/org/apache/directory/server/config/ConfigPartitionReaderTest.java (props changed)
directory/apacheds/branches/apacheds-subtree/server-integ/ (props changed)
directory/apacheds/branches/apacheds-subtree/server-integ/src/test/java/org/apache/directory/server/operations/add/AddIT.java
directory/apacheds/branches/apacheds-subtree/server-jndi/ (props changed)
directory/apacheds/branches/apacheds-subtree/server-jndi/src/main/java/org/apache/directory/server/configuration/ApacheDS.java
directory/apacheds/branches/apacheds-subtree/server-tools/ (props changed)
directory/apacheds/branches/apacheds-subtree/server-tools/src/main/java/org/apache/directory/server/ldap/handlers/extended/LaunchDiagnosticUiHandler.java
directory/apacheds/branches/apacheds-subtree/xdbm-partition/ (props changed)
directory/apacheds/branches/apacheds-subtree/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java
directory/apacheds/branches/apacheds-subtree/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/AbstractStoreTest.java
directory/apacheds/branches/apacheds-subtree/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/StoreUtils.java
directory/apacheds/branches/apacheds-subtree/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlStoreTest.java
directory/apacheds/branches/apacheds-subtree/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/GreaterEqTest.java
directory/apacheds/branches/apacheds-subtree/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/LessEqTest.java
directory/apacheds/branches/apacheds-subtree/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/OneLevelScopeTest.java
directory/apacheds/branches/apacheds-subtree/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/SubtreeScopeTest.java
directory/shared/branches/shared-subtree/ldap/ (props changed)
directory/shared/branches/shared-subtree/ldap/src/main/java/org/apache/directory/shared/ldap/name/DN.java
directory/shared/branches/shared-subtree/ldap/src/main/java/org/apache/directory/shared/ldap/name/RDN.java
directory/shared/branches/shared-subtree/ldap/src/main/java/org/apache/directory/shared/ldap/schema/comparators/DnComparator.java
directory/shared/branches/shared-subtree/ldap/src/main/java/org/apache/directory/shared/ldap/schema/comparators/UniqueMemberComparator.java
directory/shared/branches/shared-subtree/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/DnNormalizer.java
directory/shared/branches/shared-subtree/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/UniqueMemberNormalizer.java
Propchange: directory/apacheds/branches/apacheds-subtree/core-api/
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Thu Jul 22 07:36:11 2010
@@ -0,0 +1,4 @@
+/directory/apacheds/branches/apacheds-replication/core-api:749790-764110
+/directory/apacheds/branches/apacheds-schema/core-api:806623-896441
+/directory/apacheds/branches/xdbm-refactoring/core-api:945827-946347
+/directory/apacheds/trunk/core-api:965704-966208
Modified: directory/apacheds/branches/apacheds-subtree/core-api/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-subtree/core-api/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java?rev=966528&r1=966527&r2=966528&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-subtree/core-api/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java (original)
+++ directory/apacheds/branches/apacheds-subtree/core-api/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java Thu Jul 22 07:36:11 2010
@@ -101,45 +101,38 @@ public class PartitionSchemaLoader exten
{
// Initialize AttributeType Dns
- DN dn = new DN( SchemaConstants.ATTRIBUTES_TYPE_PATH, "cn=" + schemaName, SchemaConstants.OU_SCHEMA );
+ DN dn = new DN( schemaManager, SchemaConstants.ATTRIBUTES_TYPE_PATH, "cn=" + schemaName, SchemaConstants.OU_SCHEMA );
- dn.normalize( schemaManager.getNormalizerMapping() );
staticAttributeTypeDNs.put( schemaName, dn );
// Initialize ObjectClasses Dns
- dn = new DN( SchemaConstants.OBJECT_CLASSES_PATH, "cn=" + schemaName, SchemaConstants.OU_SCHEMA );
+ dn = new DN( schemaManager, SchemaConstants.OBJECT_CLASSES_PATH, "cn=" + schemaName, SchemaConstants.OU_SCHEMA );
- dn.normalize( schemaManager.getNormalizerMapping() );
staticObjectClassesDNs.put( schemaName, dn );
// Initialize MatchingRules Dns
- dn = new DN( SchemaConstants.MATCHING_RULES_PATH, "cn=" + schemaName, SchemaConstants.OU_SCHEMA );
+ dn = new DN( schemaManager, SchemaConstants.MATCHING_RULES_PATH, "cn=" + schemaName, SchemaConstants.OU_SCHEMA );
- dn.normalize( schemaManager.getNormalizerMapping() );
staticMatchingRulesDNs.put( schemaName, dn );
// Initialize Comparators Dns
- dn = new DN( SchemaConstants.COMPARATORS_PATH, "cn=" + schemaName, SchemaConstants.OU_SCHEMA );
+ dn = new DN( schemaManager, SchemaConstants.COMPARATORS_PATH, "cn=" + schemaName, SchemaConstants.OU_SCHEMA );
- dn.normalize( schemaManager.getNormalizerMapping() );
staticComparatorsDNs.put( schemaName, dn );
// Initialize Normalizers Dns
- dn = new DN( SchemaConstants.NORMALIZERS_PATH, "cn=" + schemaName, SchemaConstants.OU_SCHEMA );
+ dn = new DN( schemaManager, SchemaConstants.NORMALIZERS_PATH, "cn=" + schemaName, SchemaConstants.OU_SCHEMA );
- dn.normalize( schemaManager.getNormalizerMapping() );
staticNormalizersDNs.put( schemaName, dn );
// Initialize SyntaxCheckers Dns
- dn = new DN( SchemaConstants.SYNTAX_CHECKERS_PATH, "cn=" + schemaName, SchemaConstants.OU_SCHEMA );
+ dn = new DN( schemaManager, SchemaConstants.SYNTAX_CHECKERS_PATH, "cn=" + schemaName, SchemaConstants.OU_SCHEMA );
- dn.normalize( schemaManager.getNormalizerMapping() );
staticSyntaxCheckersDNs.put( schemaName, dn );
// Initialize Syntaxes Dns
- dn = new DN( SchemaConstants.SYNTAXES_PATH, "cn=" + schemaName, SchemaConstants.OU_SCHEMA );
+ dn = new DN( schemaManager, SchemaConstants.SYNTAXES_PATH, "cn=" + schemaName, SchemaConstants.OU_SCHEMA );
- dn.normalize( schemaManager.getNormalizerMapping() );
staticSyntaxesDNs.put( schemaName, dn );
}
@@ -154,9 +147,8 @@ public class PartitionSchemaLoader exten
if ( dn == null )
{
- dn = new DN( path, "cn=" + schema.getSchemaName(), SchemaConstants.OU_SCHEMA );
+ dn = new DN( schemaManager, path, "cn=" + schema.getSchemaName(), SchemaConstants.OU_SCHEMA );
- dn.normalize( schemaManager.getNormalizerMapping() );
staticDNs.put( schema.getSchemaName(), dn );
}
Modified: directory/apacheds/branches/apacheds-subtree/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-subtree/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartition.java?rev=966528&r1=966527&r2=966528&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-subtree/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartition.java (original)
+++ directory/apacheds/branches/apacheds-subtree/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartition.java Thu Jul 22 07:36:11 2010
@@ -209,8 +209,7 @@ public final class SchemaPartition exten
// Load apachemeta schema from within the ldap-schema Jar with all the
// schema it depends on. This is a minimal mandatory set of schemas.
// -----------------------------------------------------------------------
- schemaDN = new DN( SchemaConstants.OU_SCHEMA );
- schemaDN.normalize( schemaManager.getNormalizerMapping() );
+ schemaDN = new DN( SchemaConstants.OU_SCHEMA, schemaManager );
wrapped.setId( ID );
wrapped.setSuffix( schemaDN );
@@ -235,8 +234,7 @@ public final class SchemaPartition exten
throw new RuntimeException( e );
}
- schemaModificationDN = new DN( ServerDNConstants.SCHEMA_MODIFICATIONS_DN );
- schemaModificationDN.normalize( schemaManager.getNormalizerMapping() );
+ schemaModificationDN = new DN( ServerDNConstants.SCHEMA_MODIFICATIONS_DN, schemaManager );
}
Modified: directory/apacheds/branches/apacheds-subtree/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDaoImpl.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-subtree/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDaoImpl.java?rev=966528&r1=966527&r2=966528&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-subtree/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDaoImpl.java (original)
+++ directory/apacheds/branches/apacheds-subtree/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDaoImpl.java Thu Jul 22 07:36:11 2010
@@ -195,8 +195,7 @@ public class SchemaPartitionDaoImpl impl
private EntryFilteringCursor listSchemas() throws Exception
{
- DN base = new DN( SchemaConstants.OU_SCHEMA );
- base.normalize( schemaManager.getNormalizerMapping() );
+ DN base = new DN( SchemaConstants.OU_SCHEMA, schemaManager );
ExprNode filter = new EqualityNode<String>( OBJECT_CLASS_AT,
new StringValue( MetaSchemaConstants.META_SCHEMA_OC ) );
@@ -214,8 +213,7 @@ public class SchemaPartitionDaoImpl impl
*/
public Schema getSchema( String schemaName ) throws Exception
{
- DN dn = new DN( "cn=" + schemaName + ",ou=schema" );
- dn.normalize( schemaManager.getNormalizerMapping() );
+ DN dn = new DN( "cn=" + schemaName + ",ou=schema", schemaManager );
return factory.getSchema( partition.lookup( new LookupOperationContext( null, dn ) ) );
}
@@ -567,8 +565,7 @@ public class SchemaPartitionDaoImpl impl
*/
public void enableSchema( String schemaName ) throws Exception
{
- DN dn = new DN( "cn=" + schemaName + ",ou=schema" );
- dn.normalize( schemaManager.getNormalizerMapping() );
+ DN dn = new DN( "cn=" + schemaName + ",ou=schema", schemaManager );
Entry entry = partition.lookup( new LookupOperationContext( null, dn ) );
EntryAttribute disabledAttr = entry.get( disabledAttributeType );
List<Modification> mods = new ArrayList<Modification>( 3 );
Modified: directory/apacheds/branches/apacheds-subtree/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SchemaSynchronizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-subtree/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SchemaSynchronizer.java?rev=966528&r1=966527&r2=966528&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-subtree/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SchemaSynchronizer.java (original)
+++ directory/apacheds/branches/apacheds-subtree/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SchemaSynchronizer.java Thu Jul 22 07:36:11 2010
@@ -103,8 +103,7 @@ public class SchemaSynchronizer implemen
dependenciesAT = registries.getAttributeTypeRegistry()
.lookup( MetaSchemaConstants.M_DEPENDENCIES_AT );
- ouSchemaDN = new DN( SchemaConstants.OU_SCHEMA );
- ouSchemaDN.normalize( registries.getAttributeTypeRegistry().getNormalizerMapping() );
+ ouSchemaDN = new DN( SchemaConstants.OU_SCHEMA, schemaManager );
}
Propchange: directory/apacheds/branches/apacheds-subtree/core-integ/
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Thu Jul 22 07:36:11 2010
@@ -0,0 +1,4 @@
+/directory/apacheds/branches/apacheds-replication/core-integ:749790-764110
+/directory/apacheds/branches/apacheds-schema/core-integ:806623-896441
+/directory/apacheds/branches/xdbm-refactoring/core-integ:945827-946347
+/directory/apacheds/trunk/core-integ:965704-966336
Modified: directory/apacheds/branches/apacheds-subtree/core-integ/src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-subtree/core-integ/src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java?rev=966528&r1=966527&r2=966528&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-subtree/core-integ/src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java (original)
+++ directory/apacheds/branches/apacheds-subtree/core-integ/src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java Thu Jul 22 07:36:11 2010
@@ -151,8 +151,7 @@ public class IntegrationUtils
principalDn = "";
}
- DN userDn = new DN( principalDn );
- userDn.normalize( service.getSchemaManager().getNormalizerMapping() );
+ DN userDn = new DN( principalDn, service.getSchemaManager() );
LdapPrincipal principal = new LdapPrincipal( userDn, AuthenticationLevel.SIMPLE );
if ( dn == null )
@@ -174,8 +173,7 @@ public class IntegrationUtils
principalDn = "";
}
- DN userDn = new DN( principalDn );
- userDn.normalize( service.getSchemaManager().getNormalizerMapping() );
+ DN userDn = new DN( principalDn, service.getSchemaManager() );
LdapPrincipal principal = new LdapPrincipal( userDn, AuthenticationLevel.SIMPLE );
if ( dn == null )
Modified: directory/apacheds/branches/apacheds-subtree/core-integ/src/test/java/org/apache/directory/server/core/authn/ppolicy/PasswordPolicyTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-subtree/core-integ/src/test/java/org/apache/directory/server/core/authn/ppolicy/PasswordPolicyTest.java?rev=966528&r1=966527&r2=966528&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-subtree/core-integ/src/test/java/org/apache/directory/server/core/authn/ppolicy/PasswordPolicyTest.java (original)
+++ directory/apacheds/branches/apacheds-subtree/core-integ/src/test/java/org/apache/directory/server/core/authn/ppolicy/PasswordPolicyTest.java Thu Jul 22 07:36:11 2010
@@ -77,6 +77,8 @@ import org.junit.runner.RunWith;
@CreateTransport( protocol = "LDAP" ),
@CreateTransport( protocol = "LDAPS" )
})
+
+// disable changelog, for more info see DIRSERVER-1528
@CreateDS( enableChangeLog=false)
public class PasswordPolicyTest extends AbstractLdapTestUnit
{
@@ -237,9 +239,9 @@ public class PasswordPolicyTest extends
modResp = connection.modify( modReq );
assertEquals( ResultCodeEnum.SUCCESS, modResp.getLdapResult().getResultCode() );
-// LdapConnection userConnection = getNetworkConnectionAs( ldapServer, userDn.getName(), "123456" );
-// assertNotNull( userConnection );
-// assertTrue( userConnection.isAuthenticated() );
+ LdapConnection userConnection = getNetworkConnectionAs( ldapServer, userDn.getName(), "123456" );
+ assertNotNull( userConnection );
+ assertTrue( userConnection.isAuthenticated() );
}
private PasswordPolicyResponseControl getPwdRespCtrl( AbstractResponseWithResult resp ) throws Exception
@@ -251,7 +253,6 @@ public class PasswordPolicyTest extends
}
PasswordPolicyResponseControl respCtrl = new PasswordPolicyResponseControl();
- // System.out.println( StringTools.dumpBytes( ctrl.getValue() ) );
decoder.decode( ctrl.getValue(), respCtrl );
return respCtrl;
Modified: directory/apacheds/branches/apacheds-subtree/core-integ/src/test/java/org/apache/directory/server/core/authz/AuthorizationServiceAsNonAdminIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-subtree/core-integ/src/test/java/org/apache/directory/server/core/authz/AuthorizationServiceAsNonAdminIT.java?rev=966528&r1=966527&r2=966528&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-subtree/core-integ/src/test/java/org/apache/directory/server/core/authz/AuthorizationServiceAsNonAdminIT.java (original)
+++ directory/apacheds/branches/apacheds-subtree/core-integ/src/test/java/org/apache/directory/server/core/authz/AuthorizationServiceAsNonAdminIT.java Thu Jul 22 07:36:11 2010
@@ -141,8 +141,7 @@ public class AuthorizationServiceAsNonAd
Modification mod = new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE, attribute );
mods.add( mod );
- DN userDn = new DN( "uid=akarasulu,ou=users,ou=system" );
- userDn.normalize( service.getSchemaManager().getAttributeTypeRegistry().getNormalizerMapping() );
+ DN userDn = new DN( "uid=akarasulu,ou=users,ou=system", service.getSchemaManager() );
LdapPrincipal principal = new LdapPrincipal( userDn, AuthenticationLevel.SIMPLE );
CoreSession akarasuluSession = service.getSession( principal );
Modified: directory/apacheds/branches/apacheds-subtree/core-integ/src/test/java/org/apache/directory/server/core/collective/CollectiveAttributeServiceIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-subtree/core-integ/src/test/java/org/apache/directory/server/core/collective/CollectiveAttributeServiceIT.java?rev=966528&r1=966527&r2=966528&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-subtree/core-integ/src/test/java/org/apache/directory/server/core/collective/CollectiveAttributeServiceIT.java (original)
+++ directory/apacheds/branches/apacheds-subtree/core-integ/src/test/java/org/apache/directory/server/core/collective/CollectiveAttributeServiceIT.java Thu Jul 22 07:36:11 2010
@@ -400,6 +400,7 @@ public class CollectiveAttributeServiceI
// -------------------------------------------------------------------
// now modify entries included by the subentry to have collectiveExclusions
// -------------------------------------------------------------------
+
ModificationItem[] items = new ModificationItem[]
{ new ModificationItem( DirContext.ADD_ATTRIBUTE,
new BasicAttribute( "collectiveExclusions", "c-ou" ) ) };
Modified: directory/apacheds/branches/apacheds-subtree/core-integ/src/test/java/org/apache/directory/server/core/configuration/PartitionConfigurationIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-subtree/core-integ/src/test/java/org/apache/directory/server/core/configuration/PartitionConfigurationIT.java?rev=966528&r1=966527&r2=966528&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-subtree/core-integ/src/test/java/org/apache/directory/server/core/configuration/PartitionConfigurationIT.java (original)
+++ directory/apacheds/branches/apacheds-subtree/core-integ/src/test/java/org/apache/directory/server/core/configuration/PartitionConfigurationIT.java Thu Jul 22 07:36:11 2010
@@ -64,8 +64,7 @@ public class PartitionConfigurationIT ex
// Test AddContextPartition
service.addPartition( partition );
- DN suffixDn = new DN( "ou=removable" );
- suffixDn.normalize( service.getSchemaManager().getNormalizerMapping() );
+ DN suffixDn = new DN( "ou=removable", service.getSchemaManager() );
Entry ctxEntry = new DefaultEntry( service.getSchemaManager(), suffixDn );
ctxEntry.put( "objectClass", "top" );
ctxEntry.get( "objectClass" ).add( "organizationalUnit" );
Modified: directory/apacheds/branches/apacheds-subtree/core-integ/src/test/java/org/apache/directory/server/core/operational/OperationalAttributeServiceIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-subtree/core-integ/src/test/java/org/apache/directory/server/core/operational/OperationalAttributeServiceIT.java?rev=966528&r1=966527&r2=966528&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-subtree/core-integ/src/test/java/org/apache/directory/server/core/operational/OperationalAttributeServiceIT.java (original)
+++ directory/apacheds/branches/apacheds-subtree/core-integ/src/test/java/org/apache/directory/server/core/operational/OperationalAttributeServiceIT.java Thu Jul 22 07:36:11 2010
@@ -6,50 +6,51 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
- * under the License.
- *
+ * under the License.
+ *
*/
package org.apache.directory.server.core.operational;
-import static org.apache.directory.server.core.integ.IntegrationUtils.getSystemContext;
-import static org.apache.directory.server.core.integ.IntegrationUtils.getUserAddLdif;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import javax.naming.NamingEnumeration;
import javax.naming.NamingException;
-import javax.naming.NoPermissionException;
-import javax.naming.directory.Attribute;
-import javax.naming.directory.Attributes;
-import javax.naming.directory.BasicAttribute;
-import javax.naming.directory.BasicAttributes;
-import javax.naming.directory.DirContext;
-import javax.naming.directory.InvalidAttributeValueException;
-import javax.naming.directory.ModificationItem;
-import javax.naming.directory.SearchControls;
-import javax.naming.directory.SearchResult;
-import javax.naming.ldap.LdapContext;
+import org.apache.directory.ldap.client.api.LdapConnection;
+import org.apache.directory.ldap.client.api.message.ModifyResponse;
+import org.apache.directory.ldap.client.api.message.SearchResponse;
+import org.apache.directory.ldap.client.api.message.SearchResultEntry;
+import org.apache.directory.server.core.annotations.ApplyLdifs;
+import org.apache.directory.server.core.annotations.CreateDS;
import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
import org.apache.directory.server.core.integ.FrameworkRunner;
-import org.apache.directory.shared.ldap.constants.JndiPropertyConstants;
-import org.apache.directory.shared.ldap.entry.DefaultEntry;
-import org.apache.directory.shared.ldap.ldif.LdifEntry;
-import org.apache.directory.shared.ldap.message.AliasDerefMode;
+import org.apache.directory.server.core.integ.IntegrationUtils;
+import org.apache.directory.shared.ldap.cursor.Cursor;
+import org.apache.directory.shared.ldap.entry.DefaultEntryAttribute;
+import org.apache.directory.shared.ldap.entry.DefaultModification;
+import org.apache.directory.shared.ldap.entry.Entry;
+import org.apache.directory.shared.ldap.entry.EntryAttribute;
+import org.apache.directory.shared.ldap.entry.Modification;
+import org.apache.directory.shared.ldap.entry.ModificationOperation;
+import org.apache.directory.shared.ldap.filter.SearchScope;
+import org.apache.directory.shared.ldap.ldif.LdifUtils;
+import org.apache.directory.shared.ldap.message.ResultCodeEnum;
+import org.apache.directory.shared.ldap.name.DN;
import org.apache.directory.shared.ldap.util.StringTools;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -61,146 +62,109 @@ import org.junit.runner.RunWith;
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
@RunWith ( FrameworkRunner.class )
+@CreateDS(name = "OperationalDS")
+@ApplyLdifs(
+ {
+ "dn: cn=Kate Bush,ou=system",
+ "objectClass: top",
+ "objectClass: person",
+ "cn: Bush",
+ "sn: Kate Bush"
+ })
public class OperationalAttributeServiceIT extends AbstractLdapTestUnit
{
- private static final String BINARY_KEY = "java.naming.ldap.attributes.binary";
- private static final String RDN_KATE_BUSH = "cn=Kate Bush";
+ private static final String DN_KATE_BUSH = "cn=Kate Bush,ou=system";
- protected Attributes getPersonAttributes( String sn, String cn )
- {
- Attributes attrs = new BasicAttributes( true );
- Attribute ocls = new BasicAttribute( "objectClass" );
- ocls.add( "top" );
- ocls.add( "person" );
- attrs.put( ocls );
- attrs.put( "cn", cn );
- attrs.put( "sn", sn );
+ private LdapConnection connection;
- return attrs;
+ @Before
+ public void setup() throws Exception
+ {
+ connection = IntegrationUtils.getAdminConnection( service );
}
- /**
- * @todo add this to an LDIF annotation
- *
- * @param sysRoot the system root context at ou=system as the admin
- * @throws NamingException on error
- */
- protected void createData( LdapContext sysRoot ) throws NamingException
+ @After
+ public void shutdown() throws Exception
{
- // Create an entry for Kate Bush
- Attributes attrs = getPersonAttributes( "Bush", "Kate Bush" );
- DirContext ctx = sysRoot.createSubcontext( RDN_KATE_BUSH, attrs );
- assertNotNull( ctx );
+ connection.close();
}
@Test
public void testBinaryAttributeFilterExtension() throws Exception
{
- LdapContext sysRoot = getSystemContext( service );
- createData( sysRoot );
-
- Attributes attributes = new BasicAttributes( true );
- Attribute oc = new BasicAttribute( "objectClass", "top" );
- oc.add( "person" );
- oc.add( "organizationalPerson" );
- oc.add( "inetOrgPerson" );
- attributes.put( oc );
-
- attributes.put( "ou", "test" );
- attributes.put( "cn", "test" );
- attributes.put( "sn", "test" );
+ Entry entry = LdifUtils.createEntry(
+ new DN( "ou=test,ou=system" ),
+ "objectClass: top",
+ "objectClass: person",
+ "objectClass: organizationalPerson",
+ "objectClass: inetOrgPerson",
+ "ou", "test",
+ "cn", "test",
+ "sn", "test" );
- sysRoot.createSubcontext( "ou=test", attributes );
+ connection.add(entry );
// test without turning on the property
- DirContext ctx = ( DirContext ) sysRoot.lookup( "ou=test" );
- Attribute ou = ctx.getAttributes( "" ).get( "ou" );
- Object value = ou.get();
+ SearchResultEntry response = (SearchResultEntry)connection.lookup( "ou=test,ou=system" );
+ Entry result = response.getEntry();
+ EntryAttribute ou = result.get( "ou" );
+ Object value = ou.getString();
assertTrue( value instanceof String );
- // test with the property now making ou into a binary value
- sysRoot.addToEnvironment( BINARY_KEY, "ou" );
- ctx = ( DirContext ) sysRoot.lookup( "ou=test" );
- ou = ctx.getAttributes( "" ).get( "ou" );
- value = ou.get();
- assertEquals( "test", value );
-
// try jpegPhoto which should be binary automatically - use ou as control
byte[] keyValue = new byte[]
- { (byte)0xFF, (byte)0xD8, (byte)0xFF, (byte)0xE0, 0x01, 0x02, 'J', 'F', 'I', 'F', 0x00, 0x45, 0x23, 0x7d, 0x7f };
- attributes.put( "jpegPhoto", keyValue );
- sysRoot.createSubcontext( "ou=anothertest", attributes );
- ctx = ( DirContext ) sysRoot.lookup( "ou=anothertest" );
- ou = ctx.getAttributes( "" ).get( "ou" );
- value = ou.get();
+ { (byte)0xFF, (byte)0xD8, (byte)0xFF, (byte)0xE0, 0x01, 0x02, 'J', 'F', 'I', 'F', 0x00, 0x45, 0x23, 0x7d, 0x7f };
+ entry.put( "jpegPhoto", keyValue );
+ entry.setDn( new DN( "ou=anothertest,ou=system" ) );
+ entry.set( "ou", "anothertest" );
+ connection.add( entry );
+ response = (SearchResultEntry)connection.lookup( "ou=anothertest,ou=system" );
+ ou = response.getEntry().get( "ou" );
+ value = ou.getString();
assertEquals( "anothertest", value );
- Attribute jpegPhoto = ctx.getAttributes( "" ).get( "jpegPhoto" );
- value = jpegPhoto.get();
+ EntryAttribute jpegPhoto = response.getEntry().get( "jpegPhoto" );
+ value = jpegPhoto.getBytes();
assertTrue( value instanceof byte[] );
assertEquals( "0xFF 0xD8 0xFF 0xE0 0x01 0x02 0x4A 0x46 0x49 0x46 0x00 0x45 0x23 0x7D 0x7F ", StringTools.dumpBytes( ( byte[] ) value ) );
-
- // try jpegPhoto which should be binary automatically but use String to
- // create so we should still get back a byte[] - use ou as control
- /*attributes.remove( "jpegPhoto" );
- attributes.put( "jpegPhoto", "testing a string" );
- sysRoot.createSubcontext( "ou=yetanothertest", attributes );
- ctx = ( DirContext ) sysRoot.lookup( "ou=yetanothertest" );
- ou = ctx.getObject( "" ).get( "ou" );
- value = ou.get();
- assertEquals( "yetanothertest", value );
- jpegPhoto = ctx.getObject( "" ).get( "jpegPhoto" );
- value = jpegPhoto.get();
- assertTrue( value instanceof byte[] );*/
}
@Test
public void testModifyOperationalOpAttrs() throws Exception
{
- LdapContext sysRoot = getSystemContext( service );
- createData( sysRoot );
-
/*
* create ou=testing00,ou=system
*/
- Attributes attributes = new BasicAttributes( true );
- Attribute attribute = new BasicAttribute( "objectClass" );
- attribute.add( "top" );
- attribute.add( "organizationalUnit" );
- attributes.put( attribute );
- attributes.put( "ou", "testing00" );
- DirContext ctx = sysRoot.createSubcontext( "ou=testing00", attributes );
- assertNotNull( ctx );
-
- ctx = ( DirContext ) sysRoot.lookup( "ou=testing00" );
- assertNotNull( ctx );
-
- attributes = ctx.getAttributes( "" );
- assertNotNull( attributes );
- assertEquals( "testing00", attributes.get( "ou" ).get() );
- attribute = attributes.get( "objectClass" );
+ Entry entry = LdifUtils.createEntry(
+ new DN( "ou=testing00,ou=system" ),
+ "objectClass: top",
+ "objectClass: organizationalUnit",
+ "ou", "testing00" );
+
+ connection.add(entry );
+
+ SearchResultEntry response = (SearchResultEntry)connection.lookup( "ou=testing00,ou=system" );
+ assertNotNull( response );
+
+ entry = response.getEntry();
+ assertNotNull( entry );
+ assertEquals( "testing00", entry.get( "ou" ).getString() );
+ EntryAttribute attribute = entry.get( "objectClass" );
assertNotNull( attribute );
assertTrue( attribute.contains( "top" ) );
assertTrue( attribute.contains( "organizationalUnit" ) );
- assertNull( attributes.get( "createTimestamp" ) );
- assertNull( attributes.get( "creatorsName" ) );
+ assertNull( entry.get( "createTimestamp" ) );
+ assertNull( entry.get( "creatorsName" ) );
- SearchControls ctls = new SearchControls();
- ctls.setReturningAttributes( new String[]
- { "ou", "createTimestamp", "creatorsName" } );
-
- sysRoot.addToEnvironment( JndiPropertyConstants.JNDI_LDAP_DAP_DEREF_ALIASES,
- AliasDerefMode.NEVER_DEREF_ALIASES.getJndiValue() );
- NamingEnumeration<SearchResult> list;
- list = sysRoot.search( "", "(ou=testing00)", ctls );
- SearchResult result = list.next();
- list.close();
-
- assertNotNull( result.getAttributes().get( "ou" ) );
- assertNotNull( result.getAttributes().get( "creatorsName" ) );
- assertNotNull( result.getAttributes().get( "createTimestamp" ) );
+ Cursor<SearchResponse> responses = connection.search( "ou=testing00,ou=system", "(ou=testing00)", SearchScope.SUBTREE, "ou", "createTimestamp", "creatorsName" );
+ responses.next();
+ SearchResultEntry result = (SearchResultEntry)responses.get();
+
+ assertNotNull( result.getEntry().get( "ou" ) );
+ assertNotNull( result.getEntry().get( "creatorsName" ) );
+ assertNotNull( result.getEntry().get( "createTimestamp" ) );
}
@@ -219,30 +183,26 @@ public class OperationalAttributeService
@Test
public void testSystemContextRoot() throws Exception
{
- LdapContext sysRoot = getSystemContext( service );
- createData( sysRoot );
-
- SearchControls controls = new SearchControls();
- controls.setSearchScope( SearchControls.OBJECT_SCOPE );
-
- NamingEnumeration<SearchResult> list;
- list = sysRoot.search( "", "(objectClass=*)", controls );
- SearchResult result = list.next();
+ Cursor<SearchResponse> responses = connection.search( "ou=system", "(objectClass=*)", SearchScope.OBJECT, "*" );
+ responses.next();
+ SearchResultEntry result = (SearchResultEntry)responses.get();
// test to make sure op attribute do not occur - this is the control
- Attributes attributes = result.getAttributes();
- assertNull( attributes.get( "creatorsName" ) );
- assertNull( attributes.get( "createTimestamp" ) );
+ Entry entry = result.getEntry();
+ assertNull( entry.get( "creatorsName" ) );
+ assertNull( entry.get( "createTimestamp" ) );
// now we ask for all the op attributes and check to get them
- String[] ids = new String[]
- { "creatorsName", "createTimestamp" };
- controls.setReturningAttributes( ids );
- list = sysRoot.search( "", "(objectClass=*)", controls );
- result = list.next();
- attributes = result.getAttributes();
- assertNotNull( attributes.get( "creatorsName" ) );
- assertNotNull( attributes.get( "createTimestamp" ) );
+ responses = connection.search( "ou=system", "(objectClass=*)", SearchScope.OBJECT, "creatorsName", "createTimestamp" );
+ responses.next();
+ result = (SearchResultEntry)responses.get();
+
+ entry = result.getEntry();
+ assertNotNull( entry.get( "creatorsName" ) );
+ assertNotNull( entry.get( "createTimestamp" ) );
+
+ // We should not have any other operational Attribute
+ assertNull( entry.get( "entryUuid" ) );
}
@@ -262,20 +222,34 @@ public class OperationalAttributeService
@Test
public void testConfirmNonAdminUserDnIsCreatorsName() throws Exception
{
- LdifEntry akarasulu = getUserAddLdif();
- service.getAdminSession().add(
- new DefaultEntry( service.getSchemaManager(), akarasulu.getEntry() ) );
+ Entry entry = LdifUtils.createEntry(
+ new DN( "uid=akarasulu,ou=users,ou=system" ),
+ "objectClass: top",
+ "objectClass: person",
+ "objectClass: organizationalPerson",
+ "objectClass: inetOrgPerson",
+ "ou: Engineering",
+ "ou: People",
+ "uid: akarasulu",
+ "l", "Bogusville",
+ "cn: Alex Karasulu",
+ "sn: Karasulu",
+ "givenName",
+ "mail: akarasulu@apache.org",
+ "telephoneNumber: +1 408 555 4798",
+ "facsimileTelephoneNumber: +1 408 555 9751",
+ "roomnumber: 4612",
+ "userPassword: test" );
- LdapContext sysRoot = getSystemContext( service );
- createData( sysRoot );
+ connection.add(entry );
- Attributes attributes = sysRoot.getAttributes( "uid=akarasulu,ou=users", new String[]
- { "creatorsName" } );
+ SearchResultEntry response = (SearchResultEntry)connection.lookup( "uid=akarasulu,ou=users,ou=system", "creatorsName" );
+ Entry result = response.getEntry();
- assertFalse( "uid=akarasulu,ou=users,ou=system".equals( attributes.get( "creatorsName" ).get() ) );
+ assertFalse( "uid=akarasulu,ou=users,ou=system".equals( result.get( "creatorsName" ).getString() ) );
}
-
+
/**
* Modify an entry and check whether attributes modifiersName and modifyTimestamp are present.
*
@@ -284,29 +258,20 @@ public class OperationalAttributeService
@Test
public void testModifyShouldLeadToModifiersAttributes() throws Exception
{
- LdapContext sysRoot = getSystemContext( service );
- createData( sysRoot );
+ Modification modifyOp = new DefaultModification( ModificationOperation.ADD_ATTRIBUTE,
+ new DefaultEntryAttribute( "description", "Singer Songwriter" ) );
- ModificationItem modifyOp = new ModificationItem( DirContext.ADD_ATTRIBUTE, new BasicAttribute( "description",
- "Singer Songwriter" ) );
+ connection.modify( new DN( DN_KATE_BUSH ), modifyOp );
- sysRoot.modifyAttributes( RDN_KATE_BUSH, new ModificationItem[]
- { modifyOp } );
+ Cursor<SearchResponse> responses = connection.search( DN_KATE_BUSH, "(objectClass=*)", SearchScope.OBJECT, "modifiersName", "modifyTimestamp" );
+ responses.next();
+ SearchResultEntry result = (SearchResultEntry)responses.get();
- SearchControls controls = new SearchControls();
- controls.setSearchScope( SearchControls.OBJECT_SCOPE );
- String[] ids = new String[]
- { "modifiersName", "modifyTimestamp" };
- controls.setReturningAttributes( ids );
-
- NamingEnumeration<SearchResult> list = sysRoot.search( RDN_KATE_BUSH, "(objectClass=*)", controls );
- SearchResult result = list.next();
- Attributes attributes = result.getAttributes();
- assertNotNull( attributes.get( "modifiersName" ) );
- assertNotNull( attributes.get( "modifyTimestamp" ) );
+ assertNotNull( result.getEntry().get( "modifiersName" ) );
+ assertNotNull( result.getEntry().get( "modifyTimestamp" ) );
}
-
-
+
+
/**
* Modify an entry and check whether attribute modifyTimestamp changes.
*
@@ -316,45 +281,39 @@ public class OperationalAttributeService
@Test
public void testModifyShouldChangeModifyTimestamp() throws Exception, InterruptedException
{
- LdapContext sysRoot = getSystemContext( service );
- createData( sysRoot );
-
// Add attribute description to entry
- ModificationItem modifyAddOp = new ModificationItem( DirContext.ADD_ATTRIBUTE, new BasicAttribute(
- "description", "an English singer, songwriter, musician" ) );
- sysRoot.modifyAttributes( RDN_KATE_BUSH, new ModificationItem[]
- { modifyAddOp } );
+ Modification modifyAddOp = new DefaultModification( ModificationOperation.ADD_ATTRIBUTE,
+ new DefaultEntryAttribute( "description", "an English singer, songwriter, musician" ) );
+
+ connection.modify( new DN( DN_KATE_BUSH ), modifyAddOp );
// Determine modifyTimestamp
- SearchControls controls = new SearchControls();
- controls.setSearchScope( SearchControls.OBJECT_SCOPE );
- String[] ids = new String[]
- { "modifyTimestamp" };
- controls.setReturningAttributes( ids );
- NamingEnumeration<SearchResult> list = sysRoot.search( RDN_KATE_BUSH, "(objectClass=*)", controls );
- SearchResult result = list.next();
- Attributes attributes = result.getAttributes();
- Attribute modifyTimestamp = attributes.get( "modifyTimestamp" );
+ Cursor<SearchResponse> responses = connection.search( DN_KATE_BUSH, "(objectClass=*)", SearchScope.OBJECT, "modifyTimestamp" );
+ responses.next();
+ SearchResultEntry result = (SearchResultEntry)responses.get();
+
+ EntryAttribute modifyTimestamp = result.getEntry().get( "modifyTimestamp" );
assertNotNull( modifyTimestamp );
- String oldTimestamp = modifyTimestamp.get().toString();
-
- // Wait two seconds
- Thread.sleep( 2000 );
+ String oldTimestamp = modifyTimestamp.getString();
+
+ // Wait 500 milliseconds
+ Thread.sleep( 500 );
// Change value of attribute description
- ModificationItem modifyOp = new ModificationItem( DirContext.REPLACE_ATTRIBUTE, new BasicAttribute(
- "description", "one of England's most successful solo female performers" ) );
- sysRoot.modifyAttributes( RDN_KATE_BUSH, new ModificationItem[]
- { modifyOp } );
+ Modification modifyOp = new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE,
+ new DefaultEntryAttribute( "description", "one of England's most successful solo female performers" ) );
+
+ connection.modify( new DN( DN_KATE_BUSH ), modifyOp );
// Determine modifyTimestamp after modification
- list = sysRoot.search( RDN_KATE_BUSH, "(objectClass=*)", controls );
- result = list.next();
- attributes = result.getAttributes();
- modifyTimestamp = attributes.get( "modifyTimestamp" );
+ responses = connection.search( DN_KATE_BUSH, "(objectClass=*)", SearchScope.OBJECT, "modifyTimestamp" );
+ responses.next();
+ result = (SearchResultEntry)responses.get();
+
+ modifyTimestamp = result.getEntry().get( "modifyTimestamp" );
assertNotNull( modifyTimestamp );
- String newTimestamp = modifyTimestamp.get().toString();
-
+ String newTimestamp = modifyTimestamp.getString();
+
// assert the value has changed
assertFalse( oldTimestamp.equals( newTimestamp ) );
}
@@ -367,15 +326,11 @@ public class OperationalAttributeService
@Test
public void testModifyOperationalAttributeAdd() throws Exception
{
- LdapContext sysRoot = getSystemContext( service );
- createData( sysRoot );
-
- ModificationItem modifyOp = new ModificationItem( DirContext.ADD_ATTRIBUTE,
- new BasicAttribute(
- "modifiersName", "cn=Tori Amos,dc=example,dc=com" ) );
+ // Add attribute description to entry
+ Modification modifyOp = new DefaultModification( ModificationOperation.ADD_ATTRIBUTE,
+ new DefaultEntryAttribute( "modifiersName", "cn=Tori Amos,dc=example,dc=com" ) );
- sysRoot.modifyAttributes( RDN_KATE_BUSH, new ModificationItem[]
- { modifyOp } );
+ connection.modify( new DN( DN_KATE_BUSH ), modifyOp );
}
@@ -387,26 +342,12 @@ public class OperationalAttributeService
@Test
public void testModifyOperationalAttributeRemove() throws Exception
{
- LdapContext sysRoot = getSystemContext( service );
- createData( sysRoot );
+ Modification modifyOp = new DefaultModification( ModificationOperation.REMOVE_ATTRIBUTE,
+ new DefaultEntryAttribute( "creatorsName" ) );
- ModificationItem modifyOp = new ModificationItem( DirContext.REMOVE_ATTRIBUTE, new BasicAttribute(
- "creatorsName" ) );
+ ModifyResponse response = connection.modify( new DN( DN_KATE_BUSH ), modifyOp );
- try
- {
- sysRoot.modifyAttributes( RDN_KATE_BUSH, new ModificationItem[]
- { modifyOp } );
- fail( "modification of entry should fail" );
- }
- catch ( InvalidAttributeValueException e )
- {
- // expected
- }
- catch ( NoPermissionException e )
- {
- // expected
- }
+ assertEquals( ResultCodeEnum.INSUFFICIENT_ACCESS_RIGHTS, response.getLdapResult().getResultCode() );
}
@@ -418,25 +359,11 @@ public class OperationalAttributeService
@Test
public void testModifyOperationalAttributeReplace() throws Exception
{
- LdapContext sysRoot = getSystemContext( service );
- createData( sysRoot );
+ Modification modifyOp = new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE,
+ new DefaultEntryAttribute( "creatorsName", "cn=Tori Amos,dc=example,dc=com" ) );
- ModificationItem modifyOp = new ModificationItem( DirContext.REPLACE_ATTRIBUTE, new BasicAttribute(
- "creatorsName", "cn=Tori Amos,dc=example,dc=com" ) );
+ ModifyResponse response = connection.modify( new DN( DN_KATE_BUSH ), modifyOp );
- try
- {
- sysRoot.modifyAttributes( RDN_KATE_BUSH, new ModificationItem[]
- { modifyOp } );
- fail( "modification of entry should fail" );
- }
- catch ( InvalidAttributeValueException e )
- {
- // expected
- }
- catch ( NoPermissionException e )
- {
- // expected
- }
+ assertEquals( ResultCodeEnum.INSUFFICIENT_ACCESS_RIGHTS, response.getLdapResult().getResultCode() );
}
}
Modified: directory/apacheds/branches/apacheds-subtree/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxHandlerIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-subtree/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxHandlerIT.java?rev=966528&r1=966527&r2=966528&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-subtree/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxHandlerIT.java (original)
+++ directory/apacheds/branches/apacheds-subtree/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxHandlerIT.java Thu Jul 22 07:36:11 2010
@@ -600,8 +600,7 @@ public class MetaSyntaxHandlerIT extends
private void modify( int op, List<String> descriptions, String opAttr ) throws Exception
{
- DN dn = new DN( getSubschemaSubentryDN() );
- dn.normalize( service.getSchemaManager().getNormalizerMapping() );
+ DN dn = new DN( getSubschemaSubentryDN(), service.getSchemaManager() );
Attribute attr = new BasicAttribute( opAttr );
for ( String description : descriptions )
Modified: directory/apacheds/branches/apacheds-subtree/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-subtree/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java?rev=966528&r1=966527&r2=966528&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-subtree/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java (original)
+++ directory/apacheds/branches/apacheds-subtree/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java Thu Jul 22 07:36:11 2010
@@ -1877,8 +1877,7 @@ public class SubschemaSubentryIT extends
Attribute modifiersNameAttr = subentry.get( "modifiersName" );
Attribute modifyTimestampAttr = subentry.get( "modifyTimestamp" );
assertNotNull( modifiersNameAttr );
- DN expectedDN = new DN( "uid=admin,ou=system" );
- expectedDN.normalize( service.getSchemaManager().getNormalizerMapping() );
+ DN expectedDN = new DN( "uid=admin,ou=system", service.getSchemaManager() );
assertEquals( expectedDN.getName(), modifiersNameAttr.get() );
assertNotNull( modifyTimestampAttr );
@@ -1915,8 +1914,7 @@ public class SubschemaSubentryIT extends
Attribute modifiersNameAttrAfter = subentry.get( "modifiersName" );
Attribute modifiersTimestampAttrAfter = subentry.get( "modifyTimestamp" );
assertNotNull( modifiersNameAttrAfter );
- expectedDN = new DN( "uid=admin,ou=system" );
- expectedDN.normalize( service.getSchemaManager().getNormalizerMapping() );
+ expectedDN = new DN( "uid=admin,ou=system", service.getSchemaManager() );
assertEquals( expectedDN.getName(), modifiersNameAttrAfter.get() );
assertNotNull( modifiersTimestampAttrAfter );
Modified: directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java?rev=966528&r1=966527&r2=966528&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java (original)
+++ directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java Thu Jul 22 07:36:11 2010
@@ -1133,9 +1133,7 @@ public class DefaultDirectoryService imp
// create system users area
// -------------------------------------------------------------------
- Map<String,OidNormalizer> oidsMap = schemaManager.getNormalizerMapping();
- DN userDn = new DN( ServerDNConstants.USERS_SYSTEM_DN );
- userDn.normalize( oidsMap );
+ DN userDn = new DN( ServerDNConstants.USERS_SYSTEM_DN, schemaManager );
if ( !partitionNexus.hasEntry( new EntryOperationContext( adminSession, userDn ) ) )
{
@@ -1160,8 +1158,7 @@ public class DefaultDirectoryService imp
// create system groups area
// -------------------------------------------------------------------
- DN groupDn = new DN( ServerDNConstants.GROUPS_SYSTEM_DN );
- groupDn.normalize( oidsMap );
+ DN groupDn = new DN( ServerDNConstants.GROUPS_SYSTEM_DN, schemaManager );
if ( !partitionNexus.hasEntry( new EntryOperationContext( adminSession, groupDn ) ) )
{
@@ -1186,8 +1183,7 @@ public class DefaultDirectoryService imp
// create administrator group
// -------------------------------------------------------------------
- DN name = new DN( ServerDNConstants.ADMINISTRATORS_GROUP_DN );
- name.normalize( oidsMap );
+ DN name = new DN( ServerDNConstants.ADMINISTRATORS_GROUP_DN, schemaManager );
if ( !partitionNexus.hasEntry( new EntryOperationContext( adminSession, name ) ) )
{
@@ -1213,8 +1209,7 @@ public class DefaultDirectoryService imp
// create system configuration area
// -------------------------------------------------------------------
- DN configurationDn = new DN( "ou=configuration,ou=system" );
- configurationDn.normalize( oidsMap );
+ DN configurationDn = new DN( "ou=configuration,ou=system", schemaManager );
if ( !partitionNexus.hasEntry( new EntryOperationContext( adminSession, configurationDn ) ) )
{
@@ -1236,8 +1231,7 @@ public class DefaultDirectoryService imp
// create system configuration area for partition information
// -------------------------------------------------------------------
- DN partitionsDn = new DN( "ou=partitions,ou=configuration,ou=system" );
- partitionsDn.normalize( oidsMap );
+ DN partitionsDn = new DN( "ou=partitions,ou=configuration,ou=system", schemaManager );
if ( !partitionNexus.hasEntry( new EntryOperationContext( adminSession, partitionsDn ) ) )
{
@@ -1258,8 +1252,7 @@ public class DefaultDirectoryService imp
// create system configuration area for services
// -------------------------------------------------------------------
- DN servicesDn = new DN( "ou=services,ou=configuration,ou=system" );
- servicesDn.normalize( oidsMap );
+ DN servicesDn = new DN( "ou=services,ou=configuration,ou=system", schemaManager );
if ( !partitionNexus.hasEntry( new EntryOperationContext( adminSession, servicesDn ) ) )
{
@@ -1281,8 +1274,7 @@ public class DefaultDirectoryService imp
// create system configuration area for interceptors
// -------------------------------------------------------------------
- DN interceptorsDn = new DN( "ou=interceptors,ou=configuration,ou=system" );
- interceptorsDn.normalize( oidsMap );
+ DN interceptorsDn = new DN( "ou=interceptors,ou=configuration,ou=system", schemaManager );
if ( !partitionNexus.hasEntry( new EntryOperationContext( adminSession, interceptorsDn ) ) )
{
@@ -1304,8 +1296,7 @@ public class DefaultDirectoryService imp
// create system preferences area
// -------------------------------------------------------------------
- DN sysPrefRootDn = new DN( ServerDNConstants.SYSPREFROOT_SYSTEM_DN );
- sysPrefRootDn.normalize( oidsMap );
+ DN sysPrefRootDn = new DN( ServerDNConstants.SYSPREFROOT_SYSTEM_DN, schemaManager );
if ( !partitionNexus.hasEntry( new EntryOperationContext( adminSession, sysPrefRootDn ) ) )
{
@@ -1339,8 +1330,7 @@ public class DefaultDirectoryService imp
// Warn if the default password is not changed.
boolean needToChangeAdminPassword = false;
- DN adminDn = new DN( ServerDNConstants.ADMIN_SYSTEM_DN );
- adminDn.normalize( schemaManager.getNormalizerMapping() );
+ DN adminDn = new DN( ServerDNConstants.ADMIN_SYSTEM_DN, schemaManager );
Entry adminEntry = partitionNexus.lookup( new LookupOperationContext( adminSession, adminDn ) );
Value<?> userPassword = adminEntry.get( SchemaConstants.USER_PASSWORD_AT ).get();
@@ -1406,8 +1396,7 @@ public class DefaultDirectoryService imp
partitions.add( schemaService.getSchemaPartition() );
systemPartition.getSuffix().normalize( schemaManager.getNormalizerMapping() );
- adminDn = new DN( ServerDNConstants.ADMIN_SYSTEM_DN ).normalize( schemaManager.getNormalizerMapping() );
- adminDn.normalize( schemaManager.getNormalizerMapping() );
+ adminDn = new DN( ServerDNConstants.ADMIN_SYSTEM_DN, schemaManager );
adminSession = new DefaultCoreSession( new LdapPrincipal( adminDn, AuthenticationLevel.STRONG ), this );
// @TODO - NOTE: Need to find a way to instantiate without dependency on DPN
Propchange: directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Thu Jul 22 07:36:11 2010
@@ -0,0 +1,4 @@
+/directory/apacheds/branches/apacheds-replication/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java:749790-764110
+/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java:806623-896441
+/directory/apacheds/branches/xdbm-refactoring/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java:945827-946347
+/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java:966207
Modified: directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/ReferralManagerImpl.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/ReferralManagerImpl.java?rev=966528&r1=966527&r2=966528&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/ReferralManagerImpl.java (original)
+++ directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/ReferralManagerImpl.java Thu Jul 22 07:36:11 2010
@@ -161,8 +161,7 @@ public class ReferralManagerImpl impleme
for ( String suffix:suffixes )
{
// We will store each entry's DN into the Referral tree
- DN suffixDn = new DN( suffix );
- suffixDn.normalize( directoryService.getSchemaManager().getNormalizerMapping() );
+ DN suffixDn = new DN( suffix, directoryService.getSchemaManager() );
SearchOperationContext searchOperationContext = new SearchOperationContext( adminSession, suffixDn, referralFilter, searchControl );
searchOperationContext.setAliasDerefMode( AliasDerefMode.DEREF_ALWAYS );
Propchange: directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/ReferralManagerImpl.java
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Thu Jul 22 07:36:11 2010
@@ -0,0 +1,4 @@
+/directory/apacheds/branches/apacheds-replication/core/src/main/java/org/apache/directory/server/core/ReferralManagerImpl.java:749790-764110
+/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/ReferralManagerImpl.java:806623-896441
+/directory/apacheds/branches/xdbm-refactoring/core/src/main/java/org/apache/directory/server/core/ReferralManagerImpl.java:945827-946347
+/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/ReferralManagerImpl.java:966207
Propchange: directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/authz/
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Thu Jul 22 07:36:11 2010
@@ -0,0 +1,4 @@
+/directory/apacheds/branches/apacheds-replication/core/src/main/java/org/apache/directory/server/core/authz:749790-764110
+/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz:806623-896441
+/directory/apacheds/branches/xdbm-refactoring/core/src/main/java/org/apache/directory/server/core/authz:945827-946347
+/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz:966207
Modified: directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java?rev=966528&r1=966527&r2=966528&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java (original)
+++ directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java Thu Jul 22 07:36:11 2010
@@ -189,8 +189,7 @@ public class AciAuthorizationInterceptor
{
super.init( directoryService );
- DN adminDn = new DN( ServerDNConstants.ADMIN_SYSTEM_DN );
- adminDn.normalize( directoryService.getSchemaManager().getNormalizerMapping() );
+ DN adminDn = new DN( ServerDNConstants.ADMIN_SYSTEM_DN, directoryService.getSchemaManager() );
CoreSession adminSession = new DefaultCoreSession( new LdapPrincipal( adminDn, AuthenticationLevel.STRONG ),
directoryService );
schemaManager = directoryService.getSchemaManager();
@@ -213,8 +212,7 @@ public class AciAuthorizationInterceptor
// stuff for dealing with subentries (garbage for now)
Value<?> subschemaSubentry = directoryService.getPartitionNexus().getRootDSE( null ).get(
SchemaConstants.SUBSCHEMA_SUBENTRY_AT ).get();
- DN subschemaSubentryDnName = new DN( subschemaSubentry.getString() );
- subschemaSubentryDnName.normalize( schemaManager.getNormalizerMapping() );
+ DN subschemaSubentryDnName = new DN( subschemaSubentry.getString(), schemaManager );
subschemaSubentryDn = subschemaSubentryDnName.getNormName();
}
Modified: directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java?rev=966528&r1=966527&r2=966528&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java (original)
+++ directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java Thu Jul 22 07:36:11 2010
@@ -107,14 +107,11 @@ public class DefaultAuthorizationInterce
nexus = directoryService.getPartitionNexus();
SchemaManager schemaManager = directoryService.getSchemaManager();
- ADMIN_SYSTEM_DN = new DN( ServerDNConstants.ADMIN_SYSTEM_DN );
- ADMIN_SYSTEM_DN.normalize( schemaManager.getNormalizerMapping() );
+ ADMIN_SYSTEM_DN = new DN( ServerDNConstants.ADMIN_SYSTEM_DN, schemaManager );
- GROUP_BASE_DN = new DN( ServerDNConstants.GROUPS_SYSTEM_DN );
- GROUP_BASE_DN.normalize( schemaManager.getNormalizerMapping() );
+ GROUP_BASE_DN = new DN( ServerDNConstants.GROUPS_SYSTEM_DN, schemaManager );
- ADMIN_GROUP_DN = new DN( ServerDNConstants.ADMINISTRATORS_GROUP_DN );
- ADMIN_GROUP_DN.normalize( schemaManager.getNormalizerMapping() );
+ ADMIN_GROUP_DN = new DN( ServerDNConstants.ADMINISTRATORS_GROUP_DN, schemaManager );
uniqueMemberAT = schemaManager.getAttributeType( SchemaConstants.UNIQUE_MEMBER_AT_OID );
@@ -126,8 +123,7 @@ public class DefaultAuthorizationInterce
{
// read in the administrators and cache their normalized names
Set<String> newAdministrators = new HashSet<String>( 2 );
- DN adminDn = new DN( ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
- adminDn.normalize( directoryService.getSchemaManager().getNormalizerMapping() );
+ DN adminDn = new DN( ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED, directoryService.getSchemaManager() );
CoreSession adminSession = new DefaultCoreSession( new LdapPrincipal( adminDn, AuthenticationLevel.STRONG ),
directoryService );
@@ -142,8 +138,7 @@ public class DefaultAuthorizationInterce
for ( Value<?> value : uniqueMember )
{
- DN memberDn = new DN( value.getString() );
- memberDn.normalize( directoryService.getSchemaManager().getNormalizerMapping() );
+ DN memberDn = new DN( value.getString(), directoryService.getSchemaManager() );
newAdministrators.add( memberDn.getNormName() );
}
Modified: directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java?rev=966528&r1=966527&r2=966528&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java (original)
+++ directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java Thu Jul 22 07:36:11 2010
@@ -84,9 +84,9 @@ public class GroupCache
private AttributeType UNIQUE_MEMBER_AT;
/**
- * The OIDs normalizer map
+ * the schema manager
*/
- private Map<String, OidNormalizer> normalizerMap;
+ private SchemaManager schemaManager;
/** the normalized dn of the administrators group */
private DN administratorsGroupDn;
@@ -102,8 +102,7 @@ public class GroupCache
*/
public GroupCache( CoreSession session ) throws LdapException
{
- SchemaManager schemaManager = session.getDirectoryService().getSchemaManager();
- normalizerMap = schemaManager.getNormalizerMapping();
+ schemaManager = session.getDirectoryService().getSchemaManager();
nexus = session.getDirectoryService().getPartitionNexus();
OBJECT_CLASS_AT = schemaManager.getAttributeType( SchemaConstants.OBJECT_CLASS_AT );
MEMBER_AT = schemaManager.getAttributeType( SchemaConstants.MEMBER_AT );
@@ -118,8 +117,7 @@ public class GroupCache
private DN parseNormalized( String name ) throws LdapException
{
- DN dn = new DN( name );
- dn.normalize( normalizerMap );
+ DN dn = new DN( name, schemaManager );
return dn;
}
@@ -142,7 +140,7 @@ public class GroupCache
filter.addNode( new EqualityNode<String>( OBJECT_CLASS_AT, new StringValue(
SchemaConstants.GROUP_OF_UNIQUE_NAMES_OC ) ) );
- DN baseDn = new DN( suffix ).normalize( normalizerMap );
+ DN baseDn = new DN( suffix, schemaManager );
SearchControls ctls = new SearchControls();
ctls.setSearchScope( SearchControls.SUBTREE_SCOPE );
@@ -156,7 +154,7 @@ public class GroupCache
while ( results.next() )
{
Entry result = results.get();
- DN groupDn = result.getDn().normalize( normalizerMap );
+ DN groupDn = result.getDn().normalize( schemaManager.getNormalizerMapping() );
EntryAttribute members = getMemberAttribute( result );
if ( members != null )
Modified: directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java?rev=966528&r1=966527&r2=966528&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java (original)
+++ directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java Thu Jul 22 07:36:11 2010
@@ -108,8 +108,7 @@ public class TupleCache
private DN parseNormalized( SchemaManager schemaManager, String name ) throws LdapException
{
- DN dn = new DN( name );
- dn.normalize( schemaManager.getNormalizerMapping() );
+ DN dn = new DN( name, schemaManager );
return dn;
}
Propchange: directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/exception/
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Thu Jul 22 07:36:11 2010
@@ -0,0 +1,4 @@
+/directory/apacheds/branches/apacheds-replication/core/src/main/java/org/apache/directory/server/core/exception:749790-764110
+/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/exception:806623-896441
+/directory/apacheds/branches/xdbm-refactoring/core/src/main/java/org/apache/directory/server/core/exception:945827-946347
+/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception:966207
Modified: directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java?rev=966528&r1=966527&r2=966528&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java (original)
+++ directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java Thu Jul 22 07:36:11 2010
@@ -119,8 +119,7 @@ public class ExceptionInterceptor extend
{
nexus = directoryService.getPartitionNexus();
Value<?> attr = nexus.getRootDSE( null ).get( SchemaConstants.SUBSCHEMA_SUBENTRY_AT ).get();
- subschemSubentryDn = new DN( attr.getString() );
- subschemSubentryDn.normalize( directoryService.getSchemaManager().getNormalizerMapping() );
+ subschemSubentryDn = new DN( attr.getString(), directoryService.getSchemaManager() );
schemaManager = directoryService.getSchemaManager();
// look up some constant information
Propchange: directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/operational/
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Thu Jul 22 07:36:11 2010
@@ -0,0 +1,4 @@
+/directory/apacheds/branches/apacheds-replication/core/src/main/java/org/apache/directory/server/core/operational:749790-764110
+/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/operational:806623-896441
+/directory/apacheds/branches/xdbm-refactoring/core/src/main/java/org/apache/directory/server/core/operational:945827-946347
+/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational:965202-966523
Modified: directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java?rev=966528&r1=966527&r2=966528&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java (original)
+++ directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java Thu Jul 22 07:36:11 2010
@@ -137,12 +137,10 @@ public class OperationalAttributeInterce
// stuff for dealing with subentries (garbage for now)
Value<?> subschemaSubentry = service.getPartitionNexus().getRootDSE( null ).get(
SchemaConstants.SUBSCHEMA_SUBENTRY_AT ).get();
- subschemaSubentryDn = new DN( subschemaSubentry.getString() );
- subschemaSubentryDn.normalize( schemaManager.getNormalizerMapping() );
+ subschemaSubentryDn = new DN( subschemaSubentry.getString(), schemaManager );
// Create the Admin DN
- adminDn = new DN( ServerDNConstants.ADMIN_SYSTEM_DN );
- adminDn.normalize( schemaManager.getNormalizerMapping() );
+ adminDn = new DN( ServerDNConstants.ADMIN_SYSTEM_DN, schemaManager );
MODIFIERS_NAME_ATTRIBUTE_TYPE = schemaManager.getAttributeType( SchemaConstants.MODIFIERS_NAME_AT );
MODIFY_TIMESTAMP_ATTRIBUTE_TYPE = schemaManager.getAttributeType( SchemaConstants.MODIFY_TIMESTAMP_AT );
Propchange: directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/partition/
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Thu Jul 22 07:36:11 2010
@@ -0,0 +1,4 @@
+/directory/apacheds/branches/apacheds-replication/core/src/main/java/org/apache/directory/server/core/partition:749790-764110
+/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition:806623-896441
+/directory/apacheds/branches/xdbm-refactoring/core/src/main/java/org/apache/directory/server/core/partition:945827-946347
+/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition:965202-966523
Modified: directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java?rev=966528&r1=966527&r2=966528&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java (original)
+++ directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java Thu Jul 22 07:36:11 2010
@@ -297,8 +297,7 @@ public class DefaultPartitionNexus exten
system.initialize();
// Add root context entry for system partition
- DN systemSuffixDn = new DN( ServerDNConstants.SYSTEM_DN );
- systemSuffixDn.normalize( schemaManager.getNormalizerMapping() );
+ DN systemSuffixDn = new DN( ServerDNConstants.SYSTEM_DN, schemaManager );
Entry systemEntry = new DefaultEntry( schemaManager, systemSuffixDn );
// Add the ObjectClasses
@@ -312,8 +311,7 @@ public class DefaultPartitionNexus exten
systemEntry.add( SchemaConstants.ENTRY_UUID_AT, UUID.randomUUID().toString() );
systemEntry.put( NamespaceTools.getRdnAttribute( ServerDNConstants.SYSTEM_DN ), NamespaceTools
.getRdnValue( ServerDNConstants.SYSTEM_DN ) );
- DN adminDn = new DN( ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
- adminDn.normalize( schemaManager.getNormalizerMapping() );
+ DN adminDn = new DN( ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED, schemaManager );
CoreSession adminSession = new DefaultCoreSession( new LdapPrincipal( adminDn, AuthenticationLevel.STRONG ),
directoryService );
AddOperationContext addOperationContext = new AddOperationContext( adminSession, systemEntry );
@@ -368,8 +366,7 @@ public class DefaultPartitionNexus exten
{
try
{
- DN adminDn = new DN( ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
- adminDn.normalize( schemaManager.getNormalizerMapping() );
+ DN adminDn = new DN( ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED, schemaManager );
removeContextPartition( new DN( suffix ) );
}
Propchange: directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/prefs/
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Thu Jul 22 07:36:11 2010
@@ -0,0 +1,4 @@
+/directory/apacheds/branches/apacheds-replication/core/src/main/java/org/apache/directory/server/core/prefs:749790-764110
+/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/prefs:806623-896441
+/directory/apacheds/branches/xdbm-refactoring/core/src/main/java/org/apache/directory/server/core/prefs:945827-946347
+/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/prefs:965202-966523
Modified: directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/prefs/ServerSystemPreferences.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/prefs/ServerSystemPreferences.java?rev=966528&r1=966527&r2=966528&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/prefs/ServerSystemPreferences.java (original)
+++ directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/prefs/ServerSystemPreferences.java Thu Jul 22 07:36:11 2010
@@ -115,8 +115,7 @@ public class ServerSystemPreferences ext
DN parentDn = ( ( ServerSystemPreferences ) parent() ).dn;
try
{
- dn = new DN( "prefNodeName=" + name + "," + parentDn.getName() );
- dn.normalize( directoryService.getSchemaManager().getNormalizerMapping() );
+ dn = new DN( "prefNodeName=" + name + "," + parentDn.getName(), directoryService.getSchemaManager() );
if ( ! directoryService.getAdminSession().exists( dn ) )
{
Propchange: directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/referral/
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Thu Jul 22 07:36:11 2010
@@ -0,0 +1,4 @@
+/directory/apacheds/branches/apacheds-replication/core/src/main/java/org/apache/directory/server/core/referral:749790-764110
+/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/referral:806623-896441
+/directory/apacheds/branches/xdbm-refactoring/core/src/main/java/org/apache/directory/server/core/referral:945827-946347
+/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/referral:965202-966523
Modified: directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java?rev=966528&r1=966527&r2=966528&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java (original)
+++ directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java Thu Jul 22 07:36:11 2010
@@ -211,8 +211,7 @@ public class ReferralInterceptor extends
directoryService.setReferralManager( referralManager );
Value<?> subschemaSubentry = nexus.getRootDSE( null ).get( SchemaConstants.SUBSCHEMA_SUBENTRY_AT ).get();
- subschemaSubentryDn = new DN( subschemaSubentry.getString() );
- subschemaSubentryDn.normalize( schemaManager.getNormalizerMapping() );
+ subschemaSubentryDn = new DN( subschemaSubentry.getString(), schemaManager );
// look up some constant information
OBJECT_CLASS_AT = schemaManager.getAttributeType( SchemaConstants.OBJECT_CLASS_AT );
Propchange: directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/schema/
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Thu Jul 22 07:36:11 2010
@@ -0,0 +1,4 @@
+/directory/apacheds/branches/apacheds-replication/core/src/main/java/org/apache/directory/server/core/schema:749790-764110
+/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema:806623-896441
+/directory/apacheds/branches/xdbm-refactoring/core/src/main/java/org/apache/directory/server/core/schema:945827-946347
+/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema:965202-966523