directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r1072830 - in /directory/shared/branches/akarasulu/dsml-parser/src: main/java/org/apache/directory/shared/dsmlv2/request/ test/java/org/apache/directory/shared/dsmlv2/extendedRequest/
Date Mon, 21 Feb 2011 03:12:28 GMT
Author: akarasulu
Date: Mon Feb 21 03:12:27 2011
New Revision: 1072830

URL: http://svn.apache.org/viewvc?rev=1072830&view=rev
Log:
fixing compilation errors and generics issues

Modified:
    directory/shared/branches/akarasulu/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/Dsmlv2Grammar.java
    directory/shared/branches/akarasulu/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/ExtendedRequestDsml.java
    directory/shared/branches/akarasulu/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/extendedRequest/ExtendedRequestTest.java

Modified: directory/shared/branches/akarasulu/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/Dsmlv2Grammar.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/Dsmlv2Grammar.java?rev=1072830&r1=1072829&r2=1072830&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/Dsmlv2Grammar.java
(original)
+++ directory/shared/branches/akarasulu/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/Dsmlv2Grammar.java
Mon Feb 21 03:12:27 2011
@@ -58,6 +58,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.message.Control;
 import org.apache.directory.shared.ldap.model.message.DeleteRequestImpl;
 import org.apache.directory.shared.ldap.model.message.ExtendedRequestImpl;
+import org.apache.directory.shared.ldap.model.message.ExtendedResponseImpl;
 import org.apache.directory.shared.ldap.model.message.ModifyDnRequestImpl;
 import org.apache.directory.shared.ldap.model.message.ModifyRequestImpl;
 import org.apache.directory.shared.ldap.model.message.Request;
@@ -1526,7 +1527,8 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            ExtendedRequestDsml extendedRequest = new ExtendedRequestDsml( codec, new ExtendedRequestImpl()
);
+            ExtendedRequestDsml<?,?> extendedRequest = 
+                new ExtendedRequestDsml<ExtendedRequestImpl,ExtendedResponseImpl>(
codec, new ExtendedRequestImpl() );
             container.getBatchRequest().addRequest( extendedRequest );
 
             XmlPullParser xpp = container.getParser();
@@ -1557,7 +1559,8 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            ExtendedRequestDsml extendedRequest = ( ExtendedRequestDsml ) container.getBatchRequest().getCurrentRequest();
+            ExtendedRequestDsml<?,?> extendedRequest = ( ExtendedRequestDsml<?,?>
) 
+                container.getBatchRequest().getCurrentRequest();
 
             XmlPullParser xpp = container.getParser();
 
@@ -1597,7 +1600,8 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            ExtendedRequestDsml extendedRequest = ( ExtendedRequestDsml ) container.getBatchRequest().getCurrentRequest();
+            ExtendedRequestDsml<?,?> extendedRequest = ( ExtendedRequestDsml<?,?>
) 
+                container.getBatchRequest().getCurrentRequest();
 
             XmlPullParser xpp = container.getParser();
 

Modified: directory/shared/branches/akarasulu/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/ExtendedRequestDsml.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/ExtendedRequestDsml.java?rev=1072830&r1=1072829&r2=1072830&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/ExtendedRequestDsml.java
(original)
+++ directory/shared/branches/akarasulu/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/ExtendedRequestDsml.java
Mon Feb 21 03:12:27 2011
@@ -24,7 +24,6 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.dsmlv2.ParserUtils;
 import org.apache.directory.shared.ldap.codec.api.LdapCodecService;
 import org.apache.directory.shared.ldap.model.message.ExtendedRequest;
-import org.apache.directory.shared.ldap.model.message.ExtendedRequestImpl;
 import org.apache.directory.shared.ldap.model.message.ExtendedResponse;
 import org.apache.directory.shared.ldap.model.message.MessageTypeEnum;
 import org.dom4j.Element;
@@ -37,29 +36,20 @@ import org.dom4j.QName;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class ExtendedRequestDsml 
-    extends AbstractResultResponseRequestDsml<ExtendedRequest<ExtendedResponse>,
ExtendedResponse>
-    implements ExtendedRequest<ExtendedResponse>
+public class ExtendedRequestDsml<Q extends ExtendedRequest<P>, P extends ExtendedResponse>

+    extends AbstractResultResponseRequestDsml<Q, P>
+    implements ExtendedRequest<P>
 {
     private byte[] requestValue;
 
 
     /**
      * Creates a new getDecoratedMessage() of ExtendedRequestDsml.
-     */
-    public ExtendedRequestDsml( LdapCodecService codec )
-    {
-        super( codec, new ExtendedRequestImpl() );
-    }
-
-
-    /**
-     * Creates a new getDecoratedMessage() of ExtendedRequestDsml.
      *
      * @param ldapMessage
      *      the message to decorate
      */
-    public ExtendedRequestDsml( LdapCodecService codec, ExtendedRequest<ExtendedResponse>
ldapMessage )
+    public ExtendedRequestDsml( LdapCodecService codec, Q ldapMessage )
     {
         super( codec, ldapMessage );
     }

Modified: directory/shared/branches/akarasulu/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/extendedRequest/ExtendedRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/extendedRequest/ExtendedRequestTest.java?rev=1072830&r1=1072829&r2=1072830&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/extendedRequest/ExtendedRequestTest.java
(original)
+++ directory/shared/branches/akarasulu/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/extendedRequest/ExtendedRequestTest.java
Mon Feb 21 03:12:27 2011
@@ -72,7 +72,8 @@ public class ExtendedRequestTest extends
             fail( e.getMessage() );
         }
 
