You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ak...@apache.org on 2007/08/29 22:59:11 UTC
svn commit: r570931 - in /directory:
apacheds/trunk/core/src/main/java/org/apache/directory/server/core/
apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/
apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/...
Author: akarasulu
Date: Wed Aug 29 13:59:10 2007
New Revision: 570931
URL: http://svn.apache.org/viewvc?rev=570931&view=rev
Log:
merging back to trunks various small bug fixes and generics cleanups
Modified:
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryServiceConfiguration.java
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DirectoryService.java
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationService.java
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AuthorizationService.java
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/authz/GroupCache.java
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/ACDFEngine.java
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/HighestPrecedenceFilter.java
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/MaxImmSubFilter.java
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/MaxValueCountFilter.java
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/MicroOperationFilter.java
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedUserClassFilter.java
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/RestrictedByFilter.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/collective/CollectiveAttributesSchemaChecker.java
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/enumeration/ReferralHandlingEnumeration.java
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/enumeration/SearchResultEnumeration.java
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/enumeration/SearchResultFilteringEnumeration.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/interceptor/BaseInterceptor.java
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/NextInterceptor.java
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeSearchResultEnumeration.java
directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/Registries.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ProtectedItem.java
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java?rev=570931&r1=570930&r2=570931&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java Wed Aug 29 13:59:10 2007
@@ -25,6 +25,7 @@
import java.util.HashSet;
import java.util.Hashtable;
import java.util.Iterator;
+import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -753,13 +754,13 @@
ServerLdapContext ctx = ( ServerLdapContext )
getJndiContext( principalDn, principal, credential, authentication, "" );
- Iterator i = startupConfiguration.getTestEntries().iterator();
+ Iterator<Entry> i = startupConfiguration.getTestEntries().iterator();
while ( i.hasNext() )
{
try
{
- Entry entry = (Entry)( ( Entry ) i.next() ).clone();
+ Entry entry = i.next().clone();
Attributes attributes = entry.getAttributes();
String dn = entry.getDn();
@@ -810,11 +811,11 @@
loader.loadWithDependencies( bootstrapSchemas, registries );
// run referential integrity tests
- java.util.List errors = registries.checkRefInteg();
+ List<Throwable> errors = registries.checkRefInteg();
if ( !errors.isEmpty() )
{
NamingException e = new NamingException();
- e.setRootCause( ( Throwable ) errors.get( 0 ) );
+ e.setRootCause( errors.get( 0 ) );
throw e;
}
@@ -900,7 +901,7 @@
for ( PartitionConfiguration pconf : pcs )
{
- Iterator indices = pconf.getIndexedAttributes().iterator();
+ Iterator<Object> indices = pconf.getIndexedAttributes().iterator();
while ( indices.hasNext() )
{
Object indexedAttr = indices.next();
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryServiceConfiguration.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryServiceConfiguration.java?rev=570931&r1=570930&r2=570931&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryServiceConfiguration.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryServiceConfiguration.java Wed Aug 29 13:59:10 2007
@@ -68,7 +68,7 @@
}
- public Hashtable getEnvironment()
+ public Hashtable<String,Object> getEnvironment()
{
return parent.getEnvironment();
}
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DirectoryService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DirectoryService.java?rev=570931&r1=570930&r2=570931&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DirectoryService.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DirectoryService.java Wed Aug 29 13:59:10 2007
@@ -91,7 +91,8 @@
*
* @throws NamingException if failed to start up
*/
- public abstract void startup( DirectoryServiceListener listener, Hashtable environment ) throws NamingException;
+ public abstract void startup( DirectoryServiceListener listener, Hashtable<String,Object> environment )
+ throws NamingException;
/**
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationService.java?rev=570931&r1=570930&r2=570931&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationService.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationService.java Wed Aug 29 13:59:10 2007
@@ -54,7 +54,6 @@
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.invocation.InvocationStack;
@@ -149,7 +148,7 @@
"configuration." );
}
- Class authenticatorClass;
+ Class<?> authenticatorClass;
try
{
authenticatorClass = Class.forName( cfg.getAuthenticatorClassName() );
@@ -214,7 +213,7 @@
*/
private void unregister( Authenticator authenticator )
{
- Collection authenticatorList = getAuthenticators( authenticator.getAuthenticatorType() );
+ Collection<Authenticator> authenticatorList = getAuthenticators( authenticator.getAuthenticatorType() );
if ( authenticatorList == null )
{
@@ -329,7 +328,7 @@
}
- public NamingEnumeration list( NextInterceptor next, ListOperationContext opContext ) throws NamingException
+ public NamingEnumeration<SearchResult> list( NextInterceptor next, ListOperationContext opContext ) throws NamingException
{
if ( IS_DEBUG )
{
@@ -341,7 +340,7 @@
}
- public Iterator listSuffixes ( NextInterceptor next, ListSuffixOperationContext opContext ) throws NamingException
+ public Iterator<String> listSuffixes ( NextInterceptor next, ListSuffixOperationContext opContext ) throws NamingException
{
if ( IS_DEBUG )
{
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java?rev=570931&r1=570930&r2=570931&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java Wed Aug 29 13:59:10 2007
@@ -98,7 +98,7 @@
* Define the interceptors we should *not* go through when we will have to request the backend
* about a userPassword.
*/
- private static final Collection USERLOOKUP_BYPASS;
+ private static final Collection<String> USERLOOKUP_BYPASS;
static
{
Set<String> c = new HashSet<String>();
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AuthorizationService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AuthorizationService.java?rev=570931&r1=570930&r2=570931&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AuthorizationService.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AuthorizationService.java Wed Aug 29 13:59:10 2007
@@ -54,7 +54,6 @@
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.invocation.Invocation;
@@ -425,7 +424,7 @@
// perform checks below here for all non-admin users
SubentryService subentryService = ( SubentryService ) chain.get( StartupConfiguration.SUBENTRY_SERVICE_NAME );
Attributes subentryAttrs = subentryService.getSubentryAttributes( name, entry );
- NamingEnumeration attrList = entry.getAll();
+ NamingEnumeration<? extends Attribute> attrList = entry.getAll();
while ( attrList.hasMore() )
{
@@ -447,7 +446,7 @@
ADD_PERMS, tuples, subentryAttrs );
// now we must check if attribute type and value scope permission is granted
- NamingEnumeration attributeList = entry.getAll();
+ NamingEnumeration<? extends Attribute> attributeList = entry.getAll();
while ( attributeList.hasMore() )
{
@@ -684,7 +683,7 @@
LOOKUP_PERMS, tuples, entry );
// check that we have read access to every attribute type and value
- NamingEnumeration attributeList = entry.getAll();
+ NamingEnumeration<? extends Attribute> attributeList = entry.getAll();
while ( attributeList.hasMore() )
{
Attribute attr = ( Attribute ) attributeList.next();
@@ -824,7 +823,7 @@
// and access control subentry operational attributes.
SubentryService subentryService = ( SubentryService ) chain.get( StartupConfiguration.SUBENTRY_SERVICE_NAME );
Attributes subentryAttrs = subentryService.getSubentryAttributes( newName, importedEntry );
- NamingEnumeration attrList = importedEntry.getAll();
+ NamingEnumeration<? extends Attribute> attrList = importedEntry.getAll();
while ( attrList.hasMore() )
{
@@ -899,7 +898,7 @@
// and access control subentry operational attributes.
SubentryService subentryService = ( SubentryService ) chain.get( StartupConfiguration.SUBENTRY_SERVICE_NAME );
Attributes subentryAttrs = subentryService.getSubentryAttributes( newName, importedEntry );
- NamingEnumeration attrList = importedEntry.getAll();
+ NamingEnumeration<? extends Attribute> attrList = importedEntry.getAll();
while ( attrList.hasMore() )
{
@@ -919,12 +918,13 @@
groupCache.groupRenamed( oriChildName, newName );
}
- public NamingEnumeration list( NextInterceptor next, ListOperationContext opContext ) throws NamingException
+
+ public NamingEnumeration<SearchResult> list( NextInterceptor next, ListOperationContext opContext ) throws NamingException
{
Invocation invocation = InvocationStack.getInstance().peek();
ServerLdapContext ctx = ( ServerLdapContext ) invocation.getCaller();
LdapPrincipal user = ctx.getPrincipal();
- NamingEnumeration e = next.list( opContext );
+ NamingEnumeration<SearchResult> e = next.list( opContext );
if ( isPrincipalAnAdministrator( user.getJndiName() ) || !enabled )
{
@@ -1077,12 +1077,12 @@
* not allowed are removed from the attribute. If the attribute has no more
* values remaining then the entire attribute is removed.
*/
- NamingEnumeration idList = result.getAttributes().getIDs();
+ NamingEnumeration<String> idList = result.getAttributes().getIDs();
while ( idList.hasMore() )
{
// if attribute type scope access is not allowed then remove the attribute and continue
- String id = ( String ) idList.next();
+ String id = idList.next();
Attribute attr = result.getAttributes().get( id );
if ( !engine.hasPermission( invocation.getProxy(), userGroups, userDn, ctx.getPrincipal()
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=570931&r1=570930&r2=570931&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 Wed Aug 29 13:59:10 2007
@@ -47,7 +47,6 @@
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.invocation.Invocation;
@@ -528,9 +527,9 @@
}
- public NamingEnumeration list( NextInterceptor nextInterceptor, ListOperationContext opContext ) throws NamingException
+ public NamingEnumeration<SearchResult> list( NextInterceptor nextInterceptor, ListOperationContext opContext ) throws NamingException
{
- NamingEnumeration e = nextInterceptor.list( opContext );
+ NamingEnumeration<SearchResult> e = nextInterceptor.list( opContext );
if ( !enabled )
{
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java?rev=570931&r1=570930&r2=570931&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java Wed Aug 29 13:59:10 2007
@@ -75,7 +75,7 @@
private final PartitionNexus nexus;
/** the env to use for searching */
- private final Hashtable env;
+ private final Hashtable<?,?> env;
/** Stores a reference to the AttributeType registry */
private AttributeTypeRegistry attributeTypeRegistry;
@@ -105,7 +105,7 @@
{
normalizerMap = factoryCfg.getRegistries().getAttributeTypeRegistry().getNormalizerMapping();
nexus = factoryCfg.getPartitionNexus();
- env = ( Hashtable ) factoryCfg.getEnvironment().clone();
+ env = ( Hashtable<?,?> ) factoryCfg.getEnvironment().clone();
attributeTypeRegistry = factoryCfg.getRegistries().getAttributeTypeRegistry();
memberAT = attributeTypeRegistry.lookup( SchemaConstants.MEMBER_AT_OID );
@@ -135,11 +135,11 @@
filter.addNode( new SimpleNode( SchemaConstants.OBJECT_CLASS_AT, SchemaConstants.GROUP_OF_NAMES_OC, AssertionEnum.EQUALITY ) );
filter.addNode( new SimpleNode( SchemaConstants.OBJECT_CLASS_AT, SchemaConstants.GROUP_OF_UNIQUE_NAMES_OC, AssertionEnum.EQUALITY ) );
- Iterator suffixes = nexus.listSuffixes( null );
+ Iterator<String> suffixes = nexus.listSuffixes( null );
while ( suffixes.hasNext() )
{
- String suffix = ( String ) suffixes.next();
+ String suffix = suffixes.next();
LdapDN baseDn = new LdapDN( suffix );
SearchControls ctls = new SearchControls();
ctls.setSearchScope( SearchControls.SUBTREE_SCOPE );
@@ -255,7 +255,7 @@
* @param members the set of member values
* @throws NamingException if there are problems accessing the attr values
*/
- private void removeMembers( Set memberSet, Attribute members ) throws NamingException
+ private void removeMembers( Set<String> memberSet, Attribute members ) throws NamingException
{
for ( int ii = 0; ii < members.size(); ii++ )
{
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java?rev=570931&r1=570930&r2=570931&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java Wed Aug 29 13:59:10 2007
@@ -76,10 +76,10 @@
private static final Logger log = LoggerFactory.getLogger( TupleCache.class );
/** cloned startup environment properties we use for subentry searching */
- private final Hashtable env;
+ private final Hashtable<?,?> env;
/** a map of strings to ACITuple collections */
- private final Map<String,List> tuples = new HashMap<String,List>();
+ private final Map<String,List<ACITuple>> tuples = new HashMap<String,List<ACITuple>>();
/** a handle on the partition nexus */
private final PartitionNexus nexus;
@@ -111,7 +111,7 @@
OidRegistry oidRegistry = factoryCfg.getRegistries().getOidRegistry();
NameComponentNormalizer ncn = new ConcreteNameComponentNormalizer( attributeTypeRegistry, oidRegistry );
aciParser = new ACIItemParser( ncn, normalizerMap );
- env = ( Hashtable ) factoryCfg.getEnvironment().clone();
+ env = ( Hashtable<?,?> ) factoryCfg.getEnvironment().clone();
prescriptiveAciAT = attributeTypeRegistry.lookup( SchemaConstants.PRESCRIPTIVE_ACI_AT );
initialize();
}
@@ -130,11 +130,11 @@
// search all naming contexts for access control subentenries
// generate ACITuple Arrays for each subentry
// add that subentry to the hash
- Iterator suffixes = nexus.listSuffixes( null );
+ Iterator<String> suffixes = nexus.listSuffixes( null );
while ( suffixes.hasNext() )
{
- String suffix = ( String ) suffixes.next();
+ String suffix = suffixes.next();
LdapDN baseDn = parseNormalized( suffix );
ExprNode filter = new SimpleNode( SchemaConstants.OBJECT_CLASS_AT, SchemaConstants.ACCESS_CONTROL_SUBENTRY_OC, AssertionEnum.EQUALITY );
SearchControls ctls = new SearchControls();
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/ACDFEngine.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/ACDFEngine.java?rev=570931&r1=570930&r2=570931&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/ACDFEngine.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/ACDFEngine.java Wed Aug 29 13:59:10 2007
@@ -24,7 +24,6 @@
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
-import java.util.Iterator;
import javax.naming.NamingException;
import javax.naming.directory.Attributes;
@@ -192,9 +191,8 @@
aciTuples = new ArrayList<ACITuple>( aciTuples );
// Filter unrelated and invalid tuples
- for ( int i = 0; i < filters.length; i++ )
+ for ( ACITupleFilter filter : filters )
{
- ACITupleFilter filter = filters[i];
aciTuples = filter.filter( aciTuples, scope, proxy, userGroupNames, userName, userEntry,
authenticationLevel, entryName, attrId, attrValue, entry, microOperations );
}
@@ -207,9 +205,8 @@
// Grant access if and only if one or more tuples remain and
// all grant access. Otherwise deny access.
- for ( Iterator i = aciTuples.iterator(); i.hasNext(); )
+ for ( ACITuple tuple : aciTuples )
{
- ACITuple tuple = ( ACITuple ) i.next();
if ( !tuple.isGrant() )
{
return false;
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/HighestPrecedenceFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/HighestPrecedenceFilter.java?rev=570931&r1=570930&r2=570931&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/HighestPrecedenceFilter.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/HighestPrecedenceFilter.java Wed Aug 29 13:59:10 2007
@@ -74,9 +74,9 @@
}
// Remove all tuples whose precedences are not the maximum one.
- for ( Iterator i = tuples.iterator(); i.hasNext(); )
+ for ( Iterator<ACITuple> i = tuples.iterator(); i.hasNext(); )
{
- ACITuple tuple = ( ACITuple ) i.next();
+ ACITuple tuple = i.next();
if ( tuple.getPrecedence() != maxPrecedence )
{
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/MaxImmSubFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/MaxImmSubFilter.java?rev=570931&r1=570930&r2=570931&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/MaxImmSubFilter.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/MaxImmSubFilter.java Wed Aug 29 13:59:10 2007
@@ -98,17 +98,17 @@
int immSubCount = -1;
- for ( Iterator i = tuples.iterator(); i.hasNext(); )
+ for ( Iterator<ACITuple> i = tuples.iterator(); i.hasNext(); )
{
- ACITuple tuple = ( ACITuple ) i.next();
+ ACITuple tuple = i.next();
if ( !tuple.isGrant() )
{
continue;
}
- for ( Iterator j = tuple.getProtectedItems().iterator(); j.hasNext(); )
+ for ( Iterator<ProtectedItem> j = tuple.getProtectedItems().iterator(); j.hasNext(); )
{
- ProtectedItem item = ( ProtectedItem ) j.next();
+ ProtectedItem item = j.next();
if ( item instanceof ProtectedItem.MaxImmSub )
{
if ( immSubCount < 0 )
@@ -129,7 +129,7 @@
return tuples;
}
- public static final Collection SEARCH_BYPASS;
+ public static final Collection<String> SEARCH_BYPASS;
static
{
Collection<String> c = new HashSet<String>();
@@ -153,8 +153,8 @@
try
{
e = proxy.search(
- new SearchOperationContext( ( LdapDN ) entryName.getPrefix( 1 ), new HashMap(), childrenFilter, childrenSearchControls ),
- SEARCH_BYPASS );
+ new SearchOperationContext( ( LdapDN ) entryName.getPrefix( 1 ),
+ new HashMap<String,Object>(), childrenFilter, childrenSearchControls ), SEARCH_BYPASS );
while ( e.hasMore() )
{
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/MaxValueCountFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/MaxValueCountFilter.java?rev=570931&r1=570930&r2=570931&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/MaxValueCountFilter.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/MaxValueCountFilter.java Wed Aug 29 13:59:10 2007
@@ -70,17 +70,17 @@
return tuples;
}
- for ( Iterator i = tuples.iterator(); i.hasNext(); )
+ for ( Iterator<ACITuple> i = tuples.iterator(); i.hasNext(); )
{
- ACITuple tuple = ( ACITuple ) i.next();
+ ACITuple tuple = i.next();
if ( !tuple.isGrant() )
{
continue;
}
- for ( Iterator j = tuple.getProtectedItems().iterator(); j.hasNext(); )
+ for ( Iterator<ProtectedItem> j = tuple.getProtectedItems().iterator(); j.hasNext(); )
{
- ProtectedItem item = ( ProtectedItem ) j.next();
+ ProtectedItem item = j.next();
if ( item instanceof ProtectedItem.MaxValueCount )
{
ProtectedItem.MaxValueCount mvc = ( ProtectedItem.MaxValueCount ) item;
@@ -99,9 +99,9 @@
private boolean isRemovable( ProtectedItem.MaxValueCount mvc, String attrId, Attributes entry )
{
- for ( Iterator k = mvc.iterator(); k.hasNext(); )
+ for ( Iterator<ProtectedItem.MaxValueCountItem> k = mvc.iterator(); k.hasNext(); )
{
- MaxValueCountItem mvcItem = ( MaxValueCountItem ) k.next();
+ MaxValueCountItem mvcItem = k.next();
if ( attrId.equalsIgnoreCase( mvcItem.getAttributeType() ) )
{
Attribute attr = entry.get( attrId );
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/MicroOperationFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/MicroOperationFilter.java?rev=570931&r1=570930&r2=570931&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/MicroOperationFilter.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/MicroOperationFilter.java Wed Aug 29 13:59:10 2007
@@ -63,9 +63,9 @@
return tuples;
}
- for ( Iterator i = tuples.iterator(); i.hasNext(); )
+ for ( Iterator<ACITuple> i = tuples.iterator(); i.hasNext(); )
{
- ACITuple tuple = ( ACITuple ) i.next();
+ ACITuple tuple = i.next();
/*
* The ACITuple must contain all the MicroOperations specified within the
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java?rev=570931&r1=570930&r2=570931&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java Wed Aug 29 13:59:10 2007
@@ -89,9 +89,9 @@
return tuples;
}
- for ( Iterator i = tuples.iterator(); i.hasNext(); )
+ for ( Iterator<ACITuple> i = tuples.iterator(); i.hasNext(); )
{
- ACITuple tuple = ( ACITuple ) i.next();
+ ACITuple tuple = i.next();
if ( !isRelated( tuple, scope, userName, entryName, attrId, attrValue, entry ) )
{
i.remove();
@@ -111,9 +111,8 @@
oid = oidRegistry.getOid( attrId );
}
- for ( Iterator i = tuple.getProtectedItems().iterator(); i.hasNext(); )
+ for ( ProtectedItem item : tuple.getProtectedItems() )
{
- ProtectedItem item = ( ProtectedItem ) i.next();
if ( item == ProtectedItem.ENTRY )
{
if ( scope == OperationScope.ENTRY )
@@ -147,9 +146,9 @@
}
ProtectedItem.AllAttributeValues aav = ( ProtectedItem.AllAttributeValues ) item;
- for ( Iterator j = aav.iterator(); j.hasNext(); )
+ for ( Iterator<String> j = aav.iterator(); j.hasNext(); )
{
- if ( oid.equals( oidRegistry.getOid( ( String ) j.next() ) ) )
+ if ( oid.equals( oidRegistry.getOid( j.next() ) ) )
{
return true;
}
@@ -163,9 +162,9 @@
}
ProtectedItem.AttributeType at = ( ProtectedItem.AttributeType ) item;
- for ( Iterator j = at.iterator(); j.hasNext(); )
+ for ( Iterator<String> j = at.iterator(); j.hasNext(); )
{
- if ( oid.equals( oidRegistry.getOid( ( String ) j.next() ) ) )
+ if ( oid.equals( oidRegistry.getOid( j.next() ) ) )
{
return true;
}
@@ -179,9 +178,9 @@
}
ProtectedItem.AttributeValue av = ( ProtectedItem.AttributeValue ) item;
- for ( Iterator j = av.iterator(); j.hasNext(); )
+ for ( Iterator<Attribute> j = av.iterator(); j.hasNext(); )
{
- Attribute attr = ( Attribute ) j.next();
+ Attribute attr = j.next();
String attrOid = oidRegistry.getOid( attr.getID() );
AttributeType attrType = attrRegistry.lookup( attrOid );
@@ -211,7 +210,7 @@
}
ProtectedItem.MaxValueCount mvc = ( ProtectedItem.MaxValueCount ) item;
- for ( Iterator j = mvc.iterator(); j.hasNext(); )
+ for ( Iterator<MaxValueCountItem> j = mvc.iterator(); j.hasNext(); )
{
MaxValueCountItem mvcItem = ( MaxValueCountItem ) j.next();
if ( oid.equals( oidRegistry.getOid( mvcItem.getAttributeType() ) ) )
@@ -236,7 +235,7 @@
}
ProtectedItem.RestrictedBy rb = ( ProtectedItem.RestrictedBy ) item;
- for ( Iterator j = rb.iterator(); j.hasNext(); )
+ for ( Iterator<RestrictedByItem> j = rb.iterator(); j.hasNext(); )
{
RestrictedByItem rbItem = ( RestrictedByItem ) j.next();
if ( oid.equals( oidRegistry.getOid( rbItem.getAttributeType() ) ) )
@@ -253,9 +252,9 @@
}
ProtectedItem.SelfValue sv = ( ProtectedItem.SelfValue ) item;
- for ( Iterator j = sv.iterator(); j.hasNext(); )
+ for ( Iterator<String> j = sv.iterator(); j.hasNext(); )
{
- String svItem = String.valueOf( j.next() );
+ String svItem = j.next();
if ( oid.equals( oidRegistry.getOid( svItem ) ) )
{
AttributeType attrType = attrRegistry.lookup( oid );
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedUserClassFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedUserClassFilter.java?rev=570931&r1=570930&r2=570931&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedUserClassFilter.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedUserClassFilter.java Wed Aug 29 13:59:10 2007
@@ -76,15 +76,15 @@
return tuples;
}
- for ( Iterator i = tuples.iterator(); i.hasNext(); )
+ for ( Iterator<ACITuple> ii = tuples.iterator(); ii.hasNext(); )
{
- ACITuple tuple = ( ACITuple ) i.next();
+ ACITuple tuple = ii.next();
if ( tuple.isGrant() )
{
if ( !isRelated( userGroupNames, userName, userEntry, entryName, tuple.getUserClasses() )
|| authenticationLevel.compareTo( tuple.getAuthenticationLevel() ) < 0 )
{
- i.remove();
+ ii.remove();
}
}
else
@@ -93,7 +93,7 @@
if ( !isRelated( userGroupNames, userName, userEntry, entryName, tuple.getUserClasses() )
&& authenticationLevel.compareTo( tuple.getAuthenticationLevel() ) >= 0 )
{
- i.remove();
+ ii.remove();
}
}
}
@@ -102,12 +102,11 @@
}
- private boolean isRelated( Collection userGroupNames, LdapDN userName, Attributes userEntry, LdapDN entryName,
- Collection userClasses ) throws NamingException
+ private boolean isRelated( Collection<LdapDN> userGroupNames, LdapDN userName, Attributes userEntry,
+ LdapDN entryName, Collection<UserClass> userClasses ) throws NamingException
{
- for ( Iterator i = userClasses.iterator(); i.hasNext(); )
+ for ( UserClass userClass : userClasses )
{
- UserClass userClass = ( UserClass ) i.next();
if ( userClass == UserClass.ALL_USERS )
{
return true;
@@ -130,9 +129,8 @@
else if ( userClass instanceof UserClass.UserGroup )
{
UserClass.UserGroup userGroupUserClass = ( UserClass.UserGroup ) userClass;
- for ( Iterator j = userGroupNames.iterator(); j.hasNext(); )
+ for ( LdapDN userGroupName : userGroupNames )
{
- LdapDN userGroupName = ( LdapDN ) j.next();
if ( userGroupName != null && userGroupUserClass.getNames().contains( userGroupName ) )
{
return true;
@@ -160,9 +158,8 @@
private boolean matchUserClassSubtree( LdapDN userName, Attributes userEntry, UserClass.Subtree subtree )
throws NamingException
{
- for ( Iterator i = subtree.getSubtreeSpecifications().iterator(); i.hasNext(); )
+ for ( SubtreeSpecification subtreeSpec : subtree.getSubtreeSpecifications() )
{
- SubtreeSpecification subtreeSpec = ( SubtreeSpecification ) i.next();
if ( subtreeEvaluator.evaluate( subtreeSpec, ROOTDSE_NAME, userName, userEntry ) )
{
return true;
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/RestrictedByFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/RestrictedByFilter.java?rev=570931&r1=570930&r2=570931&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/RestrictedByFilter.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/RestrictedByFilter.java Wed Aug 29 13:59:10 2007
@@ -70,10 +70,9 @@
return tuples;
}
- for ( Iterator i = tuples.iterator(); i.hasNext(); )
+ for ( Iterator<ACITuple> ii = tuples.iterator() ; ii.hasNext(); )
{
- ACITuple tuple = ( ACITuple ) i.next();
-
+ ACITuple tuple = ii.next();
if ( !tuple.isGrant() )
{
continue;
@@ -81,7 +80,7 @@
if ( isRemovable( tuple, attrId, attrValue, entry ) )
{
- i.remove();
+ ii.remove();
}
}
@@ -91,13 +90,13 @@
public boolean isRemovable( ACITuple tuple, String attrId, Object attrValue, Attributes entry )
{
- for ( ProtectedItem item:tuple.getProtectedItems() )
+ for ( ProtectedItem item : tuple.getProtectedItems() )
{
if ( item instanceof ProtectedItem.RestrictedBy )
{
ProtectedItem.RestrictedBy rb = ( ProtectedItem.RestrictedBy ) item;
- for ( Iterator k = rb.iterator(); k.hasNext(); )
+ for ( Iterator<RestrictedByItem> k = rb.iterator(); k.hasNext(); )
{
RestrictedByItem rbItem = ( RestrictedByItem ) k.next();
@@ -118,5 +117,4 @@
return false;
}
-
}
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=570931&r1=570930&r2=570931&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 Wed Aug 29 13:59:10 2007
@@ -41,7 +41,6 @@
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.OperationContext;
import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
import org.apache.directory.server.core.invocation.Invocation;
import org.apache.directory.server.core.invocation.InvocationStack;
@@ -188,11 +187,11 @@
String subentryDnStr = ( String ) caSubentries.get( ii );
LdapDN subentryDn = new LdapDN( subentryDnStr );
Attributes subentry = nexus.lookup( new LookupOperationContext( subentryDn ) );
- NamingEnumeration attrIds = subentry.getIDs();
+ NamingEnumeration<String> attrIds = subentry.getIDs();
while ( attrIds.hasMore() )
{
- String attrId = ( String ) attrIds.next();
+ String attrId = attrIds.next();
AttributeType attrType = attrTypeRegistry.lookup( attrId );
if ( !attrType.isCollective() )
@@ -209,12 +208,12 @@
continue;
}
- Set allSuperTypes = getAllSuperTypes( attrType );
- Iterator it = retIdsSet.iterator();
+ Set<AttributeType> allSuperTypes = getAllSuperTypes( attrType );
+ Iterator<String> it = retIdsSet.iterator();
while ( it.hasNext() )
{
- String retId = ( String ) it.next();
+ String retId = it.next();
if ( retId.equals( SchemaConstants.ALL_USER_ATTRIBUTES ) || retId.equals( SchemaConstants.ALL_OPERATIONAL_ATTRIBUTES ) )
{
@@ -264,7 +263,7 @@
}
- private Set getAllSuperTypes( AttributeType id ) throws NamingException
+ private Set<AttributeType> getAllSuperTypes( AttributeType id ) throws NamingException
{
Set<AttributeType> allSuperTypes = new HashSet<AttributeType>();
AttributeType superType = id;
@@ -308,9 +307,9 @@
}
- public NamingEnumeration list( NextInterceptor nextInterceptor, ListOperationContext opContext ) throws NamingException
+ public NamingEnumeration<SearchResult> list( NextInterceptor nextInterceptor, ListOperationContext opContext ) throws NamingException
{
- NamingEnumeration e = nextInterceptor.list( opContext );
+ NamingEnumeration<SearchResult> e = nextInterceptor.list( opContext );
Invocation invocation = InvocationStack.getInstance().peek();
return new SearchResultFilteringEnumeration( e, new SearchControls(), invocation, SEARCH_FILTER, "List collective Filter" );
}
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributesSchemaChecker.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributesSchemaChecker.java?rev=570931&r1=570930&r2=570931&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributesSchemaChecker.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributesSchemaChecker.java Wed Aug 29 13:59:10 2007
@@ -79,12 +79,12 @@
public void checkModify( LdapDN normName, int modOp, Attributes mods ) throws NamingException
{
ModificationItemImpl[] modsAsArray = new ModificationItemImpl[ mods.size() ];
- NamingEnumeration allAttrs = mods.getAll();
+ NamingEnumeration<? extends Attribute> allAttrs = mods.getAll();
int i = 0;
while ( allAttrs.hasMoreElements() )
{
- Attribute attr = ( Attribute ) allAttrs.nextElement();
+ Attribute attr = allAttrs.nextElement();
modsAsArray[i] = new ModificationItemImpl( modOp, attr );
i++;
}
@@ -138,11 +138,11 @@
private boolean containsAnyCollectiveAttributes( Attributes entry ) throws NamingException
{
- NamingEnumeration allIDs = entry.getIDs();
+ NamingEnumeration<String> allIDs = entry.getIDs();
while ( allIDs.hasMoreElements() )
{
- String attrTypeStr = ( String ) allIDs.nextElement();
+ String attrTypeStr = allIDs.nextElement();
AttributeType attrType = attrTypeRegistry.lookup( attrTypeStr );
if ( attrType.isCollective() )
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/enumeration/ReferralHandlingEnumeration.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/enumeration/ReferralHandlingEnumeration.java?rev=570931&r1=570930&r2=570931&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/enumeration/ReferralHandlingEnumeration.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/enumeration/ReferralHandlingEnumeration.java Wed Aug 29 13:59:10 2007
@@ -56,7 +56,7 @@
{
private final Logger log = LoggerFactory.getLogger( ReferralHandlingEnumeration.class );
private final List<SearchResult> referrals = new ArrayList<SearchResult>();
- private final NamingEnumeration underlying;
+ private final NamingEnumeration<SearchResult> underlying;
private final ReferralLut lut;
private final PartitionNexus nexus;
private final boolean doThrow;
@@ -69,8 +69,8 @@
*/
private Map<String, OidNormalizer> normalizerMap;
- public ReferralHandlingEnumeration( NamingEnumeration underlying, ReferralLut lut, AttributeTypeRegistry registry,
- PartitionNexus nexus, int scope, boolean doThrow ) throws NamingException
+ public ReferralHandlingEnumeration( NamingEnumeration<SearchResult> underlying, ReferralLut lut,
+ AttributeTypeRegistry registry, PartitionNexus nexus, int scope, boolean doThrow ) throws NamingException
{
normalizerMap = registry.getNormalizerMapping();
this.underlying = underlying;
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/enumeration/SearchResultEnumeration.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/enumeration/SearchResultEnumeration.java?rev=570931&r1=570930&r2=570931&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/enumeration/SearchResultEnumeration.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/enumeration/SearchResultEnumeration.java Wed Aug 29 13:59:10 2007
@@ -21,6 +21,7 @@
import javax.naming.NamingEnumeration;
+import javax.naming.directory.SearchResult;
/**
@@ -29,6 +30,6 @@
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
* @version $Rev$
*/
-public interface SearchResultEnumeration extends NamingEnumeration
+public interface SearchResultEnumeration extends NamingEnumeration<SearchResult>
{
}
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/enumeration/SearchResultFilteringEnumeration.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/enumeration/SearchResultFilteringEnumeration.java?rev=570931&r1=570930&r2=570931&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/enumeration/SearchResultFilteringEnumeration.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/enumeration/SearchResultFilteringEnumeration.java Wed Aug 29 13:59:10 2007
@@ -53,16 +53,16 @@
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
* @version $Rev$
*/
-public class SearchResultFilteringEnumeration implements NamingEnumeration, AbandonListener
+public class SearchResultFilteringEnumeration implements NamingEnumeration<SearchResult>, AbandonListener
{
/** the logger used by this class */
private static final Logger log = LoggerFactory.getLogger( SearchResultFilteringEnumeration.class );
/** the list of filters to be applied */
- private final List filters;
+ private final List<SearchResultFilter> filters;
/** the underlying decorated enumeration */
- private final NamingEnumeration decorated;
+ private final NamingEnumeration<SearchResult> decorated;
/** the first accepted search result that is prefetched */
private SearchResult prefetched;
@@ -98,12 +98,12 @@
* creating this enumeration
* @param invocation the invocation representing the seach that created this enumeration
*/
- public SearchResultFilteringEnumeration( NamingEnumeration decorated, SearchControls searchControls,
+ public SearchResultFilteringEnumeration( NamingEnumeration<SearchResult> decorated, SearchControls searchControls,
Invocation invocation, SearchResultFilter filter, String name ) throws NamingException
{
this.searchControls = searchControls;
this.invocation = invocation;
- this.filters = new ArrayList();
+ this.filters = new ArrayList<SearchResultFilter>();
this.filters.add( filter );
this.decorated = decorated;
this.applyObjectFactories = invocation.getCaller().getEnvironment().containsKey( Context.OBJECT_FACTORIES );
@@ -128,12 +128,12 @@
* creating this enumeration
* @param invocation the invocation representing the seach that created this enumeration
*/
- public SearchResultFilteringEnumeration( NamingEnumeration decorated, SearchControls searchControls,
- Invocation invocation, List filters, String name ) throws NamingException
+ public SearchResultFilteringEnumeration( NamingEnumeration<SearchResult> decorated, SearchControls searchControls,
+ Invocation invocation, List<SearchResultFilter> filters, String name ) throws NamingException
{
this.searchControls = searchControls;
this.invocation = invocation;
- this.filters = new ArrayList();
+ this.filters = new ArrayList<SearchResultFilter>();
this.filters.addAll( filters );
this.decorated = decorated;
this.applyObjectFactories = invocation.getCaller().getEnvironment().containsKey( Context.OBJECT_FACTORIES );
@@ -186,7 +186,7 @@
*
* @return the result of {@link Collections#unmodifiableList(List)}
*/
- public List getFilters()
+ public List<SearchResultFilter> getFilters()
{
return Collections.unmodifiableList( filters );
}
@@ -209,7 +209,7 @@
}
- public Object next() throws NamingException
+ public SearchResult next() throws NamingException
{
SearchResult retVal = this.prefetched;
prefetch();
@@ -227,7 +227,7 @@
}
- public Object nextElement()
+ public SearchResult nextElement()
{
SearchResult retVal = this.prefetched;
@@ -248,6 +248,7 @@
// Private utility methods
// ------------------------------------------------------------------------
+
private void applyObjectFactories( SearchResult result ) throws NamingException
{
// if already populated or no factories are available just return
@@ -257,7 +258,7 @@
}
DirContext ctx = ( DirContext ) invocation.getCaller();
- Hashtable env = ctx.getEnvironment();
+ Hashtable<?,?> env = ctx.getEnvironment();
Attributes attrs = result.getAttributes();
Name name = new LdapDN( result.getName() );
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=570931&r1=570930&r2=570931&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 Wed Aug 29 13:59:10 2007
@@ -50,7 +50,6 @@
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.invocation.Invocation;
import org.apache.directory.server.core.invocation.InvocationStack;
@@ -69,6 +68,7 @@
import org.apache.directory.shared.ldap.message.ModificationItemImpl;
import org.apache.directory.shared.ldap.name.LdapDN;
import org.apache.directory.shared.ldap.name.NameComponentNormalizer;
+
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -85,7 +85,7 @@
private static Logger log = LoggerFactory.getLogger( EventService.class );
private PartitionNexus nexus;
- private Map sources = new HashMap();
+ private Map<NamingListener, Object> sources = new HashMap<NamingListener, Object>();
private Evaluator evaluator = null;
private AttributeTypeRegistry attributeRegistry;
private NormalizingVisitor visitor;
@@ -187,14 +187,14 @@
}
else if ( obj instanceof EventSourceRecord )
{
- List list = new ArrayList();
+ List<Object> list = new ArrayList<Object>();
list.add( obj );
list.add( rec );
sources.put( namingListener, list );
}
else if ( obj instanceof List )
{
- List list = ( List ) obj;
+ List<Object> list = ( List ) obj;
list.add( rec );
}
}
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/BaseInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/BaseInterceptor.java?rev=570931&r1=570930&r2=570931&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/BaseInterceptor.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/BaseInterceptor.java Wed Aug 29 13:59:10 2007
@@ -47,7 +47,6 @@
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;
@@ -150,13 +149,15 @@
}
- public NamingEnumeration list( NextInterceptor next, ListOperationContext opContext ) throws NamingException
+ public NamingEnumeration<SearchResult> list( NextInterceptor next, ListOperationContext opContext )
+ throws NamingException
{
return next.list( opContext );
}
- public Iterator listSuffixes ( NextInterceptor next, ListSuffixOperationContext opContext ) throws NamingException
+ public Iterator<String> listSuffixes ( NextInterceptor next, ListSuffixOperationContext opContext )
+ throws NamingException
{
return next.listSuffixes( opContext );
}
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=570931&r1=570930&r2=570931&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 Wed Aug 29 13:59:10 2007
@@ -42,7 +42,6 @@
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;
@@ -50,6 +49,7 @@
import org.apache.directory.server.core.partition.PartitionNexus;
import org.apache.directory.shared.ldap.name.LdapDN;
+
/**
* Represents the next {@link Interceptor} in the interceptor chain.
*
@@ -87,7 +87,7 @@
/**
* Calls the next interceptor's {@link Interceptor#listSuffixes( NextInterceptor, ListSuffixOperationContext )}.
*/
- Iterator listSuffixes( ListSuffixOperationContext opContext ) throws NamingException;
+ Iterator<String> listSuffixes( ListSuffixOperationContext opContext ) throws NamingException;
/**
@@ -122,7 +122,7 @@
/**
* Calls the next interceptor's {@link Interceptor#list( NextInterceptor, ListOperationContext )}.
*/
- NamingEnumeration list( ListOperationContext opContext ) throws NamingException;
+ NamingEnumeration<SearchResult> list( ListOperationContext opContext ) throws NamingException;
/**
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeSearchResultEnumeration.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeSearchResultEnumeration.java?rev=570931&r1=570930&r2=570931&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeSearchResultEnumeration.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeSearchResultEnumeration.java Wed Aug 29 13:59:10 2007
@@ -21,11 +21,13 @@
import java.util.Iterator;
+import java.util.NoSuchElementException;
import javax.naming.NamingEnumeration;
import javax.naming.NamingException;
import javax.naming.directory.Attribute;
import javax.naming.directory.Attributes;
+import javax.naming.directory.SearchResult;
import org.apache.directory.server.core.enumeration.SearchResultEnumeration;
import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
@@ -54,7 +56,7 @@
/** the attributes to return */
private final String[] attrIds;
/** underlying enumeration over IndexRecords */
- private final NamingEnumeration underlying;
+ private final NamingEnumeration<IndexRecord> underlying;
private boolean attrIdsHasStar = false;
private boolean attrIdsHasPlus = false;
@@ -68,7 +70,7 @@
* @param attrIds the returned attributes
* @param underlying the enumeration over IndexRecords
*/
- public BTreeSearchResultEnumeration(String[] attrIds, NamingEnumeration underlying, BTreePartition db,
+ public BTreeSearchResultEnumeration(String[] attrIds, NamingEnumeration<IndexRecord> underlying, BTreePartition db,
AttributeTypeRegistry registry)
{
this.partition = db;
@@ -101,9 +103,9 @@
/**
* @see javax.naming.NamingEnumeration#next()
*/
- public Object next() throws NamingException
+ public SearchResult next() throws NamingException
{
- IndexRecord rec = ( IndexRecord ) underlying.next();
+ IndexRecord rec = underlying.next();
Attributes entry;
String name = partition.getEntryUpdn( (Long)rec.getEntryId() );
@@ -291,8 +293,18 @@
/**
* @see java.util.Enumeration#nextElement()
*/
- public Object nextElement()
+ public SearchResult nextElement()
{
- return underlying.nextElement();
+ try
+ {
+ return next();
+ }
+ catch ( NamingException e )
+ {
+ NoSuchElementException nsee =
+ new NoSuchElementException( "Encountered NamingException on underlying enumeration." );
+ nsee.initCause( e );
+ throw nsee;
+ }
}
}
Modified: directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/Registries.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/Registries.java?rev=570931&r1=570930&r2=570931&view=diff
==============================================================================
--- directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/Registries.java (original)
+++ directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/Registries.java Wed Aug 29 13:59:10 2007
@@ -73,7 +73,7 @@
SyntaxRegistry getSyntaxRegistry();
- List checkRefInteg();
+ List<Throwable> checkRefInteg();
Schema getSchema( String schemaName );
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ProtectedItem.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ProtectedItem.java?rev=570931&r1=570930&r2=570931&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ProtectedItem.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ProtectedItem.java Wed Aug 29 13:59:10 2007
@@ -225,37 +225,24 @@
*/
private abstract static class AttributeTypeProtectedItem extends ProtectedItem
{
- protected final Collection attributeTypes;
+ protected final Collection<String> attributeTypes;
/**
* Creates a new instance.
*
- * @param attributeTypes
- * the collection of attirbute IDs
+ * @param attributeTypes the collection of attirbute IDs
*/
- protected AttributeTypeProtectedItem(Collection attributeTypes)
+ protected AttributeTypeProtectedItem( Collection<String> attributeTypes )
{
- Collection tmp = new ArrayList();
- for ( Iterator i = attributeTypes.iterator(); i.hasNext(); )
- {
- Object val = i.next();
- if ( !String.class.isAssignableFrom( val.getClass() ) )
- {
- throw new IllegalArgumentException( "attributeTypes contains an element which is not a string." );
- }
-
- tmp.add( ( ( String ) val ).toLowerCase() );
- }
-
- this.attributeTypes = Collections.unmodifiableCollection( tmp );
+ this.attributeTypes = Collections.unmodifiableCollection( attributeTypes );
}
/**
* Returns an iterator of all attribute IDs.
*/
- public Iterator iterator()
+ public Iterator<String> iterator()
{
return attributeTypes.iterator();
}
@@ -288,7 +275,7 @@
buffer.append( '{' );
buffer.append( ' ' );
- for ( Iterator it = attributeTypes.iterator(); it.hasNext(); )
+ for ( Iterator<String> it = attributeTypes.iterator(); it.hasNext(); )
{
String attributeType = ( String ) it.next();
buffer.append( attributeType );
@@ -319,7 +306,7 @@
* @param attributeTypes
* the collection of attribute IDs.
*/
- public AttributeType(Collection attributeTypes)
+ public AttributeType( Collection<String> attributeTypes )
{
super( attributeTypes );
}
@@ -353,7 +340,7 @@
* @param attributeTypes
* the collection of attribute IDs.
*/
- public AllAttributeValues(Collection attributeTypes)
+ public AllAttributeValues( Collection<String> attributeTypes )
{
super( attributeTypes );
}
@@ -389,10 +376,9 @@
/**
* Creates a new instance.
*
- * @param attributeTypes
- * the collection of attribute IDs.
+ * @param attributeTypes the collection of attribute IDs.
*/
- public SelfValue(Collection attributeTypes)
+ public SelfValue( Collection<String> attributeTypes )
{
super( attributeTypes );
}
@@ -418,8 +404,7 @@
public static class AttributeValue extends ProtectedItem
{
private static final long serialVersionUID = -258318397837951363L;
-
- private final Collection attributes;
+ private final Collection<Attribute> attributes;
/**
@@ -428,23 +413,16 @@
* @param attributes
* the collection of {@link Attribute}s.
*/
- public AttributeValue(Collection attributes)
+ public AttributeValue( Collection<Attribute> attributes )
{
- for ( Iterator i = attributes.iterator(); i.hasNext(); )
- {
- if ( !Attribute.class.isAssignableFrom( i.next().getClass() ) )
- {
- throw new IllegalArgumentException( "attributeTypes contains an element which is not an attribute." );
- }
- }
- this.attributes = Collections.unmodifiableCollection( new ArrayList( attributes ) );
+ this.attributes = Collections.unmodifiableCollection( attributes );
}
/**
* Returns an iterator of all {@link Attribute}s.
*/
- public Iterator iterator()
+ public Iterator<Attribute> iterator()
{
return attributes.iterator();
}
@@ -481,9 +459,9 @@
buffer.append( '{' );
buffer.append( ' ' );
- for ( Iterator it = attributes.iterator(); it.hasNext(); )
+ for ( Iterator<Attribute> it = attributes.iterator(); it.hasNext(); )
{
- Attribute attribute = ( Attribute ) it.next();
+ Attribute attribute = it.next();
buffer.append( attribute.getID() );
buffer.append( '=' );
try
@@ -519,7 +497,7 @@
{
private static final long serialVersionUID = 5261651541488944572L;
- private final Collection items;
+ private final Collection<ProtectedItem.MaxValueCountItem> items;
/**
@@ -528,9 +506,9 @@
* @param items
* the collection of {@link MaxValueCountItem}s.
*/
- public MaxValueCount(Collection items)
+ public MaxValueCount( Collection<MaxValueCountItem> items )
{
- for ( Iterator i = items.iterator(); i.hasNext(); )
+ for ( Iterator<MaxValueCountItem> i = items.iterator(); i.hasNext(); )
{
if ( !MaxValueCountItem.class.isAssignableFrom( i.next().getClass() ) )
{
@@ -538,14 +516,14 @@
}
}
- this.items = Collections.unmodifiableCollection( new ArrayList( items ) );
+ this.items = Collections.unmodifiableCollection( new ArrayList<MaxValueCountItem>( items ) );
}
/**
* Returns an iterator of all {@link MaxValueCountItem}s.
*/
- public Iterator iterator()
+ public Iterator<MaxValueCountItem> iterator()
{
return items.iterator();
}
@@ -582,9 +560,9 @@
buffer.append( '{' );
buffer.append( ' ' );
- for ( Iterator it = items.iterator(); it.hasNext(); )
+ for ( Iterator<MaxValueCountItem> it = items.iterator(); it.hasNext(); )
{
- MaxValueCountItem item = ( MaxValueCountItem ) it.next();
+ MaxValueCountItem item = it.next();
item.printToBuffer( buffer );
if(it.hasNext()) {
@@ -751,34 +729,24 @@
public static class RestrictedBy extends ProtectedItem
{
private static final long serialVersionUID = -8157637446588058799L;
-
- private final Collection items;
+ private final Collection<RestrictedByItem> items;
/**
* Creates a new instance.
*
- * @param items
- * the collection of {@link RestrictedByItem}s.
+ * @param items the collection of {@link RestrictedByItem}s.
*/
- public RestrictedBy(Collection items)
+ public RestrictedBy( Collection<RestrictedByItem> items)
{
- for ( Iterator i = items.iterator(); i.hasNext(); )
- {
- if ( !RestrictedByItem.class.isAssignableFrom( i.next().getClass() ) )
- {
- throw new IllegalArgumentException( "RestrictedBy items contains a wrong element." );
- }
- }
-
- this.items = Collections.unmodifiableCollection( new ArrayList( items ) );
+ this.items = Collections.unmodifiableCollection( items );
}
/**
* Returns an iterator of all {@link RestrictedByItem}s.
*/
- public Iterator iterator()
+ public Iterator<RestrictedByItem> iterator()
{
return items.iterator();
}
@@ -815,9 +783,9 @@
buffer.append( '{' );
buffer.append( ' ' );
- for ( Iterator it = items.iterator(); it.hasNext(); )
+ for ( Iterator<RestrictedByItem> it = items.iterator(); it.hasNext(); )
{
- RestrictedByItem item = ( RestrictedByItem ) it.next();
+ RestrictedByItem item = it.next();
item.printToBuffer( buffer );
if(it.hasNext()) {