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 2007/08/23 21:26:01 UTC
svn commit: r569124 [2/3] - in /directory/apacheds/trunk:
core/src/main/java/org/apache/directory/server/core/authn/
core/src/main/java/org/apache/directory/server/core/authz/
core/src/main/java/org/apache/directory/server/core/collective/
core/src/mai...
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/NextInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/NextInterceptor.java?rev=569124&r1=569123&r2=569124&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/NextInterceptor.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/NextInterceptor.java Thu Aug 23 12:25:57 2007
@@ -27,7 +27,26 @@
import javax.naming.directory.Attributes;
import javax.naming.directory.SearchResult;
+import org.apache.directory.server.core.interceptor.context.AddContextPartitionOperationContext;
+import org.apache.directory.server.core.interceptor.context.AddOperationContext;
+import org.apache.directory.server.core.interceptor.context.BindOperationContext;
+import org.apache.directory.server.core.interceptor.context.CompareOperationContext;
+import org.apache.directory.server.core.interceptor.context.DeleteOperationContext;
+import org.apache.directory.server.core.interceptor.context.EntryOperationContext;
+import org.apache.directory.server.core.interceptor.context.GetMatchedNameOperationContext;
+import org.apache.directory.server.core.interceptor.context.GetRootDSEOperationContext;
+import org.apache.directory.server.core.interceptor.context.GetSuffixOperationContext;
+import org.apache.directory.server.core.interceptor.context.ListOperationContext;
+import org.apache.directory.server.core.interceptor.context.ListSuffixOperationContext;
+import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
+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.RemoveContextPartitionOperationContext;
+import org.apache.directory.server.core.interceptor.context.RenameOperationContext;
+import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
+import org.apache.directory.server.core.interceptor.context.UnbindOperationContext;
import org.apache.directory.server.core.partition.PartitionNexus;
import org.apache.directory.shared.ldap.name.LdapDN;
@@ -42,114 +61,114 @@
public interface NextInterceptor
{
/**
- * Calls the next interceptor's {@link Interceptor#compare( NextInterceptor, OperationContext )}.
+ * Calls the next interceptor's {@link Interceptor#compare( NextInterceptor, CompareOperationContext )}.
*/
- boolean compare( OperationContext opContext ) throws NamingException;
+ boolean compare( CompareOperationContext opContext ) throws NamingException;
/**
- * Calls the next interceptor's {@link Interceptor#getRootDSE( NextInterceptor, OperationContext )}.
+ * Calls the next interceptor's {@link Interceptor#getRootDSE( NextInterceptor, GetRootDSEOperationContext )}.
*/
- Attributes getRootDSE( OperationContext opContext ) throws NamingException;
+ Attributes getRootDSE( GetRootDSEOperationContext opContext ) throws NamingException;
/**
- * Calls the next interceptor's {@link Interceptor#getMatchedName( NextInterceptor, OperationContext )}.
+ * Calls the next interceptor's {@link Interceptor#getMatchedName( NextInterceptor, GetMatchedNameOperationContext )}.
*/
- LdapDN getMatchedName( OperationContext opContext ) throws NamingException;
+ LdapDN getMatchedName( GetMatchedNameOperationContext opContext ) throws NamingException;
/**
- * Calls the next interceptor's {@link Interceptor#getSuffix( NextInterceptor, OperationContext )}.
+ * Calls the next interceptor's {@link Interceptor#getSuffix( NextInterceptor, GetSuffixOperationContext )}.
*/
- LdapDN getSuffix( OperationContext opContext ) throws NamingException;
+ LdapDN getSuffix( GetSuffixOperationContext opContext ) throws NamingException;
/**
- * Calls the next interceptor's {@link Interceptor#listSuffixes( NextInterceptor, OperationContext )}.
+ * Calls the next interceptor's {@link Interceptor#listSuffixes( NextInterceptor, ListSuffixOperationContext )}.
*/
- Iterator listSuffixes( OperationContext opContext ) throws NamingException;
+ Iterator listSuffixes( ListSuffixOperationContext opContext ) throws NamingException;
/**
- * Calls the next interceptor's {@link PartitionNexus#addContextPartition( nextInterceptor, OperationContext )}.
+ * Calls the next interceptor's {@link PartitionNexus#addContextPartition( nextInterceptor, AddContextPartitionOperationContext )}.
*/
- void addContextPartition( OperationContext opContext ) throws NamingException;
+ void addContextPartition( AddContextPartitionOperationContext opContext ) throws NamingException;
/**
- * Calls the next interceptor's {@link PartitionNexus#removeContextPartition( NextInterceptor, OperationContext )}.
+ * Calls the next interceptor's {@link PartitionNexus#removeContextPartition( NextInterceptor, RemoveContextPartitionOperationContext )}.
*/
- void removeContextPartition( OperationContext opContext ) throws NamingException;
+ void removeContextPartition( RemoveContextPartitionOperationContext opContext ) throws NamingException;
/**
- * Calls the next interceptor's {@link Interceptor#delete(NextInterceptor, OperationContext )}.
+ * Calls the next interceptor's {@link Interceptor#delete(NextInterceptor, DeleteOperationContext )}.
*/
- void delete( OperationContext opContext ) throws NamingException;
+ void delete( DeleteOperationContext opContext ) throws NamingException;
/**
- * Calls the next interceptor's {@link Interceptor#add( NextInterceptor, OperationContext )}.
+ * Calls the next interceptor's {@link Interceptor#add( NextInterceptor, AddOperationContext )}.
*/
- void add( OperationContext opContext ) throws NamingException;
+ void add( AddOperationContext opContext ) throws NamingException;
/**
- * Calls the next interceptor's {@link Interceptor#modify( NextInterceptor, OperationContext )}.
+ * Calls the next interceptor's {@link Interceptor#modify( NextInterceptor, ModifyOperationContext )}.
*/
- void modify( OperationContext opContext ) throws NamingException;
+ void modify( ModifyOperationContext opContext ) throws NamingException;
/**
- * Calls the next interceptor's {@link Interceptor#list( NextInterceptor, OperationContext )}.
+ * Calls the next interceptor's {@link Interceptor#list( NextInterceptor, ListOperationContext )}.
*/
- NamingEnumeration list( OperationContext opContext ) throws NamingException;
+ NamingEnumeration list( ListOperationContext opContext ) throws NamingException;
/**
- * Calls the next interceptor's {@link Interceptor#search( NextInterceptor, OperationContext opContext )}.
+ * Calls the next interceptor's {@link Interceptor#search( NextInterceptor, SearchOperationContext opContext )}.
*/
- NamingEnumeration<SearchResult> search( OperationContext opContext )
+ NamingEnumeration<SearchResult> search( SearchOperationContext opContext )
throws NamingException;
/**
- * Calls the next interceptor's {@link Interceptor#lookup( NextInterceptor, OperationContext )}.
+ * Calls the next interceptor's {@link Interceptor#lookup( NextInterceptor, LookupOperationContext )}.
*/
- Attributes lookup( OperationContext opContext ) throws NamingException;
+ Attributes lookup( LookupOperationContext opContext ) throws NamingException;
/**
- * Calls the next interceptor's {@link Interceptor#hasEntry( NextInterceptor, OperationContext )}.
+ * Calls the next interceptor's {@link Interceptor#hasEntry( NextInterceptor, EntryOperationContext )}.
*/
- boolean hasEntry( OperationContext opContext ) throws NamingException;
+ boolean hasEntry( EntryOperationContext opContext ) throws NamingException;
/**
- * Calls the next interceptor's {@link Interceptor#rename( NextInterceptor, OperationContext )}.
+ * Calls the next interceptor's {@link Interceptor#rename( NextInterceptor, RenameOperationContext )}.
*/
- void rename( OperationContext opContext ) throws NamingException;
+ void rename( RenameOperationContext opContext ) throws NamingException;
/**
- * Calls the next interceptor's {@link Interceptor#move( NextInterceptor, OperationContext )}.
+ * Calls the next interceptor's {@link Interceptor#move( NextInterceptor, MoveOperationContext )}.
*/
- void move( OperationContext opContext ) throws NamingException;
+ void move( MoveOperationContext opContext ) throws NamingException;
/**
- * Calls the next interceptor's {@link Interceptor#moveAndRename( NextInterceptor, OperationContext )}.
+ * Calls the next interceptor's {@link Interceptor#moveAndRename( NextInterceptor, MoveAndRenameOperationContext )}.
*/
- void moveAndRename( OperationContext opContext ) throws NamingException;
+ void moveAndRename( MoveAndRenameOperationContext opContext ) throws NamingException;
/**
- * Calls the next interceptor's {@link Interceptor#bind( NextInterceptor, OperationContext )}
+ * Calls the next interceptor's {@link Interceptor#bind( NextInterceptor, BindOperationContext )}
*/
- void bind( OperationContext opContext ) throws NamingException;
+ void bind( BindOperationContext opContext ) throws NamingException;
/**
- * Calls the next interceptor's {@link Interceptor#unbind( NextInterceptor, OperationContext )}
+ * Calls the next interceptor's {@link Interceptor#unbind( NextInterceptor, UnbindOperationContext )}
*/
- void unbind( OperationContext opContext ) throws NamingException;
+ void unbind( UnbindOperationContext opContext ) throws NamingException;
}
Added: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/ListSuffixOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/ListSuffixOperationContext.java?rev=569124&view=auto
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/ListSuffixOperationContext.java (added)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/ListSuffixOperationContext.java Thu Aug 23 12:25:57 2007
@@ -0,0 +1,58 @@
+/*
+ * 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.interceptor.context;
+
+import org.apache.directory.shared.ldap.name.LdapDN;
+
+/**
+ * A ListSuffix context used for Interceptors. It contains all the informations
+ * needed for the ListSuffix operation, and used by all the interceptors
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class ListSuffixOperationContext extends AbstractOperationContext
+{
+ /**
+ * Creates a new instance of ListSuffixOperationContext.
+ */
+ public ListSuffixOperationContext()
+ {
+ super();
+ }
+
+ /**
+ * Creates a new instance of ListSuffixOperationContext.
+ *
+ * @param dn The DN to get the suffix from
+ */
+ public ListSuffixOperationContext( LdapDN dn )
+ {
+ super( dn );
+ }
+
+ /**
+ * @see Object#toString()
+ */
+ public String toString()
+ {
+ return "ListSuffixOperationContext with DN '" + getDn().getUpName() + "'";
+ }
+}
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java?rev=569124&r1=569123&r2=569124&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java Thu Aug 23 12:25:57 2007
@@ -53,6 +53,7 @@
import org.apache.directory.server.core.interceptor.context.BindOperationContext;
import org.apache.directory.server.core.interceptor.context.DeleteOperationContext;
import org.apache.directory.server.core.interceptor.context.EntryOperationContext;
+import org.apache.directory.server.core.interceptor.context.GetRootDSEOperationContext;
import org.apache.directory.server.core.interceptor.context.ListOperationContext;
import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
import org.apache.directory.server.core.interceptor.context.MoveAndRenameOperationContext;
@@ -628,7 +629,7 @@
if ( name.size() == 0 )
{
- attributes = nexusProxy.getRootDSE( new LookupOperationContext( target ) );
+ attributes = nexusProxy.getRootDSE( new GetRootDSEOperationContext( target ) );
}
else
{
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/kerberos/KeyDerivationService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/kerberos/KeyDerivationService.java?rev=569124&r1=569123&r2=569124&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/kerberos/KeyDerivationService.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/kerberos/KeyDerivationService.java Thu Aug 23 12:25:57 2007
@@ -108,11 +108,11 @@
* the special keyword 'randomKey', set random keys for the principal. Set the key version number (kvno)
* to '0'.
*/
- public void add( NextInterceptor next, OperationContext addContext ) throws NamingException
+ public void add( NextInterceptor next, AddOperationContext addContext ) throws NamingException
{
LdapDN normName = addContext.getDn();
- Attributes entry = ( ( AddOperationContext ) addContext ).getEntry();
+ Attributes entry = addContext.getEntry();
if ( entry.get( "userPassword" ) != null && entry.get( KerberosAttribute.PRINCIPAL ) != null )
{
@@ -171,9 +171,8 @@
*
* If the 'userPassword' is the special keyword 'randomKey', set random keys for the principal.
*/
- public void modify( NextInterceptor next, OperationContext opContext ) throws NamingException
+ public void modify( NextInterceptor next, ModifyOperationContext modContext ) throws NamingException
{
- ModifyOperationContext modContext = ( ModifyOperationContext ) opContext;
ModifySubContext subContext = new ModifySubContext();
detectPasswordModification( modContext, subContext );
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/kerberos/PasswordPolicyService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/kerberos/PasswordPolicyService.java?rev=569124&r1=569123&r2=569124&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/kerberos/PasswordPolicyService.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/kerberos/PasswordPolicyService.java Thu Aug 23 12:25:57 2007
@@ -64,11 +64,11 @@
* Check added attributes for a 'userPassword'. If a 'userPassword' is found, apply any
* password policy checks.
*/
- public void add( NextInterceptor next, OperationContext addContext ) throws NamingException
+ public void add( NextInterceptor next, AddOperationContext addContext ) throws NamingException
{
LdapDN normName = addContext.getDn();
- Attributes entry = ( ( AddOperationContext ) addContext ).getEntry();
+ Attributes entry = addContext.getEntry();
log.debug( "Adding the entry '{}' for DN '{}'.", AttributeUtils.toString( entry ), normName.getUpName() );
@@ -120,10 +120,9 @@
* Check modification items for a 'userPassword'. If a 'userPassword' is found, apply any
* password policy checks.
*/
- public void modify( NextInterceptor next, OperationContext opContext ) throws NamingException
+ public void modify( NextInterceptor next, ModifyOperationContext modContext ) throws NamingException
{
- LdapDN name = opContext.getDn();
- ModifyOperationContext modContext = ( ModifyOperationContext ) opContext;
+ LdapDN name = modContext.getDn();
ModificationItemImpl[] mods = modContext.getModItems();
@@ -187,7 +186,7 @@
}
}
- next.modify( opContext );
+ next.modify( modContext );
}
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationService.java?rev=569124&r1=569123&r2=569124&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationService.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationService.java Thu Aug 23 12:25:57 2007
@@ -32,10 +32,22 @@
import org.apache.directory.server.core.configuration.InterceptorConfiguration;
import org.apache.directory.server.core.interceptor.BaseInterceptor;
import org.apache.directory.server.core.interceptor.NextInterceptor;
+import org.apache.directory.server.core.interceptor.context.AddContextPartitionOperationContext;
+import org.apache.directory.server.core.interceptor.context.AddOperationContext;
+import org.apache.directory.server.core.interceptor.context.BindOperationContext;
+import org.apache.directory.server.core.interceptor.context.CompareOperationContext;
+import org.apache.directory.server.core.interceptor.context.DeleteOperationContext;
+import org.apache.directory.server.core.interceptor.context.EntryOperationContext;
+import org.apache.directory.server.core.interceptor.context.GetMatchedNameOperationContext;
+import org.apache.directory.server.core.interceptor.context.GetSuffixOperationContext;
+import org.apache.directory.server.core.interceptor.context.ListOperationContext;
import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
+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.RemoveContextPartitionOperationContext;
+import org.apache.directory.server.core.interceptor.context.RenameOperationContext;
import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
import org.apache.directory.server.core.partition.PartitionNexus;
import org.apache.directory.server.schema.ConcreteNameComponentNormalizer;
@@ -107,7 +119,7 @@
// Normalize all Name based arguments for ContextPartition interface operations
// ------------------------------------------------------------------------
- public void add(NextInterceptor nextInterceptor, OperationContext opContext)
+ public void add(NextInterceptor nextInterceptor, AddOperationContext opContext)
throws NamingException
{
LdapDN.normalize( opContext.getDn(), attrNormalizers );
@@ -115,14 +127,14 @@
}
- public void delete( NextInterceptor nextInterceptor, OperationContext opContext ) throws NamingException
+ public void delete( NextInterceptor nextInterceptor, DeleteOperationContext opContext ) throws NamingException
{
LdapDN.normalize( opContext.getDn(), attrNormalizers );
nextInterceptor.delete( opContext );
}
- public void modify( NextInterceptor nextInterceptor, OperationContext opContext )
+ public void modify( NextInterceptor nextInterceptor, ModifyOperationContext opContext )
throws NamingException
{
LdapDN.normalize( opContext.getDn(), attrNormalizers );
@@ -130,7 +142,7 @@
}
- public void rename( NextInterceptor nextInterceptor, OperationContext opContext )
+ public void rename( NextInterceptor nextInterceptor, RenameOperationContext opContext )
throws NamingException
{
LdapDN.normalize( opContext.getDn(), attrNormalizers );
@@ -138,27 +150,27 @@
}
- public void move( NextInterceptor nextInterceptor, OperationContext opContext ) throws NamingException
+ public void move( NextInterceptor nextInterceptor, MoveOperationContext opContext ) throws NamingException
{
LdapDN.normalize( opContext.getDn(), attrNormalizers );
- ((MoveOperationContext)opContext).getParent().normalize( attrNormalizers);
+ opContext.getParent().normalize( attrNormalizers);
nextInterceptor.move( opContext );
}
- public void moveAndRename( NextInterceptor nextInterceptor, OperationContext opContext )
+ public void moveAndRename( NextInterceptor nextInterceptor, MoveAndRenameOperationContext opContext )
throws NamingException
{
LdapDN.normalize( opContext.getDn(), attrNormalizers );
- LdapDN.normalize( ((MoveAndRenameOperationContext)opContext).getParent(), attrNormalizers);
+ LdapDN.normalize( opContext.getParent(), attrNormalizers);
nextInterceptor.moveAndRename( opContext );
}
- public NamingEnumeration<SearchResult> search( NextInterceptor nextInterceptor, OperationContext opContext ) throws NamingException
+ public NamingEnumeration<SearchResult> search( NextInterceptor nextInterceptor, SearchOperationContext opContext ) throws NamingException
{
LdapDN base = opContext.getDn();
- ExprNode filter = ((SearchOperationContext)opContext).getFilter();
+ ExprNode filter = opContext.getFilter();
base.normalize( attrNormalizers);
@@ -333,28 +345,28 @@
}
}
- ((SearchOperationContext)opContext).setFilter( filter );
+ opContext.setFilter( filter );
return nextInterceptor.search( opContext );
}
- public boolean hasEntry( NextInterceptor nextInterceptor, OperationContext opContext ) throws NamingException
+ public boolean hasEntry( NextInterceptor nextInterceptor, EntryOperationContext opContext ) throws NamingException
{
LdapDN.normalize( opContext.getDn(), attrNormalizers );
return nextInterceptor.hasEntry( opContext );
}
- public NamingEnumeration list( NextInterceptor nextInterceptor, OperationContext opContext ) throws NamingException
+ public NamingEnumeration list( NextInterceptor nextInterceptor, ListOperationContext opContext ) throws NamingException
{
LdapDN.normalize( opContext.getDn(), attrNormalizers );
return nextInterceptor.list( opContext );
}
- public Attributes lookup( NextInterceptor nextInterceptor, OperationContext opContext ) throws NamingException
+ public Attributes lookup( NextInterceptor nextInterceptor, LookupOperationContext opContext ) throws NamingException
{
- LdapDN.normalize( ((LookupOperationContext)opContext).getDn(), attrNormalizers );
+ LdapDN.normalize( opContext.getDn(), attrNormalizers );
return nextInterceptor.lookup( opContext );
}
@@ -363,41 +375,41 @@
// Normalize all Name based arguments for other interface operations
// ------------------------------------------------------------------------
- public LdapDN getMatchedName ( NextInterceptor nextInterceptor, OperationContext opContext ) throws NamingException
+ public LdapDN getMatchedName ( NextInterceptor nextInterceptor, GetMatchedNameOperationContext opContext ) throws NamingException
{
LdapDN.normalize( opContext.getDn(), attrNormalizers );
return nextInterceptor.getMatchedName( opContext );
}
- public LdapDN getSuffix ( NextInterceptor nextInterceptor, OperationContext opContext ) throws NamingException
+ public LdapDN getSuffix ( NextInterceptor nextInterceptor, GetSuffixOperationContext opContext ) throws NamingException
{
LdapDN.normalize( opContext.getDn(), attrNormalizers );
return nextInterceptor.getSuffix( opContext );
}
- public boolean compare( NextInterceptor next, OperationContext opContext ) throws NamingException
+ public boolean compare( NextInterceptor next, CompareOperationContext opContext ) throws NamingException
{
LdapDN.normalize( opContext.getDn(), attrNormalizers );
return next.compare( opContext );
}
- public void bind( NextInterceptor next, OperationContext opContext ) throws NamingException
+ public void bind( NextInterceptor next, BindOperationContext opContext ) throws NamingException
{
LdapDN.normalize( opContext.getDn(), attrNormalizers );
next.bind( opContext );
}
- public void addContextPartition( NextInterceptor next, OperationContext opContext ) throws NamingException
+ public void addContextPartition( NextInterceptor next, AddContextPartitionOperationContext opContext ) throws NamingException
{
next.addContextPartition( opContext );
}
- public void removeContextPartition( NextInterceptor next, OperationContext opContext ) throws NamingException
+ public void removeContextPartition( NextInterceptor next, RemoveContextPartitionOperationContext opContext ) throws NamingException
{
LdapDN.normalize( opContext.getDn(), attrNormalizers );
next.removeContextPartition( opContext );
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeService.java?rev=569124&r1=569123&r2=569124&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeService.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeService.java Thu Aug 23 12:25:57 2007
@@ -44,6 +44,7 @@
import org.apache.directory.server.core.interceptor.Interceptor;
import org.apache.directory.server.core.interceptor.NextInterceptor;
import org.apache.directory.server.core.interceptor.context.AddOperationContext;
+import org.apache.directory.server.core.interceptor.context.ListOperationContext;
import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
import org.apache.directory.server.core.interceptor.context.ModifyOperationContext;
import org.apache.directory.server.core.interceptor.context.MoveAndRenameOperationContext;
@@ -153,11 +154,11 @@
/**
* Adds extra operational attributes to the entry before it is added.
*/
- public void add(NextInterceptor nextInterceptor, OperationContext opContext )
+ public void add(NextInterceptor nextInterceptor, AddOperationContext opContext )
throws NamingException
{
String principal = getPrincipal().getName();
- Attributes entry = ((AddOperationContext)opContext).getEntry();
+ Attributes entry = opContext.getEntry();
Attribute attribute = new AttributeImpl( SchemaConstants.CREATORS_NAME_AT );
attribute.add( principal );
@@ -170,17 +171,16 @@
nextInterceptor.add( opContext );
}
- public void modify( NextInterceptor nextInterceptor, OperationContext opContext )
+ public void modify( NextInterceptor nextInterceptor, ModifyOperationContext opContext )
throws NamingException
{
// -------------------------------------------------------------------
// Add the operational attributes for the modifier first
// -------------------------------------------------------------------
- ModifyOperationContext context = ( ModifyOperationContext ) opContext;
List<ModificationItemImpl> modItemList =
- new ArrayList<ModificationItemImpl>( context.getModItems().length + 2 );
- Collections.addAll( modItemList, context.getModItems() );
+ new ArrayList<ModificationItemImpl>( opContext.getModItems().length + 2 );
+ Collections.addAll( modItemList, opContext.getModItems() );
Attribute attribute = new AttributeImpl( SchemaConstants.MODIFIERS_NAME_AT );
attribute.add( getPrincipal().getName() );
@@ -195,16 +195,10 @@
// -------------------------------------------------------------------
nextInterceptor.modify( opContext );
-
- // Don't know why this was here! TODO Remove if no errors result
-// if ( opContext.getDn().getNormName().equals( subschemaSubentryDn.getNormName() ) )
-// {
-// return;
-// }
}
- public void rename( NextInterceptor nextInterceptor, OperationContext opContext )
+ public void rename( NextInterceptor nextInterceptor, RenameOperationContext opContext )
throws NamingException
{
nextInterceptor.rename( opContext );
@@ -221,7 +215,7 @@
LdapDN newDn = ( LdapDN ) opContext.getDn().clone();
newDn.remove( opContext.getDn().size() - 1 );
- newDn.add( ((RenameOperationContext)opContext).getNewRdn() );
+ newDn.add( opContext.getNewRdn() );
newDn.normalize( registry.getNormalizerMapping() );
ModificationItemImpl[] items = ModifyOperationContext.createModItems( attributes, DirContext.REPLACE_ATTRIBUTE );
@@ -232,7 +226,7 @@
}
- public void move( NextInterceptor nextInterceptor, OperationContext opContext ) throws NamingException
+ public void move( NextInterceptor nextInterceptor, MoveOperationContext opContext ) throws NamingException
{
nextInterceptor.move( opContext );
@@ -250,13 +244,13 @@
ModifyOperationContext newModify =
- new ModifyOperationContext( ((MoveOperationContext)opContext).getParent(), items );
+ new ModifyOperationContext( opContext.getParent(), items );
nexus.modify( newModify );
}
- public void moveAndRename( NextInterceptor nextInterceptor, OperationContext opContext )
+ public void moveAndRename( NextInterceptor nextInterceptor, MoveAndRenameOperationContext opContext )
throws NamingException
{
nextInterceptor.moveAndRename( opContext );
@@ -280,7 +274,7 @@
}
- public Attributes lookup( NextInterceptor nextInterceptor, OperationContext opContext ) throws NamingException
+ public Attributes lookup( NextInterceptor nextInterceptor, LookupOperationContext opContext ) throws NamingException
{
Attributes result = nextInterceptor.lookup( opContext );
@@ -289,7 +283,7 @@
return null;
}
- if ( ((LookupOperationContext)opContext).getAttrsId() == null )
+ if ( opContext.getAttrsId() == null )
{
filter( result );
}
@@ -302,7 +296,7 @@
}
- public NamingEnumeration list( NextInterceptor nextInterceptor, OperationContext opContext ) throws NamingException
+ public NamingEnumeration list( NextInterceptor nextInterceptor, ListOperationContext opContext ) throws NamingException
{
NamingEnumeration e = nextInterceptor.list( opContext );
Invocation invocation = InvocationStack.getInstance().peek();
@@ -310,11 +304,11 @@
}
- public NamingEnumeration<SearchResult> search( NextInterceptor nextInterceptor, OperationContext opContext ) throws NamingException
+ public NamingEnumeration<SearchResult> search( NextInterceptor nextInterceptor, SearchOperationContext opContext ) throws NamingException
{
Invocation invocation = InvocationStack.getInstance().peek();
NamingEnumeration e = nextInterceptor.search( opContext );
- SearchControls searchCtls = ((SearchOperationContext)opContext).getSearchControls();
+ SearchControls searchCtls = opContext.getSearchControls();
if ( searchCtls.getReturningAttributes() != null )
{
@@ -361,10 +355,10 @@
}
- private void filter( OperationContext lookupContext, Attributes entry ) throws NamingException
+ private void filter( LookupOperationContext lookupContext, Attributes entry ) throws NamingException
{
- LdapDN dn = ((LookupOperationContext)lookupContext).getDn();
- List<String> ids = ((LookupOperationContext)lookupContext).getAttrsId();
+ LdapDN dn = lookupContext.getDn();
+ List<String> ids = lookupContext.getAttrsId();
// still need to protect against returning op attrs when ids is null
if ( ids == null )
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/AbstractPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/AbstractPartition.java?rev=569124&r1=569123&r2=569124&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/AbstractPartition.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/AbstractPartition.java Thu Aug 23 12:25:57 2007
@@ -27,10 +27,12 @@
import org.apache.directory.server.core.DirectoryServiceConfiguration;
import org.apache.directory.server.core.configuration.PartitionConfiguration;
+import org.apache.directory.server.core.interceptor.context.EntryOperationContext;
import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
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.apache.directory.server.core.interceptor.context.ReplaceOperationContext;
import org.apache.directory.shared.ldap.name.LdapDN;
/**
@@ -183,11 +185,11 @@
/**
- * This method calls {@link Partition#lookup(OperationContext)} and return <tt>true</tt>
+ * This method calls {@link Partition#lookup(EntryOperationContext)} and return <tt>true</tt>
* if it returns an entry by default. Please override this method if
* there is more effective way for your implementation.
*/
- public boolean hasEntry( OperationContext entryContext ) throws NamingException
+ public boolean hasEntry( EntryOperationContext entryContext ) throws NamingException
{
try
{
@@ -201,19 +203,19 @@
/**
- * This method calls {@link Partition#lookup(org.apache.directory.shared.ldap.name.LdapDN,String[])}
+ * This method calls {@link Partition#lookup(LookupOperationContext)}
* with null <tt>attributeIds</tt> by default. Please override
* this method if there is more effective way for your implementation.
*/
- public Attributes lookup( OperationContext lookupContext ) throws NamingException
+ public Attributes lookup( LookupOperationContext lookupContext ) throws NamingException
{
return null;
}
/**
- * This method calls {@link Partition#move(OperationContext)} and
- * {@link Partition#rename(OperationContext)} subsequently
+ * This method calls {@link Partition#move(MoveOperationContext)} and
+ * {@link Partition#rename(RenameOperationContext)} subsequently
* by default. Please override this method if there is more effactive
* way for your implementation.
*/
@@ -221,7 +223,7 @@
{
LdapDN newName = ( LdapDN ) newParentName.clone();
newName.add( newRdn );
- replace( new MoveOperationContext( oldName, newParentName ) );
+ move( new MoveOperationContext( oldName, newParentName ) );
rename( new RenameOperationContext( newName, newRdn, deleteOldRn ) );
}
@@ -230,7 +232,7 @@
* This method throws {@link OperationNotSupportedException} by default.
* Please override this method to implement move operation.
*/
- public void replace( OperationContext replaceContext ) throws NamingException
+ public void replace( ReplaceOperationContext replaceContext ) throws NamingException
{
throw new OperationNotSupportedException( "Moving an entry to other parent entry is not supported." );
}
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java?rev=569124&r1=569123&r2=569124&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java Thu Aug 23 12:25:57 2007
@@ -46,12 +46,25 @@
import org.apache.directory.server.core.DirectoryServiceConfiguration;
import org.apache.directory.server.core.configuration.PartitionConfiguration;
import org.apache.directory.server.core.interceptor.context.AddContextPartitionOperationContext;
+import org.apache.directory.server.core.interceptor.context.AddOperationContext;
+import org.apache.directory.server.core.interceptor.context.BindOperationContext;
import org.apache.directory.server.core.interceptor.context.CompareOperationContext;
+import org.apache.directory.server.core.interceptor.context.DeleteOperationContext;
import org.apache.directory.server.core.interceptor.context.EntryOperationContext;
+import org.apache.directory.server.core.interceptor.context.GetMatchedNameOperationContext;
+import org.apache.directory.server.core.interceptor.context.GetRootDSEOperationContext;
+import org.apache.directory.server.core.interceptor.context.GetSuffixOperationContext;
+import org.apache.directory.server.core.interceptor.context.ListOperationContext;
+import org.apache.directory.server.core.interceptor.context.ListSuffixOperationContext;
import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
+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.RemoveContextPartitionOperationContext;
import org.apache.directory.server.core.interceptor.context.OperationContext;
+import org.apache.directory.server.core.interceptor.context.RenameOperationContext;
import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
+import org.apache.directory.server.core.interceptor.context.UnbindOperationContext;
import org.apache.directory.server.core.partition.impl.btree.MutableBTreePartitionConfiguration;
import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition;
import org.apache.directory.server.core.partition.tree.LeafNode;
@@ -503,22 +516,20 @@
// ContextPartitionNexus Method Implementations
// ------------------------------------------------------------------------
- public boolean compare( OperationContext compareContext ) throws NamingException
+ public boolean compare( CompareOperationContext compareContext ) throws NamingException
{
Partition partition = getPartition( compareContext.getDn() );
AttributeTypeRegistry registry = factoryCfg.getRegistries().getAttributeTypeRegistry();
- CompareOperationContext ctx = (CompareOperationContext)compareContext;
-
// complain if we do not recognize the attribute being compared
- if ( !registry.hasAttributeType( ctx.getOid() ) )
+ if ( !registry.hasAttributeType( compareContext.getOid() ) )
{
- throw new LdapInvalidAttributeIdentifierException( ctx.getOid() + " not found within the attributeType registry" );
+ throw new LdapInvalidAttributeIdentifierException( compareContext.getOid() + " not found within the attributeType registry" );
}
- AttributeType attrType = registry.lookup( ctx.getOid() );
+ AttributeType attrType = registry.lookup( compareContext.getOid() );
- Attribute attr = partition.lookup( new LookupOperationContext( ctx.getDn() ) ).get( attrType.getName() );
+ Attribute attr = partition.lookup( new LookupOperationContext( compareContext.getDn() ) ).get( attrType.getName() );
// complain if the attribute being compared does not exist in the entry
if ( attr == null )
@@ -528,7 +539,7 @@
// see first if simple match without normalization succeeds
// TODO Fix DIRSERVER-832
- if ( attr.contains( ctx.getValue() ) )
+ if ( attr.contains( compareContext.getValue() ) )
{
return true;
}
@@ -541,7 +552,7 @@
* through all values looking for a match.
*/
Normalizer normalizer = attrType.getEquality().getNormalizer();
- Object reqVal = normalizer.normalize( ctx.getValue() );
+ Object reqVal = normalizer.normalize( compareContext.getValue() );
for ( int ii = 0; ii < attr.size(); ii++ )
{
@@ -573,12 +584,10 @@
}
- public synchronized void addContextPartition( OperationContext addContextPartitionContext ) throws NamingException
+ public synchronized void addContextPartition( AddContextPartitionOperationContext opContext ) throws NamingException
{
- AddContextPartitionOperationContext operationContext =
- ( AddContextPartitionOperationContext ) addContextPartitionContext;
- PartitionConfiguration config = operationContext.getPartitionConfiguration();
- Partition partition = operationContext.getPartition();
+ PartitionConfiguration config = opContext.getPartitionConfiguration();
+ Partition partition = opContext.getPartition();
// Turn on default indices
String key = config.getSuffix();
@@ -624,7 +633,7 @@
}
- public synchronized void removeContextPartition( OperationContext removeContextPartition ) throws NamingException
+ public synchronized void removeContextPartition( RemoveContextPartitionOperationContext removeContextPartition ) throws NamingException
{
String key = removeContextPartition.getDn().getNormName();
Partition partition = partitions.get( key );
@@ -674,9 +683,9 @@
/**
- * @see PartitionNexus#getMatchedName( OperationContext )
+ * @see PartitionNexus#getMatchedName( GetMatchedNameOperationContext )
*/
- public LdapDN getMatchedName ( OperationContext getMatchedNameContext ) throws NamingException
+ public LdapDN getMatchedName ( GetMatchedNameOperationContext getMatchedNameContext ) throws NamingException
{
LdapDN dn = ( LdapDN ) getMatchedNameContext.getDn().clone();
@@ -706,9 +715,9 @@
/**
- * @see PartitionNexus#getSuffix( OperationContext )
+ * @see PartitionNexus#getSuffix( GetSuffixOperationContext )
*/
- public LdapDN getSuffix ( OperationContext getSuffixContext ) throws NamingException
+ public LdapDN getSuffix ( GetSuffixOperationContext getSuffixContext ) throws NamingException
{
Partition backend = getPartition( getSuffixContext.getDn() );
return backend.getSuffix();
@@ -716,15 +725,15 @@
/**
- * @see PartitionNexus#listSuffixes( OperationContext )
+ * @see PartitionNexus#listSuffixes( ListSuffixOperationContext )
*/
- public Iterator listSuffixes ( OperationContext emptyContext ) throws NamingException
+ public Iterator listSuffixes ( ListSuffixOperationContext emptyContext ) throws NamingException
{
return Collections.unmodifiableSet( partitions.keySet() ).iterator();
}
- public Attributes getRootDSE( OperationContext getRootDSEContext )
+ public Attributes getRootDSE( GetRootDSEOperationContext getRootDSEContext )
{
return rootDSE;
}
@@ -753,13 +762,13 @@
// ------------------------------------------------------------------------
// DirectoryPartition Interface Method Implementations
// ------------------------------------------------------------------------
- public void bind( OperationContext bindContext ) throws NamingException
+ public void bind( BindOperationContext bindContext ) throws NamingException
{
Partition partition = getPartition( bindContext.getDn() );
partition.bind( bindContext );
}
- public void unbind( OperationContext unbindContext ) throws NamingException
+ public void unbind( UnbindOperationContext unbindContext ) throws NamingException
{
Partition partition = getPartition( unbindContext.getDn() );
partition.unbind( unbindContext );
@@ -767,9 +776,9 @@
/**
- * @see Partition#delete(org.apache.directory.shared.ldap.name.LdapDN)
+ * @see Partition#delete(DeleteOperationContext)
*/
- public void delete( OperationContext deleteContext ) throws NamingException
+ public void delete( DeleteOperationContext deleteContext ) throws NamingException
{
Partition backend = getPartition( deleteContext.getDn() );
backend.delete( deleteContext );
@@ -783,9 +792,9 @@
* here so backend implementors do not have to worry about performing these
* kinds of checks.
*
- * @see Partition#add( OperationContext )
+ * @see Partition#add( AddOperationContext )
*/
- public void add( OperationContext addContext ) throws NamingException
+ public void add( AddOperationContext addContext ) throws NamingException
{
Partition backend = getPartition( addContext.getDn() );
backend.add( addContext );
@@ -793,9 +802,9 @@
/**
- * @see Partition#modify(org.apache.directory.shared.ldap.name.LdapDN,int,javax.naming.directory.Attributes)
+ * @see Partition#modifyModifyOperationContext)
*/
- public void modify( OperationContext modifyContext ) throws NamingException
+ public void modify( ModifyOperationContext modifyContext ) throws NamingException
{
Partition backend = getPartition( modifyContext.getDn() );
backend.modify( modifyContext );
@@ -803,9 +812,9 @@
/**
- * @see Partition#list(org.apache.directory.shared.ldap.name.LdapDN)
+ * @see Partition#list(ListOperationContext)
*/
- public NamingEnumeration list( OperationContext opContext ) throws NamingException
+ public NamingEnumeration list( ListOperationContext opContext ) throws NamingException
{
Partition backend = getPartition( opContext.getDn() );
return backend.list( opContext );
@@ -815,12 +824,12 @@
/**
* @see Partition#search(org.apache.directory.shared.ldap.name.LdapDN,java.util.Map,org.apache.directory.shared.ldap.filter.ExprNode,javax.naming.directory.SearchControls)
*/
- public NamingEnumeration<SearchResult> search( OperationContext opContext )
+ public NamingEnumeration<SearchResult> search( SearchOperationContext opContext )
throws NamingException
{
LdapDN base = opContext.getDn();
- SearchControls searchCtls = ((SearchOperationContext)opContext).getSearchControls();
- ExprNode filter = ((SearchOperationContext)opContext).getFilter();
+ SearchControls searchCtls = opContext.getSearchControls();
+ ExprNode filter = opContext.getFilter();
if ( base.size() == 0 )
{
@@ -964,23 +973,22 @@
/**
* @see Partition#lookup(org.apache.directory.shared.ldap.name.LdapDN,String[])
*/
- public Attributes lookup( OperationContext opContext ) throws NamingException
+ public Attributes lookup( LookupOperationContext opContext ) throws NamingException
{
- LookupOperationContext ctx = (LookupOperationContext)opContext;
- LdapDN dn = ctx.getDn();
+ LdapDN dn = opContext.getDn();
if ( dn.size() == 0 )
{
Attributes retval = new AttributesImpl();
NamingEnumeration list = rootDSE.getIDs();
- if ( ctx.getAttrsId() != null )
+ if ( opContext.getAttrsId() != null )
{
while ( list.hasMore() )
{
String id = ( String ) list.next();
- if ( ctx.getAttrsId().contains( id ) )
+ if ( opContext.getAttrsId().contains( id ) )
{
Attribute attr = rootDSE.get( id );
retval.put( ( Attribute ) attr.clone() );
@@ -1002,14 +1010,14 @@
}
Partition backend = getPartition( dn );
- return backend.lookup( ctx );
+ return backend.lookup( opContext );
}
/**
- * @see Partition#hasEntry(OperationContext)
+ * @see Partition#hasEntry(EntryOperationContext)
*/
- public boolean hasEntry( OperationContext opContext ) throws NamingException
+ public boolean hasEntry( EntryOperationContext opContext ) throws NamingException
{
LdapDN dn = opContext.getDn();
@@ -1029,9 +1037,9 @@
/**
- * @see Partition#rename(OperationContext)
+ * @see Partition#rename(RenameOperationContext)
*/
- public void rename( OperationContext opContext ) throws NamingException
+ public void rename( RenameOperationContext opContext ) throws NamingException
{
Partition backend = getPartition( opContext.getDn() );
backend.rename( opContext );
@@ -1039,9 +1047,9 @@
/**
- * @see Partition#move(OperationContext)
+ * @see Partition#move(MoveOperationContext)
*/
- public void move( OperationContext opContext ) throws NamingException
+ public void move( MoveOperationContext opContext ) throws NamingException
{
Partition backend = getPartition( opContext.getDn() );
backend.move( opContext );
@@ -1049,9 +1057,9 @@
/**
- * @see Partition#moveAndRename( OperationContext )
+ * @see Partition#moveAndRename( MaveAndRenameOperationContext )
*/
- public void moveAndRename( OperationContext opContext ) throws NamingException
+ public void moveAndRename( MoveAndRenameOperationContext opContext ) throws NamingException
{
Partition backend = getPartition( opContext.getDn() );
backend.moveAndRename( opContext );
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/Partition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/Partition.java?rev=569124&r1=569123&r2=569124&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/Partition.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/Partition.java Thu Aug 23 12:25:57 2007
@@ -28,7 +28,19 @@
import org.apache.directory.server.core.DirectoryServiceConfiguration;
import org.apache.directory.server.core.configuration.PartitionConfiguration;
+import org.apache.directory.server.core.interceptor.context.AddOperationContext;
+import org.apache.directory.server.core.interceptor.context.BindOperationContext;
+import org.apache.directory.server.core.interceptor.context.DeleteOperationContext;
+import org.apache.directory.server.core.interceptor.context.EntryOperationContext;
+import org.apache.directory.server.core.interceptor.context.ListOperationContext;
+import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
+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.apache.directory.server.core.interceptor.context.SearchOperationContext;
+import org.apache.directory.server.core.interceptor.context.UnbindOperationContext;
import org.apache.directory.shared.ldap.name.LdapDN;
@@ -111,7 +123,7 @@
* delete from this ContextPartition.
* @throws NamingException if there are any problems
*/
- void delete( OperationContext opContext ) throws NamingException;
+ void delete( DeleteOperationContext opContext ) throws NamingException;
/**
@@ -120,7 +132,7 @@
* @param opContext the context used to add and entry to this ContextPartition
* @throws NamingException if there are any problems
*/
- void add( OperationContext opContext ) throws NamingException;
+ void add( AddOperationContext opContext ) throws NamingException;
/**
@@ -137,7 +149,7 @@
* @see javax.naming.directory.DirContext#REMOVE_ATTRIBUTE
* @see javax.naming.directory.DirContext#REPLACE_ATTRIBUTE
*/
- void modify( OperationContext opContext ) throws NamingException;
+ void modify( ModifyOperationContext opContext ) throws NamingException;
/**
@@ -150,7 +162,7 @@
* @return a NamingEnumeration containing objects of type {@link SearchResult}
* @throws NamingException if there are any problems
*/
- NamingEnumeration list( OperationContext opContext ) throws NamingException;
+ NamingEnumeration list( ListOperationContext opContext ) throws NamingException;
/**
@@ -167,7 +179,7 @@
* <a href="http://java.sun.com/j2se/1.4.2/docs/api/
* javax/naming/directory/SearchResult.html">SearchResult</a>.
*/
- NamingEnumeration<SearchResult> search( OperationContext opContext )
+ NamingEnumeration<SearchResult> search( SearchOperationContext opContext )
throws NamingException;
@@ -183,7 +195,7 @@
* @return an Attributes object representing the entry
* @throws NamingException if there are any problems
*/
- Attributes lookup( OperationContext lookupContext ) throws NamingException;
+ Attributes lookup( LookupOperationContext lookupContext ) throws NamingException;
/**
* Fast operation to check and see if a particular entry exists.
@@ -192,7 +204,7 @@
* @return true if the entry exists, false if it does not
* @throws NamingException if there are any problems
*/
- boolean hasEntry( OperationContext opContext ) throws NamingException;
+ boolean hasEntry( EntryOperationContext opContext ) throws NamingException;
/**
* Modifies an entry by changing its relative name. Optionally attributes
@@ -203,7 +215,7 @@
* @param opContext the modify DN context
* @throws NamingException if there are any problems
*/
- void rename( OperationContext opContext ) throws NamingException;
+ void rename( RenameOperationContext opContext ) throws NamingException;
/**
@@ -213,7 +225,7 @@
* @param opContext The context containing the DNs to move
* @throws NamingException if there are any problems
*/
- void move( OperationContext opContext ) throws NamingException;
+ void move( MoveOperationContext opContext ) throws NamingException;
/**
@@ -228,7 +240,7 @@
* the modifyDN operation
* @throws NamingException if there are any problems
*/
- void moveAndRename( OperationContext opContext ) throws NamingException;
+ void moveAndRename( MoveAndRenameOperationContext opContext ) throws NamingException;
/**
@@ -239,7 +251,7 @@
* @param opContext the bind context, containing all the needed informations to bind
* @throws NamingException if something goes wrong
*/
- void bind( OperationContext opContext ) throws NamingException;
+ void bind( BindOperationContext opContext ) throws NamingException;
/**
* Represents an unbind operation issued by an authenticated client. Partitions
@@ -249,5 +261,5 @@
* @param opContext the context used to unbind
* @throws NamingException if something goes wrong
*/
- void unbind( OperationContext opContext ) throws NamingException;
+ void unbind( UnbindOperationContext opContext ) throws NamingException;
}
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexus.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexus.java?rev=569124&r1=569123&r2=569124&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexus.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexus.java Thu Aug 23 12:25:57 2007
@@ -30,7 +30,14 @@
import javax.naming.directory.Attributes;
import javax.naming.ldap.LdapContext;
+import org.apache.directory.server.core.interceptor.context.AddContextPartitionOperationContext;
+import org.apache.directory.server.core.interceptor.context.CompareOperationContext;
+import org.apache.directory.server.core.interceptor.context.GetMatchedNameOperationContext;
+import org.apache.directory.server.core.interceptor.context.GetRootDSEOperationContext;
+import org.apache.directory.server.core.interceptor.context.GetSuffixOperationContext;
+import org.apache.directory.server.core.interceptor.context.ListSuffixOperationContext;
import org.apache.directory.server.core.interceptor.context.OperationContext;
+import org.apache.directory.server.core.interceptor.context.RemoveContextPartitionOperationContext;
import org.apache.directory.shared.ldap.constants.SchemaConstants;
import org.apache.directory.shared.ldap.name.LdapDN;
import org.apache.directory.shared.ldap.schema.NoOpNormalizer;
@@ -181,7 +188,7 @@
*
* @return the attributes of the RootDSE
*/
- public abstract Attributes getRootDSE( OperationContext opContext ) throws NamingException;
+ public abstract Attributes getRootDSE( GetRootDSEOperationContext opContext ) throws NamingException;
/**
@@ -192,13 +199,13 @@
* @return true if the entry contains an attribute with the value, false otherwise
* @throws NamingException if there is a problem accessing the entry and its values
*/
- public abstract boolean compare( OperationContext opContext ) throws NamingException;
+ public abstract boolean compare( CompareOperationContext opContext ) throws NamingException;
- public abstract void addContextPartition( OperationContext opContext ) throws NamingException;
+ public abstract void addContextPartition( AddContextPartitionOperationContext opContext ) throws NamingException;
- public abstract void removeContextPartition( OperationContext opContext ) throws NamingException;
+ public abstract void removeContextPartition( RemoveContextPartitionOperationContext opContext ) throws NamingException;
public abstract Partition getSystemPartition();
@@ -227,7 +234,7 @@
* the empty string distinguished name if no match was found.
* @throws NamingException if there are any problems
*/
- public abstract LdapDN getMatchedName ( OperationContext opContext ) throws NamingException;
+ public abstract LdapDN getMatchedName ( GetMatchedNameOperationContext opContext ) throws NamingException;
/**
@@ -241,7 +248,7 @@
* naming context was found for dn.
* @throws NamingException if there are any problems
*/
- public abstract LdapDN getSuffix ( OperationContext opContext ) throws NamingException;
+ public abstract LdapDN getSuffix ( GetSuffixOperationContext opContext ) throws NamingException;
/**
@@ -251,7 +258,7 @@
* @return Iteration over ContextPartition suffix names as Names.
* @throws NamingException if there are any problems
*/
- public abstract Iterator listSuffixes( OperationContext opContext ) throws NamingException;
+ public abstract Iterator listSuffixes( ListSuffixOperationContext opContext ) throws NamingException;
/**
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexusProxy.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexusProxy.java?rev=569124&r1=569123&r2=569124&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexusProxy.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexusProxy.java Thu Aug 23 12:25:57 2007
@@ -47,9 +47,26 @@
import org.apache.directory.server.core.enumeration.SearchResultFilteringEnumeration;
import org.apache.directory.server.core.event.EventService;
import org.apache.directory.server.core.interceptor.InterceptorChain;
+import org.apache.directory.server.core.interceptor.context.AddContextPartitionOperationContext;
+import org.apache.directory.server.core.interceptor.context.AddOperationContext;
+import org.apache.directory.server.core.interceptor.context.BindOperationContext;
+import org.apache.directory.server.core.interceptor.context.CompareOperationContext;
+import org.apache.directory.server.core.interceptor.context.DeleteOperationContext;
+import org.apache.directory.server.core.interceptor.context.EntryOperationContext;
+import org.apache.directory.server.core.interceptor.context.GetMatchedNameOperationContext;
+import org.apache.directory.server.core.interceptor.context.GetRootDSEOperationContext;
+import org.apache.directory.server.core.interceptor.context.GetSuffixOperationContext;
+import org.apache.directory.server.core.interceptor.context.ListOperationContext;
+import org.apache.directory.server.core.interceptor.context.ListSuffixOperationContext;
import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
+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.RemoveContextPartitionOperationContext;
+import org.apache.directory.server.core.interceptor.context.RenameOperationContext;
import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
+import org.apache.directory.server.core.interceptor.context.UnbindOperationContext;
import org.apache.directory.server.core.invocation.Invocation;
import org.apache.directory.server.core.invocation.InvocationStack;
import org.apache.directory.shared.ldap.exception.LdapSizeLimitExceededException;
@@ -224,13 +241,13 @@
}
- public LdapDN getMatchedName ( OperationContext opContext ) throws NamingException
+ public LdapDN getMatchedName ( GetMatchedNameOperationContext opContext ) throws NamingException
{
return getMatchedName( opContext, null );
}
- public LdapDN getMatchedName( OperationContext opContext, Collection bypass ) throws NamingException
+ public LdapDN getMatchedName( GetMatchedNameOperationContext opContext, Collection bypass ) throws NamingException
{
ensureStarted();
InvocationStack stack = InvocationStack.getInstance();
@@ -248,13 +265,13 @@
}
- public LdapDN getSuffix ( OperationContext opContext ) throws NamingException
+ public LdapDN getSuffix ( GetSuffixOperationContext opContext ) throws NamingException
{
return getSuffix( opContext, null );
}
- public LdapDN getSuffix( OperationContext opContext, Collection bypass ) throws NamingException
+ public LdapDN getSuffix( GetSuffixOperationContext opContext, Collection bypass ) throws NamingException
{
ensureStarted();
InvocationStack stack = InvocationStack.getInstance();
@@ -271,13 +288,13 @@
}
- public Iterator listSuffixes( OperationContext opContext ) throws NamingException
+ public Iterator listSuffixes( ListSuffixOperationContext opContext ) throws NamingException
{
return listSuffixes( opContext );
}
- public Iterator listSuffixes( OperationContext opContext, Collection bypass ) throws NamingException
+ public Iterator listSuffixes( ListSuffixOperationContext opContext, Collection bypass ) throws NamingException
{
ensureStarted();
InvocationStack stack = InvocationStack.getInstance();
@@ -294,13 +311,13 @@
}
- public boolean compare( OperationContext opContext ) throws NamingException
+ public boolean compare( CompareOperationContext opContext ) throws NamingException
{
return compare( opContext, null );
}
- public boolean compare( OperationContext opContext, Collection bypass ) throws NamingException
+ public boolean compare( CompareOperationContext opContext, Collection bypass ) throws NamingException
{
ensureStarted();
InvocationStack stack = InvocationStack.getInstance();
@@ -317,13 +334,13 @@
}
- public void delete( OperationContext opContext ) throws NamingException
+ public void delete( DeleteOperationContext opContext ) throws NamingException
{
delete( opContext, null );
}
- public void delete( OperationContext opContext, Collection bypass ) throws NamingException
+ public void delete( DeleteOperationContext opContext, Collection bypass ) throws NamingException
{
ensureStarted();
InvocationStack stack = InvocationStack.getInstance();
@@ -340,13 +357,13 @@
}
- public void add( OperationContext opContext ) throws NamingException
+ public void add( AddOperationContext opContext ) throws NamingException
{
add( opContext, null );
}
- public void add( OperationContext opContext, Collection bypass ) throws NamingException
+ public void add( AddOperationContext opContext, Collection bypass ) throws NamingException
{
ensureStarted();
InvocationStack stack = InvocationStack.getInstance();
@@ -363,13 +380,13 @@
}
- public void modify( OperationContext opContext ) throws NamingException
+ public void modify( ModifyOperationContext opContext ) throws NamingException
{
modify( opContext, null );
}
- public void modify( OperationContext opContext, Collection bypass ) throws NamingException
+ public void modify( ModifyOperationContext opContext, Collection bypass ) throws NamingException
{
ensureStarted();
InvocationStack stack = InvocationStack.getInstance();
@@ -387,13 +404,13 @@
}
- public NamingEnumeration list( OperationContext opContext ) throws NamingException
+ public NamingEnumeration list( ListOperationContext opContext ) throws NamingException
{
return list( opContext, null );
}
- public NamingEnumeration list( OperationContext opContext, Collection bypass ) throws NamingException
+ public NamingEnumeration list( ListOperationContext opContext, Collection bypass ) throws NamingException
{
ensureStarted();
InvocationStack stack = InvocationStack.getInstance();
@@ -410,7 +427,7 @@
}
- public NamingEnumeration<SearchResult> search( OperationContext opContext )
+ public NamingEnumeration<SearchResult> search( SearchOperationContext opContext )
throws NamingException
{
NamingEnumeration<SearchResult> ne = search( opContext, null );
@@ -418,7 +435,7 @@
if ( ne instanceof SearchResultFilteringEnumeration )
{
SearchResultFilteringEnumeration results = ( SearchResultFilteringEnumeration ) ne;
- SearchControls searchCtls = ((SearchOperationContext)opContext).getSearchControls();
+ SearchControls searchCtls = opContext.getSearchControls();
if ( searchCtls.getTimeLimit() + searchCtls.getCountLimit() > 0 )
{
@@ -462,7 +479,7 @@
}
- public NamingEnumeration<SearchResult> search( OperationContext opContext, Collection bypass )
+ public NamingEnumeration<SearchResult> search( SearchOperationContext opContext, Collection bypass )
throws NamingException
{
ensureStarted();
@@ -480,11 +497,11 @@
}
- public Attributes lookup( OperationContext opContext ) throws NamingException
+ public Attributes lookup( LookupOperationContext opContext ) throws NamingException
{
if ( opContext.getDn().size() == 0 )
{
- List<String> attrs = ( (LookupOperationContext)opContext).getAttrsId();
+ List<String> attrs = opContext.getAttrsId();
if ( ( attrs == null ) || ( attrs.size() == 0 ) )
{
@@ -517,7 +534,7 @@
}
- public Attributes lookup( OperationContext opContext, Collection bypass ) throws NamingException
+ public Attributes lookup( LookupOperationContext opContext, Collection bypass ) throws NamingException
{
ensureStarted();
InvocationStack stack = InvocationStack.getInstance();
@@ -533,13 +550,13 @@
}
}
- public boolean hasEntry( OperationContext opContext ) throws NamingException
+ public boolean hasEntry( EntryOperationContext opContext ) throws NamingException
{
return hasEntry( opContext, null );
}
- public boolean hasEntry( OperationContext opContext, Collection bypass ) throws NamingException
+ public boolean hasEntry( EntryOperationContext opContext, Collection bypass ) throws NamingException
{
ensureStarted();
InvocationStack stack = InvocationStack.getInstance();
@@ -556,13 +573,13 @@
}
- public void rename( OperationContext opContext ) throws NamingException
+ public void rename( RenameOperationContext opContext ) throws NamingException
{
rename( opContext, null );
}
- public void rename( OperationContext opContext, Collection bypass ) throws NamingException
+ public void rename( RenameOperationContext opContext, Collection bypass ) throws NamingException
{
ensureStarted();
InvocationStack stack = InvocationStack.getInstance();
@@ -580,13 +597,13 @@
}
- public void move( OperationContext opContext ) throws NamingException
+ public void move( MoveOperationContext opContext ) throws NamingException
{
move( opContext, null );
}
- public void move( OperationContext opContext, Collection bypass ) throws NamingException
+ public void move( MoveOperationContext opContext, Collection bypass ) throws NamingException
{
ensureStarted();
InvocationStack stack = InvocationStack.getInstance();
@@ -603,13 +620,13 @@
}
- public void moveAndRename( OperationContext opContext ) throws NamingException
+ public void moveAndRename( MoveAndRenameOperationContext opContext ) throws NamingException
{
moveAndRename( opContext, null );
}
- public void moveAndRename( OperationContext opContext, Collection bypass )
+ public void moveAndRename( MoveAndRenameOperationContext opContext, Collection bypass )
throws NamingException
{
ensureStarted();
@@ -634,7 +651,7 @@
* @param bypass
* @throws NamingException
*/
- public void bind( OperationContext opContext, Collection bypass )
+ public void bind( BindOperationContext opContext, Collection bypass )
throws NamingException
{
ensureStarted();
@@ -654,7 +671,7 @@
}
}
- public void unbind( OperationContext opContext, Collection bypass ) throws NamingException
+ public void unbind( UnbindOperationContext opContext, Collection bypass ) throws NamingException
{
ensureStarted();
InvocationStack stack = InvocationStack.getInstance();
@@ -672,19 +689,19 @@
}
- public void bind( OperationContext opContext ) throws NamingException
+ public void bind( BindOperationContext opContext ) throws NamingException
{
bind( opContext, null );
}
- public void unbind( OperationContext opContext ) throws NamingException
+ public void unbind( UnbindOperationContext opContext ) throws NamingException
{
unbind( opContext, null );
}
- public Attributes getRootDSE( OperationContext opContext ) throws NamingException
+ public Attributes getRootDSE( GetRootDSEOperationContext opContext ) throws NamingException
{
if ( opContext.getDn().size() == 0 )
{
@@ -703,7 +720,7 @@
}
- public Attributes getRootDSE( OperationContext opContext, Collection bypass ) throws NamingException
+ public Attributes getRootDSE( GetRootDSEOperationContext opContext, Collection bypass ) throws NamingException
{
ensureStarted();
InvocationStack stack = InvocationStack.getInstance();
@@ -719,13 +736,13 @@
}
- public void addContextPartition( OperationContext opContext ) throws NamingException
+ public void addContextPartition( AddContextPartitionOperationContext opContext ) throws NamingException
{
addContextPartition( opContext, null );
}
- public void addContextPartition( OperationContext opContext, Collection bypass ) throws NamingException
+ public void addContextPartition( AddContextPartitionOperationContext opContext, Collection bypass ) throws NamingException
{
ensureStarted();
InvocationStack stack = InvocationStack.getInstance();
@@ -742,13 +759,13 @@
}
- public void removeContextPartition( OperationContext opContext ) throws NamingException
+ public void removeContextPartition( RemoveContextPartitionOperationContext opContext ) throws NamingException
{
removeContextPartition( opContext, null );
}
- public void removeContextPartition( OperationContext opContext, Collection bypass ) throws NamingException
+ public void removeContextPartition( RemoveContextPartitionOperationContext opContext, Collection bypass ) throws NamingException
{
ensureStarted();
InvocationStack stack = InvocationStack.getInstance();
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java?rev=569124&r1=569123&r2=569124&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java Thu Aug 23 12:25:57 2007
@@ -35,8 +35,15 @@
import org.apache.directory.server.core.configuration.PartitionConfiguration;
import org.apache.directory.server.core.enumeration.SearchResultEnumeration;
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.EntryOperationContext;
+import org.apache.directory.server.core.interceptor.context.ListOperationContext;
import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
+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.apache.directory.server.core.interceptor.context.SearchOperationContext;
import org.apache.directory.server.core.partition.Oid;
import org.apache.directory.server.core.partition.Partition;
@@ -403,7 +410,7 @@
// ContextPartition Interface Method Implementations
// ------------------------------------------------------------------------
- public void delete( OperationContext opContext ) throws NamingException
+ public void delete( DeleteOperationContext opContext ) throws NamingException
{
LdapDN dn = opContext.getDn();
@@ -427,15 +434,15 @@
}
- public abstract void add( OperationContext opContext ) throws NamingException;
+ public abstract void add( AddOperationContext opContext ) throws NamingException;
- public abstract void modify( OperationContext opContext ) throws NamingException;
+ public abstract void modify( ModifyOperationContext opContext ) throws NamingException;
private static final String[] ENTRY_DELETED_ATTRS = new String[] { "entrydeleted" };
- public NamingEnumeration list( OperationContext opContext ) throws NamingException
+ public NamingEnumeration list( ListOperationContext opContext ) throws NamingException
{
SearchResultEnumeration list;
list = new BTreeSearchResultEnumeration( ENTRY_DELETED_ATTRS, list( getEntryId( opContext.getDn().getNormName() ) ),
@@ -444,37 +451,35 @@
}
- public NamingEnumeration<SearchResult> search( OperationContext opContext )
+ public NamingEnumeration<SearchResult> search( SearchOperationContext opContext )
throws NamingException
{
- SearchControls searchCtls = ((SearchOperationContext)opContext).getSearchControls();
+ SearchControls searchCtls = opContext.getSearchControls();
String[] attrIds = searchCtls.getReturningAttributes();
NamingEnumeration underlying = null;
underlying = searchEngine.search(
opContext.getDn(),
- ((SearchOperationContext)opContext).getEnv(),
- ((SearchOperationContext)opContext).getFilter(),
+ opContext.getEnv(),
+ opContext.getFilter(),
searchCtls );
return new BTreeSearchResultEnumeration( attrIds, underlying, this, attributeTypeRegistry );
}
- public Attributes lookup( OperationContext opContext ) throws NamingException
+ public Attributes lookup( LookupOperationContext opContext ) throws NamingException
{
- LookupOperationContext ctx = (LookupOperationContext)opContext;
-
- Attributes entry = lookup( getEntryId( ctx.getDn().getNormName() ) );
+ Attributes entry = lookup( getEntryId( opContext.getDn().getNormName() ) );
- if ( ( ctx.getAttrsId() == null ) || ( ctx.getAttrsId().size() == 0 ) )
+ if ( ( opContext.getAttrsId() == null ) || ( opContext.getAttrsId().size() == 0 ) )
{
return entry;
}
Attributes retval = new AttributesImpl();
- for ( String attrId:ctx.getAttrsId() )
+ for ( String attrId:opContext.getAttrsId() )
{
Attribute attr = entry.get( attrId );
@@ -488,19 +493,19 @@
}
- public boolean hasEntry( OperationContext opContext ) throws NamingException
+ public boolean hasEntry( EntryOperationContext opContext ) throws NamingException
{
return null != getEntryId( opContext.getDn().getNormName() );
}
- public abstract void rename( OperationContext opContext ) throws NamingException;
+ public abstract void rename( RenameOperationContext opContext ) throws NamingException;
- public abstract void move( OperationContext opContext ) throws NamingException;
+ public abstract void move( MoveOperationContext opContext ) throws NamingException;
- public abstract void moveAndRename( OperationContext opContext )
+ public abstract void moveAndRename( MoveAndRenameOperationContext opContext )
throws NamingException;
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java?rev=569124&r1=569123&r2=569124&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java Thu Aug 23 12:25:57 2007
@@ -31,11 +31,13 @@
import org.apache.directory.server.core.DirectoryServiceConfiguration;
import org.apache.directory.server.core.configuration.PartitionConfiguration;
import org.apache.directory.server.core.interceptor.context.AddOperationContext;
+import org.apache.directory.server.core.interceptor.context.BindOperationContext;
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.apache.directory.server.core.interceptor.context.UnbindOperationContext;
import org.apache.directory.server.core.partition.Partition;
import org.apache.directory.server.core.partition.impl.btree.BTreePartition;
import org.apache.directory.server.core.partition.impl.btree.BTreePartitionConfiguration;
@@ -310,9 +312,9 @@
}
- public final void add( OperationContext addContext ) throws NamingException
+ public final void add( AddOperationContext addContext ) throws NamingException
{
- store.add( addContext.getDn(), ((AddOperationContext)addContext).getEntry() );
+ store.add( addContext.getDn(), addContext.getEntry() );
}
@@ -375,30 +377,27 @@
}
- public final void modify( OperationContext modifyContext ) throws NamingException
+ public final void modify( ModifyOperationContext modifyContext ) throws NamingException
{
- ModifyOperationContext ctx = (ModifyOperationContext)modifyContext;
- store.modify( ctx.getDn(), ctx.getModItems() );
+ store.modify( modifyContext.getDn(), modifyContext.getModItems() );
}
- public final void rename( OperationContext renameContext ) throws NamingException
+ public final void rename( RenameOperationContext renameContext ) throws NamingException
{
- RenameOperationContext ctx = (RenameOperationContext)renameContext;
- store.rename( ctx.getDn(), ctx.getNewRdn(), ctx.getDelOldDn() );
+ store.rename( renameContext.getDn(), renameContext.getNewRdn(), renameContext.getDelOldDn() );
}
- public final void moveAndRename( OperationContext moveAndRenameContext ) throws NamingException
+ public final void moveAndRename( MoveAndRenameOperationContext moveAndRenameContext ) throws NamingException
{
- MoveAndRenameOperationContext ctx = (MoveAndRenameOperationContext)moveAndRenameContext;
- store.move( ctx.getDn(), ctx.getParent(), ctx.getNewRdn(), ctx.getDelOldDn() );
+ store.move( moveAndRenameContext.getDn(), moveAndRenameContext.getParent(),
+ moveAndRenameContext.getNewRdn(), moveAndRenameContext.getDelOldDn() );
}
- public final void move( OperationContext moveContext ) throws NamingException
+ public final void move( MoveOperationContext moveContext ) throws NamingException
{
- MoveOperationContext ctx = (MoveOperationContext)moveContext;
- store.move( ctx.getDn(), ctx.getParent() );
+ store.move( moveContext.getDn(), moveContext.getParent() );
}
@@ -411,7 +410,7 @@
ResultCodeEnum.AUTH_METHOD_NOT_SUPPORTED );
}
- public final void bind( OperationContext bindContext ) throws NamingException
+ public final void bind( BindOperationContext bindContext ) throws NamingException
{
// does nothing
throw new LdapAuthenticationNotSupportedException(
@@ -421,7 +420,7 @@
}
- public final void unbind( OperationContext unbindContext ) throws NamingException
+ public final void unbind( UnbindOperationContext unbindContext ) throws NamingException
{
}
}