directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r1075126 - in /directory: apacheds/branches/akarasulu/protocol-ldap/src/main/java/org/apache/directory/server/ldap/ shared/branches/akarasulu/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/ shared/branches/akarasulu/ldap...
Date Sun, 27 Feb 2011 20:00:53 GMT
Author: akarasulu
Date: Sun Feb 27 20:00:53 2011
New Revision: 1075126

URL: http://svn.apache.org/viewvc?rev=1075126&view=rev
Log:
DIRSHARED-92: making both clients and server use the same ProtocolCodecFactory implementation

Removed:
    directory/apacheds/branches/akarasulu/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapProtocolCodecFactory.java
Modified:
    directory/apacheds/branches/akarasulu/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java
    directory/shared/branches/akarasulu/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
    directory/shared/branches/akarasulu/ldap-codec-standalone/src/main/java/org/apache/directory/shared/ldap/codec/standalone/StandaloneLdapCodecService.java
    directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/api/LdapCodecService.java
    directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/osgi/DefaultLdapCodecService.java
    directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/protocol/mina/LdapProtocolCodecFactory.java
    directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/protocol/mina/LdapProtocolEncoder.java

Modified: directory/apacheds/branches/akarasulu/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/akarasulu/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java?rev=1075126&r1=1075125&r2=1075126&view=diff
==============================================================================
--- directory/apacheds/branches/akarasulu/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java
(original)
+++ directory/apacheds/branches/akarasulu/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java
Sun Feb 27 20:00:53 2011
@@ -60,6 +60,8 @@ import org.apache.directory.server.proto
 import org.apache.directory.server.protocol.shared.transport.TcpTransport;
 import org.apache.directory.server.protocol.shared.transport.Transport;
 import org.apache.directory.server.protocol.shared.transport.UdpTransport;
+import org.apache.directory.shared.ldap.codec.api.LdapCodecServiceFactory;
+import org.apache.directory.shared.ldap.codec.protocol.mina.LdapProtocolCodecFactory;
 import org.apache.directory.shared.ldap.extras.controls.SyncDoneValue;
 import org.apache.directory.shared.ldap.extras.controls.SyncInfoValue;
 import org.apache.directory.shared.ldap.extras.controls.SyncRequestValue;
@@ -192,7 +194,7 @@ public class LdapServer extends Director
     private LdapRequestHandler<UnbindRequest> unbindHandler;
 
     /** the underlying provider codec factory */
-    private ProtocolCodecFactory codecFactory;
+    private ProtocolCodecFactory codecFactory = LdapCodecServiceFactory.getSingleton().newProtocolCodecFactory();
 
     /** the MINA protocol handler */
     private final LdapProtocolHandler handler = new LdapProtocolHandler( this );
@@ -1017,7 +1019,7 @@ public class LdapServer extends Director
     public void setDirectoryService( DirectoryService directoryService )
     {
         super.setDirectoryService( directoryService );
-        this.codecFactory = new LdapProtocolCodecFactory( directoryService );
+        this.codecFactory = new LdapProtocolCodecFactory();
     }
 
 

Modified: directory/shared/branches/akarasulu/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java?rev=1075126&r1=1075125&r2=1075126&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
(original)
+++ directory/shared/branches/akarasulu/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
Sun Feb 27 20:00:53 2011
@@ -138,7 +138,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.schemamanager.impl.DefaultSchemaManager;
 import org.apache.directory.shared.util.StringConstants;
 import org.apache.directory.shared.util.Strings;
-import org.apache.directory.shared.util.exception.NotImplementedException;
 import org.apache.mina.core.filterchain.IoFilter;
 import org.apache.mina.core.future.CloseFuture;
 import org.apache.mina.core.future.ConnectFuture;
@@ -219,7 +218,7 @@ public class LdapNetworkConnection exten
     LdapCodecService codec = LdapCodecServiceFactory.getSingleton();
 
     /** The Ldap codec protocol filter */
-    private IoFilter ldapProtocolFilter = new ProtocolCodecFilter( codec.newProtocolCodecFactory(
true ) );
+    private IoFilter ldapProtocolFilter = new ProtocolCodecFilter( codec.newProtocolCodecFactory()
);
 
     /** the SslFilter key */
     private static final String SSL_FILTER_KEY = "sslFilter";

Modified: directory/shared/branches/akarasulu/ldap-codec-standalone/src/main/java/org/apache/directory/shared/ldap/codec/standalone/StandaloneLdapCodecService.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap-codec-standalone/src/main/java/org/apache/directory/shared/ldap/codec/standalone/StandaloneLdapCodecService.java?rev=1075126&r1=1075125&r2=1075126&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap-codec-standalone/src/main/java/org/apache/directory/shared/ldap/codec/standalone/StandaloneLdapCodecService.java
(original)
+++ directory/shared/branches/akarasulu/ldap-codec-standalone/src/main/java/org/apache/directory/shared/ldap/codec/standalone/StandaloneLdapCodecService.java
Sun Feb 27 20:00:53 2011
@@ -587,23 +587,10 @@ public class StandaloneLdapCodecService 
     
     /**
      * {@inheritDoc}
-     * 
-     * @TODO - finish this up and add factory registration capabilities,
-     * of course there is one default mechanism for now.
      */
