directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r570258 - in /directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core: ./ configuration/ interceptor/ partition/
Date Mon, 27 Aug 2007 22:16:14 GMT
Author: akarasulu
Date: Mon Aug 27 15:16:13 2007
New Revision: 570258

URL: http://svn.apache.org/viewvc?rev=570258&view=rev
Log:
changes ...

 o cleaning up some warning due to generics
 o found a couple bugs here and there due to refactoring by hand
 o removed unnecessary type safty code which is no longer needed thanks to 
   generics


Removed:
    directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/configuration/ConfigurationUtil.java
Modified:
    directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
    directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/DirectoryServiceConfiguration.java
    directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/configuration/AttributesPropertyEditor.java
    directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/configuration/MutableStartupConfiguration.java
    directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/configuration/PartitionConfiguration.java
    directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/configuration/StartupConfiguration.java
    directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/interceptor/Interceptor.java
    directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java
    directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/partition/AbstractPartition.java
    directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
    directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/partition/Partition.java
    directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexus.java
    directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexusProxy.java

Modified: directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java?rev=570258&r1=570257&r2=570258&view=diff
==============================================================================
--- directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
(original)
+++ directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
Mon Aug 27 15:16:13 2007
@@ -742,7 +742,7 @@
     }
 
 
