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 2011/11/08 17:41:52 UTC

svn commit: r1199334 - in /directory/apacheds/trunk: core-api/ core-api/src/main/java/org/apache/directory/server/core/api/interceptor/ core-integ/ core-integ/src/test/java/org/apache/directory/server/core/authz/support/ core-integ/src/test/java/org/ap...

Author: elecharny
Date: Tue Nov  8 16:41:51 2011
New Revision: 1199334

URL: http://svn.apache.org/viewvc?rev=1199334&view=rev
Log:
Merged back the osgi branch into trunks

Added:
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/support/
      - copied from r1199322, directory/apacheds/branches/apacheds-osgi/core-integ/src/test/java/org/apache/directory/server/core/authz/support/
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/support/MaxImmSubFilterTest.java
      - copied unchanged from r1199322, directory/apacheds/branches/apacheds-osgi/core-integ/src/test/java/org/apache/directory/server/core/authz/support/MaxImmSubFilterTest.java
Removed:
    directory/apacheds/trunk/interceptors/authz/src/test/java/org/apache/directory/server/core/authz/support/MaxImmSubFilterTest.java
Modified:
    directory/apacheds/trunk/core-api/   (props changed)
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/BaseInterceptor.java
    directory/apacheds/trunk/core-integ/   (props changed)
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/collective/CollectiveAttributeServiceIT.java   (props changed)
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/PartitionSchemaLoaderTest.java   (props changed)
    directory/apacheds/trunk/interceptors/authz/   (props changed)
    directory/apacheds/trunk/interceptors/authz/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
    directory/apacheds/trunk/interceptors/authz/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java
    directory/apacheds/trunk/interceptors/authz/src/main/java/org/apache/directory/server/core/authz/support/MaxImmSubFilter.java
    directory/apacheds/trunk/interceptors/changelog/   (props changed)
    directory/apacheds/trunk/interceptors/changelog/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java
    directory/apacheds/trunk/interceptors/collective/   (props changed)
    directory/apacheds/trunk/interceptors/journal/   (props changed)
    directory/apacheds/trunk/interceptors/journal/src/main/java/org/apache/directory/server/core/journal/JournalInterceptor.java
    directory/apacheds/trunk/interceptors/operational/   (props changed)
    directory/apacheds/trunk/interceptors/operational/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java
    directory/apacheds/trunk/interceptors/trigger/   (props changed)

Propchange: directory/apacheds/trunk/core-api/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Nov  8 16:41:51 2011
@@ -3,7 +3,7 @@
 /directory/apacheds/branches/apacheds-dnfactory-experiment/core-api:980138-980934
 /directory/apacheds/branches/apacheds-jdbm/core-api:1160768-1164073
 /directory/apacheds/branches/apacheds-kerberos-codec-2.0/core-api:1040956-1043765
-/directory/apacheds/branches/apacheds-osgi/core-api:1185681-1197680
+/directory/apacheds/branches/apacheds-osgi/core-api:1185681-1199319
 /directory/apacheds/branches/milestones/core-api:1072812-1075328
 /directory/apacheds/trunk/core-api:1066126-1067785,1068026-1072718,1072800-1075329
 /directory/studio/trunk/core-api:1067786-1067997

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/BaseInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/BaseInterceptor.java?rev=1199334&r1=1199333&r2=1199334&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/BaseInterceptor.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/BaseInterceptor.java Tue Nov  8 16:41:51 2011
@@ -23,8 +23,6 @@ package org.apache.directory.server.core
 import java.util.HashSet;
 import java.util.Set;
 
-import javax.naming.Context;
-
 import org.apache.directory.server.core.api.DirectoryService;
 import org.apache.directory.server.core.api.LdapPrincipal;
 import org.apache.directory.server.core.api.filtering.EntryFilteringCursor;
@@ -43,7 +41,6 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.api.interceptor.context.RenameOperationContext;
 import org.apache.directory.server.core.api.interceptor.context.SearchOperationContext;
 import org.apache.directory.server.core.api.interceptor.context.UnbindOperationContext;
