From commits-return-31892-apmail-directory-commits-archive=directory.apache.org@directory.apache.org Tue May 31 15:05:12 2011 Return-Path: X-Original-To: apmail-directory-commits-archive@www.apache.org Delivered-To: apmail-directory-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 87B4B487A for ; Tue, 31 May 2011 15:05:12 +0000 (UTC) Received: (qmail 83331 invoked by uid 500); 31 May 2011 15:05:12 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 83286 invoked by uid 500); 31 May 2011 15:05:12 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 83279 invoked by uid 99); 31 May 2011 15:05:12 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 31 May 2011 15:05:12 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 31 May 2011 15:05:05 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 824A22388897; Tue, 31 May 2011 15:04:43 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1129732 - in /directory: apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/ apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/ apacheds/trunk/core-api/src/main/java/... Date: Tue, 31 May 2011 15:04:43 -0000 To: commits@directory.apache.org From: elecharny@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110531150443.824A22388897@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: elecharny Date: Tue May 31 15:04:42 2011 New Revision: 1129732 URL: http://svn.apache.org/viewvc?rev=1129732&view=rev Log: o Fixed the lookup method, so that it returns the correct attributs. Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/AbstractOperationContext.java directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/OperationContext.java directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartition.java directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/MockOperation.java directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/LookupAuthorizationIT.java directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/referral/ModifyReferralIT.java directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/ACDFEngine.java directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/DefaultSchemaService.java directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/AbstractStoredProcedureParameterInjector.java directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/DeleteStoredProcedureParameterInjector.java directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/ModifyStoredProcedureParameterInjector.java directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/TriggerInterceptor.java directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/constants/SchemaConstants.java Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java?rev=1129732&r1=1129731&r2=1129732&view=diff ============================================================================== --- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java (original) +++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java Tue May 31 15:04:42 2011 @@ -569,7 +569,7 @@ public class InterceptorChain // trouble reading the entry due to insufficient access rights CoreSession adminSession = opContext.getSession().getDirectoryService().getAdminSession(); - LookupOperationContext lookupContext = new LookupOperationContext( adminSession, opContext.getDn() ); + LookupOperationContext lookupContext = new LookupOperationContext( adminSession, opContext.getDn(), SchemaConstants.ALL_ATTRIBUTES_ARRAY ); ClonedServerEntry foundEntry = opContext.getSession().getDirectoryService().getPartitionNexus().lookup( lookupContext ); if ( foundEntry != null ) Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/AbstractOperationContext.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/AbstractOperationContext.java?rev=1129732&r1=1129731&r2=1129732&view=diff ============================================================================== --- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/AbstractOperationContext.java (original) +++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/AbstractOperationContext.java Tue May 31 15:04:42 2011 @@ -366,6 +366,15 @@ public abstract class AbstractOperationC lookupContext.setByPassed( byPassed ); return session.getDirectoryService().getOperationManager().lookup( lookupContext ); } + + + public Entry lookup( Dn dn, Collection byPassed, String... attrIds ) throws LdapException + { + LookupOperationContext lookupContext = newLookupContext( dn ); + lookupContext.setByPassed( byPassed ); + lookupContext.setAttrsId( attrIds ); + return session.getDirectoryService().getOperationManager().lookup( lookupContext ); + } public LdapPrincipal getEffectivePrincipal() Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/OperationContext.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/OperationContext.java?rev=1129732&r1=1129731&r2=1129732&view=diff ============================================================================== --- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/OperationContext.java (original) +++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/OperationContext.java Tue May 31 15:04:42 2011 @@ -300,6 +300,9 @@ public interface OperationContext Entry lookup( Dn dn, Collection byPass ) throws LdapException; + Entry lookup( Dn dn, Collection byPass, String... attrIds ) throws LdapException; + + Entry lookup( LookupOperationContext lookupContext ) throws LdapException; Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartition.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartition.java?rev=1129732&r1=1129731&r2=1129732&view=diff ============================================================================== --- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartition.java (original) +++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartition.java Tue May 31 15:04:42 2011 @@ -377,7 +377,7 @@ public final class SchemaPartition exten public void move( MoveOperationContext moveContext ) throws LdapException { boolean cascade = moveContext.hasRequestControl( Cascade.OID ); - Entry entry = moveContext.lookup( moveContext.getDn(), ByPassConstants.LOOKUP_BYPASS ); + Entry entry = moveContext.lookup( moveContext.getDn(), ByPassConstants.LOOKUP_BYPASS, SchemaConstants.ALL_ATTRIBUTES_ARRAY ); synchronizer.move( moveContext, entry, cascade ); wrapped.move( moveContext ); updateSchemaModificationAttributes( moveContext ); @@ -390,7 +390,7 @@ public final class SchemaPartition exten public void moveAndRename( MoveAndRenameOperationContext moveAndRenameContext ) throws LdapException { boolean cascade = moveAndRenameContext.hasRequestControl( Cascade.OID ); - Entry entry = moveAndRenameContext.lookup( moveAndRenameContext.getDn(), ByPassConstants.LOOKUP_BYPASS ); + Entry entry = moveAndRenameContext.lookup( moveAndRenameContext.getDn(), ByPassConstants.LOOKUP_BYPASS, SchemaConstants.ALL_ATTRIBUTES_ARRAY ); synchronizer.moveAndRename( moveAndRenameContext, entry, cascade ); wrapped.moveAndRename( moveAndRenameContext ); updateSchemaModificationAttributes( moveAndRenameContext ); Modified: directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/MockOperation.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/MockOperation.java?rev=1129732&r1=1129731&r2=1129732&view=diff ============================================================================== --- directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/MockOperation.java (original) +++ directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/MockOperation.java Tue May 31 15:04:42 2011 @@ -180,6 +180,12 @@ public class MockOperation implements Op } + public Entry lookup( Dn dn, Collection byPass, String... attrIds ) throws LdapException + { + return null; + } + + public LookupOperationContext newLookupContext( Dn dn ) { return null; Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/LookupAuthorizationIT.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/LookupAuthorizationIT.java?rev=1129732&r1=1129731&r2=1129732&view=diff ============================================================================== --- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/LookupAuthorizationIT.java (original) +++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/LookupAuthorizationIT.java Tue May 31 15:04:42 2011 @@ -101,8 +101,8 @@ public class LookupAuthorizationIT exten assertNotNull( entry ); - // We should have 8 attributes - assertEquals( 9, entry.size() ); + // We should have 3 attributes + assertEquals( 3, entry.size() ); // Check that all the user attributes are present assertEquals( "test", entry.get( "cn" ).getString() ); Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/referral/ModifyReferralIT.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/referral/ModifyReferralIT.java?rev=1129732&r1=1129731&r2=1129732&view=diff ============================================================================== --- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/referral/ModifyReferralIT.java (original) +++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/referral/ModifyReferralIT.java Tue May 31 15:04:42 2011 @@ -47,8 +47,8 @@ import org.apache.directory.server.core. import org.apache.directory.server.core.integ.AbstractLdapTestUnit; import org.apache.directory.server.core.integ.FrameworkRunner; import org.apache.directory.shared.ldap.model.entry.Attribute; -import org.apache.directory.shared.ldap.model.entry.DefaultEntry; import org.apache.directory.shared.ldap.model.entry.DefaultAttribute; +import org.apache.directory.shared.ldap.model.entry.DefaultEntry; import org.apache.directory.shared.ldap.model.entry.DefaultModification; import org.apache.directory.shared.ldap.model.entry.Entry; import org.apache.directory.shared.ldap.model.entry.Modification; Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java?rev=1129732&r1=1129731&r2=1129732&view=diff ============================================================================== --- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java (original) +++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java Tue May 31 15:04:42 2011 @@ -68,8 +68,8 @@ import org.apache.directory.shared.ldap. import org.apache.directory.shared.ldap.model.constants.AuthenticationLevel; import org.apache.directory.shared.ldap.model.constants.Loggers; import org.apache.directory.shared.ldap.model.constants.SchemaConstants; -import org.apache.directory.shared.ldap.model.entry.Entry; import org.apache.directory.shared.ldap.model.entry.Attribute; +import org.apache.directory.shared.ldap.model.entry.Entry; import org.apache.directory.shared.ldap.model.entry.Modification; import org.apache.directory.shared.ldap.model.entry.StringValue; import org.apache.directory.shared.ldap.model.entry.Value; @@ -364,7 +364,7 @@ public class AciAuthorizationInterceptor if ( oc.contains( SchemaConstants.SUBENTRY_OC ) ) { Dn parentDn = dn.getParent(); - originalEntry = opContext.lookup( parentDn, ByPassConstants.LOOKUP_BYPASS ); + originalEntry = opContext.lookup( parentDn, ByPassConstants.LOOKUP_BYPASS, SchemaConstants.ALL_ATTRIBUTES_ARRAY ); } Attribute subentries = originalEntry.get( ACCESS_CONTROL_SUBENTRIES_AT ); @@ -442,7 +442,7 @@ public class AciAuthorizationInterceptor // get the parent or administrative entry for this subentry since it // will contain the subentryACI attributes that effect subentries Dn parentDn = dn.getParent(); - Entry administrativeEntry = ( ( ClonedServerEntry ) opContext.lookup( parentDn, ByPassConstants.LOOKUP_BYPASS ) ) + Entry administrativeEntry = ( ( ClonedServerEntry ) opContext.lookup( parentDn, ByPassConstants.LOOKUP_BYPASS, SchemaConstants.ALL_ATTRIBUTES_ARRAY ) ) .getOriginalEntry(); Attribute subentryAci = administrativeEntry.get( SUBENTRY_ACI_AT ); @@ -675,7 +675,7 @@ public class AciAuthorizationInterceptor /** * @TODO: A virtual entry can be created here for not hitting the backend again. */ - Entry modifiedEntry = modifyContext.lookup( dn, ByPassConstants.LOOKUP_BYPASS ); + Entry modifiedEntry = modifyContext.lookup( dn, ByPassConstants.LOOKUP_BYPASS, SchemaConstants.ALL_ATTRIBUTES_ARRAY ); tupleCache.subentryModified( dn, mods, modifiedEntry ); groupCache.groupModified( dn, mods, entry, schemaManager ); return; @@ -831,7 +831,7 @@ public class AciAuthorizationInterceptor return answer; } - Entry entry = hasEntryContext.lookup( dn, ByPassConstants.HAS_ENTRY_BYPASS ); + Entry entry = hasEntryContext.lookup( dn, ByPassConstants.HAS_ENTRY_BYPASS, SchemaConstants.ALL_ATTRIBUTES_ARRAY ); Set userGroups = groupCache.getGroups( principalDn.getNormName() ); Collection tuples = new HashSet(); addPerscriptiveAciTuples( hasEntryContext, tuples, dn, entry ); @@ -1064,7 +1064,7 @@ public class AciAuthorizationInterceptor // but after this service. Entry importedEntry = moveAndRenameContext.lookup( oldDn, - ByPassConstants.LOOKUP_EXCLUDING_OPR_ATTRS_BYPASS ); + ByPassConstants.LOOKUP_EXCLUDING_OPR_ATTRS_BYPASS, SchemaConstants.ALL_ATTRIBUTES_ARRAY ); // As the target entry does not exist yet and so // its subentry operational attributes are not there, @@ -1158,7 +1158,7 @@ public class AciAuthorizationInterceptor // will not be valid at the new location. // This will certainly be fixed by the SubentryInterceptor, // but after this service. - Entry importedEntry = moveContext.lookup( oriChildName, ByPassConstants.LOOKUP_EXCLUDING_OPR_ATTRS_BYPASS ); + Entry importedEntry = moveContext.lookup( oriChildName, ByPassConstants.LOOKUP_EXCLUDING_OPR_ATTRS_BYPASS, SchemaConstants.ALL_ATTRIBUTES_ARRAY ); // As the target entry does not exist yet and so // its subentry operational attributes are not there, Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/ACDFEngine.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/ACDFEngine.java?rev=1129732&r1=1129731&r2=1129732&view=diff ============================================================================== --- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/ACDFEngine.java (original) +++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/ACDFEngine.java Tue May 31 15:04:42 2011 @@ -41,6 +41,7 @@ import org.apache.directory.server.core. import org.apache.directory.server.core.subtree.SubtreeEvaluator; import org.apache.directory.server.core.trigger.TriggerInterceptor; import org.apache.directory.shared.ldap.aci.ACITuple; +import org.apache.directory.shared.ldap.model.constants.SchemaConstants; import org.apache.directory.shared.ldap.model.entry.Entry; import org.apache.directory.shared.ldap.model.exception.LdapException; import org.apache.directory.shared.ldap.model.exception.LdapNoPermissionException; @@ -152,7 +153,7 @@ public class ACDFEngine throw new IllegalArgumentException( "entryName" ); } - Entry userEntry = aciContext.getOperationContext().lookup( aciContext.getUserDn(), USER_LOOKUP_BYPASS ); + Entry userEntry = aciContext.getOperationContext().lookup( aciContext.getUserDn(), USER_LOOKUP_BYPASS, SchemaConstants.ALL_ATTRIBUTES_ARRAY ); // Determine the scope of the requested operation. OperationScope scope; Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java?rev=1129732&r1=1129731&r2=1129732&view=diff ============================================================================== --- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java (original) +++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java Tue May 31 15:04:42 2011 @@ -38,9 +38,9 @@ import org.apache.directory.server.core. import org.apache.directory.server.core.partition.ByPassConstants; import org.apache.directory.server.core.schema.SchemaService; import org.apache.directory.shared.ldap.model.constants.SchemaConstants; +import org.apache.directory.shared.ldap.model.entry.Attribute; import org.apache.directory.shared.ldap.model.entry.DefaultEntry; import org.apache.directory.shared.ldap.model.entry.Entry; -import org.apache.directory.shared.ldap.model.entry.Attribute; import org.apache.directory.shared.ldap.model.entry.Modification; import org.apache.directory.shared.ldap.model.exception.LdapException; import org.apache.directory.shared.ldap.model.ldif.ChangeType; @@ -202,7 +202,7 @@ public class ChangeLogInterceptor extend } else { - serverEntry = opContext.lookup( dn, ByPassConstants.LOOKUP_BYPASS ); + serverEntry = opContext.lookup( dn, ByPassConstants.LOOKUP_BYPASS, SchemaConstants.ALL_ATTRIBUTES_ARRAY ); } return serverEntry; Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java?rev=1129732&r1=1129731&r2=1129732&view=diff ============================================================================== --- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java (original) +++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java Tue May 31 15:04:42 2011 @@ -401,7 +401,7 @@ public class CollectiveAttributeIntercep * time looking up this sub-entry. */ - Entry subentry = opContext.lookup( subentryDn, ByPassConstants.LOOKUP_COLLECTIVE_BYPASS ); + Entry subentry = opContext.lookup( subentryDn, ByPassConstants.LOOKUP_COLLECTIVE_BYPASS, SchemaConstants.ALL_ATTRIBUTES_ARRAY ); for ( AttributeType attributeType : subentry.getAttributeTypes() ) { Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java?rev=1129732&r1=1129731&r2=1129732&view=diff ============================================================================== --- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java (original) +++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java Tue May 31 15:04:42 2011 @@ -41,6 +41,7 @@ import org.apache.directory.server.core. import org.apache.directory.server.core.interceptor.context.RenameOperationContext; import org.apache.directory.server.core.normalization.FilterNormalizingVisitor; import org.apache.directory.server.core.partition.ByPassConstants; +import org.apache.directory.shared.ldap.model.constants.SchemaConstants; import org.apache.directory.shared.ldap.model.entry.Entry; import org.apache.directory.shared.ldap.model.exception.LdapException; import org.apache.directory.shared.ldap.model.filter.ExprNode; @@ -190,7 +191,7 @@ public class EventInterceptor extends Ba } // Get the modified entry - Entry alteredEntry = modifyContext.lookup( modifyContext.getDn(), ByPassConstants.LOOKUP_BYPASS ); + Entry alteredEntry = modifyContext.lookup( modifyContext.getDn(), ByPassConstants.LOOKUP_BYPASS, SchemaConstants.ALL_ATTRIBUTES_ARRAY ); modifyContext.setAlteredEntry( alteredEntry ); for ( final RegistrationEntry registration : selecting ) @@ -216,7 +217,7 @@ public class EventInterceptor extends Ba } // Get the modifed entry - Entry alteredEntry = renameContext.lookup( renameContext.getNewDn(), ByPassConstants.LOOKUP_BYPASS ); + Entry alteredEntry = renameContext.lookup( renameContext.getNewDn(), ByPassConstants.LOOKUP_BYPASS, SchemaConstants.ALL_ATTRIBUTES_ARRAY ); renameContext.setModifiedEntry( alteredEntry ); for ( final RegistrationEntry registration : selecting ) Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java?rev=1129732&r1=1129731&r2=1129732&view=diff ============================================================================== --- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java (original) +++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java Tue May 31 15:04:42 2011 @@ -43,8 +43,8 @@ import org.apache.directory.server.core. import org.apache.directory.server.i18n.I18n; import org.apache.directory.shared.ldap.model.constants.SchemaConstants; import org.apache.directory.shared.ldap.model.cursor.EmptyCursor; -import org.apache.directory.shared.ldap.model.entry.Entry; import org.apache.directory.shared.ldap.model.entry.Attribute; +import org.apache.directory.shared.ldap.model.entry.Entry; import org.apache.directory.shared.ldap.model.entry.Value; import org.apache.directory.shared.ldap.model.exception.LdapAliasException; import org.apache.directory.shared.ldap.model.exception.LdapEntryAlreadyExistsException; @@ -161,7 +161,7 @@ public class ExceptionInterceptor extend try { - attrs = addContext.lookup( parentDn, ByPassConstants.LOOKUP_BYPASS ); + attrs = addContext.lookup( parentDn, ByPassConstants.LOOKUP_BYPASS, SchemaConstants.ALL_ATTRIBUTES_ARRAY ); } catch ( Exception e ) { Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java?rev=1129732&r1=1129731&r2=1129732&view=diff ============================================================================== --- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java (original) +++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java Tue May 31 15:04:42 2011 @@ -37,8 +37,8 @@ import org.apache.directory.server.core. import org.apache.directory.server.core.partition.PartitionNexus; import org.apache.directory.server.i18n.I18n; import org.apache.directory.shared.ldap.model.constants.SchemaConstants; -import org.apache.directory.shared.ldap.model.entry.Entry; import org.apache.directory.shared.ldap.model.entry.Attribute; +import org.apache.directory.shared.ldap.model.entry.Entry; import org.apache.directory.shared.ldap.model.entry.StringValue; import org.apache.directory.shared.ldap.model.entry.Value; import org.apache.directory.shared.ldap.model.exception.LdapException; @@ -346,6 +346,7 @@ public class ReferralInterceptor extends // Update the referralManager LookupOperationContext lookupContext = new LookupOperationContext( renameContext.getSession(), renameContext .getNewDn() ); + lookupContext.setAttrsId( SchemaConstants.ALL_ATTRIBUTES_ARRAY ); Entry newEntry = nexus.lookup( lookupContext ); @@ -383,6 +384,7 @@ public class ReferralInterceptor extends // into the opContext, but for an unknow reason, this will fail // on eferral tests... LookupOperationContext lookupContext = new LookupOperationContext( modifyContext.getSession(), dn ); + lookupContext.setAttrsId( SchemaConstants.ALL_ATTRIBUTES_ARRAY ); Entry newEntry = nexus.lookup( lookupContext ); Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/DefaultSchemaService.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/DefaultSchemaService.java?rev=1129732&r1=1129731&r2=1129732&view=diff ============================================================================== --- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/DefaultSchemaService.java (original) +++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/DefaultSchemaService.java Tue May 31 15:04:42 2011 @@ -26,10 +26,10 @@ import org.apache.directory.server.const import org.apache.directory.server.constants.ServerDNConstants; import org.apache.directory.server.core.interceptor.context.LookupOperationContext; import org.apache.directory.shared.ldap.model.constants.SchemaConstants; -import org.apache.directory.shared.ldap.model.entry.DefaultEntry; +import org.apache.directory.shared.ldap.model.entry.Attribute; import org.apache.directory.shared.ldap.model.entry.DefaultAttribute; +import org.apache.directory.shared.ldap.model.entry.DefaultEntry; import org.apache.directory.shared.ldap.model.entry.Entry; -import org.apache.directory.shared.ldap.model.entry.Attribute; import org.apache.directory.shared.ldap.model.exception.LdapException; import org.apache.directory.shared.ldap.model.name.Dn; import org.apache.directory.shared.ldap.model.schema.AttributeType; @@ -405,7 +405,7 @@ public class DefaultSchemaService implem Entry mods = schemaPartition.lookup( - new LookupOperationContext( null, schemaModificationAttributesDn) ); + new LookupOperationContext( null, schemaModificationAttributesDn, SchemaConstants.ALL_ATTRIBUTES_ARRAY ) ); // @todo enable this optimization at some point but for now it // is causing some problems so I will just turn it off Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java?rev=1129732&r1=1129731&r2=1129732&view=diff ============================================================================== --- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java (original) +++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java Tue May 31 15:04:42 2011 @@ -54,11 +54,11 @@ import org.apache.directory.server.i18n. import org.apache.directory.shared.ldap.codec.controls.search.subentries.SubentriesDecorator; import org.apache.directory.shared.ldap.model.constants.AuthenticationLevel; import org.apache.directory.shared.ldap.model.constants.SchemaConstants; -import org.apache.directory.shared.ldap.model.entry.DefaultEntry; +import org.apache.directory.shared.ldap.model.entry.Attribute; import org.apache.directory.shared.ldap.model.entry.DefaultAttribute; +import org.apache.directory.shared.ldap.model.entry.DefaultEntry; import org.apache.directory.shared.ldap.model.entry.DefaultModification; import org.apache.directory.shared.ldap.model.entry.Entry; -import org.apache.directory.shared.ldap.model.entry.Attribute; import org.apache.directory.shared.ldap.model.entry.Modification; import org.apache.directory.shared.ldap.model.entry.ModificationOperation; import org.apache.directory.shared.ldap.model.entry.StringValue; @@ -395,7 +395,7 @@ public class SubentryInterceptor extends */ private void checkAdministrativeRole( OperationContext opContext, Dn apDn ) throws LdapException { - Entry administrationPoint = opContext.lookup( apDn, ByPassConstants.LOOKUP_BYPASS ); + Entry administrationPoint = opContext.lookup( apDn, ByPassConstants.LOOKUP_BYPASS, SchemaConstants.ALL_ATTRIBUTES_ARRAY ); // The administrativeRole AT must exist and not be null Attribute administrativeRole = administrationPoint.get( ADMINISTRATIVE_ROLE_AT ); Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/AbstractStoredProcedureParameterInjector.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/AbstractStoredProcedureParameterInjector.java?rev=1129732&r1=1129731&r2=1129732&view=diff ============================================================================== --- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/AbstractStoredProcedureParameterInjector.java (original) +++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/AbstractStoredProcedureParameterInjector.java Tue May 31 15:04:42 2011 @@ -29,6 +29,7 @@ import java.util.Map; import org.apache.directory.server.core.interceptor.context.OperationContext; import org.apache.directory.server.core.partition.ByPassConstants; +import org.apache.directory.shared.ldap.model.constants.SchemaConstants; import org.apache.directory.shared.ldap.model.exception.LdapException; import org.apache.directory.shared.ldap.model.exception.LdapInvalidDnException; import org.apache.directory.shared.ldap.model.name.Dn; @@ -110,7 +111,7 @@ public abstract class AbstractStoredProc { Generic_LDAP_CONTEXT ldapCtxParam = ( Generic_LDAP_CONTEXT ) param; Dn ldapCtxName = ldapCtxParam.getCtxName(); - return opContext.lookup( ldapCtxName, ByPassConstants.LOOKUP_BYPASS ); + return opContext.lookup( ldapCtxName, ByPassConstants.LOOKUP_BYPASS, SchemaConstants.ALL_ATTRIBUTES_ARRAY ); } }; } Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/DeleteStoredProcedureParameterInjector.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/DeleteStoredProcedureParameterInjector.java?rev=1129732&r1=1129731&r2=1129732&view=diff ============================================================================== --- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/DeleteStoredProcedureParameterInjector.java (original) +++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/DeleteStoredProcedureParameterInjector.java Tue May 31 15:04:42 2011 @@ -24,6 +24,7 @@ import java.util.Map; import org.apache.directory.server.core.interceptor.context.OperationContext; import org.apache.directory.server.core.partition.ByPassConstants; +import org.apache.directory.shared.ldap.model.constants.SchemaConstants; import org.apache.directory.shared.ldap.model.entry.Entry; import org.apache.directory.shared.ldap.model.exception.LdapException; import org.apache.directory.shared.ldap.model.name.Dn; @@ -71,6 +72,6 @@ public class DeleteStoredProcedureParame * Using LOOKUP_EXCLUDING_OPR_ATTRS_BYPASS here to exclude operational attributes * especially subentry related ones like "triggerExecutionSubentries". */ - return opContext.lookup( deletedEntryName, ByPassConstants.LOOKUP_EXCLUDING_OPR_ATTRS_BYPASS ); + return opContext.lookup( deletedEntryName, ByPassConstants.LOOKUP_EXCLUDING_OPR_ATTRS_BYPASS, SchemaConstants.ALL_ATTRIBUTES_ARRAY ); } } Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/ModifyStoredProcedureParameterInjector.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/ModifyStoredProcedureParameterInjector.java?rev=1129732&r1=1129731&r2=1129732&view=diff ============================================================================== --- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/ModifyStoredProcedureParameterInjector.java (original) +++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/ModifyStoredProcedureParameterInjector.java Tue May 31 15:04:42 2011 @@ -27,6 +27,7 @@ import java.util.Map; import org.apache.directory.server.core.interceptor.context.ModifyOperationContext; import org.apache.directory.server.core.interceptor.context.OperationContext; import org.apache.directory.server.core.partition.ByPassConstants; +import org.apache.directory.shared.ldap.model.constants.SchemaConstants; import org.apache.directory.shared.ldap.model.entry.Entry; import org.apache.directory.shared.ldap.model.entry.Modification; import org.apache.directory.shared.ldap.model.exception.LdapException; @@ -106,6 +107,6 @@ public class ModifyStoredProcedureParame * Using LOOKUP_EXCLUDING_OPR_ATTRS_BYPASS here to exclude operational attributes * especially subentry related ones like "triggerExecutionSubentries". */ - return opContext.lookup( modifiedEntryName, ByPassConstants.LOOKUP_EXCLUDING_OPR_ATTRS_BYPASS ); + return opContext.lookup( modifiedEntryName, ByPassConstants.LOOKUP_EXCLUDING_OPR_ATTRS_BYPASS, SchemaConstants.ALL_ATTRIBUTES_ARRAY ); } } Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/TriggerInterceptor.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/TriggerInterceptor.java?rev=1129732&r1=1129731&r2=1129732&view=diff ============================================================================== --- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/TriggerInterceptor.java (original) +++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/TriggerInterceptor.java Tue May 31 15:04:42 2011 @@ -128,7 +128,7 @@ public class TriggerInterceptor extends { Dn parentDn = dn.getParent(); - entry = opContext.lookup( parentDn, ByPassConstants.LOOKUP_BYPASS ); + entry = opContext.lookup( parentDn, ByPassConstants.LOOKUP_BYPASS, SchemaConstants.ALL_ATTRIBUTES_ARRAY ); } Attribute subentries = entry.get( SchemaConstants.TRIGGER_EXECUTION_SUBENTRIES_AT ); @@ -435,7 +435,7 @@ public class TriggerInterceptor extends // will not be valid at the new location. // This will certainly be fixed by the SubentryInterceptor, // but after this service. - Entry importedEntry = moveAndRenameContext.lookup( oldDn, ByPassConstants.LOOKUP_EXCLUDING_OPR_ATTRS_BYPASS ); + Entry importedEntry = moveAndRenameContext.lookup( oldDn, ByPassConstants.LOOKUP_EXCLUDING_OPR_ATTRS_BYPASS, SchemaConstants.ALL_ATTRIBUTES_ARRAY ); // As the target entry does not exist yet and so // its subentry operational attributes are not there, @@ -509,7 +509,7 @@ public class TriggerInterceptor extends // will not be valid at the new location. // This will certainly be fixed by the SubentryInterceptor, // but after this service. - Entry importedEntry = moveContext.lookup( dn, ByPassConstants.LOOKUP_EXCLUDING_OPR_ATTRS_BYPASS ); + Entry importedEntry = moveContext.lookup( dn, ByPassConstants.LOOKUP_EXCLUDING_OPR_ATTRS_BYPASS, SchemaConstants.ALL_ATTRIBUTES_ARRAY ); // As the target entry does not exist yet and so // its subentry operational attributes are not there, Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java?rev=1129732&r1=1129731&r2=1129732&view=diff ============================================================================== --- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java (original) +++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java Tue May 31 15:04:42 2011 @@ -303,28 +303,63 @@ public abstract class BTreePartition return entry; } - if ( ( lookupContext.getAttrsId() == null ) || ( lookupContext.getAttrsId().size() == 0 ) - && !lookupContext.hasAllOperational() && !lookupContext.hasAllUser() ) + if ( lookupContext.hasAllUser() ) { - return entry; - } + if ( lookupContext.hasAllOperational() ) + { + return entry; + } + else + { + for ( AttributeType attributeType : ( entry.getOriginalEntry() ).getAttributeTypes() ) + { + String oid = attributeType.getOid(); - for ( AttributeType attributeType : ( entry.getOriginalEntry() ).getAttributeTypes() ) + if ( attributeType.getUsage() != UsageEnum.USER_APPLICATIONS ) + { + if ( !lookupContext.getAttrsId().contains( oid ) ) + { + entry.removeAttributes( attributeType ); + } + } + } + } + } + else { - String oid = attributeType.getOid(); - - if ( !lookupContext.getAttrsId().contains( oid ) ) + if ( lookupContext.hasAllOperational() ) { - if ( attributeType.getUsage() == UsageEnum.USER_APPLICATIONS ) + for ( AttributeType attributeType : ( entry.getOriginalEntry() ).getAttributeTypes() ) { - if ( !lookupContext.hasAllUser() ) + if ( attributeType.getUsage() == UsageEnum.USER_APPLICATIONS ) { entry.removeAttributes( attributeType ); } } - else if ( ( !lookupContext.hasAllOperational() ) ) + } + else + { + if ( lookupContext.getAttrsId().size() == 0 ) { - entry.removeAttributes( attributeType ); + for ( AttributeType attributeType : ( entry.getOriginalEntry() ).getAttributeTypes() ) + { + if ( attributeType.getUsage() != UsageEnum.USER_APPLICATIONS ) + { + entry.removeAttributes( attributeType ); + } + } + } + else + { + for ( AttributeType attributeType : ( entry.getOriginalEntry() ).getAttributeTypes() ) + { + String oid = attributeType.getOid(); + + if ( !lookupContext.getAttrsId().contains( oid ) ) + { + entry.removeAttributes( attributeType ); + } + } } } } Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/constants/SchemaConstants.java URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/constants/SchemaConstants.java?rev=1129732&r1=1129731&r2=1129732&view=diff ============================================================================== --- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/constants/SchemaConstants.java (original) +++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/constants/SchemaConstants.java Tue May 31 15:04:42 2011 @@ -82,6 +82,9 @@ public final class SchemaConstants public final static String ALL_OPERATIONAL_ATTRIBUTES = "+"; public final static String[] ALL_OPERATIONAL_ATTRIBUTES_ARRAY = new String[]{ ALL_OPERATIONAL_ATTRIBUTES }; + + public final static String[] ALL_ATTRIBUTES_ARRAY = new String[]{ ALL_OPERATIONAL_ATTRIBUTES, ALL_USER_ATTRIBUTES }; + // ---- ObjectClasses ----------------------------------------------------- // Domain