-    private void createTestEntries( Hashtable env ) throws NamingException
+    private void createTestEntries( Hashtable<String,Object> env ) throws NamingException
     {
         String principal = AbstractContextFactory.getPrincipal( env );
         byte[] credential = AbstractContextFactory.getCredential( env );

Modified: directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/DirectoryServiceConfiguration.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/DirectoryServiceConfiguration.java?rev=570258&r1=570257&r2=570258&view=diff
==============================================================================
--- directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/DirectoryServiceConfiguration.java
(original)
+++ directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/DirectoryServiceConfiguration.java
Mon Aug 27 15:16:13 2007
@@ -61,7 +61,7 @@
     /**
      * Returns the initial context environment of the {@link DirectoryService}.
      */
-    Hashtable getEnvironment();
+    Hashtable<String,Object> getEnvironment();
 
 
     /**

Modified: directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/configuration/AttributesPropertyEditor.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/configuration/AttributesPropertyEditor.java?rev=570258&r1=570257&r2=570258&view=diff
==============================================================================
--- directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/configuration/AttributesPropertyEditor.java
(original)
+++ directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/configuration/AttributesPropertyEditor.java
Mon Aug 27 15:16:13 2007
@@ -33,7 +33,6 @@
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
 
-import org.apache.commons.collections.MultiHashMap;
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.shared.ldap.ldif.LdifComposer;
 import org.apache.directory.shared.ldap.ldif.LdifComposerImpl;
@@ -74,13 +73,15 @@
     /**
      * Returns LDIF string of {@link Attributes} object.
      */
+    @SuppressWarnings("deprecation")
     public String getAsText()
     {
         LdifComposer composer = new LdifComposerImpl();
         MultiMap map = new MultiMap()
         {
             // FIXME Stop forking commons-collections.
-            private final MultiHashMap map = new MultiHashMap();
+            private final org.apache.commons.collections.MultiHashMap map = 
+                new org.apache.commons.collections.MultiHashMap();
 
             public Object remove( Object arg0, Object arg1 )
             {
@@ -112,7 +113,8 @@
                 return map.remove( arg0 );
             }
 
-            public Collection values()
+            @SuppressWarnings("unchecked")
+            public Collection<Object> values()
             {
                 return map.values();
             }
@@ -127,6 +129,7 @@
                 return map.containsKey( key );
             }
 
+            @SuppressWarnings("unchecked")
             public void putAll( Map arg0 )
             {
                 map.putAll( arg0 );
@@ -137,12 +140,12 @@
                 map.clear();
             }
 
-            public Set keySet()
+            public Set<?> keySet()
             {
                 return map.keySet();
             }
 
-            public Set entrySet()
+            public Set<?> entrySet()
             {
                 return map.entrySet();
             }
@@ -151,11 +154,11 @@
         Attributes attrs = (Attributes) getValue();
         try
         {
-            NamingEnumeration e = attrs.getAll();
+            NamingEnumeration<? extends Attribute> e = attrs.getAll();
             while ( e.hasMore() )
             {
-                Attribute attr = (Attribute) e.next();
-                NamingEnumeration e2 = attr.getAll();
+                Attribute attr = e.next();
+                NamingEnumeration<? extends Object> e2 = attr.getAll();
                 while ( e2.hasMoreElements() )
                 {
                     Object value = e2.next();

Modified: directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/configuration/MutableStartupConfiguration.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/configuration/MutableStartupConfiguration.java?rev=570258&r1=570257&r2=570258&view=diff
==============================================================================
--- directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/configuration/MutableStartupConfiguration.java
(original)
+++ directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/configuration/MutableStartupConfiguration.java
Mon Aug 27 15:16:13 2007
@@ -24,6 +24,8 @@
 import java.util.List;
 import java.util.Set;
 
+import org.apache.directory.shared.ldap.ldif.Entry;
+
 
 /**
  * A mutable version of {@link StartupConfiguration}.
@@ -96,13 +98,13 @@
     }
 
 
-    public void setInterceptorConfigurations( List interceptorConfigurations )
+    public void setInterceptorConfigurations( List<InterceptorConfiguration> interceptorConfigurations
)
     {
         super.setInterceptorConfigurations( interceptorConfigurations );
     }
 
 
-    public void setTestEntries( List testEntries )
+    public void setTestEntries( List<Entry> testEntries )
     {
         super.setTestEntries( testEntries );
     }

Modified: directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/configuration/PartitionConfiguration.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/configuration/PartitionConfiguration.java?rev=570258&r1=570257&r2=570258&view=diff
==============================================================================
--- directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/configuration/PartitionConfiguration.java
(original)
+++ directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/configuration/PartitionConfiguration.java
Mon Aug 27 15:16:13 2007
@@ -50,7 +50,7 @@
     private String id;
     private int cacheSize = -1;
     private String suffix;
-    private Set indexedAttributes; // Set<String> or <IndexConfiguration>
+    private Set<Object> indexedAttributes; // Set<String> or <IndexConfiguration>
     private Attributes contextEntry = new AttributesImpl( true );
     private String partitionClassName = DEFAULT_PARTITION_IMPLEMENTATION;
 
@@ -91,7 +91,9 @@
     @SuppressWarnings("unchecked")
     public Set<Object> getIndexedAttributes()
     {
-        return ConfigurationUtil.getClonedSet( indexedAttributes );
+        Set<Object> newSet = new HashSet<Object>();
+        newSet.addAll( indexedAttributes );
+        return newSet;
     }
 
 

Modified: directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/configuration/StartupConfiguration.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/configuration/StartupConfiguration.java?rev=570258&r1=570257&r2=570258&view=diff
==============================================================================
--- directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/configuration/StartupConfiguration.java
(original)
+++ directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/configuration/StartupConfiguration.java
Mon Aug 27 15:16:13 2007
@@ -30,7 +30,6 @@
 import javax.naming.directory.Attributes;
 
 import org.apache.directory.shared.ldap.ldif.Entry;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -116,12 +115,12 @@
     private int maxThreads = MAX_THREADS_DEFAULT; // set to default value
     private int maxSizeLimit = MAX_SIZE_LIMIT_DEFAULT; // set to default value
     private int maxTimeLimit = MAX_TIME_LIMIT_DEFAULT; // set to default value (milliseconds)
-    private Set authenticatorConfigurations; // Set<AuthenticatorConfiguration>
-    private List interceptorConfigurations; // Set<InterceptorConfiguration>
+    private Set<AuthenticatorConfiguration> authenticatorConfigurations; 
+    private List<InterceptorConfiguration> interceptorConfigurations; 
     private PartitionConfiguration systemPartitionConfiguration; 
     private Set<? extends PartitionConfiguration> partitionConfigurations = 
         new HashSet<PartitionConfiguration>();
-    private List testEntries = new ArrayList(); // List<Attributes>
+    private List<Entry> testEntries = new ArrayList<Entry>(); 
 
 
     /**
@@ -236,9 +235,13 @@
     /**
      * Returns {@link AuthenticatorConfiguration}s to use for authenticating clients.
      */
+    @SuppressWarnings("unchecked")
     public Set<AuthenticatorConfiguration> getAuthenticatorConfigurations()
     {
-        return ConfigurationUtil.getClonedSet( authenticatorConfigurations );
+        Set<AuthenticatorConfiguration> cloned = 
+            new HashSet<AuthenticatorConfiguration>( authenticatorConfigurations.size()
);
+        cloned.addAll( authenticatorConfigurations );
+        return cloned;
     }
 
 
@@ -277,7 +280,9 @@
      */
     public Set<PartitionConfiguration> getPartitionConfigurations()
     {
-        return ConfigurationUtil.getClonedSet( partitionConfigurations );
+        Set<PartitionConfiguration> cloned = new HashSet<PartitionConfiguration>();
+        cloned.addAll( partitionConfigurations );
+        return cloned;
     }
 
 
@@ -286,15 +291,13 @@
      */
     protected void setPartitionConfigurations( Set<? extends PartitionConfiguration>
contextParitionConfigurations )
     {
-        Set<? extends PartitionConfiguration> newSet = 
-            ( Set <? extends PartitionConfiguration> ) ConfigurationUtil
-            .getTypeSafeSet( contextParitionConfigurations, PartitionConfiguration.class
);
-
+        Set<PartitionConfiguration> cloned = new HashSet<PartitionConfiguration>();
+        cloned.addAll( contextParitionConfigurations );
         Set<String> names = new HashSet<String>();
-        Iterator i = newSet.iterator();
+        Iterator<? extends PartitionConfiguration> i = cloned.iterator();
         while ( i.hasNext() )
         {
-            PartitionConfiguration cfg = ( PartitionConfiguration ) i.next();
+            PartitionConfiguration cfg = i.next();
             cfg.validate();
 
             String id = cfg.getId();
@@ -305,7 +308,7 @@
             names.add( id );
         }
 
-        this.partitionConfigurations = newSet;
+        this.partitionConfigurations = cloned;
     }
 
 
@@ -348,24 +351,28 @@
     /**
      * Returns interceptor chain.
      */
-    public List getInterceptorConfigurations()
+    @SuppressWarnings("unchecked")
+    public List<InterceptorConfiguration> getInterceptorConfigurations()
     {
-        return ConfigurationUtil.getClonedList( interceptorConfigurations );
+        List<InterceptorConfiguration> cloned = new ArrayList<InterceptorConfiguration>();
+        cloned.addAll( interceptorConfigurations );
+        return cloned;
     }
 
 
     /**
      * Sets interceptor chain.
      */
-    protected void setInterceptorConfigurations( List interceptorConfigurations )
+    protected void setInterceptorConfigurations( List<InterceptorConfiguration> interceptorConfigurations
)
     {
-        List newList = ConfigurationUtil.getTypeSafeList( interceptorConfigurations, InterceptorConfiguration.class
);
+        List<InterceptorConfiguration> cloned = new ArrayList<InterceptorConfiguration>();
+        cloned.addAll( interceptorConfigurations );
 
         Set<String> names = new HashSet<String>();
-        Iterator i = newList.iterator();
+        Iterator<InterceptorConfiguration> i = cloned.iterator();
         while ( i.hasNext() )
         {
-            InterceptorConfiguration cfg = ( InterceptorConfiguration ) i.next();
+            InterceptorConfiguration cfg = i.next();
             cfg.validate();
 
             String name = cfg.getName();
@@ -384,16 +391,11 @@
      * Returns test directory entries({@link Attributes}) to be loaded while
      * bootstrapping.
      */
-    public List getTestEntries()
+    public List<Entry> getTestEntries()
     {
-    	try
-    	{
-    		return ConfigurationUtil.getClonedAttributesList( testEntries );
-    	}
-    	catch ( CloneNotSupportedException cnse )
-    	{
-    		return null;
-    	}
+        List<Entry> cloned = new ArrayList<Entry>();
+        cloned.addAll( testEntries );
+        return cloned;
     }
 
 
@@ -401,19 +403,11 @@
      * Sets test directory entries({@link Attributes}) to be loaded while
      * bootstrapping.
      */
-    protected void setTestEntries( List testEntries )
+    protected void setTestEntries( List<Entry> testEntries )
     {
-    	try
-    	{
-	        testEntries = ConfigurationUtil.getClonedAttributesList( ConfigurationUtil.getTypeSafeList(
testEntries,
-	            Entry.class ) );
-	
-	        this.testEntries = testEntries;
-    	}
-    	catch ( CloneNotSupportedException cnse )
-    	{
-    		this.testEntries = null;
-    	}
+        List<Entry> cloned = new ArrayList<Entry>();
+        cloned.addAll( testEntries );
+        this.testEntries = testEntries;
     }
 
 

Modified: directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/interceptor/Interceptor.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/interceptor/Interceptor.java?rev=570258&r1=570257&r2=570258&view=diff
==============================================================================
--- directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/interceptor/Interceptor.java
(original)
+++ directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/interceptor/Interceptor.java
Mon Aug 27 15:16:13 2007
@@ -44,7 +44,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;
@@ -154,7 +153,7 @@
     /**
      * Filters {@link PartitionNexus#listSuffixes( ListSuffixOperationContext )} call.
      */
-    Iterator listSuffixes( NextInterceptor next, ListSuffixOperationContext opContext ) throws
NamingException;
+    Iterator<String> listSuffixes( NextInterceptor next, ListSuffixOperationContext
opContext ) throws NamingException;
 
 
     /**
@@ -196,7 +195,7 @@
     /**
      * Filters {@link Partition#list( ListOperationContext )} call.
      */
-    NamingEnumeration list( NextInterceptor next, ListOperationContext opContext ) throws
NamingException;
+    NamingEnumeration<SearchResult> list( NextInterceptor next, ListOperationContext
opContext ) throws NamingException;
 
 
     /**

Modified: directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java?rev=570258&r1=570257&r2=570258&view=diff
==============================================================================
--- directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java
(original)
+++ directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java
Mon Aug 27 15:16:13 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.RemoveContextPartitionOperationContext;
 import org.apache.directory.server.core.interceptor.context.RenameOperationContext;
 import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
@@ -119,7 +118,7 @@
         }
 
 
-        public Iterator listSuffixes( NextInterceptor next, ListSuffixOperationContext opContext
) throws NamingException
+        public Iterator<String> listSuffixes( NextInterceptor next, ListSuffixOperationContext
opContext ) throws NamingException
         {
             return nexus.listSuffixes( opContext );
         }
@@ -143,7 +142,7 @@
         }
 
 
-        public NamingEnumeration list( NextInterceptor next, ListOperationContext opContext
) throws NamingException
+        public NamingEnumeration<SearchResult> list( NextInterceptor next, ListOperationContext
opContext ) throws NamingException
         {
             return nexus.list( opContext );
         }
@@ -243,7 +242,7 @@
         FINAL_INTERCEPTOR.init( factoryCfg, null );
 
         // And register and initialize all interceptors
-        ListIterator i = factoryCfg.getStartupConfiguration().getInterceptorConfigurations().listIterator();
+        ListIterator<InterceptorConfiguration> i = factoryCfg.getStartupConfiguration().getInterceptorConfigurations().listIterator();
         Interceptor interceptor = null;
         try
         {
@@ -327,7 +326,7 @@
     /**
      * Returns the list of all registered interceptors.
      */
-    public synchronized List getAll()
+    public synchronized List<Interceptor> getAll()
     {
         List<Interceptor> result = new ArrayList<Interceptor>();
         Entry e = head;
@@ -431,7 +430,7 @@
     private Interceptor getInterceptorInstance( InterceptorConfiguration interceptorConfiguration
) 
         throws NamingException
     {
-        Class interceptorClass = null;
+        Class<?> interceptorClass = null;
         Interceptor interceptor = null;
         
         // Load the interceptor class and if we cannot find it blow a config exception
@@ -655,7 +654,7 @@
     }
 
 
-    public Iterator listSuffixes( ListSuffixOperationContext opContext ) throws NamingException
+    public Iterator<String> listSuffixes( ListSuffixOperationContext opContext ) throws
NamingException
     {
         Entry entry = getStartingEntry();
         Interceptor head = entry.interceptor;
@@ -847,7 +846,7 @@
     }*/
 
 
-    public NamingEnumeration list( ListOperationContext opContext ) throws NamingException
+    public NamingEnumeration<SearchResult> list( ListOperationContext opContext ) throws
NamingException
     {
         Entry entry = getStartingEntry();
         Interceptor head = entry.interceptor;
@@ -1156,7 +1155,7 @@
                 }
 
 
-                public Iterator listSuffixes( ListSuffixOperationContext opContext ) throws
NamingException
+                public Iterator<String> listSuffixes( ListSuffixOperationContext opContext
) throws NamingException
                 {
                     Entry next = getNextEntry();
                     Interceptor interceptor = next.interceptor;
@@ -1237,7 +1236,7 @@
                 }
 
                 
-                public NamingEnumeration list( ListOperationContext opContext ) throws NamingException
+                public NamingEnumeration<SearchResult> list( ListOperationContext opContext
) throws NamingException
                 {
                     Entry next = getNextEntry();
                     Interceptor interceptor = next.interceptor;

Modified: directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/partition/AbstractPartition.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/partition/AbstractPartition.java?rev=570258&r1=570257&r2=570258&view=diff
==============================================================================
--- directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/partition/AbstractPartition.java
(original)
+++ directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/partition/AbstractPartition.java
Mon Aug 27 15:16:13 2007
@@ -30,10 +30,10 @@
 import org.apache.directory.server.core.interceptor.context.EntryOperationContext;
 import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
 import org.apache.directory.server.core.interceptor.context.MoveOperationContext;
-import org.apache.directory.server.core.interceptor.context.OperationContext;
 import org.apache.directory.server.core.interceptor.context.RenameOperationContext;
 import org.apache.directory.server.core.interceptor.context.ReplaceOperationContext;
 import org.apache.directory.shared.ldap.name.LdapDN;
+
 
 /**
  * A {@link Partition} that helps users to implement their own partition.

Modified: directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java?rev=570258&r1=570257&r2=570258&view=diff
==============================================================================
--- directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
(original)
+++ directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
Mon Aug 27 15:16:13 2007
@@ -61,7 +61,6 @@
 import org.apache.directory.server.core.interceptor.context.MoveAndRenameOperationContext;
 import org.apache.directory.server.core.interceptor.context.MoveOperationContext;
 import org.apache.directory.server.core.interceptor.context.RemoveContextPartitionOperationContext;
-import org.apache.directory.server.core.interceptor.context.OperationContext;
 import org.apache.directory.server.core.interceptor.context.RenameOperationContext;
 import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
 import org.apache.directory.server.core.interceptor.context.UnbindOperationContext;
@@ -250,12 +249,13 @@
         List<Partition> initializedPartitions = new ArrayList<Partition>();
         initializedPartitions.add( 0, this.system );
 
-        Iterator i = factoryCfg.getStartupConfiguration().getPartitionConfigurations().iterator();
+        Iterator<PartitionConfiguration> partitionConfigurations = 
+            factoryCfg.getStartupConfiguration().getPartitionConfigurations().iterator();
         try
         {
-            while ( i.hasNext() )
+            while ( partitionConfigurations.hasNext() )
             {
-                PartitionConfiguration c = ( PartitionConfiguration ) i.next();
+                PartitionConfiguration c = ( PartitionConfiguration ) partitionConfigurations.next();
                 AddContextPartitionOperationContext opCtx = new AddContextPartitionOperationContext(
c );
                 addContextPartition( opCtx );
                 initializedPartitions.add( opCtx.getPartition() );
@@ -266,7 +266,7 @@
         {
             if ( !initialized )
             {
-                i = initializedPartitions.iterator();
+                Iterator<Partition> i = initializedPartitions.iterator();
                 while ( i.hasNext() )
                 {
                     Partition partition = ( Partition ) i.next();
@@ -480,7 +480,7 @@
     public void sync() throws NamingException
     {
         MultiException error = null;
-        Iterator list = this.partitions.values().iterator();
+        Iterator<Partition> list = this.partitions.values().iterator();
         
         while ( list.hasNext() )
         {
@@ -727,7 +727,7 @@
     /**
      * @see PartitionNexus#listSuffixes( ListSuffixOperationContext )
      */
-    public Iterator listSuffixes ( ListSuffixOperationContext emptyContext ) throws NamingException
+    public Iterator<String> listSuffixes ( ListSuffixOperationContext emptyContext
) throws NamingException
     {
         return Collections.unmodifiableSet( partitions.keySet() ).iterator();
     }
@@ -814,7 +814,7 @@
     /**
      * @see Partition#list(ListOperationContext)
      */
-    public NamingEnumeration list( ListOperationContext opContext ) throws NamingException
+    public NamingEnumeration<SearchResult> list( ListOperationContext opContext ) throws
NamingException
     {
         Partition backend = getPartition( opContext.getDn() );
         return backend.list( opContext );
@@ -853,7 +853,7 @@
                 if ( ids == null || ids.length == 0 )
                 {
                     SearchResult result = new ServerSearchResult( "", null, ( Attributes
) getRootDSE( null ).clone(), false );
-                    return new SingletonEnumeration( result );
+                    return new SingletonEnumeration<SearchResult>( result );
                 }
                 
                 // -----------------------------------------------------------
@@ -897,20 +897,20 @@
                 if ( containsOneDotOne )
                 {
                     SearchResult result = new ServerSearchResult( "", null, new AttributesImpl(),
false );
-                    return new SingletonEnumeration( result );
+                    return new SingletonEnumeration<SearchResult>( result );
                 }
                 
                 // return everything
                 if ( containsAsterisk && containsPlus )
                 {
                     SearchResult result = new ServerSearchResult( "", null, ( Attributes
) getRootDSE( null ).clone(), false );
-                    return new SingletonEnumeration( result );
+                    return new SingletonEnumeration<SearchResult>( result );
                 }
                 
                 Attributes attrs = new AttributesImpl();
                 if ( containsAsterisk )
                 {
-                    for ( NamingEnumeration ii = getRootDSE( null ).getAll(); ii.hasMore();
/**/ )
+                    for ( NamingEnumeration<? extends Attribute> ii = getRootDSE( null
).getAll(); ii.hasMore(); /**/ )
                     {
                         // add all user attribute
                         Attribute attr = ( Attribute ) ii.next();
@@ -928,7 +928,7 @@
                 }
                 else if ( containsPlus )
                 {
-                    for ( NamingEnumeration ii = getRootDSE( null ).getAll(); ii.hasMore();
/**/ )
+                    for ( NamingEnumeration<? extends Attribute> ii = getRootDSE( null
).getAll(); ii.hasMore(); /**/ )
                     {
                         // add all operational attributes
                         Attribute attr = ( Attribute ) ii.next();
@@ -946,7 +946,7 @@
                 }
                 else
                 {
-                    for ( NamingEnumeration ii = getRootDSE( null ).getAll(); ii.hasMore();
/**/ )
+                    for ( NamingEnumeration<? extends Attribute> ii = getRootDSE( null
).getAll(); ii.hasMore(); /**/ )
                     {
                       // add user attributes specifically asked for
                         Attribute attr = ( Attribute ) ii.next();
@@ -959,7 +959,7 @@
                 }
 
                 SearchResult result = new ServerSearchResult( "", null, attrs, false );
-                return new SingletonEnumeration( result );
+                return new SingletonEnumeration<SearchResult>( result );
             }
 
             throw new LdapNameNotFoundException();
@@ -980,13 +980,13 @@
         if ( dn.size() == 0 )
         {
             Attributes retval = new AttributesImpl();
-            NamingEnumeration list = rootDSE.getIDs();
+            NamingEnumeration<String> list = rootDSE.getIDs();
      
             if ( opContext.getAttrsId() != null )
             {
                 while ( list.hasMore() )
                 {
-                    String id = ( String ) list.next();
+                    String id = list.next();
                     
                     if ( opContext.getAttrsId().contains( id ) )
                     {
@@ -999,8 +999,7 @@
             {
                 while ( list.hasMore() )
                 {
-                    String id = ( String ) list.next();
-                    
+                    String id = list.next();
                     Attribute attr = rootDSE.get( id );
                     retval.put( ( Attribute ) attr.clone() );
                 }
@@ -1119,7 +1118,7 @@
     // ------------------------------------------------------------------------
 
 
-    public void registerSupportedExtensions( Set extensionOids )
+    public void registerSupportedExtensions( Set<String> extensionOids )
     {
         Attribute supportedExtension = rootDSE.get( "supportedExtension" );
         if ( supportedExtension == null )
@@ -1127,7 +1126,7 @@
             supportedExtension = new AttributeImpl( "supportedExtension" );
             rootDSE.put( supportedExtension );
         }
-        for ( Iterator oids = extensionOids.iterator(); oids.hasNext(); )
+        for ( Iterator<String> oids = extensionOids.iterator(); oids.hasNext(); )
         {
             supportedExtension.add( oids.next() );
         }

Modified: directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/partition/Partition.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/partition/Partition.java?rev=570258&r1=570257&r2=570258&view=diff
==============================================================================
--- directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/partition/Partition.java
(original)
+++ directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/partition/Partition.java
Mon Aug 27 15:16:13 2007
@@ -37,7 +37,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.interceptor.context.UnbindOperationContext;
@@ -162,7 +161,7 @@
      * @return a NamingEnumeration containing objects of type {@link SearchResult}
      * @throws NamingException if there are any problems
      */
-    NamingEnumeration list( ListOperationContext opContext ) throws NamingException;
+    NamingEnumeration<SearchResult> list( ListOperationContext opContext ) throws NamingException;
 
 
     /**

Modified: directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexus.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexus.java?rev=570258&r1=570257&r2=570258&view=diff
==============================================================================
--- directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexus.java
(original)
+++ directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexus.java
Mon Aug 27 15:16:13 2007
@@ -257,7 +257,7 @@
      * @return Iteration over ContextPartition suffix names as Names.
      * @throws NamingException if there are any problems
      */
-    public abstract Iterator listSuffixes( ListSuffixOperationContext opContext ) throws
NamingException;
+    public abstract Iterator<String> listSuffixes( ListSuffixOperationContext opContext
) throws NamingException;
 
 
     /**
@@ -266,5 +266,5 @@
      * @param extensionOids a set of OID strings to add to the supportedExtension 
      * attribute in the RootDSE
      */
-    public abstract void registerSupportedExtensions( Set extensionOids );
+    public abstract void registerSupportedExtensions( Set<String> extensionOids );
 }

Modified: directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexusProxy.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexusProxy.java?rev=570258&r1=570257&r2=570258&view=diff
==============================================================================
--- directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexusProxy.java
(original)
+++ directory/sandbox/akarasulu/refactoring-apacheds-trunk/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexusProxy.java
Mon Aug 27 15:16:13 2007
@@ -62,7 +62,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;
@@ -88,19 +87,19 @@
 public class PartitionNexusProxy extends PartitionNexus
 {
     /** safe to use set of bypass instructions to lookup raw entries */
-    public static final Collection LOOKUP_BYPASS;
+    public static final Collection<String> LOOKUP_BYPASS;
     
     /** safe to use set of bypass instructions to getMatchedDn */
-    public static final Collection GETMATCHEDDN_BYPASS;
+    public static final Collection<String> GETMATCHEDDN_BYPASS;
     
     /** safe to use set of bypass instructions to lookup raw entries excluding operational
attributes */
-    public static final Collection LOOKUP_EXCLUDING_OPR_ATTRS_BYPASS;
+    public static final Collection<String> LOOKUP_EXCLUDING_OPR_ATTRS_BYPASS;
     
     /** Bypass String to use when ALL interceptors should be skipped */
     public static final String BYPASS_ALL = "*";
     
     /** Bypass String to use when ALL interceptors should be skipped */
-    public static final Collection BYPASS_ALL_COLLECTION = Collections.singleton( BYPASS_ALL
);
+    public static final Collection<String> BYPASS_ALL_COLLECTION = Collections.singleton(
BYPASS_ALL );
     
     /** A static object to store the rootDSE entry with all the attributes */
     private static Attributes ROOT_DSE_ALL;
@@ -247,7 +246,7 @@
     }
 
 
-    public LdapDN getMatchedName( GetMatchedNameOperationContext opContext, Collection bypass
) throws NamingException
+    public LdapDN getMatchedName( GetMatchedNameOperationContext opContext, Collection<String>
bypass ) throws NamingException
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
@@ -271,7 +270,7 @@
     }
 
 
-    public LdapDN getSuffix( GetSuffixOperationContext opContext, Collection bypass ) throws
NamingException
+    public LdapDN getSuffix( GetSuffixOperationContext opContext, Collection<String>
bypass ) throws NamingException
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
@@ -288,13 +287,13 @@
     }
 
 
-    public Iterator listSuffixes( ListSuffixOperationContext opContext ) throws NamingException
+    public Iterator<String> listSuffixes( ListSuffixOperationContext opContext ) throws
NamingException
     {
-        return listSuffixes( opContext );
+        return listSuffixes( opContext, null );
     }
 
 
-    public Iterator listSuffixes( ListSuffixOperationContext opContext, Collection bypass
) throws NamingException
+    public Iterator<String> listSuffixes( ListSuffixOperationContext opContext, Collection<String>
bypass ) throws NamingException
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
@@ -317,7 +316,7 @@
     }
 
 
-    public boolean compare( CompareOperationContext opContext, Collection bypass ) throws
NamingException
+    public boolean compare( CompareOperationContext opContext, Collection<String> bypass
) throws NamingException
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
@@ -340,7 +339,7 @@
     }
 
 
-    public void delete( DeleteOperationContext opContext, Collection bypass ) throws NamingException
+    public void delete( DeleteOperationContext opContext, Collection<String> bypass
) throws NamingException
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
@@ -363,7 +362,7 @@
     }
 
 
-    public void add( AddOperationContext opContext, Collection bypass ) throws NamingException
+    public void add( AddOperationContext opContext, Collection<String> bypass ) throws
NamingException
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
@@ -386,7 +385,7 @@
     }
 
 
-    public void modify( ModifyOperationContext opContext, Collection bypass ) throws NamingException
+    public void modify( ModifyOperationContext opContext, Collection<String> bypass
) throws NamingException
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
@@ -404,13 +403,14 @@
     }
 
 
-    public NamingEnumeration list( ListOperationContext opContext ) throws NamingException
+    public NamingEnumeration<SearchResult> list( ListOperationContext opContext ) throws
NamingException
     {
         return list( opContext, null );
     }
 
 
-    public NamingEnumeration list( ListOperationContext opContext, Collection bypass ) throws
NamingException
+    public NamingEnumeration<SearchResult> list( ListOperationContext opContext, Collection<String>
bypass ) 
+        throws NamingException
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
@@ -479,7 +479,7 @@
     }
 
 
-    public NamingEnumeration<SearchResult> search( SearchOperationContext opContext,
Collection bypass )
+    public NamingEnumeration<SearchResult> search( SearchOperationContext opContext,
Collection<String> bypass )
         throws NamingException
     {
         ensureStarted();
@@ -509,7 +509,7 @@
     			{
     				if ( ROOT_DSE_NO_OPERATIONNAL == null )
     				{
-    					ROOT_DSE_NO_OPERATIONNAL = lookup( opContext, ( Collection ) null );
+    					ROOT_DSE_NO_OPERATIONNAL = lookup( opContext, ( Collection<String> ) null
);
     				}
     			}
     			
@@ -521,7 +521,7 @@
     			{
     				if ( ROOT_DSE_ALL == null )
     				{
-    					ROOT_DSE_ALL = lookup( opContext, ( Collection ) null );
+    					ROOT_DSE_ALL = lookup( opContext, ( Collection<String> ) null );
     				}
     			}
     			
@@ -530,11 +530,11 @@
     			
     	}
     	
-        return lookup( opContext, ( Collection ) null );
+        return lookup( opContext, ( Collection<String> ) null );
     }
 
 
-    public Attributes lookup( LookupOperationContext opContext, Collection bypass ) throws
NamingException
+    public Attributes lookup( LookupOperationContext opContext, Collection<String>
bypass ) throws NamingException
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
@@ -556,7 +556,7 @@
     }
 
 
-    public boolean hasEntry( EntryOperationContext opContext, Collection bypass ) throws
NamingException
+    public boolean hasEntry( EntryOperationContext opContext, Collection<String> bypass
) throws NamingException
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
@@ -579,7 +579,7 @@
     }
 
 
-    public void rename( RenameOperationContext opContext, Collection bypass ) throws NamingException
+    public void rename( RenameOperationContext opContext, Collection<String> bypass
) throws NamingException
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
@@ -603,7 +603,7 @@
     }
 
 
-    public void move( MoveOperationContext opContext, Collection bypass ) throws NamingException
+    public void move( MoveOperationContext opContext, Collection<String> bypass ) throws
NamingException
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
@@ -626,7 +626,7 @@
     }
 
 
-    public void moveAndRename( MoveAndRenameOperationContext opContext, Collection bypass
)
+    public void moveAndRename( MoveAndRenameOperationContext opContext, Collection<String>
bypass )
         throws NamingException
     {
         ensureStarted();
@@ -651,7 +651,7 @@
      * @param bypass
      * @throws NamingException
      */
-    public void bind( BindOperationContext opContext, Collection bypass )
+    public void bind( BindOperationContext opContext, Collection<String> bypass )
         throws NamingException
     {
         ensureStarted();
@@ -671,7 +671,7 @@
         }
     }
 
-    public void unbind( UnbindOperationContext opContext, Collection bypass ) throws NamingException
+    public void unbind( UnbindOperationContext opContext, Collection<String> bypass
) throws NamingException
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
@@ -720,7 +720,8 @@
     }
 
 
-    public Attributes getRootDSE( GetRootDSEOperationContext opContext, Collection bypass
) throws NamingException
+    public Attributes getRootDSE( GetRootDSEOperationContext opContext, Collection<String>
bypass ) 
+        throws NamingException
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
@@ -742,7 +743,8 @@
     }
 
 
-    public void addContextPartition( AddContextPartitionOperationContext opContext, Collection
bypass ) throws NamingException
+    public void addContextPartition( AddContextPartitionOperationContext opContext, Collection<String>
bypass ) 
+        throws NamingException
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
@@ -765,7 +767,8 @@
     }
 
 
-    public void removeContextPartition( RemoveContextPartitionOperationContext opContext,
Collection bypass ) throws NamingException
+    public void removeContextPartition( RemoveContextPartitionOperationContext opContext,
Collection<String> bypass ) 
+        throws NamingException
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
@@ -791,7 +794,7 @@
     }
 
 
-    public void registerSupportedExtensions( Set extensionOids )
+    public void registerSupportedExtensions( Set<String> extensionOids )
     {
         configuration.getPartitionNexus().registerSupportedExtensions( extensionOids );
     }



Mime
View raw message