-import org.apache.directory.server.core.api.invocation.InvocationStack;
 import org.apache.directory.server.core.api.partition.PartitionNexus;
 import org.apache.directory.shared.ldap.model.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.model.entry.Entry;
@@ -253,22 +250,12 @@ public abstract class BaseInterceptor im
     /**
      * TODO delete this since it uses static access
      * Returns {@link LdapPrincipal} of current context.
+     * @param opContext TODO
      * @return the authenticated principal
      */
-    public static LdapPrincipal getPrincipal()
-    {
-        return getContext().getSession().getEffectivePrincipal();
-    }
-
-
-    /**
-     * TODO delete this since it uses static access
-     * Returns the current JNDI {@link Context}.
-     * @return the context on the invocation stack
-     */
-    public static OperationContext getContext()
+    public static LdapPrincipal getPrincipal( OperationContext opContext )
     {
-        return InvocationStack.getInstance().peek();
+        return opContext.getSession().getEffectivePrincipal();
     }
 
 

Propchange: directory/apacheds/trunk/core-integ/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Nov  8 16:41:51 2011
@@ -3,6 +3,7 @@
 /directory/apacheds/branches/apacheds-dnfactory-experiment/core-integ:980138-980934
 /directory/apacheds/branches/apacheds-jdbm/core-integ:1160768-1164075
 /directory/apacheds/branches/apacheds-kerberos-codec-2.0/core-integ:1040956-1043765
+/directory/apacheds/branches/apacheds-osgi/core-integ:1185681-1199322
 /directory/apacheds/branches/milestones/core-integ:1072812-1075328
 /directory/apacheds/trunk/core-integ:1066126-1067785,1068026-1072718,1072800-1075329
 /directory/studio/trunk/core-integ:1067786-1067997

Propchange: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/collective/CollectiveAttributeServiceIT.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Nov  8 16:41:51 2011
@@ -3,6 +3,7 @@
 /directory/apacheds/branches/apacheds-dnfactory-experiment/core-integ/src/test/java/org/apache/directory/server/core/collective/CollectiveAttributeServiceIT.java:980138-980934
 /directory/apacheds/branches/apacheds-jdbm/core-integ/src/test/java/org/apache/directory/server/core/collective/CollectiveAttributeServiceIT.java:1160768-1164075
 /directory/apacheds/branches/apacheds-kerberos-codec-2.0/core-integ/src/test/java/org/apache/directory/server/core/collective/CollectiveAttributeServiceIT.java:1040956-1043765
+/directory/apacheds/branches/apacheds-osgi/core-integ/src/test/java/org/apache/directory/server/core/collective/CollectiveAttributeServiceIT.java:1185681-1199322
 /directory/apacheds/branches/apacheds-replication/core-integ/src/test/java/org/apache/directory/server/core/collective/CollectiveAttributeServiceIT.java:749790-764110
 /directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/collective/CollectiveAttributeServiceIT.java:806623-896441
 /directory/apacheds/branches/apacheds-subtree/core-integ/src/test/java/org/apache/directory/server/core/collective/CollectiveAttributeServiceIT.java:965202-966561

Propchange: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/PartitionSchemaLoaderTest.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Nov  8 16:41:51 2011
@@ -3,6 +3,7 @@
 /directory/apacheds/branches/apacheds-dnfactory-experiment/jdbm-partition/src/test/java/org/apache/directory/server/core/schema/PartitionSchemaLoaderTest.java:980138-980935
 /directory/apacheds/branches/apacheds-jdbm/jdbm-partition/src/test/java/org/apache/directory/server/core/schema/PartitionSchemaLoaderTest.java:1160768-1164080
 /directory/apacheds/branches/apacheds-kerberos-codec-2.0/jdbm-partition/src/test/java/org/apache/directory/server/core/schema/PartitionSchemaLoaderTest.java:1040956-1043765
