directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r815967 - in /directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core: authz/ event/ exception/ operational/
Date Wed, 16 Sep 2009 21:11:54 GMT
Author: elecharny
Date: Wed Sep 16 21:11:54 2009
New Revision: 815967

URL: http://svn.apache.org/viewvc?rev=815967&view=rev
Log:
Removed useless lookups as we already have the entry in the context

Modified:
    directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
    directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java
    directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java
    directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java

Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java?rev=815967&r1=815966&r2=815967&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
Wed Sep 16 21:11:54 2009
@@ -20,8 +20,6 @@
 package org.apache.directory.server.core.authz;
 
 
-import javax.naming.directory.SearchControls;
-
 import java.text.ParseException;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -30,6 +28,8 @@
 import java.util.List;
 import java.util.Set;
 
+import javax.naming.directory.SearchControls;
+
 import org.apache.directory.server.constants.ServerDNConstants;
 import org.apache.directory.server.core.CoreSession;
 import org.apache.directory.server.core.DefaultCoreSession;
@@ -79,7 +79,6 @@
 import org.apache.directory.shared.ldap.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.shared.ldap.schema.registries.ObjectClassRegistry;
 import org.apache.directory.shared.ldap.schema.registries.Registries;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -805,7 +804,7 @@
     {
         LdapDN name = renameContext.getDn();
 
-        ClonedServerEntry entry = renameContext.lookup( name, ByPassConstants.LOOKUP_BYPASS
);
+        ClonedServerEntry entry = renameContext.getEntry();
         
         LdapPrincipal principal = renameContext.getSession().getEffectivePrincipal();
         LdapDN principalDn = principal.getJndiName();

Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java?rev=815967&r1=815966&r2=815967&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java
Wed Sep 16 21:11:54 2009
@@ -49,7 +49,6 @@
 import org.apache.directory.shared.ldap.schema.normalizers.ConcreteNameComponentNormalizer;
 import org.apache.directory.shared.ldap.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.shared.ldap.schema.registries.OidRegistry;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -211,7 +210,7 @@
 
     public void rename( NextInterceptor next, RenameOperationContext opContext ) throws Exception
     {
-        ClonedServerEntry oriEntry = opContext.lookup( opContext.getDn(), ByPassConstants.LOOKUP_BYPASS
);
+        ClonedServerEntry oriEntry = opContext.getEntry();
         List<RegistrationEntry> selecting = getSelectingRegistrations( opContext.getDn(),
oriEntry );
         next.rename( opContext );
 

Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java?rev=815967&r1=815966&r2=815967&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java
Wed Sep 16 21:11:54 2009
@@ -20,13 +20,16 @@
 package org.apache.directory.server.core.exception;
 
 
+import java.util.List;
+import java.util.Map;
+
 import org.apache.commons.collections.map.LRUMap;
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.entry.ClonedServerEntry;
 import org.apache.directory.server.core.entry.ServerAttribute;
 import org.apache.directory.server.core.entry.ServerEntry;
-import org.apache.directory.server.core.filtering.EntryFilteringCursor;
 import org.apache.directory.server.core.filtering.BaseEntryFilteringCursor;
+import org.apache.directory.server.core.filtering.EntryFilteringCursor;
 import org.apache.directory.server.core.interceptor.BaseInterceptor;
 import org.apache.directory.server.core.interceptor.NextInterceptor;
 import org.apache.directory.server.core.interceptor.context.AddOperationContext;
@@ -61,9 +64,6 @@
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.normalizers.OidNormalizer;
 
-import java.util.List;
-import java.util.Map;
-
 
 /**
  * An {@link org.apache.directory.server.core.interceptor.Interceptor} that detects any operations
that breaks integrity

Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java?rev=815967&r1=815966&r2=815967&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java
Wed Sep 16 21:11:54 2009
@@ -257,19 +257,20 @@
     {
         nextInterceptor.rename( opContext );
 
-        // add operational attributes after call in case the operation fails
-        ServerEntry serverEntry = new DefaultServerEntry( registries, opContext.getDn() );
-        serverEntry.put( SchemaConstants.MODIFIERS_NAME_AT, getPrincipal().getName() );
-        serverEntry.put( SchemaConstants.MODIFY_TIMESTAMP_AT, DateUtils.getGeneralizedTime()
);
-
         LdapDN newDn = ( LdapDN ) opContext.getDn().clone();
         newDn.remove( opContext.getDn().size() - 1 );
         newDn.add( opContext.getNewRdn() );
         newDn.normalize( atRegistry.getNormalizerMapping() );
         
+        // add operational attributes after call in case the operation fails
+        ServerEntry serverEntry = new DefaultServerEntry( registries, newDn );
+        serverEntry.put( SchemaConstants.MODIFIERS_NAME_AT, getPrincipal().getName() );
+        serverEntry.put( SchemaConstants.MODIFY_TIMESTAMP_AT, DateUtils.getGeneralizedTime()
);
+
         List<Modification> items = ModifyOperationContext.createModItems( serverEntry,
ModificationOperation.REPLACE_ATTRIBUTE );
 
         ModifyOperationContext newModify = new ModifyOperationContext( opContext.getSession(),
newDn, items );
+        newModify.setEntry( opContext.getEntry() );
         
         service.getPartitionNexus().modify( newModify );
     }



Mime
View raw message