Author: elecharny Date: Mon Sep 10 10:47:27 2007 New Revision: 574315 URL: http://svn.apache.org/viewvc?rev=574315&view=rev Log: Removed some warnings using generics Using the SchemaConstants for the 'userPassword' attribute Minor cleaning Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationService.java directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeService.java directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/event/EventService.java directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionService.java directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/kerberos/PasswordPolicyService.java directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationService.java directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeService.java directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/referral/ReferralService.java directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryService.java directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationService.java Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationService.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationService.java?rev=574315&r1=574314&r2=574315&view=diff ============================================================================== --- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationService.java (original) +++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationService.java Mon Sep 10 10:47:27 2007 @@ -515,6 +515,7 @@ } Invocation invocation = InvocationStack.getInstance().peek(); + return new SearchResultFilteringEnumeration( e, opContext.getSearchControls(), invocation, new SearchResultFilter() { @@ -529,16 +530,16 @@ public NamingEnumeration list( NextInterceptor nextInterceptor, ListOperationContext opContext ) throws NamingException { - NamingEnumeration e = nextInterceptor.list( opContext ); + NamingEnumeration result = nextInterceptor.list( opContext ); if ( !enabled ) { - return e; + return result; } Invocation invocation = InvocationStack.getInstance().peek(); - return new SearchResultFilteringEnumeration( e, null, invocation, new SearchResultFilter() + return new SearchResultFilteringEnumeration( result, null, invocation, new SearchResultFilter() { public boolean accept( Invocation invocation, SearchResult result, SearchControls controls ) throws NamingException Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeService.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeService.java?rev=574315&r1=574314&r2=574315&view=diff ============================================================================== --- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeService.java (original) +++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeService.java Mon Sep 10 10:47:27 2007 @@ -309,18 +309,20 @@ public NamingEnumeration list( NextInterceptor nextInterceptor, ListOperationContext opContext ) throws NamingException { - NamingEnumeration e = nextInterceptor.list( opContext ); + NamingEnumeration result = nextInterceptor.list( opContext ); Invocation invocation = InvocationStack.getInstance().peek(); - return new SearchResultFilteringEnumeration( e, new SearchControls(), invocation, SEARCH_FILTER, "List collective Filter" ); + + return new SearchResultFilteringEnumeration( result, new SearchControls(), invocation, SEARCH_FILTER, "List collective Filter" ); } public NamingEnumeration search( NextInterceptor nextInterceptor, SearchOperationContext opContext ) throws NamingException { - NamingEnumeration e = nextInterceptor.search( opContext ); + NamingEnumeration result = nextInterceptor.search( opContext ); Invocation invocation = InvocationStack.getInstance().peek(); + return new SearchResultFilteringEnumeration( - e, opContext.getSearchControls(), invocation, SEARCH_FILTER, "Search collective Filter" ); + result, opContext.getSearchControls(), invocation, SEARCH_FILTER, "Search collective Filter" ); } // ------------------------------------------------------------------------ @@ -330,13 +332,17 @@ public void add( NextInterceptor next, AddOperationContext opContext ) throws NamingException { collectiveAttributesSchemaChecker.checkAdd( opContext.getDn(), opContext.getEntry() ); - super.add( next, opContext ); + + next.add( opContext ); + //super.add( next, opContext ); } public void modify( NextInterceptor next, ModifyOperationContext opContext ) throws NamingException { collectiveAttributesSchemaChecker.checkModify( opContext.getDn(), opContext.getModItems() ); - super.modify( next, opContext ); + + next.modify( opContext ); + //super.modify( next, opContext ); } } Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/event/EventService.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/event/EventService.java?rev=574315&r1=574314&r2=574315&view=diff ============================================================================== --- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/event/EventService.java (original) +++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/event/EventService.java Mon Sep 10 10:47:27 2007 @@ -237,8 +237,10 @@ public void add( NextInterceptor next, AddOperationContext opContext ) throws NamingException { - super.add( next, opContext ); - LdapDN name = opContext.getDn(); + next.add( opContext ); + //super.add( next, opContext ); + + LdapDN name = opContext.getDn(); Attributes entry = opContext.getEntry(); Set selecting = getSelectingSources( name, entry ); @@ -270,7 +272,10 @@ { LdapDN name = opContext.getDn(); Attributes entry = nexus.lookup( new LookupOperationContext( name ) ); - super.delete( next, opContext ); + + next.delete( opContext ); + //super.delete( next, opContext ); + Set selecting = getSelectingSources( name, entry ); if ( selecting.isEmpty() ) @@ -328,7 +333,10 @@ Invocation invocation = InvocationStack.getInstance().peek(); PartitionNexusProxy proxy = invocation.getProxy(); Attributes oriEntry = proxy.lookup( new LookupOperationContext( opContext.getDn() ), PartitionNexusProxy.LOOKUP_BYPASS ); - super.modify( next, opContext ); + + next.modify( opContext ); + //super.modify( next, opContext ); + notifyOnModify( opContext.getDn(), opContext.getModItems(), oriEntry ); } @@ -362,8 +370,10 @@ public void rename( NextInterceptor next, RenameOperationContext opContext ) throws NamingException { - super.rename( next, opContext ); - LdapDN newName = ( LdapDN ) opContext.getDn().clone(); + next.rename( opContext ); + //super.rename( next, opContext ); + + LdapDN newName = ( LdapDN ) opContext.getDn().clone(); newName.remove( newName.size() - 1 ); newName.add( opContext.getNewRdn() ); newName.normalize( attributeRegistry.getNormalizerMapping() ); @@ -374,7 +384,9 @@ public void moveAndRename( NextInterceptor next, MoveAndRenameOperationContext opContext ) throws NamingException { - super.moveAndRename( next, opContext ); + next.moveAndRename( opContext ); + //super.moveAndRename( next, opContext ); + LdapDN newName = ( LdapDN ) opContext.getParent().clone(); newName.add( opContext.getNewRdn() ); notifyOnNameChange( opContext.getDn(), newName ); @@ -383,7 +395,9 @@ public void move( NextInterceptor next, MoveOperationContext opContext ) throws NamingException { - super.move( next, opContext ); + next.move( opContext ); + //super.move( next, opContext ); + LdapDN oriChildName = opContext.getDn(); LdapDN newName = ( LdapDN ) opContext.getParent().clone(); @@ -399,14 +413,17 @@ return Collections.EMPTY_SET; } - Set selecting = new HashSet(); + Set selecting = new HashSet(); Iterator list = sources.values().iterator(); + while ( list.hasNext() ) { Object obj = list.next(); + if ( obj instanceof EventSourceRecord ) { EventSourceRecord rec = ( EventSourceRecord ) obj; + if ( evaluator.evaluate( rec.getFilter(), name.toNormName(), entry ) ) { selecting.add( obj ); Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionService.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionService.java?rev=574315&r1=574314&r2=574315&view=diff ============================================================================== --- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionService.java (original) +++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionService.java Mon Sep 10 10:47:27 2007 @@ -259,12 +259,12 @@ /** * Checks to see the base being searched exists, otherwise throws the appropriate LdapException. */ - public NamingEnumeration list( NextInterceptor nextInterceptor, ListOperationContext opContext ) throws NamingException + public NamingEnumeration list( NextInterceptor nextInterceptor, ListOperationContext opContext ) throws NamingException { if ( opContext.getDn().getNormName().equals( subschemSubentryDn.getNormName() ) ) { // there is nothing under the schema subentry - return new EmptyEnumeration(); + return new EmptyEnumeration(); } // check if entry to search exists Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java?rev=574315&r1=574314&r2=574315&view=diff ============================================================================== --- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java (original) +++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java Mon Sep 10 10:47:27 2007 @@ -1070,7 +1070,6 @@ return next; } - public boolean compare( CompareOperationContext opContext ) throws NamingException { Entry next = getNextEntry(); @@ -1090,7 +1089,6 @@ throw new InternalError(); // Should be unreachable } } - public Attributes getRootDSE( GetRootDSEOperationContext opContext ) throws NamingException { 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=574315&r1=574314&r2=574315&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 Mon Sep 10 10:47:27 2007 @@ -675,14 +675,20 @@ return; } + if ( obj instanceof Attributes ) + { + Attributes attributes = (Attributes)obj; + + LdapDN target = buildTarget( name ); + doAddOperation( target, attributes ); + } // Check for Referenceable - if ( obj instanceof Referenceable ) + else if ( obj instanceof Referenceable ) { throw new NamingException( "Do not know how to store Referenceables yet!" ); } - // Store different formats - if ( obj instanceof Reference ) + else if ( obj instanceof Reference ) { // Store as ref and add outAttrs throw new NamingException( "Do not know how to store References yet!" ); @@ -691,9 +697,11 @@ { // Serialize and add outAttrs Attributes attributes = new AttributesImpl(); + if ( outAttrs != null && outAttrs.size() > 0 ) { NamingEnumeration list = outAttrs.getAll(); + while ( list.hasMore() ) { attributes.put( ( Attribute ) list.next() ); 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=574315&r1=574314&r2=574315&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 Mon Sep 10 10:47:27 2007 @@ -33,6 +33,7 @@ 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.ModifyOperationContext; +import org.apache.directory.shared.ldap.constants.SchemaConstants; import org.apache.directory.shared.ldap.message.ModificationItemImpl; import org.apache.directory.shared.ldap.name.LdapDN; import org.apache.directory.shared.ldap.util.AttributeUtils; @@ -73,12 +74,12 @@ Object attr = null; - if ( entry.get( "userPassword" ) != null ) + if ( entry.get( SchemaConstants.USER_PASSWORD_AT ) != null ) { String userPassword = ""; String username = ""; - attr = entry.get( "userPassword" ).get(); + attr = entry.get( SchemaConstants.USER_PASSWORD_AT ).get(); if ( attr instanceof String ) { @@ -101,9 +102,9 @@ userPassword = string; } - if ( entry.get( "cn" ) != null ) + if ( entry.get( SchemaConstants.CN_AT ) != null ) { - attr = entry.get( "cn" ).get(); + attr = entry.get( SchemaConstants.CN_AT ).get(); username = ( String ) attr; } @@ -127,28 +128,30 @@ String operation = null; - for ( int ii = 0; ii < mods.length; ii++ ) + for ( ModificationItemImpl mod:mods ) { if ( log.isDebugEnabled() ) { - switch ( mods[ii].getModificationOp() ) + switch ( mod.getModificationOp() ) { case DirContext.ADD_ATTRIBUTE: operation = "Adding"; break; + case DirContext.REMOVE_ATTRIBUTE: operation = "Removing"; break; + case DirContext.REPLACE_ATTRIBUTE: operation = "Replacing"; break; } } - Attribute attr = mods[ii].getAttribute(); + Attribute attr = mod.getAttribute(); String id = attr.getID(); - if ( id.equalsIgnoreCase( "userPassword" ) ) + if ( id.equalsIgnoreCase( SchemaConstants.USER_PASSWORD_AT ) ) { Object userPassword = attr.get(); @@ -181,7 +184,7 @@ if ( log.isDebugEnabled() ) { - log.debug( operation + " for entry '" + name.getUpName() + "' the attribute " + mods[ii].getAttribute() ); + log.debug( operation + " for entry '" + name.getUpName() + "' the attribute " + mod.getAttribute() ); } } @@ -243,27 +246,27 @@ char[] characters = password.toCharArray(); - for ( int ii = 0; ii < characters.length; ii++ ) + for ( char character:characters ) { - if ( Character.isLowerCase( characters[ii] ) ) + if ( Character.isLowerCase( character ) ) { lowercase = 1; } else { - if ( Character.isUpperCase( characters[ii] ) ) + if ( Character.isUpperCase( character ) ) { uppercase = 1; } else { - if ( Character.isDigit( characters[ii] ) ) + if ( Character.isDigit( character ) ) { digit = 1; } else { - if ( !Character.isLetterOrDigit( characters[ii] ) ) + if ( !Character.isLetterOrDigit( character ) ) { nonAlphaNumeric = 1; } 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=574315&r1=574314&r2=574315&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 Mon Sep 10 10:47:27 2007 @@ -176,6 +176,7 @@ if ( filter.isLeaf() ) { LeafNode ln = ( LeafNode ) filter; + if ( !attributeRegistry.hasAttributeType( ln.getAttribute() ) ) { StringBuffer buf = new StringBuffer(); @@ -183,11 +184,12 @@ buf.append( ln.getAttribute() ); buf.append( "' not evaluted at all. Returning empty enumeration." ); log.warn( buf.toString() ); - return new EmptyEnumeration(); + return new EmptyEnumeration(); } } boolean isFailure = true; + while ( isFailure && ( filter != null ) ) { try @@ -195,6 +197,7 @@ if ( filter.isLeaf() ) { LeafNode ln = ( LeafNode ) filter; + if ( !attributeRegistry.hasAttributeType( ln.getAttribute() ) ) { StringBuffer buf = new StringBuffer(); @@ -202,7 +205,7 @@ buf.append( ln.getAttribute() ); buf.append( "' not evaluted at all. Returning empty enumeration." ); log.warn( buf.toString() ); - return new EmptyEnumeration(); + return new EmptyEnumeration(); } } @@ -212,6 +215,7 @@ catch( UndefinedFilterAttributeException e ) { isFailure = true; + if ( log.isWarnEnabled() ) { log.warn( "An undefined attribute was found within the supplied search filter. " + @@ -221,16 +225,17 @@ // we can only get here if the filter is a branch node with only leaves // note that in this case the undefined node will not be removed. BranchNode bnode = ( BranchNode ) filter; + if ( bnode.isNegation() ) { - return new EmptyEnumeration(); + return new EmptyEnumeration(); } bnode.getChildren().remove( e.getUndefinedFilterNode() ); if ( bnode.getOperator() == AssertionEnum.AND ) { - return new EmptyEnumeration(); + return new EmptyEnumeration(); } if ( bnode.getChildren().size() < 2 ) @@ -250,7 +255,7 @@ { log.warn( "Undefined branchnode filter without child nodes not " + "evaluted at all. Returning empty enumeration." ); - return new EmptyEnumeration(); + return new EmptyEnumeration(); } // now for AND & OR nodes with a single child left replace them with their child @@ -272,6 +277,7 @@ else { LeafNode leaf = ( LeafNode ) filter; + if ( attributeRegistry.hasDescendants( leaf.getAttribute() ) ) { // create new OR node and add the filter leaf to it @@ -356,7 +362,7 @@ } - public NamingEnumeration list( NextInterceptor nextInterceptor, ListOperationContext opContext ) throws NamingException + public NamingEnumeration list( NextInterceptor nextInterceptor, ListOperationContext opContext ) throws NamingException { LdapDN.normalize( opContext.getDn(), attrNormalizers ); return nextInterceptor.list( 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=574315&r1=574314&r2=574315&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 Mon Sep 10 10:47:27 2007 @@ -268,7 +268,7 @@ ModifyOperationContext newModify = new ModifyOperationContext( - ((MoveAndRenameOperationContext)opContext).getParent(), items ); + opContext.getParent(), items ); nexus.modify( newModify ); } @@ -295,31 +295,32 @@ } - public NamingEnumeration list( NextInterceptor nextInterceptor, ListOperationContext opContext ) throws NamingException + public NamingEnumeration list( NextInterceptor nextInterceptor, ListOperationContext opContext ) throws NamingException { - NamingEnumeration e = nextInterceptor.list( opContext ); + NamingEnumeration result = nextInterceptor.list( opContext ); Invocation invocation = InvocationStack.getInstance().peek(); - return new SearchResultFilteringEnumeration( e, new SearchControls(), invocation, SEARCH_FILTER, "List Operational Filter" ); + + return new SearchResultFilteringEnumeration( result, new SearchControls(), invocation, SEARCH_FILTER, "List Operational Filter" ); } public NamingEnumeration search( NextInterceptor nextInterceptor, SearchOperationContext opContext ) throws NamingException { Invocation invocation = InvocationStack.getInstance().peek(); - NamingEnumeration e = nextInterceptor.search( opContext ); + NamingEnumeration result = nextInterceptor.search( opContext ); SearchControls searchCtls = opContext.getSearchControls(); if ( searchCtls.getReturningAttributes() != null ) { if ( isDenormalizeOpAttrsEnabled ) { - return new SearchResultFilteringEnumeration( e, searchCtls, invocation, DENORMALIZING_SEARCH_FILTER, "Search Operational Filter denormalized" ); + return new SearchResultFilteringEnumeration( result, searchCtls, invocation, DENORMALIZING_SEARCH_FILTER, "Search Operational Filter denormalized" ); } - return e; + return result; } - return new SearchResultFilteringEnumeration( e, searchCtls, invocation, SEARCH_FILTER , "Search Operational Filter"); + return new SearchResultFilteringEnumeration( result, searchCtls, invocation, SEARCH_FILTER , "Search Operational Filter"); } @@ -350,6 +351,7 @@ attributes.remove( attrId ); } } + return true; } @@ -466,6 +468,7 @@ // below we only process multi-valued rdns StringBuffer buf = new StringBuffer(); + for ( Iterator jj = rdn.iterator(); jj.hasNext(); /**/ ) { AttributeTypeAndValue atav = ( AttributeTypeAndValue ) jj.next(); @@ -476,6 +479,7 @@ buf.append( '+' ); } } + newDn.add( new Rdn(buf.toString()) ); } Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/referral/ReferralService.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/referral/ReferralService.java?rev=574315&r1=574314&r2=574315&view=diff ============================================================================== --- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/referral/ReferralService.java (original) +++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/referral/ReferralService.java Mon Sep 10 10:47:27 2007 @@ -620,6 +620,7 @@ if ( refval == null || refval.equals( IGNORE ) ) { next.moveAndRename( opContext ); + if ( lut.isReferral( oldName ) ) { lut.referralChanged( oldName, newName ); @@ -635,6 +636,7 @@ if ( farthestSrc == null && farthestDst == null && !lut.isReferral( newName ) ) { next.moveAndRename( opContext ); + if ( lut.isReferral( oldName ) ) { lut.referralChanged( oldName, newName ); Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java?rev=574315&r1=574314&r2=574315&view=diff ============================================================================== --- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java (original) +++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java Mon Sep 10 10:47:27 2007 @@ -379,11 +379,11 @@ /** * */ - public NamingEnumeration list( NextInterceptor nextInterceptor, ListOperationContext opContext ) throws NamingException + public NamingEnumeration list( NextInterceptor nextInterceptor, ListOperationContext opContext ) throws NamingException { - NamingEnumeration e = nextInterceptor.list( opContext ); + NamingEnumeration result = nextInterceptor.list( opContext ); Invocation invocation = InvocationStack.getInstance().peek(); - return new SearchResultFilteringEnumeration( e, new SearchControls(), invocation, binaryAttributeFilter, "List Schema Filter" ); + return new SearchResultFilteringEnumeration( result, new SearchControls(), invocation, binaryAttributeFilter, "List Schema Filter" ); } /** @@ -514,16 +514,16 @@ // Deal with the normal case : searching for a normal value (not subSchemaSubEntry if ( !subschemaSubentryDnNorm.equals( base.toNormName() ) ) { - NamingEnumeration e = nextInterceptor.search( opContext ); + NamingEnumeration result = nextInterceptor.search( opContext ); Invocation invocation = InvocationStack.getInstance().peek(); if ( searchCtls.getReturningAttributes() != null ) { - return new SearchResultFilteringEnumeration( e, new SearchControls(), invocation, topFilter, "Search Schema Filter top" ); + return new SearchResultFilteringEnumeration( result, new SearchControls(), invocation, topFilter, "Search Schema Filter top" ); } - return new SearchResultFilteringEnumeration( e, searchCtls, invocation, filters, "Search Schema Filter" ); + return new SearchResultFilteringEnumeration( result, searchCtls, invocation, filters, "Search Schema Filter" ); } // The user was searching into the subSchemaSubEntry @@ -556,7 +556,7 @@ } else { - return new EmptyEnumeration(); + return new EmptyEnumeration(); } String nodeOid = registries.getOidRegistry().getOid( node.getAttribute() ); @@ -570,11 +570,11 @@ // call.setBypass( true ); Attributes attrs = getSubschemaEntry( searchCtls.getReturningAttributes() ); SearchResult result = new ServerSearchResult( base.toString(), null, attrs ); - return new SingletonEnumeration( result ); + return new SingletonEnumeration( result ); } else { - return new EmptyEnumeration(); + return new EmptyEnumeration(); } } else if ( filter instanceof PresenceNode ) @@ -587,13 +587,13 @@ // call.setBypass( true ); Attributes attrs = getSubschemaEntry( searchCtls.getReturningAttributes() ); SearchResult result = new ServerSearchResult( base.toString(), null, attrs, false ); - return new SingletonEnumeration( result ); + return new SingletonEnumeration( result ); } } } // In any case not handled previously, just return an empty result - return new EmptyEnumeration(); + return new EmptyEnumeration(); } Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryService.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryService.java?rev=574315&r1=574314&r2=574315&view=diff ============================================================================== --- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryService.java (original) +++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryService.java Mon Sep 10 10:47:27 2007 @@ -230,39 +230,39 @@ public NamingEnumeration list( NextInterceptor nextInterceptor, ListOperationContext opContext ) throws NamingException { - NamingEnumeration e = nextInterceptor.list( opContext ); + NamingEnumeration result = nextInterceptor.list( opContext ); Invocation invocation = InvocationStack.getInstance().peek(); if ( !isSubentryVisible( invocation ) ) { - return new SearchResultFilteringEnumeration( e, new SearchControls(), invocation, + return new SearchResultFilteringEnumeration( result, new SearchControls(), invocation, new HideSubentriesFilter(), "List Subentry filter" ); } - return e; + return result; } public NamingEnumeration search( NextInterceptor nextInterceptor, SearchOperationContext opContext ) throws NamingException { - NamingEnumeration e = nextInterceptor.search( opContext ); + NamingEnumeration result = nextInterceptor.search( opContext ); Invocation invocation = InvocationStack.getInstance().peek(); SearchControls searchCtls = opContext.getSearchControls(); // object scope searches by default return subentries if ( searchCtls.getSearchScope() == SearchControls.OBJECT_SCOPE ) { - return e; + return result; } // for subtree and one level scope we filter if ( !isSubentryVisible( invocation ) ) { - return new SearchResultFilteringEnumeration( e, searchCtls, invocation, new HideSubentriesFilter(), "Search Subentry filter hide subentries" ); + return new SearchResultFilteringEnumeration( result, searchCtls, invocation, new HideSubentriesFilter(), "Search Subentry filter hide subentries" ); } else { - return new SearchResultFilteringEnumeration( e, searchCtls, invocation, new HideEntriesFilter(), "Search Subentry filter hide entries"); + return new SearchResultFilteringEnumeration( result, searchCtls, invocation, new HideEntriesFilter(), "Search Subentry filter hide entries"); } } Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationService.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationService.java?rev=574315&r1=574314&r2=574315&view=diff ============================================================================== --- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationService.java (original) +++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationService.java Mon Sep 10 10:47:27 2007 @@ -491,22 +491,23 @@ @Override - public NamingEnumeration list( NextInterceptor next, ListOperationContext opContext ) throws NamingException + public NamingEnumeration list( NextInterceptor nextInterceptor, ListOperationContext opContext ) throws NamingException { DirContext ctx = ( DirContext ) InvocationStack.getInstance().peek().getCaller(); - NamingEnumeration e = next.search( - new SearchOperationContext( - opContext.getDn(), ctx.getEnvironment(), - new PresenceNode( SchemaConstants.OBJECT_CLASS_AT_OID ), - new SearchControls() ) ); - return new SearchResultFilteringEnumeration( e, new SearchControls(), InvocationStack.getInstance().peek(), + NamingEnumeration result = nextInterceptor.search( + new SearchOperationContext( + opContext.getDn(), ctx.getEnvironment(), + new PresenceNode( SchemaConstants.OBJECT_CLASS_AT_OID ), + new SearchControls() ) ); + + return new SearchResultFilteringEnumeration( result, new SearchControls(), InvocationStack.getInstance().peek(), Constants.DELETED_ENTRIES_FILTER, "List replication filter" ); } @Override - public NamingEnumeration search( NextInterceptor next, SearchOperationContext opContext ) throws NamingException + public NamingEnumeration search( NextInterceptor nextInterceptor, SearchOperationContext opContext ) throws NamingException { SearchControls searchControls = opContext.getSearchControls(); @@ -519,9 +520,9 @@ searchControls.setReturningAttributes( newAttrIds ); } - NamingEnumeration e = next.search( + NamingEnumeration result = nextInterceptor.search( new SearchOperationContext( opContext.getDn(), opContext.getEnv(), opContext.getFilter(), searchControls ) ); - return new SearchResultFilteringEnumeration( e, searchControls, InvocationStack.getInstance().peek(), + return new SearchResultFilteringEnumeration( result, searchControls, InvocationStack.getInstance().peek(), Constants.DELETED_ENTRIES_FILTER, "Search Replication filter" ); }