+/directory/apacheds/branches/apacheds-osgi/core-integ/src/test/java/org/apache/directory/server/core/schema/PartitionSchemaLoaderTest.java:1185681-1199322
 /directory/apacheds/branches/apacheds-replication/jdbm-partition/src/test/java/org/apache/directory/server/core/schema/PartitionSchemaLoaderTest.java:749790-764110
 /directory/apacheds/branches/apacheds-schema/jdbm-partition/src/test/java/org/apache/directory/server/core/schema/PartitionSchemaLoaderTest.java:806623-810034
 /directory/apacheds/branches/apacheds-subtree/jdbm-partition/src/test/java/org/apache/directory/server/core/schema/PartitionSchemaLoaderTest.java:965203-965686

Propchange: directory/apacheds/trunk/interceptors/authz/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Nov  8 16:41:51 2011
@@ -1 +1 @@
-/directory/apacheds/branches/apacheds-osgi/interceptors/authz:1185681-1197685
+/directory/apacheds/branches/apacheds-osgi/interceptors/authz:1185681-1199323

Modified: directory/apacheds/trunk/interceptors/authz/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/authz/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java?rev=1199334&r1=1199333&r2=1199334&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/authz/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/authz/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java Tue Nov  8 16:41:51 2011
@@ -302,9 +302,9 @@ public class AciAuthorizationInterceptor
     }
 
 
-    private void protectCriticalEntries( Dn dn ) throws LdapException
+    private void protectCriticalEntries( OperationContext opCtx, Dn dn ) throws LdapException
     {
-        Dn principalDn = getPrincipal().getDn();
+        Dn principalDn = getPrincipal( opCtx ).getDn();
 
         if ( dn.isEmpty() )
         {
@@ -615,7 +615,7 @@ public class AciAuthorizationInterceptor
 
         Entry entry = deleteContext.getEntry();
 
-        protectCriticalEntries( dn );
+        protectCriticalEntries( deleteContext, dn );
 
         // bypass authz code but manage caches if operation is performed by the admin
         if ( isPrincipalAnAdministrator( principalDn ) )
@@ -988,7 +988,7 @@ public class AciAuthorizationInterceptor
             return;
         }
 
-        protectCriticalEntries( oldName );
+        protectCriticalEntries( renameContext, oldName );
 
         // bypass authz code but manage caches if operation is performed by the admin
         if ( isPrincipalAnAdministrator( principalDn ) )
@@ -1044,7 +1044,7 @@ public class AciAuthorizationInterceptor
             return;
         }
 
-        protectCriticalEntries( oldDn );
+        protectCriticalEntries( moveAndRenameContext, oldDn );
 
         // bypass authz code but manage caches if operation is performed by the admin
         if ( isPrincipalAnAdministrator( principalDn ) )
@@ -1140,7 +1140,7 @@ public class AciAuthorizationInterceptor
             return;
         }
 
-        protectCriticalEntries( oriChildName );
+        protectCriticalEntries( moveContext, oriChildName );
 
         // bypass authz code but manage caches if operation is performed by the admin
         if ( isPrincipalAnAdministrator( principalDn ) )

Modified: directory/apacheds/trunk/interceptors/authz/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/authz/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java?rev=1199334&r1=1199333&r2=1199334&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/authz/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/authz/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java Tue Nov  8 16:41:51 2011
@@ -176,7 +176,7 @@ public class DefaultAuthorizationInterce
             throw new LdapNoPermissionException( msg );
         }
 
