directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r669073 - in /directory/apacheds/branches/bigbang/core/src: main/java/org/apache/directory/server/core/event/ main/java/org/apache/directory/server/core/jndi/ main/java/org/apache/directory/server/core/partition/ main/java/org/apache/direct...
Date Wed, 18 Jun 2008 03:49:58 GMT
Author: akarasulu
Date: Tue Jun 17 20:49:58 2008
New Revision: 669073

URL: http://svn.apache.org/viewvc?rev=669073&view=rev
Log:
revamping core event service and interceptor

 o swapped out old EventInterceptor for new one based on non-JNDI notification
   model better suited towards the design of the LDAP operation contexts in ADS
 o added adapter to transduce DirectoryListener call backs into NamingEvents 
   delivered to associated NamingListeners to facilitate JNDI wrapper 
 o added proper modifications to Context implementations for addListener and 
   removeNamingListener methods
 o fixed some breakage from changes to OperationContext interfaces in Subentry
   interceptor and some mock test classes

NOTE: core integration tests are badly damaged and most will not work - fixes to
      follow 


Added:
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java
      - copied, changed from r666559, directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/event/NewEventInterceptor.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/EventListenerAdapter.java
Removed:
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/event/NewEventInterceptor.java
Modified:
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/event/NotificationCriteria.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexusProxy.java
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
    directory/apacheds/branches/bigbang/core/src/test/java/org/apache/directory/server/core/authz/support/MaxImmSubFilterTest.java

