directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r1072850 - in /directory/shared/branches/akarasulu: ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/extended/ ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/extendedResponse/ ldap-codec/sr...
Date Mon, 21 Feb 2011 05:00:20 GMT
Author: akarasulu
Date: Mon Feb 21 05:00:19 2011
New Revision: 1072850

URL: http://svn.apache.org/viewvc?rev=1072850&view=rev
Log:
DIRSHARED-86: properly implemented the cert generation plumbing

Added:
    directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ICertGenerationRequest.java
    directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ICertGenerationResponse.java
    directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/CertGenerationRequestDecorator.java
    directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/CertGenerationResponseDecorator.java
Modified:
    directory/shared/branches/akarasulu/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/extended/ExtendedResponseTest.java
    directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/extendedResponse/InitExtendedResponse.java
    directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/extendedResponse/StoreExtendedResponseValue.java
    directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/extendedResponse/StoreResponseName.java
    directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/api/ExtendedResponseDecorator.java
    directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/api/MessageDecorator.java
    directory/shared/branches/akarasulu/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/extended/ExtendedResponseTest.java
    directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/ExtrasBundleActivator.java
    directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/CertGenerationRequest.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/ads_impl/CancelResponseDecorator.java
    directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/CertGenerationContainer.java
    directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/CertGenerationDecoder.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/CertGenerationGrammar.java
    directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/CertGenerationObject.java

Modified: directory/shared/branches/akarasulu/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/extended/ExtendedResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/extended/ExtendedResponseTest.java?rev=1072850&r1=1072849&r2=1072850&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/extended/ExtendedResponseTest.java (original)
+++ directory/shared/branches/akarasulu/ldap-codec-standalone/src/test/java/org/apache/directory/shared/ldap/codec/extended/ExtendedResponseTest.java Mon Feb 21 05:00:19 2011
@@ -85,8 +85,8 @@ public class ExtendedResponseTest extend
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedResponseDecorator> container = 
-            new LdapMessageContainer<ExtendedResponseDecorator>( codec );
+        LdapMessageContainer<ExtendedResponseDecorator<?>> container = 
+            new LdapMessageContainer<ExtendedResponseDecorator<?>>( codec );
 
         // Decode the ExtendedResponse PDU
         try
@@ -100,7 +100,7 @@ public class ExtendedResponseTest extend
         }
 
         // Check the decoded ExtendedResponse PDU
-        ExtendedResponseDecorator extendedResponse = container.getMessage();
+        ExtendedResponseDecorator<?> extendedResponse = container.getMessage();
 
         assertEquals( 1, extendedResponse.getMessageId() );
         assertEquals( ResultCodeEnum.SUCCESS, extendedResponse.getLdapResult().getResultCode() );
@@ -177,8 +177,8 @@ public class ExtendedResponseTest extend
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedResponseDecorator> container = 
-            new LdapMessageContainer<ExtendedResponseDecorator>( codec );
+        LdapMessageContainer<ExtendedResponseDecorator<?>> container = 
+            new LdapMessageContainer<ExtendedResponseDecorator<?>>( codec );
 
         // Decode the ExtendedResponse PDU
         try
@@ -192,7 +192,7 @@ public class ExtendedResponseTest extend
         }
 
         // Check the decoded ExtendedResponse PDU
-        ExtendedResponseDecorator extendedResponse = container.getMessage();
+        ExtendedResponseDecorator<?> extendedResponse = container.getMessage();
 
         assertEquals( 1, extendedResponse.getMessageId() );
         assertEquals( ResultCodeEnum.SUCCESS, extendedResponse.getLdapResult().getResultCode() );
@@ -261,8 +261,8 @@ public class ExtendedResponseTest extend
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedResponseDecorator> container = 
-            new LdapMessageContainer<ExtendedResponseDecorator>( codec );
+        LdapMessageContainer<ExtendedResponseDecorator<?>> container = 
+            new LdapMessageContainer<ExtendedResponseDecorator<?>>( codec );
 
         // Decode the ExtendedResponse PDU
         try
@@ -344,8 +344,8 @@ public class ExtendedResponseTest extend
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedResponseDecorator> container = 
-            new LdapMessageContainer<ExtendedResponseDecorator>( codec );
+        LdapMessageContainer<ExtendedResponseDecorator<?>> container = 
+            new LdapMessageContainer<ExtendedResponseDecorator<?>>( codec );
 
         // Decode the ExtendedResponse PDU
         try
@@ -415,8 +415,8 @@ public class ExtendedResponseTest extend
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedResponseDecorator> container = 
-            new LdapMessageContainer<ExtendedResponseDecorator>( codec );
+        LdapMessageContainer<ExtendedResponseDecorator<?>> container = 
+            new LdapMessageContainer<ExtendedResponseDecorator<?>>( codec );
 
         // Decode a DelRequest PDU
         try
@@ -460,8 +460,8 @@ public class ExtendedResponseTest extend
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedResponseDecorator> container = 
-            new LdapMessageContainer<ExtendedResponseDecorator>( codec );
+        LdapMessageContainer<ExtendedResponseDecorator<?>> container = 
+            new LdapMessageContainer<ExtendedResponseDecorator<?>>( codec );
 
         // Decode a DelRequest PDU
         try
@@ -505,8 +505,8 @@ public class ExtendedResponseTest extend
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedResponseDecorator> container = 
-            new LdapMessageContainer<ExtendedResponseDecorator>( codec );
+        LdapMessageContainer<ExtendedResponseDecorator<?>> container = 
+            new LdapMessageContainer<ExtendedResponseDecorator<?>>( codec );
 
         // Decode a DelRequest PDU
         try
@@ -551,8 +551,8 @@ public class ExtendedResponseTest extend
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedResponseDecorator> container = 
-            new LdapMessageContainer<ExtendedResponseDecorator>( codec );
+        LdapMessageContainer<ExtendedResponseDecorator<?>> container = 
+            new LdapMessageContainer<ExtendedResponseDecorator<?>>( codec );
 
         // Decode the ExtendedResponse PDU
         try
@@ -566,7 +566,7 @@ public class ExtendedResponseTest extend
         }
 
         // Check the decoded ExtendedResponse PDU
-        ExtendedResponseDecorator extendedResponse = container.getMessage();
+        ExtendedResponseDecorator<?> extendedResponse = container.getMessage();
 
         assertEquals( 1, extendedResponse.getMessageId() );
         assertEquals( ResultCodeEnum.SUCCESS, extendedResponse.getLdapResult().getResultCode() );