-        Dn principalDn = getPrincipal().getDn();
+        Dn principalDn = getPrincipal( deleteContext ).getDn();
 
         if ( dn.equals( ADMIN_SYSTEM_DN ) )
         {
@@ -234,7 +234,7 @@ public class DefaultAuthorizationInterce
         {
             Dn dn = modifyContext.getDn();
 
-            protectModifyAlterations( dn );
+            protectModifyAlterations( modifyContext, dn );
             nextInterceptor.modify( modifyContext );
 
             // update administrators if we change administrators group
@@ -250,9 +250,9 @@ public class DefaultAuthorizationInterce
     }
 
 
-    private void protectModifyAlterations( Dn dn ) throws LdapException
+    private void protectModifyAlterations( OperationContext opCtx, Dn dn ) throws LdapException
     {
-        Dn principalDn = getPrincipal().getDn();
+        Dn principalDn = getPrincipal( opCtx ).getDn();
 
         if ( dn.isEmpty() )
         {
@@ -264,7 +264,7 @@ public class DefaultAuthorizationInterce
         if ( !isAnAdministrator( principalDn ) )
         {
             // allow self modifications
-            if ( dn.equals( getPrincipal() ) )
+            if ( dn.equals( getPrincipal( opCtx ) ) )
             {
                 return;
             }
@@ -309,7 +309,7 @@ public class DefaultAuthorizationInterce
     {
         if ( !renameContext.getSession().getDirectoryService().isAccessControlEnabled() )
         {
-            protectDnAlterations( renameContext.getDn() );
+            protectDnAlterations( renameContext, renameContext.getDn() );
         }
 
         nextInterceptor.rename( renameContext );
@@ -323,7 +323,7 @@ public class DefaultAuthorizationInterce
     {
         if ( !moveContext.getSession().getDirectoryService().isAccessControlEnabled() )
         {
-            protectDnAlterations( moveContext.getDn() );
+            protectDnAlterations( moveContext, moveContext.getDn() );
         }
 
         nextInterceptor.move( moveContext );
@@ -335,16 +335,16 @@ public class DefaultAuthorizationInterce
     {
         if ( !moveAndRenameContext.getSession().getDirectoryService().isAccessControlEnabled() )
         {
-            protectDnAlterations( moveAndRenameContext.getDn() );
+            protectDnAlterations( moveAndRenameContext, moveAndRenameContext.getDn() );
         }
 
         nextInterceptor.moveAndRename( moveAndRenameContext );
     }
 
 
-    private void protectDnAlterations( Dn dn ) throws LdapException
+    private void protectDnAlterations( OperationContext opCtx, Dn dn ) throws LdapException
     {
-        Dn principalDn = getPrincipal().getDn();
+        Dn principalDn = getPrincipal( opCtx ).getDn();
 
         if ( dn.isEmpty() )
         {

Modified: directory/apacheds/trunk/interceptors/authz/src/main/java/org/apache/directory/server/core/authz/support/MaxImmSubFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/authz/src/main/java/org/apache/directory/server/core/authz/support/MaxImmSubFilter.java?rev=1199334&r1=1199333&r2=1199334&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/authz/src/main/java/org/apache/directory/server/core/authz/support/MaxImmSubFilter.java (original)
+++ directory/apacheds/trunk/interceptors/authz/src/main/java/org/apache/directory/server/core/authz/support/MaxImmSubFilter.java Tue Nov  8 16:41:51 2011
@@ -132,22 +132,6 @@ public class MaxImmSubFilter implements 
         return aciContext.getAciTuples();
     }
 
-    public static final Collection<String> SEARCH_BYPASS;
-    static
-    {
-        Collection<String> c = new HashSet<String>();
-        c.add( "NormalizationInterceptor" );
-        c.add( "AuthenticationInterceptor" );
-        c.add( "AciAuthorizationInterceptor" );
-        c.add( "DefaultAuthorizationInterceptor" );
-        c.add( "AdministrativePointInterceptor" );
-        c.add( "OperationalAttributeInterceptor" );
-        c.add( "SchemaInterceptor" );
-        c.add( "SubentryInterceptor" );
-        c.add( "EventInterceptor" );
-        SEARCH_BYPASS = Collections.unmodifiableCollection( c );
-    }
-
 
     private int getImmSubCount( OperationContext opContext, Dn entryName ) throws LdapException
     {
@@ -159,10 +143,9 @@ public class MaxImmSubFilter implements 
             Dn baseDn = new Dn( opContext.getSession().getDirectoryService().getSchemaManager(), entryName.getRdn( entryName.size() - 1 ) );
             SearchOperationContext searchContext = new SearchOperationContext( opContext.getSession(),
                 baseDn, childrenFilter, childrenSearchControls );
-            searchContext.setByPassed( SEARCH_BYPASS );
             searchContext.setAliasDerefMode( AliasDerefMode.DEREF_ALWAYS );
 
-            results = opContext.getSession().getDirectoryService().getOperationManager().search( searchContext );
+            results = opContext.getSession().getDirectoryService().getPartitionNexus().search( searchContext );
 
             try
             {

Propchange: directory/apacheds/trunk/interceptors/changelog/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Nov  8 16:41:51 2011
@@ -1 +1 @@
-/directory/apacheds/branches/apacheds-osgi/interceptors/changelog:1185681-1197579
+/directory/apacheds/branches/apacheds-osgi/interceptors/changelog:1185681-1199323

Modified: directory/apacheds/trunk/interceptors/changelog/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/changelog/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java?rev=1199334&r1=1199333&r2=1199334&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/changelog/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/changelog/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java Tue Nov  8 16:41:51 2011
@@ -125,7 +125,7 @@ public class ChangeLogInterceptor extend
         }
         
         LdifEntry reverse = LdifRevertor.reverseAdd( addContext.getDn() );
-        addContext.setChangeLogEvent( changeLog.log( getPrincipal(), forward, reverse ) );
+        addContext.setChangeLogEvent( changeLog.log( getPrincipal( addContext ), forward, reverse ) );
     }
 
 
@@ -177,7 +177,7 @@ public class ChangeLogInterceptor extend
         }
 
         LdifEntry reverse = LdifRevertor.reverseDel( deleteContext.getDn(), reverseEntry );
-        deleteContext.setChangeLogEvent( changeLog.log( getPrincipal(), forward, reverse ) );
+        deleteContext.setChangeLogEvent( changeLog.log( getPrincipal( deleteContext ), forward, reverse ) );
     }
 
 
@@ -282,7 +282,7 @@ public class ChangeLogInterceptor extend
             mods, 
             clientEntry );
         
-        modifyContext.setChangeLogEvent( changeLog.log( getPrincipal(), forward, reverse ) );
+        modifyContext.setChangeLogEvent( changeLog.log( getPrincipal( modifyContext ), forward, reverse ) );
     }
 
 
@@ -319,7 +319,7 @@ public class ChangeLogInterceptor extend
         List<LdifEntry> reverses = LdifRevertor.reverseRename( 
             serverEntry, renameContext.getNewRdn(), renameContext.getDeleteOldRdn() );
         
-        renameContext.setChangeLogEvent( changeLog.log( getPrincipal(), forward, reverses ) );
+        renameContext.setChangeLogEvent( changeLog.log( getPrincipal( renameContext ), forward, reverses ) );
     }
 
 
@@ -358,7 +358,7 @@ public class ChangeLogInterceptor extend
             reversedEntry.addControl( new ManageDsaITImpl() );
         }
         
-        moveAndRenameContext.setChangeLogEvent( changeLog.log( getPrincipal(), forward, reverses ) );
+        moveAndRenameContext.setChangeLogEvent( changeLog.log( getPrincipal( moveAndRenameContext ), forward, reverses ) );
     }
 
 