-        ExtendedRequestDsml extendedRequest = ( ExtendedRequestDsml ) parser.getBatchRequest().getCurrentRequest();
+        ExtendedRequestDsml<?,?> extendedRequest = 
+            ( ExtendedRequestDsml<?,?> ) parser.getBatchRequest().getCurrentRequest();
 
         assertEquals( 456, extendedRequest.getMessageId() );
     }
@@ -109,7 +110,8 @@ public class ExtendedRequestTest extends
             fail( e.getMessage() );
         }
 
-        ExtendedRequestDsml extendedRequest = ( ExtendedRequestDsml ) parser.getBatchRequest().getCurrentRequest();
+        ExtendedRequestDsml<?,?> extendedRequest = 
+            ( ExtendedRequestDsml<?,?> ) parser.getBatchRequest().getCurrentRequest();
         Map<String, Control> controls = extendedRequest.getControls();
 
         assertEquals( 1, extendedRequest.getControls().size() );
@@ -144,7 +146,8 @@ public class ExtendedRequestTest extends
             fail( e.getMessage() );
         }
 
-        ExtendedRequestDsml extendedRequest = ( ExtendedRequestDsml ) parser.getBatchRequest().getCurrentRequest();
+        ExtendedRequestDsml<?,?> extendedRequest = 
+            ( ExtendedRequestDsml<?,?> ) parser.getBatchRequest().getCurrentRequest();
         Map<String, Control> controls = extendedRequest.getControls();
 
         assertEquals( 1, extendedRequest.getControls().size() );
@@ -179,7 +182,8 @@ public class ExtendedRequestTest extends
             fail( e.getMessage() );
         }
 
-        ExtendedRequestDsml extendedRequest = ( ExtendedRequestDsml ) parser.getBatchRequest().getCurrentRequest();
+        ExtendedRequestDsml<?,?> extendedRequest = 
+            ( ExtendedRequestDsml<?,?> ) parser.getBatchRequest().getCurrentRequest();
         Map<String, Control> controls = extendedRequest.getControls();
 
         assertEquals( 1, extendedRequest.getControls().size() );
@@ -214,7 +218,8 @@ public class ExtendedRequestTest extends
             fail( e.getMessage() );
         }
 
-        ExtendedRequestDsml extendedRequest = ( ExtendedRequestDsml ) parser.getBatchRequest().getCurrentRequest();
+        ExtendedRequestDsml<?,?> extendedRequest = 
+            ( ExtendedRequestDsml<?,?> ) parser.getBatchRequest().getCurrentRequest();
         Map<String, Control> controls = extendedRequest.getControls();
 
         assertEquals( 2, extendedRequest.getControls().size() );
@@ -249,7 +254,8 @@ public class ExtendedRequestTest extends
             fail( e.getMessage() );
         }
 
-        ExtendedRequestDsml extendedRequest = ( ExtendedRequestDsml ) parser.getBatchRequest().getCurrentRequest();
+        ExtendedRequestDsml<?,?> extendedRequest = 
+            ( ExtendedRequestDsml<?,?> ) parser.getBatchRequest().getCurrentRequest();
         Map<String, Control> controls = extendedRequest.getControls();
 
         assertEquals( 3, extendedRequest.getControls().size() );
@@ -284,7 +290,8 @@ public class ExtendedRequestTest extends
             fail( e.getMessage() );
         }
 
-        ExtendedRequestDsml extendedRequest = ( ExtendedRequestDsml ) parser.getBatchRequest().getCurrentRequest();
+        ExtendedRequestDsml<?,?> extendedRequest = 
+            ( ExtendedRequestDsml<?,?> ) parser.getBatchRequest().getCurrentRequest();
 
         assertEquals( "foobar", new String( extendedRequest.getRequestValue() ) );
     }
@@ -311,7 +318,8 @@ public class ExtendedRequestTest extends
             fail( e.getMessage() );
         }
 
-        ExtendedRequestDsml extendedRequest = ( ExtendedRequestDsml ) parser.getBatchRequest().getCurrentRequest();
+        ExtendedRequestDsml<?,?> extendedRequest = 
+            ( ExtendedRequestDsml<?,?> ) parser.getBatchRequest().getCurrentRequest();
 
         assertEquals( "DSMLv2.0 rocks!!", new String( extendedRequest.getRequestValue() )
);
     }
@@ -368,8 +376,8 @@ public class ExtendedRequestTest extends
             fail( e.getMessage() );
         }
 
-        ExtendedRequestDsml extendedRequest = ( ExtendedRequestDsml ) parser
-            .getBatchRequest().getCurrentRequest();
+        ExtendedRequestDsml<?,?> extendedRequest = 
+            ( ExtendedRequestDsml<?,?> ) parser.getBatchRequest().getCurrentRequest();
         assertNull( extendedRequest.getRequestValue() );
     }
 



Mime
View raw message