@@ -638,8 +638,8 @@ public class ExtendedResponseTest extend
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedResponseDecorator> container = 
-            new LdapMessageContainer<ExtendedResponseDecorator>( codec );
+        LdapMessageContainer<ExtendedResponseDecorator<?>> container = 
+            new LdapMessageContainer<ExtendedResponseDecorator<?>>( codec );
 
         // Decode the ExtendedResponse PDU
         try
@@ -653,7 +653,7 @@ public class ExtendedResponseTest extend
         }
 
         // Check the decoded ExtendedResponse PDU
-        ExtendedResponseDecorator extendedResponse = container.getMessage();
+        ExtendedResponseDecorator<?> extendedResponse = container.getMessage();
 
         assertEquals( 1, extendedResponse.getMessageId() );
         assertEquals( ResultCodeEnum.SUCCESS, extendedResponse.getLdapResult().getResultCode() );
@@ -731,8 +731,8 @@ public class ExtendedResponseTest extend
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedResponseDecorator> container = 
-            new LdapMessageContainer<ExtendedResponseDecorator>( codec );
+        LdapMessageContainer<ExtendedResponseDecorator<?>> container = 
+            new LdapMessageContainer<ExtendedResponseDecorator<?>>( codec );
 
         // Decode the ExtendedResponse PDU
         try
@@ -746,7 +746,7 @@ public class ExtendedResponseTest extend
         }
 
         // Check the decoded ExtendedResponse PDU
-        ExtendedResponseDecorator extendedResponse = container.getMessage();
+        ExtendedResponseDecorator<?> extendedResponse = container.getMessage();
 
         assertEquals( 1, extendedResponse.getMessageId() );
         assertEquals( ResultCodeEnum.SUCCESS, extendedResponse.getLdapResult().getResultCode() );
@@ -819,8 +819,8 @@ public class ExtendedResponseTest extend
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedResponseDecorator> container = 
-            new LdapMessageContainer<ExtendedResponseDecorator>( codec );
+        LdapMessageContainer<ExtendedResponseDecorator<?>> container = 
+            new LdapMessageContainer<ExtendedResponseDecorator<?>>( codec );
 
         // Decode the ExtendedResponse PDU
         try
@@ -834,7 +834,7 @@ public class ExtendedResponseTest extend
         }
 
         // Check the decoded ExtendedResponse PDU
-        ExtendedResponseDecorator extendedResponse = container.getMessage();
+        ExtendedResponseDecorator<?> extendedResponse = container.getMessage();
 
         assertEquals( 1, extendedResponse.getMessageId() );
         assertEquals( ResultCodeEnum.SUCCESS, extendedResponse.getLdapResult().getResultCode() );