-    public ProtocolCodecFactory newProtocolCodecFactory( boolean client )
+    public ProtocolCodecFactory newProtocolCodecFactory()
     {
-        if ( client )
-        {
-            return new LdapProtocolCodecFactory( this );
-        }
-        else
-        {
-            throw new NotImplementedException( 
-                "Filters may be different here, and we're probably going to " +
-                "want to have a protocol codec factory registration mechanism" +
-                "since this way we can swap in and out MINA/Grizzly" );
-        }
+        return new LdapProtocolCodecFactory();
     }
 
     

Modified: directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/api/LdapCodecService.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/api/LdapCodecService.java?rev=1075126&r1=1075125&r2=1075126&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/api/LdapCodecService.java
(original)
+++ directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/api/LdapCodecService.java
Sun Feb 27 20:00:53 2011
@@ -242,11 +242,9 @@ public interface LdapCodecService
     /**
      * Creates a new LDAP {@link ProtocolCodecFactory}.
      *
-     * @param client if true a factory designed for clients is returned, 
-     * otherwise one for servers is returned.
-     * @return the client or server specific {@link ProtocolCodecFactory}
+     * @return the {@link ProtocolCodecFactory}
      */
-    ProtocolCodecFactory newProtocolCodecFactory( boolean client );
+    ProtocolCodecFactory newProtocolCodecFactory();
 
     
     /**

Modified: directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/osgi/DefaultLdapCodecService.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/osgi/DefaultLdapCodecService.java?rev=1075126&r1=1075125&r2=1075126&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/osgi/DefaultLdapCodecService.java
(original)
+++ directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/osgi/DefaultLdapCodecService.java
Sun Feb 27 20:00:53 2011
@@ -184,23 +184,10 @@ public class DefaultLdapCodecService imp
 
     /**
      * {@inheritDoc}
-     *
-     * @TODO - finish this up and add factory registration capabilities,
-     * of course there is one default mechanism for now.
      */
-    public ProtocolCodecFactory newProtocolCodecFactory( boolean client )
+    public ProtocolCodecFactory newProtocolCodecFactory()
     {
-        if ( client )
-        {
-            return new LdapProtocolCodecFactory( this );
-        }
-        else
-        {
-            throw new NotImplementedException(
-                "Filters may be different here, and we're probably going to " +
-                "want to have a protocol codec factory registration mechanism" +
-                "since this way we can swap in and out MINA/Grizzly" );
-        }
+        return new LdapProtocolCodecFactory();
     }
 
 

Modified: directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/protocol/mina/LdapProtocolCodecFactory.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/protocol/mina/LdapProtocolCodecFactory.java?rev=1075126&r1=1075125&r2=1075126&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/protocol/mina/LdapProtocolCodecFactory.java
(original)
+++ directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/protocol/mina/LdapProtocolCodecFactory.java
Sun Feb 27 20:00:53 2011
@@ -20,7 +20,6 @@
 package org.apache.directory.shared.ldap.codec.protocol.mina;
 
 
-import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
 import org.apache.mina.core.session.IoSession;
 import org.apache.mina.filter.codec.ProtocolCodecFactory;
 import org.apache.mina.filter.codec.ProtocolDecoder;
@@ -44,21 +43,6 @@ public class LdapProtocolCodecFactory im
     public static final String LDAP_ENCODER = "LDAP_ENCODER";
 
     
-    private LdapCodecService codec;
-
-    
-    /**
-     * Creates a new instance of LdapProtocolCodecFactory. It
-     * creates the encoded an decoder instances.
-     * 
-     * @param codec The codec associated with this protocol codec factory
-     */
-    public LdapProtocolCodecFactory( LdapCodecService codec )
-    {
-        this.codec = codec;
-    }
-
-
     /**
      * Get the LDAP decoder.
      *
@@ -79,6 +63,6 @@ public class LdapProtocolCodecFactory im
      */
     public ProtocolEncoder getEncoder( IoSession session )
     {
-        return new LdapProtocolEncoder( codec );
+        return new LdapProtocolEncoder();
     }
 }

Modified: directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/protocol/mina/LdapProtocolEncoder.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/protocol/mina/LdapProtocolEncoder.java?rev=1075126&r1=1075125&r2=1075126&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/protocol/mina/LdapProtocolEncoder.java
(original)
+++ directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/protocol/mina/LdapProtocolEncoder.java
Sun Feb 27 20:00:53 2011
@@ -23,7 +23,7 @@ package org.apache.directory.shared.ldap
 import java.nio.ByteBuffer;
 
 import org.apache.directory.shared.ldap.codec.LdapEncoder;
-import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
+import org.apache.directory.shared.ldap.codec.api.LdapCodecServiceFactory;
 import org.apache.directory.shared.ldap.model.message.Message;
 import org.apache.mina.core.buffer.IoBuffer;
 import org.apache.mina.core.session.IoSession;
@@ -47,9 +47,9 @@ public class LdapProtocolEncoder impleme
      *
      * @param codec The LDAP codec service associated with this encoder.
      */
-    public LdapProtocolEncoder( LdapCodecService codec )
+    public LdapProtocolEncoder()
     {
-        this.encoder = new LdapEncoder( codec );
+        this.encoder = new LdapEncoder( LdapCodecServiceFactory.getSingleton() );
     }
 
 



Mime
View raw message