@@ -380,6 +380,6 @@ public class ChangeLogInterceptor extend
         forward.setNewSuperior( moveContext.getNewSuperior().getName() );
 
         LdifEntry reverse = LdifRevertor.reverseMove(moveContext.getNewSuperior(), moveContext.getDn());
-        moveContext.setChangeLogEvent( changeLog.log( getPrincipal(), forward, reverse ) );
+        moveContext.setChangeLogEvent( changeLog.log( getPrincipal( moveContext ), forward, reverse ) );
     }
 }

Propchange: directory/apacheds/trunk/interceptors/collective/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Nov  8 16:41:51 2011
@@ -1 +1 @@
-/directory/apacheds/branches/apacheds-osgi/interceptors/collective:1185681-1197680
+/directory/apacheds/branches/apacheds-osgi/interceptors/collective:1185681-1199326

Propchange: directory/apacheds/trunk/interceptors/journal/
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Tue Nov  8 16:41:51 2011
@@ -0,0 +1 @@
+/directory/apacheds/branches/apacheds-osgi/interceptors/journal:1185681-1199325

Modified: directory/apacheds/trunk/interceptors/journal/src/main/java/org/apache/directory/server/core/journal/JournalInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/journal/src/main/java/org/apache/directory/server/core/journal/JournalInterceptor.java?rev=1199334&r1=1199333&r2=1199334&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/journal/src/main/java/org/apache/directory/server/core/journal/JournalInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/journal/src/main/java/org/apache/directory/server/core/journal/JournalInterceptor.java Tue Nov  8 16:41:51 2011
@@ -19,7 +19,6 @@
 package org.apache.directory.server.core.journal;
 
 