Modified: directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/extendedResponse/InitExtendedResponse.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/extendedResponse/InitExtendedResponse.java?rev=1072850&r1=1072849&r2=1072850&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/extendedResponse/InitExtendedResponse.java (original)
+++ directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/extendedResponse/InitExtendedResponse.java Mon Feb 21 05:00:19 2011
@@ -37,7 +37,7 @@ import org.slf4j.LoggerFactory;
  * </pre>
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class InitExtendedResponse extends GrammarAction<LdapMessageContainer<ExtendedResponseDecorator>>
+public class InitExtendedResponse extends GrammarAction<LdapMessageContainer<ExtendedResponseDecorator<?>>>
 {
     /** The logger */
     private static final Logger LOG = LoggerFactory.getLogger( InitExtendedResponse.class );
@@ -54,10 +54,10 @@ public class InitExtendedResponse extend
     /**
      * {@inheritDoc}
      */
-    public void action( LdapMessageContainer<ExtendedResponseDecorator> container ) throws DecoderException
+    public void action( LdapMessageContainer<ExtendedResponseDecorator<?>> container ) throws DecoderException
     {
         // Now, we can allocate the ExtendedResponse Object
-        ExtendedResponseDecorator extendedResponse = new ExtendedResponseDecorator(
+        ExtendedResponseDecorator<?> extendedResponse = new ExtendedResponseDecorator<ExtendedResponseImpl>(
             container.getLdapCodecService(), new ExtendedResponseImpl( container.getMessageId() ) );
         container.setMessage( extendedResponse );
 

Modified: directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/extendedResponse/StoreExtendedResponseValue.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/extendedResponse/StoreExtendedResponseValue.java?rev=1072850&r1=1072849&r2=1072850&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/extendedResponse/StoreExtendedResponseValue.java (original)
+++ directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/extendedResponse/StoreExtendedResponseValue.java Mon Feb 21 05:00:19 2011
@@ -39,7 +39,7 @@ import org.slf4j.LoggerFactory;
  * </pre>
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class StoreExtendedResponseValue extends GrammarAction<LdapMessageContainer<ExtendedResponseDecorator>>
+public class StoreExtendedResponseValue extends GrammarAction<LdapMessageContainer<ExtendedResponseDecorator<?>>>
 {
     /** The logger */
     private static final Logger LOG = LoggerFactory.getLogger( StoreExtendedResponseValue.class );
@@ -60,10 +60,10 @@ public class StoreExtendedResponseValue 
     /**
      * {@inheritDoc}
      */
-    public void action( LdapMessageContainer<ExtendedResponseDecorator> container ) throws DecoderException
+    public void action( LdapMessageContainer<ExtendedResponseDecorator<?>> container ) throws DecoderException
     {
         // We can allocate the ExtendedResponse Object
-        ExtendedResponseDecorator extendedResponse = container.getMessage();
+        ExtendedResponseDecorator<?> extendedResponse = container.getMessage();
 
         // Get the Value and store it in the ExtendedResponse
         TLV tlv = container.getCurrentTLV();

Modified: directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/extendedResponse/StoreResponseName.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/extendedResponse/StoreResponseName.java?rev=1072850&r1=1072849&r2=1072850&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/extendedResponse/StoreResponseName.java (original)
+++ directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/extendedResponse/StoreResponseName.java Mon Feb 21 05:00:19 2011
@@ -44,7 +44,7 @@ import org.slf4j.LoggerFactory;
  * </pre>
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class StoreResponseName extends GrammarAction<LdapMessageContainer<ExtendedResponseDecorator>>
+public class StoreResponseName extends GrammarAction<LdapMessageContainer<ExtendedResponseDecorator<?>>>
 {
     /** The logger */
     private static final Logger LOG = LoggerFactory.getLogger( StoreResponseName.class );
@@ -65,7 +65,7 @@ public class StoreResponseName extends G
     /**
      * {@inheritDoc}
      */
-    public void action( LdapMessageContainer<ExtendedResponseDecorator> container ) throws DecoderException
+    public void action( LdapMessageContainer<ExtendedResponseDecorator<?>> container ) throws DecoderException
     {
         // We can allocate the ExtendedResponse Object
         ExtendedResponse extendedResponse = container.getMessage();

Modified: directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/api/ExtendedResponseDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/api/ExtendedResponseDecorator.java?rev=1072850&r1=1072849&r2=1072850&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/api/ExtendedResponseDecorator.java (original)
+++ directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/api/ExtendedResponseDecorator.java Mon Feb 21 05:00:19 2011
@@ -37,7 +37,7 @@ import org.apache.directory.shared.util.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class ExtendedResponseDecorator extends ResponseDecorator<ExtendedResponse> 
+public class ExtendedResponseDecorator<R extends ExtendedResponse> extends ResponseDecorator<R> 
     implements ExtendedResponse
 {
     private static final long serialVersionUID = -9029282485890195506L;
@@ -56,7 +56,7 @@ public class ExtendedResponseDecorator e
      *
      * @param decoratedMessage the decorated ExtendedResponse
      */
-    public ExtendedResponseDecorator( LdapCodecService codec, ExtendedResponse decoratedMessage )
+    public ExtendedResponseDecorator( LdapCodecService codec, R decoratedMessage )
     {
         super( codec, decoratedMessage );
     }

Modified: directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/api/MessageDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/api/MessageDecorator.java?rev=1072850&r1=1072849&r2=1072850&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/api/MessageDecorator.java (original)
+++ directory/shared/branches/akarasulu/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/api/MessageDecorator.java Mon Feb 21 05:00:19 2011
@@ -150,7 +150,7 @@ public abstract class MessageDecorator<E
                 break;
                 
             case EXTENDED_RESPONSE:
-                decorator = new ExtendedResponseDecorator( codec, ( ExtendedResponse ) decoratedMessage );
+                decorator = new ExtendedResponseDecorator<ExtendedResponse>( codec, ( ExtendedResponse ) decoratedMessage );
                 break;
                 
             case INTERMEDIATE_RESPONSE:

Modified: directory/shared/branches/akarasulu/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/extended/ExtendedResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/extended/ExtendedResponseTest.java?rev=1072850&r1=1072849&r2=1072850&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/extended/ExtendedResponseTest.java (original)
+++ directory/shared/branches/akarasulu/ldap-codec/src/test/java/org/apache/directory/shared/ldap/codec/extended/ExtendedResponseTest.java Mon Feb 21 05:00:19 2011
@@ -85,8 +85,8 @@ public class ExtendedResponseTest extend
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedResponseDecorator> container = 
-            new LdapMessageContainer<ExtendedResponseDecorator>( codec );
+        LdapMessageContainer<ExtendedResponseDecorator<?>> container = 
+            new LdapMessageContainer<ExtendedResponseDecorator<?>>( codec );
 
         // Decode the ExtendedResponse PDU
         try
@@ -100,7 +100,7 @@ public class ExtendedResponseTest extend
         }
 
         // Check the decoded ExtendedResponse PDU
-        ExtendedResponseDecorator extendedResponse = container.getMessage();
+        ExtendedResponseDecorator<?> extendedResponse = container.getMessage();
 
         assertEquals( 1, extendedResponse.getMessageId() );
         assertEquals( ResultCodeEnum.SUCCESS, extendedResponse.getLdapResult().getResultCode() );
@@ -177,8 +177,8 @@ public class ExtendedResponseTest extend
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedResponseDecorator> container = 
-            new LdapMessageContainer<ExtendedResponseDecorator>( codec );
+        LdapMessageContainer<ExtendedResponseDecorator<?>> container = 
+            new LdapMessageContainer<ExtendedResponseDecorator<?>>( codec );
 
         // Decode the ExtendedResponse PDU
         try
@@ -192,7 +192,7 @@ public class ExtendedResponseTest extend
         }
 
         // Check the decoded ExtendedResponse PDU
-        ExtendedResponseDecorator extendedResponse = container.getMessage();
+        ExtendedResponseDecorator<?> extendedResponse = container.getMessage();
 
         assertEquals( 1, extendedResponse.getMessageId() );
         assertEquals( ResultCodeEnum.SUCCESS, extendedResponse.getLdapResult().getResultCode() );
@@ -261,8 +261,8 @@ public class ExtendedResponseTest extend
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedResponseDecorator> container = 
-            new LdapMessageContainer<ExtendedResponseDecorator>( codec );
+        LdapMessageContainer<ExtendedResponseDecorator<?>> container = 
+            new LdapMessageContainer<ExtendedResponseDecorator<?>>( codec );
 
         // Decode the ExtendedResponse PDU
         try
@@ -344,8 +344,8 @@ public class ExtendedResponseTest extend
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedResponseDecorator> container = 
-            new LdapMessageContainer<ExtendedResponseDecorator>( codec );
+        LdapMessageContainer<ExtendedResponseDecorator<?>> container = 
+            new LdapMessageContainer<ExtendedResponseDecorator<?>>( codec );
 
         // Decode the ExtendedResponse PDU
         try
@@ -415,8 +415,8 @@ public class ExtendedResponseTest extend
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedResponseDecorator> container = 
-            new LdapMessageContainer<ExtendedResponseDecorator>( codec );
+        LdapMessageContainer<ExtendedResponseDecorator<?>> container = 
+            new LdapMessageContainer<ExtendedResponseDecorator<?>>( codec );
 
         // Decode a DelRequest PDU
         try
@@ -460,8 +460,8 @@ public class ExtendedResponseTest extend
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedResponseDecorator> container = 
-            new LdapMessageContainer<ExtendedResponseDecorator>( codec );
+        LdapMessageContainer<ExtendedResponseDecorator<?>> container = 
+            new LdapMessageContainer<ExtendedResponseDecorator<?>>( codec );
 
         // Decode a DelRequest PDU
         try
@@ -505,8 +505,8 @@ public class ExtendedResponseTest extend
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedResponseDecorator> container = 
-            new LdapMessageContainer<ExtendedResponseDecorator>( codec );
+        LdapMessageContainer<ExtendedResponseDecorator<?>> container = 
+            new LdapMessageContainer<ExtendedResponseDecorator<?>>( codec );
 
         // Decode a DelRequest PDU
         try
@@ -551,8 +551,8 @@ public class ExtendedResponseTest extend
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedResponseDecorator> container = 
-            new LdapMessageContainer<ExtendedResponseDecorator>( codec );
+        LdapMessageContainer<ExtendedResponseDecorator<?>> container = 
+            new LdapMessageContainer<ExtendedResponseDecorator<?>>( codec );
 
         // Decode the ExtendedResponse PDU
         try
@@ -566,7 +566,7 @@ public class ExtendedResponseTest extend
         }
 
         // Check the decoded ExtendedResponse PDU
-        ExtendedResponseDecorator extendedResponse = container.getMessage();
+        ExtendedResponseDecorator<?> extendedResponse = container.getMessage();
 
         assertEquals( 1, extendedResponse.getMessageId() );
         assertEquals( ResultCodeEnum.SUCCESS, extendedResponse.getLdapResult().getResultCode() );
@@ -638,8 +638,8 @@ public class ExtendedResponseTest extend
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedResponseDecorator> container = 
-            new LdapMessageContainer<ExtendedResponseDecorator>( codec );
+        LdapMessageContainer<ExtendedResponseDecorator<?>> container = 
+            new LdapMessageContainer<ExtendedResponseDecorator<?>>( codec );
 
         // Decode the ExtendedResponse PDU
         try
@@ -653,7 +653,7 @@ public class ExtendedResponseTest extend
         }
 
         // Check the decoded ExtendedResponse PDU
-        ExtendedResponseDecorator extendedResponse = container.getMessage();
+        ExtendedResponseDecorator<?> extendedResponse = container.getMessage();
 
         assertEquals( 1, extendedResponse.getMessageId() );
         assertEquals( ResultCodeEnum.SUCCESS, extendedResponse.getLdapResult().getResultCode() );
@@ -731,8 +731,8 @@ public class ExtendedResponseTest extend
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedResponseDecorator> container = 
-            new LdapMessageContainer<ExtendedResponseDecorator>( codec );
+        LdapMessageContainer<ExtendedResponseDecorator<?>> container = 
+            new LdapMessageContainer<ExtendedResponseDecorator<?>>( codec );
 
         // Decode the ExtendedResponse PDU
         try
@@ -746,7 +746,7 @@ public class ExtendedResponseTest extend
         }
 
         // Check the decoded ExtendedResponse PDU
-        ExtendedResponseDecorator extendedResponse = container.getMessage();
+        ExtendedResponseDecorator<?> extendedResponse = container.getMessage();
 
         assertEquals( 1, extendedResponse.getMessageId() );
         assertEquals( ResultCodeEnum.SUCCESS, extendedResponse.getLdapResult().getResultCode() );
@@ -819,8 +819,8 @@ public class ExtendedResponseTest extend
         stream.flip();
 
         // Allocate a LdapMessage Container
-        LdapMessageContainer<ExtendedResponseDecorator> container = 
-            new LdapMessageContainer<ExtendedResponseDecorator>( codec );
+        LdapMessageContainer<ExtendedResponseDecorator<?>> container = 
+            new LdapMessageContainer<ExtendedResponseDecorator<?>>( codec );
 
         // Decode the ExtendedResponse PDU
         try
@@ -834,7 +834,7 @@ public class ExtendedResponseTest extend
         }
 
         // Check the decoded ExtendedResponse PDU
-        ExtendedResponseDecorator extendedResponse = container.getMessage();
+        ExtendedResponseDecorator<?> extendedResponse = container.getMessage();
 
         assertEquals( 1, extendedResponse.getMessageId() );
         assertEquals( ResultCodeEnum.SUCCESS, extendedResponse.getLdapResult().getResultCode() );

Modified: directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/ExtrasBundleActivator.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/ExtrasBundleActivator.java?rev=1072850&r1=1072849&r2=1072850&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/ExtrasBundleActivator.java (original)
+++ directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/ExtrasBundleActivator.java Mon Feb 21 05:00:19 2011
@@ -36,10 +36,10 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.extras.controls.syncrepl_impl.SyncModifyDnFactory;
 import org.apache.directory.shared.ldap.extras.controls.syncrepl_impl.SyncRequestValueFactory;
 import org.apache.directory.shared.ldap.extras.controls.syncrepl_impl.SyncStateValueFactory;
-import org.apache.directory.shared.ldap.extras.extended.CertGenerationRequest;
 import org.apache.directory.shared.ldap.extras.extended.GracefulDisconnect;
 import org.apache.directory.shared.ldap.extras.extended.GracefulShutdownRequest;
 import org.apache.directory.shared.ldap.extras.extended.CancelRequest;
+import org.apache.directory.shared.ldap.extras.extended.ICertGenerationRequest;
 import org.apache.directory.shared.ldap.extras.extended.StoredProcedureRequest;
 import org.apache.directory.shared.ldap.extras.extended.ads_impl.CancelFactory;
 import org.apache.directory.shared.ldap.extras.extended.ads_impl.CertGenerationFactory;
@@ -151,7 +151,7 @@ public class ExtrasBundleActivator imple
         codec.unregisterControl( PasswordPolicy.OID );
         
         codec.unregisterExtendedRequest( CancelRequest.EXTENSION_OID );
-        codec.unregisterExtendedRequest( CertGenerationRequest.EXTENSION_OID );
+        codec.unregisterExtendedRequest( ICertGenerationRequest.EXTENSION_OID );
         codec.unregisterExtendedRequest( GracefulShutdownRequest.EXTENSION_OID );
         codec.unregisterExtendedRequest( StoredProcedureRequest.EXTENSION_OID );
         

Modified: directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/CertGenerationRequest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/CertGenerationRequest.java?rev=1072850&r1=1072849&r2=1072850&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/CertGenerationRequest.java (original)
+++ directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/CertGenerationRequest.java Mon Feb 21 05:00:19 2011
@@ -20,18 +20,7 @@
 package org.apache.directory.shared.ldap.extras.extended;
 
 
-import javax.naming.NamingException;
-import javax.naming.ldap.ExtendedResponse;
-
-import org.apache.directory.shared.asn1.DecoderException;
-import org.apache.directory.shared.asn1.EncoderException;
-import org.apache.directory.shared.i18n.I18n;
-import org.apache.directory.shared.ldap.extras.extended.ads_impl.CertGenerationDecoder;
-import org.apache.directory.shared.ldap.extras.extended.ads_impl.CertGenerationObject;
-import org.apache.directory.shared.ldap.model.message.ExtendedRequestImpl;
-import org.apache.directory.shared.ldap.model.message.ResultResponse;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.directory.shared.ldap.model.message.AbstractExtendedRequest;
 
 
 /**
@@ -41,18 +30,24 @@ import org.slf4j.LoggerFactory;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class CertGenerationRequest extends ExtendedRequestImpl
+public class CertGenerationRequest extends AbstractExtendedRequest<ICertGenerationResponse> implements ICertGenerationRequest
 {
     /** The serial version UUID */
     private static final long serialVersionUID = 1L;
 
-    private CertGenerationObject certGenObj;
+    /** the Dn of the server entry which will be updated*/
+    private String targetDN;
 
-    private static final Logger LOG = LoggerFactory.getLogger( CertGenerationRequest.class );
+    /** the issuer Dn that will be set in the certificate*/
+    private String issuerDN;// = "CN=ApacheDS, OU=Directory, O=ASF, C=US";
 
-    public static final String EXTENSION_OID = "1.3.6.1.4.1.18060.0.1.8";
+    /** the Dn of the subject that is present in the certificate*/
+    private String subjectDN;// = "CN=ApacheDS, OU=Directory, O=ASF, C=US";
 
+    /** name of the algorithm used for generating the keys*/
+    private String keyAlgorithm;// = "RSA";
 
+    
     /**
      * Creates a new instance of CertGenerationRequest.
      *
@@ -66,12 +61,10 @@ public class CertGenerationRequest exten
     {
         super( messageId );
         setRequestName( EXTENSION_OID );
-
-        this.certGenObj = new CertGenerationObject();
-        certGenObj.setTargetDN( targerDN );
-        certGenObj.setIssuerDN( issuerDN );
-        certGenObj.setSubjectDN( subjectDN );
-        certGenObj.setKeyAlgorithm( keyAlgorithm );
+        this.targetDN = targerDN;
+        this.issuerDN = issuerDN;
+        this.subjectDN = subjectDN;
+        this.keyAlgorithm = keyAlgorithm;
     }
 
 
@@ -81,127 +74,97 @@ public class CertGenerationRequest exten
     public CertGenerationRequest()
     {
         setRequestName( EXTENSION_OID );
-        this.certGenObj = new CertGenerationObject();
-    }
-
-
-    public void setequestValue( byte[] requestValue )
-    {
-        CertGenerationDecoder decoder = new CertGenerationDecoder();
-
-        try
-        {
-            certGenObj = (CertGenerationObject) decoder.decode( requestValue );
-
-            if ( requestValue != null )
-            {
-                this.requestValue = new byte[requestValue.length];
-                System.arraycopy( requestValue, 0, this.requestValue, 0, requestValue.length );
-            }
-            else
-            {
-                this.requestValue = null;
-            }
-        }
-        catch ( DecoderException e )
-        {
-            LOG.error( I18n.err( I18n.ERR_04165 ), e );
-            throw new RuntimeException( e );
-        }
-    }
-
-
-    public ExtendedResponse createExtendedResponse( String id, byte[] berValue, int offset, int length )
-        throws NamingException
-    {
-        return ( ExtendedResponse ) getResultResponse();
     }
 
 
     /**
      * {@inheritDoc}
      */
-    public byte[] getRequestValue()
-    {
-        if ( requestValue == null )
-        {
-            try
-            {
-                requestValue = certGenObj.encode().array();
-            }
-            catch ( EncoderException e )
-            {
-                LOG.error( I18n.err( I18n.ERR_04167 ), e );
-                throw new RuntimeException( e );
-            }
-        }
-
-        if ( requestValue == null )
-        {
-            return null;
-        }
-
-        final byte[] copy = new byte[requestValue.length];
-        System.arraycopy( requestValue, 0, copy, 0, requestValue.length );
-        return copy;
-    }
-
-
-    public ResultResponse getResultResponse()
-    {
-        if ( response == null )
-        {
-            response = new CertGenerationResponse( getMessageId() );
-        }
-
-        return response;
-    }
-
-
     public String getTargetDN()
     {
-        return certGenObj.getTargetDN();
+        return targetDN;
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public void setTargetDN( String targetDN )
     {
-        certGenObj.setTargetDN( targetDN );
+        this.targetDN = targetDN;
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public String getIssuerDN()
     {
-        return certGenObj.getIssuerDN();
+        return issuerDN;
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public void setIssuerDN( String issuerDN )
     {
-        certGenObj.setIssuerDN( issuerDN );
+        this.issuerDN = issuerDN;
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public String getSubjectDN()
     {
-        return certGenObj.getSubjectDN();
+        return subjectDN;
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public void setSubjectDN( String subjectDN )
     {
-        certGenObj.setSubjectDN( subjectDN );
+        this.subjectDN = subjectDN;
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public String getKeyAlgorithm()
     {
-        return certGenObj.getKeyAlgorithm();
+        return keyAlgorithm;
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public void setKeyAlgorithm( String keyAlgorithm )
     {
-        certGenObj.setKeyAlgorithm( keyAlgorithm );
+        this.keyAlgorithm = keyAlgorithm;
+    }
+
+
+    @Override
+    public ICertGenerationResponse getResultResponse()
+    {
+        return new CertGenerationResponse();
+    }
+    
+    
+    @Override
+    public String toString()
+    {
+        StringBuilder sb = new StringBuilder();
+        sb.append( "Certficate Generation Object { " ).append( " Target Dn: " ).append( targetDN ).append( ',' );
+        sb.append( " Issuer Dn: " ).append( issuerDN ).append( ',' );
+        sb.append( " Subject Dn: " ).append( subjectDN ).append( ',' );
+        sb.append( " Key Algorithm: " ).append( keyAlgorithm ).append( " }" );
+
+        return sb.toString();
     }
 }

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=1072850&r1=1072849&r2=1072850&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 Mon Feb 21 05:00:19 2011
@@ -23,7 +23,6 @@ package org.apache.directory.shared.ldap
 import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.model.message.ExtendedResponseImpl;
 import org.apache.directory.shared.ldap.model.message.ResultCodeEnum;
-import org.apache.directory.shared.util.StringConstants;
 
 
 /**
@@ -32,15 +31,11 @@ import org.apache.directory.shared.util.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class CertGenerationResponse extends ExtendedResponseImpl
+public class CertGenerationResponse extends ExtendedResponseImpl implements ICertGenerationResponse
 {
     /** The serial version UUID */
     private static final long serialVersionUID = 1L;
 
-    /** The CertGenerationResponse OID */
-    public static final String EXTENSION_OID = "1.3.6.1.4.1.18060.0.1.9";
-
-
     public CertGenerationResponse( int messageId, ResultCodeEnum rcode )
     {
         super( messageId, EXTENSION_OID );
@@ -78,33 +73,6 @@ public class CertGenerationResponse exte
     }
 
 
-    // ------------------------------------------------------------------------
-    // ExtendedResponse Interface Method Implementations
-    // ------------------------------------------------------------------------
-
-    /**
-     * Gets the reponse OID specific encoded response values.
-     * 
-     * @return the response specific encoded response values.
-     */
-    public byte[] getResponse()
-    {
-        return StringConstants.EMPTY_BYTES;
-    }
-
-
-    /**
-     * Sets the response OID specific encoded response values.
-     * 
-     * @param value
-     *            the response specific encoded response values.
-     */
-    public void setResponse( byte[] value )
-    {
-        // do nothing here instead
-    }
-
-
     /**
      * Gets the OID uniquely identifying this extended response (a.k.a. its
      * name).

Added: directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ICertGenerationRequest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ICertGenerationRequest.java?rev=1072850&view=auto
==============================================================================
--- directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ICertGenerationRequest.java (added)
+++ directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ICertGenerationRequest.java Mon Feb 21 05:00:19 2011
@@ -0,0 +1,59 @@
+/*
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *   or more contributor license agreements.  See the NOTICE file
+ *   distributed with this work for additional information
+ *   regarding copyright ownership.  The ASF licenses this file
+ *   to you under the Apache License, Version 2.0 (the
+ *   "License"); you may not use this file except in compliance
+ *   with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing,
+ *   software distributed under the License is distributed on an
+ *   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *   KIND, either express or implied.  See the License for the
+ *   specific language governing permissions and limitations
+ *   under the License.
+ *
+ */
+package org.apache.directory.shared.ldap.extras.extended;
+
+
+import org.apache.directory.shared.ldap.model.message.ExtendedRequest;
+
+
+/**
+ * The interface for a certificate generation request extended operation.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public interface ICertGenerationRequest extends ExtendedRequest<ICertGenerationResponse>
+{
+    public static final String EXTENSION_OID = "1.3.6.1.4.1.18060.0.1.8";
+
+
+    String getTargetDN();
+
+
+    void setTargetDN( String targetDN );
+
+
+    String getIssuerDN();
+
+
+    void setIssuerDN( String issuerDN );
+
+
+    String getSubjectDN();
+
+
+    void setSubjectDN( String subjectDN );
+
+
+    String getKeyAlgorithm();
+
+
+    void setKeyAlgorithm( String keyAlgorithm );
+
+}
\ No newline at end of file

Added: directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ICertGenerationResponse.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ICertGenerationResponse.java?rev=1072850&view=auto
==============================================================================
--- directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ICertGenerationResponse.java (added)
+++ directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ICertGenerationResponse.java Mon Feb 21 05:00:19 2011
@@ -0,0 +1,35 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.directory.shared.ldap.extras.extended;
+
+
+import org.apache.directory.shared.ldap.model.message.ExtendedResponse;
+
+
+/**
+ * The interface for the certificate generation extended operation.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public interface ICertGenerationResponse extends ExtendedResponse
+{
+    /** The CertGenerationResponse OID */
+    public static final String EXTENSION_OID = "1.3.6.1.4.1.18060.0.1.9";
+}
\ 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/CancelResponseDecorator.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/CancelResponseDecorator.java?rev=1072850&r1=1072849&r2=1072850&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/CancelResponseDecorator.java (original)
+++ directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/CancelResponseDecorator.java Mon Feb 21 05:00:19 2011
@@ -23,7 +23,6 @@ package org.apache.directory.shared.ldap
 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.CancelResponse;
-import org.apache.directory.shared.ldap.model.message.ExtendedResponse;
 
 
 /**
@@ -31,7 +30,7 @@ import org.apache.directory.shared.ldap.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class CancelResponseDecorator extends ExtendedResponseDecorator implements CancelResponse
+public class CancelResponseDecorator extends ExtendedResponseDecorator<CancelResponse> implements CancelResponse
 {
     /**
      * Creates a new instance of CancelResponseDecorator.
@@ -39,7 +38,7 @@ public class CancelResponseDecorator ext
      * @param codec
      * @param decoratedMessage
      */
-    public CancelResponseDecorator( LdapCodecService codec, ExtendedResponse decoratedMessage )
+    public CancelResponseDecorator( LdapCodecService codec, CancelResponse decoratedMessage )
     {
         super( codec, decoratedMessage );
     }

Modified: directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/CertGenerationContainer.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/CertGenerationContainer.java?rev=1072850&r1=1072849&r2=1072850&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/CertGenerationContainer.java (original)
+++ directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/CertGenerationContainer.java Mon Feb 21 05:00:19 2011
@@ -19,10 +19,11 @@
  */
 package org.apache.directory.shared.ldap.extras.extended.ads_impl;
 
+
 import org.apache.directory.shared.asn1.ber.AbstractContainer;
 
+
 /**
- * 
  * A container for certificate generation request codec.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
@@ -30,7 +31,7 @@ import org.apache.directory.shared.asn1.
 public class CertGenerationContainer extends AbstractContainer
 {
     /** CertGenerationObject */
-    private CertGenerationObject certGenObj;
+    private CertGenerationRequestDecorator certGenObj;
 
 
     /**
@@ -49,7 +50,7 @@ public class CertGenerationContainer ext
     /**
      * @return Returns the CertGenerationObject instance.
      */
-    public CertGenerationObject getCertGenerationObject()
+    public CertGenerationRequestDecorator getCertGenerationObject()
     {
         return certGenObj;
     }
@@ -61,7 +62,7 @@ public class CertGenerationContainer ext
      * 
      * @param certGenObj the CertGenerationObject to set.
      */
-    public void setCertGenerationObject( CertGenerationObject certGenObj )
+    public void setCertGenerationObject( CertGenerationRequestDecorator certGenObj )
     {
         this.certGenObj = certGenObj;
     }

Modified: directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/CertGenerationDecoder.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/CertGenerationDecoder.java?rev=1072850&r1=1072849&r2=1072850&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/CertGenerationDecoder.java (original)
+++ directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/CertGenerationDecoder.java Mon Feb 21 05:00:19 2011
@@ -52,12 +52,11 @@ public class CertGenerationDecoder exten
         ByteBuffer bb = ByteBuffer.wrap( stream );
         CertGenerationContainer container = new CertGenerationContainer();
         decoder.decode( bb, container );
-        CertGenerationObject certGenObj = container.getCertGenerationObject();
+        CertGenerationRequestDecorator certGenObj = container.getCertGenerationObject();
 
         // Clean the container for the next decoding
         container.clean();
 
-        return certGenObj;
+        return certGenObj.getCertGenerationObject();
     }
-
 }

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=1072850&r1=1072849&r2=1072850&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 Mon Feb 21 05:00:19 2011
@@ -22,8 +22,11 @@ package org.apache.directory.shared.ldap
 
 import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.ldap.codec.api.ExtendedRequestFactory;
+import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
 import org.apache.directory.shared.ldap.extras.extended.CertGenerationRequest;
 import org.apache.directory.shared.ldap.extras.extended.CertGenerationResponse;
+import org.apache.directory.shared.ldap.extras.extended.ICertGenerationRequest;
+import org.apache.directory.shared.ldap.extras.extended.ICertGenerationResponse;
 
 
 /**
@@ -33,32 +36,41 @@ import org.apache.directory.shared.ldap.
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public class CertGenerationFactory 
-    implements ExtendedRequestFactory<CertGenerationRequest, CertGenerationResponse>
+    implements ExtendedRequestFactory<ICertGenerationRequest, ICertGenerationResponse>
 {
+    private LdapCodecService codec;
+    
+    
+    public CertGenerationFactory( LdapCodecService codec )
+    {
+        this.codec = codec;
+    }
+    
+    
     /**
      * {@inheritDoc}
      */
     public String getOid()
     {
-        return CertGenerationRequest.EXTENSION_OID;
+        return ICertGenerationRequest.EXTENSION_OID;
     }
 
     
     /**
      * {@inheritDoc}
      */
-    public CertGenerationRequest newRequest()
+    public ICertGenerationRequest newRequest()
     {
-        return new CertGenerationRequest();
+        return new CertGenerationRequestDecorator( codec, new CertGenerationRequest() );
     }
 
 
     /**
      * {@inheritDoc}
      */
-    public CertGenerationResponse newResponse( byte[] encodedValue ) throws DecoderException
+    public ICertGenerationResponse newResponse( byte[] encodedValue ) throws DecoderException
     {
-        CertGenerationResponse response = new CertGenerationResponse();
+        CertGenerationResponseDecorator response = new CertGenerationResponseDecorator( codec, new CertGenerationResponse() );
         response.setResponseValue( encodedValue );
         return response;
     }

Modified: directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/CertGenerationGrammar.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/CertGenerationGrammar.java?rev=1072850&r1=1072849&r2=1072850&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/CertGenerationGrammar.java (original)
+++ directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/CertGenerationGrammar.java Mon Feb 21 05:00:19 2011
@@ -28,6 +28,8 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.ber.tlv.Value;
 import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.i18n.I18n;
+import org.apache.directory.shared.ldap.codec.api.LdapCodecServiceFactory;
+import org.apache.directory.shared.ldap.extras.extended.CertGenerationRequest;
 import org.apache.directory.shared.ldap.model.name.Dn;
 import org.apache.directory.shared.util.Strings;
 import org.slf4j.Logger;
@@ -88,7 +90,8 @@ public class CertGenerationGrammar exten
             {
                 public void action( CertGenerationContainer container )
                 {
-                    CertGenerationObject certGenerationObject = new CertGenerationObject();
+                    CertGenerationRequestDecorator certGenerationObject = new CertGenerationRequestDecorator( 
+                        LdapCodecServiceFactory.getSingleton(), new CertGenerationRequest() );
                     container.setCertGenerationObject( certGenerationObject );
                 }
             } );

Modified: directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/CertGenerationObject.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/CertGenerationObject.java?rev=1072850&r1=1072849&r2=1072850&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/CertGenerationObject.java (original)
+++ directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/CertGenerationObject.java Mon Feb 21 05:00:19 2011
@@ -26,6 +26,7 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.EncoderException;
 import org.apache.directory.shared.asn1.ber.tlv.UniversalTag;
 import org.apache.directory.shared.asn1.ber.tlv.Value;
+import org.apache.directory.shared.ldap.extras.extended.ICertGenerationRequest;
 import org.apache.directory.shared.util.Strings;
 
 
@@ -46,19 +47,15 @@ import org.apache.directory.shared.util.
  */
 public class CertGenerationObject extends AbstractAsn1Object
 {
-
-    /** the Dn of the server entry which will be updated*/
-    private String targetDN;
-
-    /** the issuer Dn that will be set in the certificate*/
-    private String issuerDN;// = "CN=ApacheDS, OU=Directory, O=ASF, C=US";
-
-    /** the Dn of the subject that is present in the certificate*/
-    private String subjectDN;// = "CN=ApacheDS, OU=Directory, O=ASF, C=US";
-
-    /** name of the algorithm used for generating the keys*/
-    private String keyAlgorithm;// = "RSA";
-
+    private ICertGenerationRequest request;
+    
+    
+    public CertGenerationObject( ICertGenerationRequest request )
+    {
+        this.request = request;
+    }
+    
+    
     /** stores the length of the request*/
     private int requestLength = 0;
 
@@ -66,16 +63,16 @@ public class CertGenerationObject extend
     @Override
     public int computeLength()
     {
-        int len = Strings.getBytesUtf8(targetDN).length;
+        int len = Strings.getBytesUtf8( request.getTargetDN() ).length;
         requestLength = 1 + Value.getNbBytes( len ) + len;
 
-        len = Strings.getBytesUtf8(issuerDN).length;
+        len = Strings.getBytesUtf8( request.getIssuerDN() ).length;
         requestLength += 1 + Value.getNbBytes( len ) + len;
 
-        len = Strings.getBytesUtf8(subjectDN).length;
+        len = Strings.getBytesUtf8( request.getSubjectDN() ).length;
         requestLength += 1 + Value.getNbBytes( len ) + len;
 
-        len = Strings.getBytesUtf8(keyAlgorithm).length;
+        len = Strings.getBytesUtf8( request.getKeyAlgorithm() ).length;
         requestLength += 1 + Value.getNbBytes( len ) + len;
 
         return 1 + Value.getNbBytes( requestLength ) + requestLength;
@@ -89,72 +86,11 @@ public class CertGenerationObject extend
         bb.put( UniversalTag.SEQUENCE.getValue() );
         bb.put( Value.getBytes( requestLength ) );
 
-        Value.encode( bb, targetDN );
-        Value.encode( bb, issuerDN );
-        Value.encode( bb, subjectDN );
-        Value.encode( bb, keyAlgorithm );
+        Value.encode( bb, request.getTargetDN() );
+        Value.encode( bb, request.getIssuerDN() );
+        Value.encode( bb, request.getSubjectDN() );
+        Value.encode( bb, request.getKeyAlgorithm() );
 
         return bb;
     }
-
-
-    public String getTargetDN()
-    {
-        return targetDN;
-    }
-
-
-    public void setTargetDN( String targetDN )
-    {
-        this.targetDN = targetDN;
-    }
-
-
-    public String getIssuerDN()
-    {
-        return issuerDN;
-    }
-
-
-    public void setIssuerDN( String issuerDN )
-    {
-        this.issuerDN = issuerDN;
-    }
-
-
-    public String getSubjectDN()
-    {
-        return subjectDN;
-    }
-
-
-    public void setSubjectDN( String subjectDN )
-    {
-        this.subjectDN = subjectDN;
-    }
-
-
-    public String getKeyAlgorithm()
-    {
-        return keyAlgorithm;
-    }
-
-
-    public void setKeyAlgorithm( String keyAlgorithm )
-    {
-        this.keyAlgorithm = keyAlgorithm;
-    }
-
-
-    @Override
-    public String toString()
-    {
-        StringBuilder sb = new StringBuilder();
-        sb.append( "Certficate Generation Object { " ).append( " Target Dn: " ).append( targetDN ).append( ',' );
-        sb.append( " Issuer Dn: " ).append( issuerDN ).append( ',' );
-        sb.append( " Subject Dn: " ).append( subjectDN ).append( ',' );
-        sb.append( " Key Algorithm: " ).append( keyAlgorithm ).append( " }" );
-
-        return sb.toString();
-    }
 }

Added: directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/CertGenerationRequestDecorator.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/CertGenerationRequestDecorator.java?rev=1072850&view=auto
==============================================================================
--- directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/CertGenerationRequestDecorator.java (added)
+++ directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/CertGenerationRequestDecorator.java Mon Feb 21 05:00:19 2011
@@ -0,0 +1,202 @@
+/*
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *   or more contributor license agreements.  See the NOTICE file
+ *   distributed with this work for additional information
+ *   regarding copyright ownership.  The ASF licenses this file
+ *   to you under the Apache License, Version 2.0 (the
+ *   "License"); you may not use this file except in compliance
+ *   with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing,
+ *   software distributed under the License is distributed on an
+ *   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *   KIND, either express or implied.  See the License for the
+ *   specific language governing permissions and limitations
+ *   under the License.
+ *
+ */
+package org.apache.directory.shared.ldap.extras.extended.ads_impl;
+
+
+import org.apache.directory.shared.asn1.DecoderException;
+import org.apache.directory.shared.asn1.EncoderException;
+import org.apache.directory.shared.i18n.I18n;
+import org.apache.directory.shared.ldap.codec.api.ExtendedRequestDecorator;
+import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
+import org.apache.directory.shared.ldap.extras.extended.ICertGenerationRequest;
+import org.apache.directory.shared.ldap.extras.extended.ICertGenerationResponse;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * A Decorator for CancelRequests.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class CertGenerationRequestDecorator 
+    extends ExtendedRequestDecorator<ICertGenerationRequest,ICertGenerationResponse> 
+    implements ICertGenerationRequest
+{
+    private static final Logger LOG = LoggerFactory.getLogger( CertGenerationRequestDecorator.class );
+    
+
+    private CertGenerationObject certGenObj;
+
+
+    public CertGenerationRequestDecorator( LdapCodecService codec, ICertGenerationRequest decoratedMessage )
+    {
+        super( codec, decoratedMessage );
+        certGenObj = new CertGenerationObject( decoratedMessage );
+    }
+
+    
+    CertGenerationObject getCertGenerationObject()
+    {
+        return certGenObj;
+    }
+    
+    
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void setRequestValue( byte[] requestValue )
+    {
+        CertGenerationDecoder decoder = new CertGenerationDecoder();
+
+        try
+        {
+            certGenObj = ( CertGenerationObject ) decoder.decode( requestValue );
+
+            if ( requestValue != null )
+            {
+                this.requestValue = new byte[requestValue.length];
+                System.arraycopy( requestValue, 0, this.requestValue, 0, requestValue.length );
+            }
+            else
+            {
+                this.requestValue = null;
+            }
+        }
+        catch ( DecoderException e )
+        {
+            LOG.error( I18n.err( I18n.ERR_04165 ), e );
+            throw new RuntimeException( e );
+        }
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public byte[] getRequestValue()
+    {
+        if ( requestValue == null )
+        {
+            try
+            {
+                requestValue = certGenObj.encode().array();
+            }
+            catch ( EncoderException e )
+            {
+                LOG.error( I18n.err( I18n.ERR_04167 ), e );
+                throw new RuntimeException( e );
+            }
+        }
+
+        if ( requestValue == null )
+        {
+            return null;
+        }
+
+        final byte[] copy = new byte[requestValue.length];
+        System.arraycopy( requestValue, 0, copy, 0, requestValue.length );
+        return copy;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public ICertGenerationResponse getResultResponse()
+    {
+        return getDecorated().getResultResponse();
+    }
+    
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getTargetDN()
+    {
+        return getDecorated().getTargetDN();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setTargetDN( String targetDN )
+    {
+        getDecorated().setTargetDN( targetDN );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getIssuerDN()
+    {
+        return getDecorated().getIssuerDN();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setIssuerDN( String issuerDN )
+    {
+        getDecorated().setIssuerDN( issuerDN );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getSubjectDN()
+    {
+        return getDecorated().getSubjectDN();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setSubjectDN( String subjectDN )
+    {
+        getDecorated().setSubjectDN( subjectDN );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getKeyAlgorithm()
+    {
+        return getDecorated().getKeyAlgorithm();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setKeyAlgorithm( String keyAlgorithm )
+    {
+        getDecorated().setKeyAlgorithm( keyAlgorithm );
+    }
+}

Added: directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/CertGenerationResponseDecorator.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/CertGenerationResponseDecorator.java?rev=1072850&view=auto
==============================================================================
--- directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/CertGenerationResponseDecorator.java (added)
+++ directory/shared/branches/akarasulu/ldap-extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/extended/ads_impl/CertGenerationResponseDecorator.java Mon Feb 21 05:00:19 2011
@@ -0,0 +1,45 @@
+/*
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *   or more contributor license agreements.  See the NOTICE file
+ *   distributed with this work for additional information
+ *   regarding copyright ownership.  The ASF licenses this file
+ *   to you under the Apache License, Version 2.0 (the
+ *   "License"); you may not use this file except in compliance
+ *   with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing,
+ *   software distributed under the License is distributed on an
+ *   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *   KIND, either express or implied.  See the License for the
+ *   specific language governing permissions and limitations
+ *   under the License.
+ *
+ */
+package org.apache.directory.shared.ldap.extras.extended.ads_impl;
+
+
+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.ICertGenerationResponse;
+
+
+/**
+ * A Decorator for CancelResponses.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class CertGenerationResponseDecorator extends ExtendedResponseDecorator<ICertGenerationResponse> implements ICertGenerationResponse
+{
+    /**
+     * Creates a new instance of CancelResponseDecorator.
+     *
+     * @param codec
+     * @param decoratedMessage
+     */
+    public CertGenerationResponseDecorator( LdapCodecService codec, ICertGenerationResponse decoratedMessage )
+    {
+        super( codec, decoratedMessage );
+    }
+}



Mime
View raw message