You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2011/11/10 00:53:54 UTC
svn commit: r1200046 - in /directory/apacheds/trunk:
core-api/src/main/java/org/apache/directory/server/core/api/interceptor/
core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/
core-api/src/test/java/org/apache/directory/s...
Author: elecharny
Date: Wed Nov 9 23:53:53 2011
New Revision: 1200046
URL: http://svn.apache.org/viewvc?rev=1200046&view=rev
Log:
Moved the List operation out of the InterceptorChain
Modified:
directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/BaseInterceptor.java
directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/Interceptor.java
directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/InterceptorChain.java
directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/NextInterceptor.java
directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/ListOperationContext.java
directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/api/MockInterceptor.java
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultOperationManager.java
directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java
directory/apacheds/trunk/interceptors/authz/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
directory/apacheds/trunk/interceptors/authz/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java
directory/apacheds/trunk/interceptors/collective/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java
directory/apacheds/trunk/interceptors/exception/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java
directory/apacheds/trunk/interceptors/logger/src/main/java/org/apache/directory/server/core/logger/TimerInterceptor.java
directory/apacheds/trunk/interceptors/normalization/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java
directory/apacheds/trunk/interceptors/operational/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java
directory/apacheds/trunk/interceptors/schema/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
directory/apacheds/trunk/interceptors/subtree/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/BaseInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/BaseInterceptor.java?rev=1200046&r1=1200045&r2=1200046&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/BaseInterceptor.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/BaseInterceptor.java Wed Nov 9 23:53:53 2011
@@ -199,7 +199,7 @@ public abstract class BaseInterceptor im
/**
* {@inheritDoc}
*/
- public EntryFilteringCursor list( NextInterceptor next, ListOperationContext listContext ) throws LdapException
+ public EntryFilteringCursor list( ListOperationContext listContext ) throws LdapException
{
return nexus.list( listContext );
}
@@ -208,11 +208,10 @@ public abstract class BaseInterceptor im
/**
* {@inheritDoc}
*/
- public Entry lookup( NextInterceptor next, LookupOperationContext lookupContext )
- throws LdapException
- {
+ public Entry lookup( NextInterceptor next, LookupOperationContext lookupContext ) throws LdapException
+ {
return nexus.lookup( lookupContext );
- }
+ }
/**
@@ -236,11 +235,10 @@ public abstract class BaseInterceptor im
/**
* {@inheritDoc}
*/
- public void moveAndRename( NextInterceptor next, MoveAndRenameOperationContext moveAndRenameContext )
- throws LdapException
- {
+ public void moveAndRename( NextInterceptor next, MoveAndRenameOperationContext moveAndRenameContext ) throws LdapException
+ {
nexus.moveAndRename( moveAndRenameContext );
- }
+ }
/**
@@ -255,11 +253,10 @@ public abstract class BaseInterceptor im
/**
* {@inheritDoc}
*/
- public EntryFilteringCursor search( NextInterceptor next, SearchOperationContext searchContext )
- throws LdapException
- {
+ public EntryFilteringCursor search( NextInterceptor next, SearchOperationContext searchContext ) throws LdapException
+ {
return nexus.search( searchContext );
- }
+ }
/**
@@ -505,9 +502,27 @@ public abstract class BaseInterceptor im
}
- public EntryFilteringCursor list( NextInterceptor next, ListOperationContext listContext ) throws LdapException
+ /**
+ * {@inheritDoc}
+ */
+ public EntryFilteringCursor list( ListOperationContext listContext ) throws LdapException
{
- return next.list( listContext );
+ return null;
+ }
+
+
+ /**
+ * Calls the next interceptor for the list operation.
+ *
+ * @param listContext The context in which we are executing this operation
+ * @return the cursor containing the listed entries
+ * @throws LdapException If something went wrong
+ */
+ protected final EntryFilteringCursor next( ListOperationContext listContext ) throws LdapException
+ {
+ Interceptor interceptor = getNextInterceptor( listContext );
+
+ return interceptor.list( listContext );
}
@@ -532,11 +547,10 @@ public abstract class BaseInterceptor im
}
- public void moveAndRename( NextInterceptor next, MoveAndRenameOperationContext moveAndRenameContext )
- throws LdapException
- {
+ public void moveAndRename( NextInterceptor next, MoveAndRenameOperationContext moveAndRenameContext ) throws LdapException
+ {
next.moveAndRename( moveAndRenameContext );
- }
+ }
public void rename( NextInterceptor next, RenameOperationContext renameContext ) throws LdapException
@@ -545,11 +559,10 @@ public abstract class BaseInterceptor im
}
- public EntryFilteringCursor search( NextInterceptor next, SearchOperationContext searchContext )
- throws LdapException
- {
+ public EntryFilteringCursor search( NextInterceptor next, SearchOperationContext searchContext ) throws LdapException
+ {
return next.search( searchContext );
- }
+ }
/**
Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/Interceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/Interceptor.java?rev=1200046&r1=1200045&r2=1200046&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/Interceptor.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/Interceptor.java Wed Nov 9 23:53:53 2011
@@ -6,16 +6,16 @@
* 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.
- *
+ * under the License.
+ *
*/
package org.apache.directory.server.core.api.interceptor;
@@ -50,7 +50,7 @@ import org.apache.directory.shared.ldap.
*
* Interceptors should usually pass the control
* of current invocation to the next interceptor by calling an appropriate method
- * on {@link NextInterceptor}. The flow control is returned when the next
+ * on {@link NextInterceptor}. The flow control is returned when the next
* interceptor's filter method returns. You can therefore implement pre-, post-,
* around- invocation handler by how you place the statement. Otherwise, you
* can transform the invocation into other(s).
@@ -114,7 +114,7 @@ public interface Interceptor
/**
* Intializes this interceptor. This is invoked by {@link InterceptorChain}
* when this intercepter is loaded into interceptor chain.
- * @throws Exception
+ * @throws Exception
*/
void init( DirectoryService directoryService ) throws LdapException;
@@ -173,7 +173,7 @@ public interface Interceptor
/**
* Filters {@link Partition#list( ListOperationContext )} call.
*/
- EntryFilteringCursor list( NextInterceptor next, ListOperationContext listContext ) throws LdapException;
+ EntryFilteringCursor list( ListOperationContext listContext ) throws LdapException;
/**
Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/InterceptorChain.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/InterceptorChain.java?rev=1200046&r1=1200045&r2=1200046&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/InterceptorChain.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/InterceptorChain.java Wed Nov 9 23:53:53 2011
@@ -91,18 +91,27 @@ public class InterceptorChain
}
+ /**
+ * {@inheritDoc}
+ */
public void add( NextInterceptor next, AddOperationContext addContext ) throws LdapException
{
nexus.add( addContext );
}
+ /**
+ * {@inheritDoc}
+ */
public void bind( BindOperationContext bindContext ) throws LdapException
{
// Do nothing
}
-
+
+ /**
+ * {@inheritDoc}
+ */
public boolean compare( CompareOperationContext compareContext ) throws LdapException
{
return false;
@@ -127,23 +136,29 @@ public class InterceptorChain
}
+ /**
+ * {@inheritDoc}
+ */
public boolean hasEntry( EntryOperationContext hasEntryContext ) throws LdapException
{
return false;
}
- public EntryFilteringCursor list( NextInterceptor next, ListOperationContext listContext ) throws LdapException
+ /**
+ * {@inheritDoc}
+ */
+ public EntryFilteringCursor list( ListOperationContext listContext ) throws LdapException
{
- return nexus.list( listContext );
+ return null;
}
public Entry lookup( NextInterceptor next, LookupOperationContext lookupContext )
throws LdapException
- {
+ {
return nexus.lookup( lookupContext );
- }
+ }
public void modify( NextInterceptor next, ModifyOperationContext modifyContext ) throws LdapException
@@ -160,9 +175,9 @@ public class InterceptorChain
public void moveAndRename( NextInterceptor next, MoveAndRenameOperationContext moveAndRenameContext )
throws LdapException
- {
+ {
nexus.moveAndRename( moveAndRenameContext );
- }
+ }
public void rename( NextInterceptor next, RenameOperationContext renameContext ) throws LdapException
@@ -173,9 +188,9 @@ public class InterceptorChain
public EntryFilteringCursor search( NextInterceptor next, SearchOperationContext searchContext )
throws LdapException
- {
+ {
return nexus.search( searchContext );
- }
+ }
public void unbind( UnbindOperationContext unbindContext ) throws LdapException
@@ -522,7 +537,7 @@ public class InterceptorChain
// We have to use the admin session here, otherwise we may have
// trouble reading the entry due to insufficient access rights
CoreSession adminSession = opContext.getSession().getDirectoryService().getAdminSession();
-
+
LookupOperationContext lookupContext = new LookupOperationContext( adminSession, opContext.getDn(), SchemaConstants.ALL_ATTRIBUTES_ARRAY );
Entry foundEntry = opContext.getSession().getDirectoryService().getPartitionNexus().lookup( lookupContext );
@@ -586,7 +601,7 @@ public class InterceptorChain
throwInterceptorException( head, e );
}
}
- */
+ */
public void add( AddOperationContext addContext ) throws LdapException
@@ -632,28 +647,6 @@ public class InterceptorChain
}
- public EntryFilteringCursor list( ListOperationContext listContext ) throws LdapException
- {
- Element entry = getStartingEntry();
- Interceptor head = entry.interceptor;
- NextInterceptor next = entry.nextInterceptor;
-
- try
- {
- return head.list( next, listContext );
- }
- catch ( LdapException le )
- {
- throw le;
- }
- catch ( Throwable e )
- {
- throwInterceptorException( head, e );
- throw new InternalError(); // Should be unreachable
- }
- }
-
-
public EntryFilteringCursor search( SearchOperationContext searchContext ) throws LdapException
{
Element entry = getStartingEntry();
@@ -881,31 +874,6 @@ public class InterceptorChain
}
- public EntryFilteringCursor list( ListOperationContext listContext ) throws LdapException
- {
- Element next = getNextEntry();
- Interceptor interceptor = next.interceptor;
-
- try
- {
- //System.out.println( ">>> Entering into " + interceptor.getClass().getSimpleName() + ", listRequest" );
- EntryFilteringCursor cursor = interceptor.list( next.nextInterceptor, listContext );
- //System.out.println( "<<< Exiting from " + interceptor.getClass().getSimpleName() + ", listRequest" );
-
- return cursor;
- }
- catch ( LdapException le )
- {
- throw le;
- }
- catch ( Throwable e )
- {
- throwInterceptorException( interceptor, e );
- throw new InternalError(); // Should be unreachable
- }
- }
-
-
public EntryFilteringCursor search( SearchOperationContext searchContext ) throws LdapException
{
Element next = getNextEntry();
@@ -916,7 +884,7 @@ public class InterceptorChain
//System.out.println( ">>> Entering into " + interceptor.getClass().getSimpleName() + ", searchRequest" );
EntryFilteringCursor cursor = interceptor.search( next.nextInterceptor, searchContext );
//System.out.println( "<<< Exiting from " + interceptor.getClass().getSimpleName() + ", searchRequest" );
-
+
return cursor;
}
catch ( LdapException le )
@@ -941,7 +909,7 @@ public class InterceptorChain
//System.out.println( ">>> Entering into " + interceptor.getClass().getSimpleName() + ", lookupRequest" );
Entry entry = interceptor.lookup( next.nextInterceptor, lookupContext );
//System.out.println( "<<< Exiting from " + interceptor.getClass().getSimpleName() + ", lookupRequest" );
-
+
return entry;
}
catch ( LdapException le )
Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/NextInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/NextInterceptor.java?rev=1200046&r1=1200045&r2=1200046&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/NextInterceptor.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/NextInterceptor.java Wed Nov 9 23:53:53 2011
@@ -6,23 +6,22 @@
* 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.
- *
+ * under the License.
+ *
*/
package org.apache.directory.server.core.api.interceptor;
import org.apache.directory.server.core.api.filtering.EntryFilteringCursor;
import org.apache.directory.server.core.api.interceptor.context.AddOperationContext;
-import org.apache.directory.server.core.api.interceptor.context.ListOperationContext;
import org.apache.directory.server.core.api.interceptor.context.LookupOperationContext;
import org.apache.directory.server.core.api.interceptor.context.ModifyOperationContext;
import org.apache.directory.server.core.api.interceptor.context.MoveAndRenameOperationContext;
@@ -49,12 +48,6 @@ public interface NextInterceptor
/**
- * Calls the next interceptor's {@link Interceptor#list( NextInterceptor, ListOperationContext )}.
- */
- EntryFilteringCursor list( ListOperationContext listContext ) throws LdapException;
-
-
- /**
* Calls the next interceptor's {@link Interceptor#lookup( NextInterceptor, LookupOperationContext )}.
*/
Entry lookup( LookupOperationContext lookupContext ) throws LdapException;
Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/ListOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/ListOperationContext.java?rev=1200046&r1=1200045&r2=1200046&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/ListOperationContext.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/ListOperationContext.java Wed Nov 9 23:53:53 2011
@@ -6,16 +6,16 @@
* 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.
- *
+ * under the License.
+ *
*/
package org.apache.directory.server.core.api.interceptor.context;
@@ -23,6 +23,7 @@ package org.apache.directory.server.core
import java.util.Set;
import org.apache.directory.server.core.api.CoreSession;
+import org.apache.directory.server.core.api.OperationEnum;
import org.apache.directory.shared.ldap.model.name.Dn;
import org.apache.directory.shared.ldap.model.schema.AttributeTypeOptions;
@@ -41,6 +42,7 @@ public class ListOperationContext extend
public ListOperationContext( CoreSession session )
{
super( session );
+ setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.LIST ) );
}
@@ -52,6 +54,7 @@ public class ListOperationContext extend
public ListOperationContext( CoreSession session, Dn dn )
{
super( session, dn );
+ setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.LIST ) );
}
@@ -66,6 +69,7 @@ public class ListOperationContext extend
public ListOperationContext( CoreSession session, Dn dn, Set<AttributeTypeOptions> returningAttributes )
{
super( session, dn, returningAttributes );
+ setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.LIST ) );
}
@@ -77,7 +81,7 @@ public class ListOperationContext extend
return "List";
}
-
+
/**
* @see Object#toString()
*/
Modified: directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/api/MockInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/api/MockInterceptor.java?rev=1200046&r1=1200045&r2=1200046&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/api/MockInterceptor.java (original)
+++ directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/api/MockInterceptor.java Wed Nov 9 23:53:53 2011
@@ -122,12 +122,11 @@ public class MockInterceptor extends Bas
/**
* {@inheritDoc}
*/
- public Entry getRootDSE( GetRootDSEOperationContext getRootDseContext )
- throws LdapException
- {
+ public Entry getRootDSE( GetRootDSEOperationContext getRootDseContext ) throws LdapException
+ {
interceptors.add( this );
return next( getRootDseContext );
- }
+ }
/**
@@ -143,10 +142,10 @@ public class MockInterceptor extends Bas
/**
* {@inheritDoc}
*/
- public EntryFilteringCursor list( NextInterceptor next, ListOperationContext listContext ) throws LdapException
+ public EntryFilteringCursor list( ListOperationContext listContext ) throws LdapException
{
interceptors.add( this );
- return next.list( listContext );
+ return next( listContext );
}
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultOperationManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultOperationManager.java?rev=1200046&r1=1200045&r2=1200046&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultOperationManager.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultOperationManager.java Wed Nov 9 23:53:53 2011
@@ -592,7 +592,9 @@ public class DefaultOperationManager imp
try
{
- return directoryService.getInterceptorChain().list( listContext );
+ Interceptor head = directoryService.getInterceptor( listContext.getNextInterceptor() );
+
+ return head.list( listContext );
}
finally
{
Modified: directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java?rev=1200046&r1=1200045&r2=1200046&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java Wed Nov 9 23:53:53 2011
@@ -422,7 +422,10 @@ public class AuthenticationInterceptor e
}
- public EntryFilteringCursor list( NextInterceptor next, ListOperationContext listContext ) throws LdapException
+ /**
+ * {@inheritDoc}
+ */
+ public EntryFilteringCursor list( ListOperationContext listContext ) throws LdapException
{
if ( IS_DEBUG )
{
@@ -432,7 +435,7 @@ public class AuthenticationInterceptor e
checkAuthenticated( listContext );
checkPwdReset( listContext );
- return next.list( listContext );
+ return next( listContext );
}
Modified: directory/apacheds/trunk/interceptors/authz/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/authz/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java?rev=1200046&r1=1200045&r2=1200046&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/authz/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/authz/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java Wed Nov 9 23:53:53 2011
@@ -433,9 +433,8 @@ public class AciAuthorizationInterceptor
* @throws Exception if there are problems accessing attribute values
* @param proxy the partition nexus proxy object
*/
- private void addSubentryAciTuples( OperationContext opContext, Collection<ACITuple> tuples, Dn dn, Entry entry )
- throws LdapException
- {
+ private void addSubentryAciTuples( OperationContext opContext, Collection<ACITuple> tuples, Dn dn, Entry entry ) throws LdapException
+ {
// only perform this for subentries
if ( !entry.contains( SchemaConstants.OBJECT_CLASS_AT, SchemaConstants.SUBENTRY_OC ) )
{
@@ -477,7 +476,7 @@ public class AciAuthorizationInterceptor
tuples.addAll( item.toTuples() );
}
- }
+ }
/* -------------------------------------------------------------------------------
@@ -1027,9 +1026,8 @@ public class AciAuthorizationInterceptor
}
- public void moveAndRename( NextInterceptor next, MoveAndRenameOperationContext moveAndRenameContext )
- throws LdapException
- {
+ public void moveAndRename( NextInterceptor next, MoveAndRenameOperationContext moveAndRenameContext ) throws LdapException
+ {
Dn oldDn = moveAndRenameContext.getDn();
CoreSession session = moveAndRenameContext.getSession();
@@ -1116,7 +1114,7 @@ public class AciAuthorizationInterceptor
next.moveAndRename( moveAndRenameContext );
tupleCache.subentryRenamed( oldDn, newDn );
groupCache.groupRenamed( oldDn, newDn );
- }
+ }
/**
@@ -1213,10 +1211,13 @@ public class AciAuthorizationInterceptor
}
- public EntryFilteringCursor list( NextInterceptor next, ListOperationContext listContext ) throws LdapException
+ /**
+ * {@inheritDoc}
+ */
+ public EntryFilteringCursor list( ListOperationContext listContext ) throws LdapException
{
LdapPrincipal user = listContext.getSession().getEffectivePrincipal();
- EntryFilteringCursor cursor = next.list( listContext );
+ EntryFilteringCursor cursor = next( listContext );
if ( isPrincipalAnAdministrator( user.getDn() )
|| !directoryService.isAccessControlEnabled() )
@@ -1226,6 +1227,7 @@ public class AciAuthorizationInterceptor
AuthorizationFilter authzFilter = new AuthorizationFilter();
cursor.addEntryFilter( authzFilter );
+
return cursor;
}
Modified: directory/apacheds/trunk/interceptors/authz/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/authz/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java?rev=1200046&r1=1200045&r2=1200046&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/authz/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/authz/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java Wed Nov 9 23:53:53 2011
@@ -95,7 +95,7 @@ public class DefaultAuthorizationInterce
}
}
-
+
/**
* Creates a new instance.
*/
@@ -330,8 +330,7 @@ public class DefaultAuthorizationInterce
}
- public void moveAndRename( NextInterceptor nextInterceptor, MoveAndRenameOperationContext moveAndRenameContext )
- throws LdapException
+ public void moveAndRename( NextInterceptor nextInterceptor, MoveAndRenameOperationContext moveAndRenameContext ) throws LdapException
{
if ( !moveAndRenameContext.getSession().getDirectoryService().isAccessControlEnabled() )
{
@@ -448,8 +447,7 @@ public class DefaultAuthorizationInterce
}
- public EntryFilteringCursor search( NextInterceptor nextInterceptor, SearchOperationContext searchContext )
- throws LdapException
+ public EntryFilteringCursor search( NextInterceptor nextInterceptor, SearchOperationContext searchContext ) throws LdapException
{
EntryFilteringCursor cursor = nextInterceptor.search( searchContext );
@@ -464,10 +462,12 @@ public class DefaultAuthorizationInterce
}
- public EntryFilteringCursor list( NextInterceptor nextInterceptor, ListOperationContext listContext )
- throws LdapException
+ /**
+ * {@inheritDoc}
+ */
+ public EntryFilteringCursor list( ListOperationContext listContext ) throws LdapException
{
- EntryFilteringCursor cursor = nextInterceptor.list( listContext );
+ EntryFilteringCursor cursor = next( listContext );
if ( listContext.getSession().getDirectoryService().isAccessControlEnabled() )
{
@@ -475,6 +475,7 @@ public class DefaultAuthorizationInterce
}
cursor.addEntryFilter( new DefaultAuthorizationSearchFilter() );
+
return cursor;
}
Modified: directory/apacheds/trunk/interceptors/collective/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/collective/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java?rev=1200046&r1=1200045&r2=1200046&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/collective/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/collective/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java Wed Nov 9 23:53:53 2011
@@ -6,16 +6,16 @@
* 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.
- *
+ * under the License.
+ *
*/
package org.apache.directory.server.core.collective;
@@ -80,15 +80,15 @@ public class CollectiveAttributeIntercep
{
String[] retAttrs = operation.getSearchControls().getReturningAttributes();
addCollectiveAttributes( operation, entry, retAttrs );
-
+
return true;
}
}
-
+
/** The CollectiveAttribute search filter */
private final EntryFilter SEARCH_FILTER = new CollectiveAttributeFilter();
-
+
//-------------------------------------------------------------------------------------
// Initialization
//-------------------------------------------------------------------------------------
@@ -98,7 +98,7 @@ public class CollectiveAttributeIntercep
public void init( DirectoryService directoryService ) throws LdapException
{
super.init( directoryService );
-
+
LOG.debug( "CollectiveAttribute interceptor initilaized" );
}
@@ -120,13 +120,12 @@ public class CollectiveAttributeIntercep
/**
* {@inheritDoc}
*/
- public EntryFilteringCursor list( NextInterceptor nextInterceptor, ListOperationContext listContext )
- throws LdapException
+ public EntryFilteringCursor list( ListOperationContext listContext ) throws LdapException
{
- EntryFilteringCursor cursor = nextInterceptor.list( listContext );
-
+ EntryFilteringCursor cursor = next( listContext );
+
cursor.addEntryFilter( SEARCH_FILTER );
-
+
return cursor;
}
@@ -166,11 +165,10 @@ public class CollectiveAttributeIntercep
/**
* {@inheritDoc}
*/
- public EntryFilteringCursor search( NextInterceptor nextInterceptor, SearchOperationContext searchContext )
- throws LdapException
+ public EntryFilteringCursor search( NextInterceptor nextInterceptor, SearchOperationContext searchContext ) throws LdapException
{
EntryFilteringCursor cursor = nextInterceptor.search( searchContext );
-
+
cursor.addEntryFilter( SEARCH_FILTER );
return cursor;
@@ -200,7 +198,7 @@ public class CollectiveAttributeIntercep
return;
}
}
-
+
LOG.info( "A CollectiveAttribute subentry *should* have at least one collectiveAttribute" );
throw new LdapSchemaViolationException( ResultCodeEnum.OBJECT_CLASS_VIOLATION, I18n.err( I18n.ERR_257_COLLECTIVE_SUBENTRY_WITHOUT_COLLECTIVE_AT ) );
}
@@ -216,7 +214,7 @@ public class CollectiveAttributeIntercep
}
}
-
+
/**
* Check that we can modify an entry
*/
@@ -224,7 +222,7 @@ public class CollectiveAttributeIntercep
{
List<Modification> mods = modifyContext.getModItems();
Entry originalEntry = modifyContext.getEntry();
- Entry targetEntry = ( Entry ) SchemaUtils.getTargetEntry( mods, originalEntry );
+ Entry targetEntry = SchemaUtils.getTargetEntry( mods, originalEntry );
// If the modified entry contains the CollectiveAttributeSubentry, then the modification
// is accepted, no matter what
@@ -245,7 +243,7 @@ public class CollectiveAttributeIntercep
}
}
-
+
/**
* Check that we have a CollectiveAttribute in the modifications. (CollectiveAttributes
* are those with a name starting with 'c-').
@@ -284,7 +282,7 @@ public class CollectiveAttributeIntercep
return false;
}
-
+
/**
* Check if the entry contains any collective AttributeType (those starting with 'c-')
*/
@@ -303,14 +301,14 @@ public class CollectiveAttributeIntercep
return false;
}
-
+
/**
* Adds the set of collective attributes requested in the returning attribute list
* and contained in subentries referenced by the entry. Excludes collective
* attributes that are specified to be excluded via the 'collectiveExclusions'
* attribute in the entry.
*
- * @param opContext the context of the operation collective attributes
+ * @param opContext the context of the operation collective attributes
* are added to
* @param entry the entry to have the collective attributes injected
* @param retAttrs array or attribute type to be specifically included in the result entry(s)
@@ -322,7 +320,7 @@ public class CollectiveAttributeIntercep
COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT );
/*
- * If there are no collective attribute subentries referenced then we
+ * If there are no collective attribute subentries referenced then we
* have no collective attributes to inject to this entry.
*/
if ( collectiveAttributeSubentries == null )
@@ -331,9 +329,9 @@ public class CollectiveAttributeIntercep
}
/*
- * Before we proceed we need to lookup the exclusions within the entry
- * and build a set of exclusions for rapid lookup. We use OID values
- * in the exclusions set instead of regular names that may have case
+ * Before we proceed we need to lookup the exclusions within the entry
+ * and build a set of exclusions for rapid lookup. We use OID values
+ * in the exclusions set instead of regular names that may have case
* variance.
*/
Attribute collectiveExclusions = ( ( ClonedServerEntry ) entry ).getOriginalEntry().get(
@@ -400,10 +398,10 @@ public class CollectiveAttributeIntercep
Dn subentryDn = opContext.getSession().getDirectoryService().getDnFactory().create( subentryDnStr );
/*
- * TODO - Instead of hitting disk here can't we leverage the
+ * TODO - Instead of hitting disk here can't we leverage the
* SubentryService to get us cached sub-entries so we're not
* wasting time with a lookup here? It is ridiculous to waste
- * time looking up this sub-entry.
+ * time looking up this sub-entry.
*/
CoreSession session = opContext.getSession();
Modified: directory/apacheds/trunk/interceptors/exception/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/exception/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java?rev=1200046&r1=1200045&r2=1200046&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/exception/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/exception/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java Wed Nov 9 23:53:53 2011
@@ -157,7 +157,7 @@ public class ExceptionInterceptor extend
CoreSession session = addContext.getSession();
LookupOperationContext lookupContext = new LookupOperationContext( session, parentDn );
lookupContext.setAttrsId( SchemaConstants.ALL_ATTRIBUTES_ARRAY );
-
+
attrs = directoryService.getPartitionNexus().lookup( lookupContext );
}
catch ( Exception e )
@@ -218,10 +218,9 @@ public class ExceptionInterceptor extend
/**
- * Checks to see the base being searched exists, otherwise throws the appropriate LdapException.
+ * {@inheritDoc}
*/
- public EntryFilteringCursor list( NextInterceptor nextInterceptor, ListOperationContext listContext )
- throws LdapException
+ public EntryFilteringCursor list( ListOperationContext listContext ) throws LdapException
{
if ( listContext.getDn().getNormName().equals( subschemSubentryDn.getNormName() ) )
{
@@ -233,7 +232,7 @@ public class ExceptionInterceptor extend
//String msg = "Attempt to search under non-existant entry: ";
//assertHasEntry( listContext, msg, listContext.getDn() );
- return nextInterceptor.list( listContext );
+ return next( listContext );
}
@@ -362,8 +361,7 @@ public class ExceptionInterceptor extend
* Checks to see the entry being moved exists, and so does its parent, otherwise throws the appropriate
* LdapException.
*/
- public void moveAndRename( NextInterceptor nextInterceptor, MoveAndRenameOperationContext moveAndRenameContext )
- throws LdapException
+ public void moveAndRename( NextInterceptor nextInterceptor, MoveAndRenameOperationContext moveAndRenameContext ) throws LdapException
{
Dn oldDn = moveAndRenameContext.getDn();
Modified: directory/apacheds/trunk/interceptors/logger/src/main/java/org/apache/directory/server/core/logger/TimerInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/logger/src/main/java/org/apache/directory/server/core/logger/TimerInterceptor.java?rev=1200046&r1=1200045&r2=1200046&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/logger/src/main/java/org/apache/directory/server/core/logger/TimerInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/logger/src/main/java/org/apache/directory/server/core/logger/TimerInterceptor.java Wed Nov 9 23:53:53 2011
@@ -274,9 +274,8 @@ public class TimerInterceptor extends Ba
/**
* {@inheritDoc}
*/
- public Entry getRootDSE( GetRootDSEOperationContext getRootDseContext )
- throws LdapException
- {
+ public Entry getRootDSE( GetRootDSEOperationContext getRootDseContext ) throws LdapException
+ {
long t0 = System.nanoTime();
Entry rootDSE = next( getRootDseContext );
long delta = System.nanoTime() - t0;
@@ -299,7 +298,7 @@ public class TimerInterceptor extends Ba
}
return rootDSE;
- }
+ }
/**
@@ -343,10 +342,10 @@ public class TimerInterceptor extends Ba
/**
* {@inheritDoc}
*/
- public EntryFilteringCursor list( NextInterceptor next, ListOperationContext listContext ) throws LdapException
+ public EntryFilteringCursor list( ListOperationContext listContext ) throws LdapException
{
long t0 = System.nanoTime();
- EntryFilteringCursor cursor = next.list( listContext );
+ EntryFilteringCursor cursor = next( listContext );
long delta = System.nanoTime() - t0;
if ( IS_DEBUG_STATS )
Modified: directory/apacheds/trunk/interceptors/normalization/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/normalization/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java?rev=1200046&r1=1200045&r2=1200046&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/normalization/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/normalization/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java Wed Nov 9 23:53:53 2011
@@ -216,9 +216,8 @@ public class NormalizationInterceptor ex
/**
* {@inheritDoc}
*/
- public void moveAndRename( NextInterceptor nextInterceptor, MoveAndRenameOperationContext moveAndRenameContext )
- throws LdapException
- {
+ public void moveAndRename( NextInterceptor nextInterceptor, MoveAndRenameOperationContext moveAndRenameContext ) throws LdapException
+ {
if ( !moveAndRenameContext.getNewRdn().isSchemaAware() )
{
@@ -241,15 +240,14 @@ public class NormalizationInterceptor ex
}
nextInterceptor.moveAndRename( moveAndRenameContext );
- }
+ }
/**
* {@inheritDoc}
*/
- public EntryFilteringCursor search( NextInterceptor nextInterceptor, SearchOperationContext searchContext )
- throws LdapException
- {
+ public EntryFilteringCursor search( NextInterceptor nextInterceptor, SearchOperationContext searchContext ) throws LdapException
+ {
Dn dn = searchContext.getDn();
if ( !dn.isSchemaAware() )
@@ -280,7 +278,7 @@ public class NormalizationInterceptor ex
// TODO Normalize the returned Attributes, storing the UP attributes to format the returned values.
return nextInterceptor.search( searchContext );
}
- }
+ }
/**
@@ -297,12 +295,12 @@ public class NormalizationInterceptor ex
/**
* {@inheritDoc}
*/
- public EntryFilteringCursor list( NextInterceptor nextInterceptor, ListOperationContext listContext )
- throws LdapException
- {
+ public EntryFilteringCursor list( ListOperationContext listContext ) throws LdapException
+ {
listContext.getDn().apply( schemaManager );
- return nextInterceptor.list( listContext );
- }
+
+ return next( listContext );
+ }
/**
Modified: directory/apacheds/trunk/interceptors/operational/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/operational/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java?rev=1200046&r1=1200045&r2=1200046&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/operational/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/operational/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java Wed Nov 9 23:53:53 2011
@@ -6,16 +6,16 @@
* 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.
- *
+ * under the License.
+ *
*/
package org.apache.directory.server.core.operational;
@@ -106,10 +106,10 @@ public class OperationalAttributeInterce
public boolean accept( SearchingOperationContext operation, Entry entry ) throws Exception
{
return operation.getSearchControls().getReturningAttributes() != null
- || filterOperationalAttributes( entry );
+ || filterOperationalAttributes( entry );
}
}
-
+
private final EntryFilter SEARCH_FILTER = new OperationalAttributeSearchFilter();
/** The subschemasubentry Dn */
@@ -178,7 +178,7 @@ public class OperationalAttributeInterce
* - creatorsName
* - createTimestamp
* - entryCSN
- * - entryUUID
+ * - entryUUID
*/
public void add( NextInterceptor nextInterceptor, AddOperationContext addContext ) throws LdapException
{
@@ -250,7 +250,7 @@ public class OperationalAttributeInterce
boolean modifiedTimeAtPresent = false;
boolean entryCsnAtPresent = false;
Dn dn = modifyContext.getDn();
-
+
for ( Modification modification : mods )
{
AttributeType attributeType = modification.getAttribute().getAttributeType();
@@ -308,37 +308,37 @@ public class OperationalAttributeInterce
// Add the modification AT only if we are not trying to modify the SubentrySubschema
if ( !dn.equals( subschemaSubentryDn ) )
{
- if ( !modifierAtPresent )
- {
- // Inject the ModifiersName AT if it's not present
- Attribute attribute = new DefaultAttribute( MODIFIERS_NAME_AT, getPrincipal( modifyContext )
- .getName() );
-
- Modification modifiersName = new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE, attribute );
-
- mods.add( modifiersName );
- }
-
- if ( !modifiedTimeAtPresent )
- {
- // Inject the ModifyTimestamp AT if it's not present
- Attribute attribute = new DefaultAttribute( MODIFY_TIMESTAMP_AT, DateUtils
- .getGeneralizedTime() );
-
- Modification timestamp = new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE, attribute );
-
- mods.add( timestamp );
- }
-
- if ( !entryCsnAtPresent )
- {
- String csn = directoryService.getCSN().toString();
- Attribute attribute = new DefaultAttribute( ENTRY_CSN_AT, csn );
- Modification updatedCsn = new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE, attribute );
- mods.add( updatedCsn );
- }
+ if ( !modifierAtPresent )
+ {
+ // Inject the ModifiersName AT if it's not present
+ Attribute attribute = new DefaultAttribute( MODIFIERS_NAME_AT, getPrincipal( modifyContext )
+ .getName() );
+
+ Modification modifiersName = new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE, attribute );
+
+ mods.add( modifiersName );
+ }
+
+ if ( !modifiedTimeAtPresent )
+ {
+ // Inject the ModifyTimestamp AT if it's not present
+ Attribute attribute = new DefaultAttribute( MODIFY_TIMESTAMP_AT, DateUtils
+ .getGeneralizedTime() );
+
+ Modification timestamp = new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE, attribute );
+
+ mods.add( timestamp );
+ }
+
+ if ( !entryCsnAtPresent )
+ {
+ String csn = directoryService.getCSN().toString();
+ Attribute attribute = new DefaultAttribute( ENTRY_CSN_AT, csn );
+ Modification updatedCsn = new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE, attribute );
+ mods.add( updatedCsn );
+ }
}
-
+
// Go down in the chain
nextInterceptor.modify( modifyContext );
}
@@ -375,8 +375,7 @@ public class OperationalAttributeInterce
}
- public void moveAndRename( NextInterceptor nextInterceptor, MoveAndRenameOperationContext moveAndRenameContext )
- throws LdapException
+ public void moveAndRename( NextInterceptor nextInterceptor, MoveAndRenameOperationContext moveAndRenameContext ) throws LdapException
{
Entry modifiedEntry = moveAndRenameContext.getOriginalEntry().clone();
modifiedEntry.put( SchemaConstants.MODIFIERS_NAME_AT, getPrincipal( moveAndRenameContext ).getName() );
@@ -406,17 +405,16 @@ public class OperationalAttributeInterce
}
- public EntryFilteringCursor list( NextInterceptor nextInterceptor, ListOperationContext listContext )
- throws LdapException
+ public EntryFilteringCursor list( ListOperationContext listContext ) throws LdapException
{
- EntryFilteringCursor cursor = nextInterceptor.list( listContext );
+ EntryFilteringCursor cursor = next( listContext );
cursor.addEntryFilter( SEARCH_FILTER );
+
return cursor;
}
- public EntryFilteringCursor search( NextInterceptor nextInterceptor, SearchOperationContext searchContext )
- throws LdapException
+ public EntryFilteringCursor search( NextInterceptor nextInterceptor, SearchOperationContext searchContext ) throws LdapException
{
EntryFilteringCursor cursor = nextInterceptor.search( searchContext );
@@ -452,7 +450,7 @@ public class OperationalAttributeInterce
for ( Attribute attribute : attributes.getAttributes() )
{
AttributeType attributeType = attribute.getAttributeType();
-
+
if ( attributeType.getUsage() != UsageEnum.USER_APPLICATIONS )
{
removedAttributes.add( attributeType );
@@ -555,7 +553,7 @@ public class OperationalAttributeInterce
for ( int pos = 0; pos < size; pos++ )
{
Rdn rdn = dn.getRdn( size - 1 - pos );
-
+
if ( rdn.size() == 0 )
{
newDn = newDn.add( new Rdn() );
Modified: directory/apacheds/trunk/interceptors/schema/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/schema/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java?rev=1200046&r1=1200045&r2=1200046&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/schema/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/schema/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java Wed Nov 9 23:53:53 2011
@@ -370,10 +370,11 @@ public class SchemaInterceptor extends B
}
- public EntryFilteringCursor list( NextInterceptor nextInterceptor, ListOperationContext listContext ) throws LdapException
+ public EntryFilteringCursor list( ListOperationContext listContext ) throws LdapException
{
- EntryFilteringCursor cursor = nextInterceptor.list( listContext );
+ EntryFilteringCursor cursor = next( listContext );
cursor.addEntryFilter( binaryAttributeFilter );
+
return cursor;
}
Modified: directory/apacheds/trunk/interceptors/subtree/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/subtree/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java?rev=1200046&r1=1200045&r2=1200046&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/subtree/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/subtree/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java Wed Nov 9 23:53:53 2011
@@ -111,7 +111,7 @@ public class SubentryInterceptor extends
/** A reference to the nexus for direct backend operations */
private PartitionNexus nexus;
-
+
/** An enum used for the entries update */
private enum OperationEnum
{
@@ -179,10 +179,10 @@ public class SubentryInterceptor extends
SUBENTRY_OPATTRS = new AttributeType[]
{
- ACCESS_CONTROL_SUBENTRIES_AT,
- SUBSCHEMA_SUBENTRY_AT,
- COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT,
- TRIGGER_EXECUTION_SUBENTRIES_AT
+ ACCESS_CONTROL_SUBENTRIES_AT,
+ SUBSCHEMA_SUBENTRY_AT,
+ COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT,
+ TRIGGER_EXECUTION_SUBENTRIES_AT
};
ssParser = new SubtreeSpecificationParser( schemaManager );
@@ -321,7 +321,7 @@ public class SubentryInterceptor extends
if ( opContext.hasRequestControl( SUBENTRY_CONTROL ) )
{
SubentriesDecorator subentriesDecorator = ( SubentriesDecorator ) opContext.getRequestControl( SUBENTRY_CONTROL );
- return ( ( Subentries ) subentriesDecorator.getDecorated() ).isVisible();
+ return subentriesDecorator.getDecorated().isVisible();
}
return false;
@@ -369,7 +369,7 @@ public class SubentryInterceptor extends
case REPLACE :
modifications = getOperationalModsForReplace( subentryDn, candidate );
break;
- */
+ */
}
LOG.debug( "The entry {} has been evaluated to true for subentry {}", candidate.getDn(), subentryDn );
@@ -415,7 +415,7 @@ public class SubentryInterceptor extends
CoreSession session = opContext.getSession();
LookupOperationContext lookupContext = new LookupOperationContext( session, apDn );
lookupContext.setAttrsId( SchemaConstants.ALL_ATTRIBUTES_ARRAY );
-
+
Entry administrationPoint = directoryService.getPartitionNexus().lookup( lookupContext );
// The administrativeRole AT must exist and not be null
@@ -520,7 +520,7 @@ public class SubentryInterceptor extends
*/
SubentryCache subentryCache = directoryService.getSubentryCache();
SubtreeEvaluator evaluator = directoryService.getEvaluator();
-
+
for ( Dn subentryDn : subentryCache )
{
Dn apDn = subentryDn.getParent();
@@ -583,7 +583,7 @@ public class SubentryInterceptor extends
for ( Modification mod : mods )
{
if ( mod.getAttribute().getId().equalsIgnoreCase( SchemaConstants.OBJECT_CLASS_AT ) ||
- mod.getAttribute().getId().equalsIgnoreCase( SchemaConstants.OBJECT_CLASS_AT_OID ) )
+ mod.getAttribute().getId().equalsIgnoreCase( SchemaConstants.OBJECT_CLASS_AT_OID ) )
{
switch ( mod.getOperation() )
{
@@ -620,8 +620,7 @@ public class SubentryInterceptor extends
* Update the list of modifications with a modification associated with a specific
* role, if it's requested.
*/
- private void getOperationalModForReplace( boolean hasRole, AttributeType attributeType, Entry entry, Dn oldDn, Dn newDn, List<Modification> modifications )
- throws LdapInvalidAttributeValueException
+ private void getOperationalModForReplace( boolean hasRole, AttributeType attributeType, Entry entry, Dn oldDn, Dn newDn, List<Modification> modifications ) throws LdapInvalidAttributeValueException
{
String oldDnStr = oldDn.getNormName();
String newDnStr = newDn.getNormName();
@@ -649,8 +648,7 @@ public class SubentryInterceptor extends
* Get the list of modifications to be applied on an entry to inject the operational attributes
* associated with the administrative roles.
*/
- private List<Modification> getOperationalModsForReplace( Dn oldDn, Dn newDn, Subentry subentry, Entry entry )
- throws Exception
+ private List<Modification> getOperationalModsForReplace( Dn oldDn, Dn newDn, Subentry subentry, Entry entry ) throws Exception
{
List<Modification> modifications = new ArrayList<Modification>();
@@ -1017,10 +1015,9 @@ public class SubentryInterceptor extends
/**
* {@inheritDoc}
*/
- public EntryFilteringCursor list( NextInterceptor nextInterceptor, ListOperationContext listContext )
- throws LdapException
+ public EntryFilteringCursor list( ListOperationContext listContext ) throws LdapException
{
- EntryFilteringCursor cursor = nextInterceptor.list( listContext );
+ EntryFilteringCursor cursor = next( listContext );
if ( !isSubentryVisible( listContext ) )
{
@@ -1118,7 +1115,7 @@ public class SubentryInterceptor extends
getOperationalModsForRemove( dn, candidate ) ) );
}
}
-
+
subentries.close();
}
catch ( Exception e )
@@ -1521,8 +1518,7 @@ public class SubentryInterceptor extends
/**
* {@inheritDoc}
*/
- public EntryFilteringCursor search( NextInterceptor nextInterceptor, SearchOperationContext searchContext )
- throws LdapException
+ public EntryFilteringCursor search( NextInterceptor nextInterceptor, SearchOperationContext searchContext ) throws LdapException
{
EntryFilteringCursor cursor = nextInterceptor.search( searchContext );