-import java.util.Set;
 import java.util.concurrent.atomic.AtomicLong;
 
 import org.apache.directory.server.core.api.DirectoryService;
@@ -30,6 +29,7 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.api.interceptor.context.ModifyOperationContext;
 import org.apache.directory.server.core.api.interceptor.context.MoveAndRenameOperationContext;
 import org.apache.directory.server.core.api.interceptor.context.MoveOperationContext;
+import org.apache.directory.server.core.api.interceptor.context.OperationContext;
 import org.apache.directory.server.core.api.interceptor.context.RenameOperationContext;
 import org.apache.directory.server.core.api.journal.Journal;
 import org.apache.directory.shared.ldap.model.entry.Attribute;
@@ -89,9 +89,9 @@ public class JournalInterceptor extends 
     /**
      * Log the operation, manage the logs rotations.
      */
-    private void log( long revision, LdifEntry ldif ) throws LdapException
+    private void log( OperationContext opCtx, long revision, LdifEntry ldif ) throws LdapException
     {
-        journal.log( getPrincipal(), revision, ldif );
+        journal.log( getPrincipal( opCtx ), revision, ldif );
     }
     
     
@@ -122,7 +122,7 @@ public class JournalInterceptor extends 
                 ldif.addAttribute( addEntry.get( attributeType).clone() );
             }
             
-            log( opRevision, ldif );
+            log( addContext, opRevision, ldif );
         }
 
         try
@@ -164,7 +164,7 @@ public class JournalInterceptor extends 
             ldif.setChangeType( ChangeType.Delete );
             ldif.setDn( deleteContext.getDn() );
             
-            journal.log( getPrincipal(), opRevision, ldif );
+            journal.log( getPrincipal( deleteContext ), opRevision, ldif );
         }
 
         try
@@ -212,7 +212,7 @@ public class JournalInterceptor extends 
                 ldif.addModification( modification );
             }
             
-            journal.log( getPrincipal(), opRevision, ldif );
+            journal.log( getPrincipal( modifyContext ), opRevision, ldif );
         }
         
         try
@@ -255,7 +255,7 @@ public class JournalInterceptor extends 
             ldif.setNewRdn( renameContext.getNewRdn().getNormName() );
             ldif.setDeleteOldRdn( renameContext.getDeleteOldRdn() );
             
-            journal.log( getPrincipal(), opRevision, ldif );
+            journal.log( getPrincipal( renameContext ), opRevision, ldif );
         }
         
         try
@@ -301,7 +301,7 @@ public class JournalInterceptor extends 
             ldif.setDeleteOldRdn( moveAndRenameContext.getDeleteOldRdn() );
             ldif.setNewSuperior( moveAndRenameContext.getNewDn().getNormName() );
             
-            journal.log( getPrincipal(), opRevision, ldif );
+            journal.log( getPrincipal( moveAndRenameContext ), opRevision, ldif );
         }
         
         try
@@ -344,7 +344,7 @@ public class JournalInterceptor extends 
             ldif.setDn( moveContext.getDn() );
             ldif.setNewSuperior( moveContext.getNewSuperior().getNormName() );
             
-            journal.log( getPrincipal(), opRevision, ldif );
+            journal.log( getPrincipal( moveContext ), opRevision, ldif );
         }
         
         try