Copied: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java
(from r666559, directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/event/NewEventInterceptor.java)
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java?p2=directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java&p1=directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/event/NewEventInterceptor.java&r1=666559&r2=669073&rev=669073&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/event/NewEventInterceptor.java
(original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java
Tue Jun 17 20:49:58 2008
@@ -63,9 +63,9 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev: 666516 $
  */
-public class NewEventInterceptor extends BaseInterceptor
+public class EventInterceptor extends BaseInterceptor
 {
-    private final static Logger LOG = LoggerFactory.getLogger( NewEventInterceptor.class
);
+    private final static Logger LOG = LoggerFactory.getLogger( EventInterceptor.class );
 
     
     private List<RegistrationEntry> registrations = new CopyOnWriteArrayList<RegistrationEntry>();

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/event/NotificationCriteria.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/event/NotificationCriteria.java?rev=669073&r1=669072&r2=669073&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/event/NotificationCriteria.java
(original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/event/NotificationCriteria.java
Tue Jun 17 20:49:58 2008
@@ -32,7 +32,7 @@
 /**
  * Contains the set of notification criteria required for triggering the 
  * delivery of change notifications notifications to {@link DirectoryListener}s.
- *
+ * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */

Added: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/EventListenerAdapter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/EventListenerAdapter.java?rev=669073&view=auto
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/EventListenerAdapter.java
(added)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/EventListenerAdapter.java
Tue Jun 17 20:49:58 2008
@@ -0,0 +1,259 @@
+/*
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *   or more contributor license agreements.  See the NOTICE file
+ *   distributed with this work for additional information
+ *   regarding copyright ownership.  The ASF licenses this file
+ *   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.
+ *
+ */
+package org.apache.directory.server.core.jndi;
+
+
+import javax.naming.Binding;
+import javax.naming.NamingException;
+import javax.naming.directory.SearchControls;
+import javax.naming.event.NamespaceChangeListener;
+import javax.naming.event.NamingEvent;
+import javax.naming.event.NamingExceptionEvent;
+import javax.naming.event.NamingListener;
+import javax.naming.event.ObjectChangeListener;
+
+import org.apache.directory.server.core.entry.ServerEntryUtils;
+import org.apache.directory.server.core.event.DirectoryListener;
+import org.apache.directory.server.core.interceptor.context.AddOperationContext;
+import org.apache.directory.server.core.interceptor.context.DeleteOperationContext;
+import org.apache.directory.server.core.interceptor.context.ModifyOperationContext;
+import org.apache.directory.server.core.interceptor.context.MoveAndRenameOperationContext;
+import org.apache.directory.server.core.interceptor.context.MoveOperationContext;
+import org.apache.directory.server.core.interceptor.context.OperationContext;
+import org.apache.directory.server.core.interceptor.context.RenameOperationContext;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * A DirectoryListener implementation which adapts call back to methods 
+ * notifying of changes to the DIT into NamingEvents for use with the ApacheDS
+ * DirectoryService JNDI provider.
+ * 
+ * TODO for the time being bindings in NamingEvents generated are not relative 
+ * to the source context which they should be.
+ * 
+ * TODO presume correctly manipulated entry values in opContext.getEntry() 
+ * objects to function properly - at this point this is not handled in the
+ * Interceptors and needs to be added for this adapter to populate the event
+ * bindings.
+ * 
+ * TODO - Should we factor in the attributes to be returned in bindings? 
+ * Perhaps this should be privided as search controls along with the info
+ * we need to handle aliases, and referals?
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class EventListenerAdapter implements DirectoryListener
+{
+    private static final Logger LOG = LoggerFactory.getLogger( EventListenerAdapter.class
);
+    private final NamingListener listener;
+    private final ServerLdapContext source;
+    
+    /** 
+     * TODO not utilized but should be to effect returns in bindings, alias 
+     * and referral handling
+     */
+    private final SearchControls controls;
+
+    
+    public EventListenerAdapter( ServerLdapContext source, NamingListener listener )
+    {
+        this( source, listener, new SearchControls() );
+    }
+    
+    
+    public EventListenerAdapter( ServerLdapContext source, NamingListener listener, SearchControls
controls )
+    {
+        this.source = source;
+        this.controls = controls;
+        this.listener = listener;
+    }
+    
+    
+    private void deliverNamingExceptionEvent( Exception e, OperationContext opContext )
+    {
+        LOG.error( "Error encountered while delivering notifications.", e );
+        NamingExceptionEvent evt = null;
+        
+        if ( e instanceof NamingException )
+        {
+            evt = new NamingExceptionEvent( source, ( NamingException ) e );
+        }
+        else
+        {
+            NamingException ne = new NamingException( "Encountered exception during event
handling." );
+            ne.setRootCause( e );
+            evt = new NamingExceptionEvent( source, ne );
+        }
+        
+        listener.namingExceptionThrown( evt );
+    }
+    
+
+    /* (non-Javadoc)
+     * @see org.apache.directory.server.core.event.DirectoryListener#entryAdded(org.apache.directory.server.core.interceptor.context.AddOperationContext)
+     */
+    public void entryAdded( AddOperationContext opContext )
+    {
+        try
+        {
+            Binding binding = new Binding( opContext.getDn().getUpName(), 
+                ServerEntryUtils.toAttributesImpl( opContext.getEntry() ), false );
+            NamingEvent evt = new NamingEvent( source, NamingEvent.OBJECT_ADDED, 
+                binding, null, opContext );
+
+            if ( listener instanceof NamespaceChangeListener )
+            {
+                ( ( NamespaceChangeListener ) listener ).objectAdded( evt );
+            }
+        }
+        catch ( Exception e )
+        {
+            deliverNamingExceptionEvent( e, opContext );
+        }
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.apache.directory.server.core.event.DirectoryListener#entryDeleted(org.apache.directory.server.core.interceptor.context.DeleteOperationContext)
+     */
+    public void entryDeleted( DeleteOperationContext opContext )
+    {
+        try
+        {
+            if ( listener instanceof NamespaceChangeListener )
+            {
+                Binding binding = new Binding( opContext.getDn().getUpName(), 
+                    ServerEntryUtils.toAttributesImpl( opContext.getEntry() ), false );
+                NamingEvent evt = new NamingEvent( source, NamingEvent.OBJECT_REMOVED, null,

+                    binding, opContext );
+                ( ( NamespaceChangeListener ) listener ).objectAdded( evt );
+            }
+        }
+        catch ( Exception e )
+        {
+            deliverNamingExceptionEvent( e, opContext );
+        }
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.apache.directory.server.core.event.DirectoryListener#entryModified(org.apache.directory.server.core.interceptor.context.ModifyOperationContext)
+     */
+    public void entryModified( ModifyOperationContext opContext )
+    {
+        try
+        {
+            Binding newBinding = new Binding( opContext.getDn().getUpName(), 
+                ServerEntryUtils.toAttributesImpl( opContext.getEntry() ), false );
+            Binding oldBinding = new Binding( opContext.getDn().getUpName(), 
+                ServerEntryUtils.toAttributesImpl( opContext.getEntry().getOriginalEntry()
),  false );
+            NamingEvent evt = new NamingEvent( source, NamingEvent.OBJECT_CHANGED, 
+                newBinding, oldBinding, opContext );
+
+            if ( listener instanceof ObjectChangeListener )
+            {
+                ( ( ObjectChangeListener ) listener ).objectChanged( evt );
+            }
+        }
+        catch ( Exception e )
+        {
+            deliverNamingExceptionEvent( e, opContext );
+        }
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.apache.directory.server.core.event.DirectoryListener#entryMoved(org.apache.directory.server.core.interceptor.context.MoveOperationContext)
+     */
+    public void entryMoved( MoveOperationContext opContext )
+    {
+        try
+        {
+            if ( listener instanceof NamespaceChangeListener )
+            {
+                Binding newBinding = new Binding( opContext.getDn().getUpName(), 
+                    ServerEntryUtils.toAttributesImpl( opContext.getEntry() ), false );
+                Binding oldBinding = new Binding( opContext.getDn().getUpName(), 
+                    ServerEntryUtils.toAttributesImpl( opContext.getEntry().getOriginalEntry()
), false );
+                NamingEvent evt = new NamingEvent( source, NamingEvent.OBJECT_RENAMED, 
+                    newBinding, oldBinding, opContext );
+                ( ( NamespaceChangeListener ) listener ).objectRenamed( evt );
+            }
+        }
+        catch ( Exception e )
+        {
+            deliverNamingExceptionEvent( e, opContext );
+        }
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.apache.directory.server.core.event.DirectoryListener#entryMovedAndRenamed(org.apache.directory.server.core.interceptor.context.MoveAndRenameOperationContext)
+     */
+    public void entryMovedAndRenamed( MoveAndRenameOperationContext opContext )
+    {
+        try
+        {
+            if ( listener instanceof NamespaceChangeListener )
+            {
+                Binding newBinding = new Binding( opContext.getDn().getUpName(), 
+                    ServerEntryUtils.toAttributesImpl( opContext.getEntry() ), false );
+                Binding oldBinding = new Binding( opContext.getDn().getUpName(), 
+                    ServerEntryUtils.toAttributesImpl( opContext.getEntry().getOriginalEntry()
), false );
+                NamingEvent evt = new NamingEvent( source, NamingEvent.OBJECT_RENAMED, 
+                    newBinding, oldBinding, opContext );
+                ( ( NamespaceChangeListener ) listener ).objectRenamed( evt );
+            }
+        }
+        catch ( Exception e )
+        {
+            deliverNamingExceptionEvent( e, opContext );
+        }
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.apache.directory.server.core.event.DirectoryListener#entryRenamed(org.apache.directory.server.core.interceptor.context.RenameOperationContext)
+     */
+    public void entryRenamed( RenameOperationContext opContext )
+    {
+        try
+        {
+            if ( listener instanceof NamespaceChangeListener )
+            {
+                Binding newBinding = new Binding( opContext.getDn().getUpName(), 
+                    ServerEntryUtils.toAttributesImpl( opContext.getEntry() ), false );
+                Binding oldBinding = new Binding( opContext.getDn().getUpName(), 
+                    ServerEntryUtils.toAttributesImpl( opContext.getEntry().getOriginalEntry()
), false );
+                NamingEvent evt = new NamingEvent( source, NamingEvent.OBJECT_RENAMED, 
+                    newBinding, oldBinding, null );
+                ( ( NamespaceChangeListener ) listener ).objectRenamed( evt );
+            }
+        }
+        catch ( Exception e )
+        {
+            deliverNamingExceptionEvent( e, opContext );
+        }
+    }
+}

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java?rev=669073&r1=669072&r2=669073&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java
(original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java
Tue Jun 17 20:49:58 2008
@@ -28,6 +28,8 @@
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.entry.ServerEntryUtils;
+import org.apache.directory.server.core.event.DirectoryListener;
+import org.apache.directory.server.core.event.NotificationCriteria;
 import org.apache.directory.server.core.filtering.EntryFilteringCursor;
 import org.apache.directory.server.core.interceptor.context.AddOperationContext;
 import org.apache.directory.server.core.interceptor.context.BindOperationContext;
@@ -50,6 +52,7 @@
 import org.apache.directory.shared.ldap.exception.LdapSchemaViolationException;
 import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.filter.PresenceNode;
+import org.apache.directory.shared.ldap.filter.SearchScope;
 import org.apache.directory.shared.ldap.message.AliasDerefMode;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.AttributeTypeAndValue;
@@ -75,10 +78,10 @@
 import javax.naming.spi.DirStateFactory;
 import javax.naming.spi.DirectoryManager;
 import java.io.Serializable;
-import java.util.HashSet;
+import java.util.HashMap;
 import java.util.Hashtable;
 import java.util.List;
-import java.util.Set;
+import java.util.Map;
 
 
 /**
@@ -108,7 +111,8 @@
     private final LdapDN dn;
 
     /** The set of registered NamingListeners */
-    private final Set<NamingListener> listeners = new HashSet<NamingListener>();
+    private final Map<NamingListener,DirectoryListener> listeners = 
+        new HashMap<NamingListener,DirectoryListener>();
 
     /** The request controls to set on operations before performing them */
     protected Control[] requestControls = EMPTY_CONTROLS;
@@ -565,17 +569,19 @@
      */
     public void close() throws NamingException
     {
-        for ( NamingListener listener : listeners )
+        for ( DirectoryListener listener : listeners.values() )
         {
             try
             {
-                ( ( PartitionNexusProxy ) this.nexusProxy ).removeNamingListener( this, listener
);
+                service.getEventService().removeListener( listener );
             }
             catch ( Exception e )
             {
                 JndiUtils.wrap( e );
             }
         }
+        
+        listeners.clear();
     }
 
 
@@ -1300,18 +1306,23 @@
     public void addNamingListener( Name name, int scope, NamingListener namingListener )
throws NamingException
     {
         ExprNode filter = new PresenceNode( SchemaConstants.OBJECT_CLASS_AT );
-        SearchControls controls = new SearchControls();
-        controls.setSearchScope( scope );
+
         try
         {
-            ( ( PartitionNexusProxy ) this.nexusProxy ).addNamingListener( this, buildTarget(
name ), filter, controls,
-                namingListener );
+            DirectoryListener listener = new EventListenerAdapter( ( ServerLdapContext )
this, namingListener );
+            NotificationCriteria criteria = new NotificationCriteria();
+            criteria.setFilter( filter );
+            criteria.setScope( SearchScope.getSearchScope( scope ) );
+            criteria.setAliasDerefMode( AliasDerefMode.getEnum( env ) );
+            criteria.setBase( buildTarget( name ) );
+            
+            service.getEventService().addListener( listener );
+            listeners.put( namingListener, listener );
         }
         catch ( Exception e )
         {
             JndiUtils.wrap( e );
         }
-        listeners.add( namingListener );
     }
 
 
@@ -1325,13 +1336,17 @@
     {
         try
         {
-            ( ( PartitionNexusProxy ) this.nexusProxy ).removeNamingListener( this, namingListener
);
+            DirectoryListener listener = listeners.remove( namingListener );
+            
+            if ( listener != null )
+            {
+                service.getEventService().removeListener( listener );
+            }
         }
         catch ( Exception e )
         {
             JndiUtils.wrap( e );
         }
-        listeners.remove( namingListener );
     }
 
 
@@ -1346,7 +1361,7 @@
      *
      * @return the set of listeners used for tracking registered name listeners.
      */
-    protected Set<NamingListener> getListeners()
+    protected Map<NamingListener, DirectoryListener> getListeners()
     {
         return listeners;
     }

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java?rev=669073&r1=669072&r2=669073&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java
(original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java
Tue Jun 17 20:49:58 2008
@@ -25,6 +25,8 @@
 import org.apache.directory.server.core.authn.LdapPrincipal;
 import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.entry.ServerEntryUtils;
+import org.apache.directory.server.core.event.DirectoryListener;
+import org.apache.directory.server.core.event.NotificationCriteria;
 import org.apache.directory.server.core.interceptor.context.EntryOperationContext;
 import org.apache.directory.server.core.partition.PartitionNexusProxy;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
@@ -38,6 +40,7 @@
 import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.filter.FilterParser;
 import org.apache.directory.shared.ldap.filter.PresenceNode;
+import org.apache.directory.shared.ldap.filter.SearchScope;
 import org.apache.directory.shared.ldap.filter.SimpleNode;
 import org.apache.directory.shared.ldap.message.AliasDerefMode;
 import org.apache.directory.shared.ldap.message.ModificationItemImpl;
@@ -922,6 +925,7 @@
     // EventDirContext implementations
     // ------------------------------------------------------------------------
 
+    
     public void addNamingListener( Name name, String filterStr, SearchControls searchControls,
         NamingListener namingListener ) throws NamingException
     {
@@ -940,14 +944,20 @@
 
         try
         {
-            ( ( PartitionNexusProxy ) getNexusProxy() ).addNamingListener( this, buildTarget(
name ), filter,
-                searchControls, namingListener );
+            DirectoryListener listener = new EventListenerAdapter( ( ServerLdapContext )
this, namingListener );
+            NotificationCriteria criteria = new NotificationCriteria();
+            criteria.setFilter( filter );
+            criteria.setScope( SearchScope.getSearchScope( searchControls ) );
+            criteria.setAliasDerefMode( AliasDerefMode.getEnum( getEnvironment() ) );
+            criteria.setBase( buildTarget( name ) );
+            
+            getDirectoryService().getEventService().addListener( listener );
+            getListeners().put( namingListener, listener );
         }
         catch ( Exception e )
         {
             JndiUtils.wrap( e );
         }
-        getListeners().add( namingListener );
     }
 
 

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexusProxy.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexusProxy.java?rev=669073&r1=669072&r2=669073&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexusProxy.java
(original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexusProxy.java
Tue Jun 17 20:49:58 2008
@@ -28,14 +28,11 @@
 import javax.naming.Context;
 import javax.naming.ServiceUnavailableException;
 import javax.naming.directory.SearchControls;
-import javax.naming.event.EventContext;
-import javax.naming.event.NamingListener;
 import javax.naming.ldap.LdapContext;
 
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.entry.ClonedServerEntry;
 import org.apache.directory.server.core.entry.ServerEntry;
-import org.apache.directory.server.core.event.EventInterceptor;
 import org.apache.directory.server.core.filtering.EntryFilter;
 import org.apache.directory.server.core.filtering.EntryFilteringCursor;
 import org.apache.directory.server.core.interceptor.InterceptorChain;
@@ -65,9 +62,9 @@
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.exception.LdapSizeLimitExceededException;
 import org.apache.directory.shared.ldap.exception.LdapTimeLimitExceededException;
-import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.name.LdapDN;
 
+
 /**
  * A decorator that wraps other {@link PartitionNexus} to enable
  * {@link InterceptorChain} and {@link InvocationStack} support.
@@ -785,38 +782,6 @@
     }
 
 
-    // -----------------------------------------------------------------------
-    // EventContext and EventDirContext notification methods
-    // -----------------------------------------------------------------------
-
-    /*
-     * All listener registration/deregistration methods can be reduced down to
-     * the following methods.  Rather then make these actual intercepted methods
-     * we use them as out of band methods to interface with the notification
-     * interceptor.
-     */
-
-    public void addNamingListener( EventContext ctx, LdapDN name, ExprNode filter, SearchControls
searchControls,
-            NamingListener namingListener ) throws Exception
-    {
-        InterceptorChain chain = service.getInterceptorChain();
-        EventInterceptor interceptor = ( EventInterceptor ) chain.get( EventInterceptor.class.getName()
);
-        interceptor.addNamingListener( ctx, name, filter, searchControls, namingListener
);
-    }
-
-
-    public void removeNamingListener( EventContext ctx, NamingListener namingListener ) throws
Exception
-    {
-        InterceptorChain chain = service.getInterceptorChain();
-        if ( chain == null )
-        {
-            return;
-        }
-        EventInterceptor interceptor = ( EventInterceptor ) chain.get( EventInterceptor.class.getName()
);
-        interceptor.removeNamingListener( ctx, namingListener );
-    }
-
-
     public ClonedServerEntry lookup( Long id ) throws Exception
     {
         // TODO not implemented until we can lookup partition using the 

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java?rev=669073&r1=669072&r2=669073&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
(original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
Tue Jun 17 20:49:58 2008
@@ -405,7 +405,7 @@
     public void add( NextInterceptor next, AddOperationContext addContext ) throws Exception
     {
         LdapDN name = addContext.getDn();
-        ServerEntry entry = addContext.getEntry();
+        ClonedServerEntry entry = addContext.getEntry();
 
         EntryAttribute objectClasses = entry.get( SchemaConstants.OBJECT_CLASS_AT );
 
@@ -496,6 +496,8 @@
                 }
             }
 
+            // TODO why are we doing this here if we got the entry from the 
+            // opContext in the first place - got to look into this 
             addContext.setEntry( entry );
         }
         else
@@ -573,6 +575,8 @@
                 }
             }
 
+            // TODO why are we doing this here if we got the entry from the 
+            // opContext in the first place - got to look into this 
             addContext.setEntry( entry );
 
             next.add( addContext );

Modified: directory/apacheds/branches/bigbang/core/src/test/java/org/apache/directory/server/core/authz/support/MaxImmSubFilterTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/test/java/org/apache/directory/server/core/authz/support/MaxImmSubFilterTest.java?rev=669073&r1=669072&r2=669073&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/test/java/org/apache/directory/server/core/authz/support/MaxImmSubFilterTest.java
(original)
+++ directory/apacheds/branches/bigbang/core/src/test/java/org/apache/directory/server/core/authz/support/MaxImmSubFilterTest.java
Tue Jun 17 20:49:58 2008
@@ -469,6 +469,20 @@
             // TODO Auto-generated method stub
             
         }
+
+
+        public ClonedServerEntry getEntry()
+        {
+            // TODO Auto-generated method stub
+            return null;
+        }
+
+
+        public void setEntry( ClonedServerEntry entry )
+        {
+            // TODO Auto-generated method stub
+            
+        }
     }
 
     class MockDirectoryService implements DirectoryService



Mime
View raw message