directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r1074029 - in /directory/shared/branches/akarasulu: ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/ ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ ldap-extras/codec/src/main/java/org/apach...
Date Thu, 24 Feb 2011 03:28:39 GMT
Author: akarasulu
Date: Thu Feb 24 03:28:37 2011
New Revision: 1074029

URL: http://svn.apache.org/viewvc?rev=1074029&view=rev
Log:
DIRSHARED-86: modifying factory decorate methods and making req/resp pairs use same OID

Modified:
    directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/LdapEncoder.java
    directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/CertGenerationResponse.java
    directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/GracefulShutdownResponse.java
    directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/StoredProcedureResponse.java
    directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/CancelFactory.java
    directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/CertGenerationFactory.java
    directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/GracefulDisconnectFactory.java
    directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/GracefulShutdownFactory.java
    directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/StoredProcedureFactory.java

Modified: directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/LdapEncoder.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/LdapEncoder.java?rev=1074029&r1=1074028&r2=1074029&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/LdapEncoder.java
(original)
+++ directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/LdapEncoder.java
Thu Feb 24 03:28:37 2011
@@ -60,6 +60,11 @@ public class LdapEncoder
      */
     public LdapEncoder( LdapCodecService codec )
     {
+        if ( codec == null )
+        {
+            throw new NullPointerException( "codec argument cannot be null" );
+        }
+        
         this.codec = codec;
     }
     

Modified: directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/CertGenerationResponse.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/CertGenerationResponse.java?rev=1074029&r1=1074028&r2=1074029&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/CertGenerationResponse.java
(original)
+++ directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/CertGenerationResponse.java
Thu Feb 24 03:28:37 2011
@@ -31,5 +31,5 @@ import org.apache.directory.shared.ldap.
 public interface CertGenerationResponse extends ExtendedResponse
 {
     /** The CertGenerationResponse OID */
-    public static final String EXTENSION_OID = "1.3.6.1.4.1.18060.0.1.9";
+    public static final String EXTENSION_OID = CertGenerationRequest.EXTENSION_OID;
 }
\ No newline at end of file

Modified: directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/GracefulShutdownResponse.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/GracefulShutdownResponse.java?rev=1074029&r1=1074028&r2=1074029&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/GracefulShutdownResponse.java
(original)
+++ directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/GracefulShutdownResponse.java
Thu Feb 24 03:28:37 2011
@@ -14,5 +14,5 @@ import org.apache.directory.shared.ldap.
 public interface GracefulShutdownResponse extends ExtendedResponse
 {
     /** The OID for the graceful shutdown extended operation response. */
-    String EXTENSION_OID = "1.3.6.1.4.1.18060.0.1.4";
+    String EXTENSION_OID = GracefulShutdownRequest.EXTENSION_OID;
 }
\ No newline at end of file

Modified: directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/StoredProcedureResponse.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/StoredProcedureResponse.java?rev=1074029&r1=1074028&r2=1074029&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/StoredProcedureResponse.java
(original)
+++ directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/StoredProcedureResponse.java
Thu Feb 24 03:28:37 2011
@@ -31,5 +31,5 @@ import org.apache.directory.shared.ldap.
 public interface StoredProcedureResponse extends ExtendedResponse
 {
     /** The OID for the stored procedure extended operation response. */
-    String EXTENSION_OID = "1.3.6.1.4.1.18060.0.1.7";
+    String EXTENSION_OID = StoredProcedureRequest.EXTENSION_OID;
 }
\ No newline at end of file

Modified: directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/CancelFactory.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/CancelFactory.java?rev=1074029&r1=1074028&r2=1074029&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/CancelFactory.java
(original)
+++ directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/CancelFactory.java
Thu Feb 24 03:28:37 2011
@@ -99,12 +99,8 @@ public class CancelFactory implements Ex
         {
             return ( CancelRequestDecorator ) modelRequest;
         }
-        else if ( modelRequest instanceof CancelRequest )
-        {
-            return new CancelRequestDecorator( codec, ( CancelRequest ) modelRequest );
-        }
         
-        return ( CancelRequestDecorator ) newRequest();
+        return new CancelRequestDecorator( codec, ( CancelRequest ) modelRequest );
     }
 
 
@@ -117,11 +113,7 @@ public class CancelFactory implements Ex
         {
             return ( CancelResponseDecorator ) decoratedMessage;
         }
-        else if ( decoratedMessage instanceof CancelResponse )
-        {
-            return new CancelResponseDecorator( codec, ( CancelResponse ) decoratedMessage
);
-        }
-        
-        return new CancelResponseDecorator( codec, new CancelResponseImpl() );        
+
+        return new CancelResponseDecorator( codec, ( CancelResponse ) decoratedMessage );
     }
 }

Modified: directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/CertGenerationFactory.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/CertGenerationFactory.java?rev=1074029&r1=1074028&r2=1074029&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/CertGenerationFactory.java
(original)
+++ directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/CertGenerationFactory.java
Thu Feb 24 03:28:37 2011
@@ -25,7 +25,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.codec.api.ExtendedRequestFactory;
 import org.apache.directory.shared.ldap.codec.api.ExtendedResponseDecorator;
 import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
-import org.apache.directory.shared.ldap.extras.extended.CancelRequest;
 import org.apache.directory.shared.ldap.extras.extended.CertGenerationRequestImpl;
 import org.apache.directory.shared.ldap.extras.extended.CertGenerationResponseImpl;
 import org.apache.directory.shared.ldap.extras.extended.CertGenerationRequest;