Propchange: directory/apacheds/trunk/interceptors/operational/
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Tue Nov  8 16:41:51 2011
@@ -0,0 +1 @@
+/directory/apacheds/branches/apacheds-osgi/interceptors/operational:1185681-1199325

Modified: directory/apacheds/trunk/interceptors/operational/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/operational/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java?rev=1199334&r1=1199333&r2=1199334&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/operational/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/operational/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java Tue Nov  8 16:41:51 2011
@@ -182,7 +182,7 @@ public class OperationalAttributeInterce
      */
     public void add( NextInterceptor nextInterceptor, AddOperationContext addContext ) throws LdapException
     {
-        String principal = getPrincipal().getName();
+        String principal = getPrincipal( addContext ).getName();
 
         Entry entry = addContext.getEntry();
 
@@ -311,7 +311,7 @@ public class OperationalAttributeInterce
 	        if ( !modifierAtPresent )
 	        {
 	            // Inject the ModifiersName AT if it's not present
-	            Attribute attribute = new DefaultAttribute( MODIFIERS_NAME_AT, getPrincipal()
+	            Attribute attribute = new DefaultAttribute( MODIFIERS_NAME_AT, getPrincipal( modifyContext )
 	                .getName() );
 	
 	            Modification modifiersName = new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE, attribute );
@@ -347,11 +347,11 @@ public class OperationalAttributeInterce
     public void rename( NextInterceptor nextInterceptor, RenameOperationContext renameContext ) throws LdapException
     {
         Entry entry = ( ( ClonedServerEntry ) renameContext.getEntry() ).getClonedEntry();
-        entry.put( SchemaConstants.MODIFIERS_NAME_AT, getPrincipal().getName() );
+        entry.put( SchemaConstants.MODIFIERS_NAME_AT, getPrincipal( renameContext ).getName() );
         entry.put( SchemaConstants.MODIFY_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
 
         Entry modifiedEntry = renameContext.getOriginalEntry().clone();
-        modifiedEntry.put( SchemaConstants.MODIFIERS_NAME_AT, getPrincipal().getName() );
+        modifiedEntry.put( SchemaConstants.MODIFIERS_NAME_AT, getPrincipal( renameContext ).getName() );
         modifiedEntry.put( SchemaConstants.MODIFY_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
         //modifiedEntry.setDn( renameContext.getNewDn() );
         renameContext.setModifiedEntry( modifiedEntry );
@@ -366,7 +366,7 @@ public class OperationalAttributeInterce
     public void move( NextInterceptor nextInterceptor, MoveOperationContext moveContext ) throws LdapException
     {
         Entry modifiedEntry = moveContext.getOriginalEntry().clone();
-        modifiedEntry.put( SchemaConstants.MODIFIERS_NAME_AT, getPrincipal().getName() );
+        modifiedEntry.put( SchemaConstants.MODIFIERS_NAME_AT, getPrincipal( moveContext ).getName() );
         modifiedEntry.put( SchemaConstants.MODIFY_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
         modifiedEntry.setDn( moveContext.getNewDn() );
         moveContext.setModifiedEntry( modifiedEntry );
@@ -379,7 +379,7 @@ public class OperationalAttributeInterce
         throws LdapException
     {
         Entry modifiedEntry = moveAndRenameContext.getOriginalEntry().clone();
-        modifiedEntry.put( SchemaConstants.MODIFIERS_NAME_AT, getPrincipal().getName() );
+        modifiedEntry.put( SchemaConstants.MODIFIERS_NAME_AT, getPrincipal( moveAndRenameContext ).getName() );
         modifiedEntry.put( SchemaConstants.MODIFY_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
         modifiedEntry.setDn( moveAndRenameContext.getNewDn() );
         moveAndRenameContext.setModifiedEntry( modifiedEntry );

Propchange: directory/apacheds/trunk/interceptors/trigger/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Nov  8 16:41:51 2011
@@ -1 +1 @@
-/directory/apacheds/branches/apacheds-osgi/interceptors/trigger:1185681-1197580
+/directory/apacheds/branches/apacheds-osgi/interceptors/trigger:1185681-1199326