@@ -101,12 +100,8 @@ public class CertGenerationFactory 
         {
             return ( CertGenerationRequestDecorator ) modelRequest;
         }
-        else if ( modelRequest instanceof CancelRequest )
-        {
-            return new CertGenerationRequestDecorator( codec, ( CertGenerationRequest ) modelRequest
);
-        }
-        
-        return ( CertGenerationRequestDecorator ) newRequest();
+
+        return new CertGenerationRequestDecorator( codec, ( CertGenerationRequest ) modelRequest
);
     }
 
 
@@ -119,11 +114,7 @@ public class CertGenerationFactory 
         {
             return ( CertGenerationResponseDecorator ) decoratedMessage;
         }
-        else if ( decoratedMessage instanceof CertGenerationResponse )
-        {
-            return new CertGenerationResponseDecorator( codec, ( CertGenerationResponse )
decoratedMessage );
-        }
-        
-        return new CertGenerationResponseDecorator( codec, new CertGenerationResponseImpl()
);
+
+        return new CertGenerationResponseDecorator( codec, ( CertGenerationResponse ) decoratedMessage
);
     }
 }

Modified: directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/GracefulDisconnectFactory.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/GracefulDisconnectFactory.java?rev=1074029&r1=1074028&r2=1074029&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/GracefulDisconnectFactory.java
(original)
+++ directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/GracefulDisconnectFactory.java
Thu Feb 24 03:28:37 2011
@@ -59,23 +59,25 @@ public class GracefulDisconnectFactory i
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public GracefulDisconnectResponse newResponse( byte[] encodedValue ) throws DecoderException
     {
         return new GracefulDisconnectResponseDecorator( codec, encodedValue );
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public ExtendedResponseDecorator<GracefulDisconnectResponse> decorate( ExtendedResponse
decoratedMessage )
     {
         if ( decoratedMessage instanceof GracefulDisconnectResponseDecorator )
         {
             return ( GracefulDisconnectResponseDecorator ) decoratedMessage;
         }
-        else if ( decoratedMessage instanceof GracefulDisconnectResponse )
-        {
-            return new GracefulDisconnectResponseDecorator( codec, ( GracefulDisconnectResponse
) decoratedMessage );
-        }
-        
-        return new GracefulDisconnectResponseDecorator( codec, new GracefulDisconnectResponseImpl()
);
+
+        return new GracefulDisconnectResponseDecorator( codec, ( GracefulDisconnectResponse
) decoratedMessage );
     }
 }

Modified: directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/GracefulShutdownFactory.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/GracefulShutdownFactory.java?rev=1074029&r1=1074028&r2=1074029&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/GracefulShutdownFactory.java
(original)
+++ directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/GracefulShutdownFactory.java
Thu Feb 24 03:28:37 2011
@@ -102,12 +102,8 @@ public class GracefulShutdownFactory 
         {
             return ( GracefulShutdownRequestDecorator ) modelRequest;
         }
-        else if ( modelRequest instanceof GracefulShutdownRequest )
-        {
-            return new GracefulShutdownRequestDecorator( codec, ( GracefulShutdownRequest
) modelRequest );
-        }
-        
-        return ( GracefulShutdownRequestDecorator ) newRequest();
+
+        return new GracefulShutdownRequestDecorator( codec, ( GracefulShutdownRequest ) modelRequest
);
     }
 
 
@@ -120,11 +116,7 @@ public class GracefulShutdownFactory 
         {
             return ( GracefulShutdownResponseDecorator ) decoratedMessage;
         }
-        else if ( decoratedMessage instanceof GracefulShutdownResponse )
-        {
-            return new GracefulShutdownResponseDecorator( codec, ( GracefulShutdownResponse
) decoratedMessage );
-        }
-        
-        return new GracefulShutdownResponseDecorator( codec, new GracefulShutdownResponseImpl()
);
+
+        return new GracefulShutdownResponseDecorator( codec, ( GracefulShutdownResponse )
decoratedMessage );
     }
 }

Modified: directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/StoredProcedureFactory.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/StoredProcedureFactory.java?rev=1074029&r1=1074028&r2=1074029&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/StoredProcedureFactory.java
(original)
+++ directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/StoredProcedureFactory.java
Thu Feb 24 03:28:37 2011
@@ -105,27 +105,22 @@ public class StoredProcedureFactory impl
         {
             return ( StoredProcedureRequestDecorator ) modelRequest;
         }
-        else if ( modelRequest instanceof StoredProcedureRequest )
-        {
-            return new StoredProcedureRequestDecorator( codec, ( StoredProcedureRequest )
modelRequest );
-        }
         
-        // @TODO this is really bad because we loose the parameters 
-        return ( StoredProcedureRequestDecorator ) newRequest();
+        
+        return new StoredProcedureRequestDecorator( codec, ( StoredProcedureRequest ) modelRequest
);
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public ExtendedResponseDecorator<StoredProcedureResponse> decorate( ExtendedResponse
decoratedMessage )
     {
         if ( decoratedMessage instanceof StoredProcedureResponseDecorator )
         {
             return ( StoredProcedureResponseDecorator ) decoratedMessage;
         }
-        else if ( decoratedMessage instanceof StoredProcedureResponse )
-        {
-            return new StoredProcedureResponseDecorator( codec, ( StoredProcedureResponse
) decoratedMessage );
-        }
         
-        return new StoredProcedureResponseDecorator( codec, new StoredProcedureResponseImpl()
);
+        return new StoredProcedureResponseDecorator( codec, ( StoredProcedureResponse ) decoratedMessage
);
     }
 }



Mime
View raw message