directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1064392 - in /directory/shared/trunk/dsml-parser/src: main/java/org/apache/directory/shared/dsmlv2/reponse/ main/java/org/apache/directory/shared/dsmlv2/request/ test/java/org/apache/directory/shared/dsmlv2/searchResponse/
Date Fri, 28 Jan 2011 00:54:18 GMT
Author: elecharny
Date: Fri Jan 28 00:54:18 2011
New Revision: 1064392

URL: http://svn.apache.org/viewvc?rev=1064392&view=rev
Log:
Fixes for all the other DSML messages

Modified:
    directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/Dsmlv2ResponseGrammar.java
    directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResultEntryDsml.java
    directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/Dsmlv2Grammar.java
    directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/searchResponse/SearchResponseTest.java

Modified: directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/Dsmlv2ResponseGrammar.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/Dsmlv2ResponseGrammar.java?rev=1064392&r1=1064391&r2=1064392&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/Dsmlv2ResponseGrammar.java
(original)
+++ directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/Dsmlv2ResponseGrammar.java
Fri Jan 28 00:54:18 2011
@@ -39,36 +39,41 @@ import org.apache.directory.shared.dsmlv
 import org.apache.directory.shared.dsmlv2.Tag;
 import org.apache.directory.shared.dsmlv2.reponse.ErrorResponse.ErrorResponseType;
 import org.apache.directory.shared.i18n.I18n;
+import org.apache.directory.shared.ldap.codec.controls.ControlDecorator;
 import org.apache.directory.shared.ldap.codec.controls.ControlImpl;
-import org.apache.directory.shared.ldap.model.exception.LdapURLEncodingException;
+import org.apache.directory.shared.ldap.codec.decorators.MessageDecorator;
+import org.apache.directory.shared.ldap.codec.decorators.SearchResultDoneDecorator;
+import org.apache.directory.shared.ldap.codec.decorators.SearchResultEntryDecorator;
+import org.apache.directory.shared.ldap.codec.decorators.SearchResultReferenceDecorator;
 import org.apache.directory.shared.ldap.model.exception.LdapException;
 import org.apache.directory.shared.ldap.model.exception.LdapInvalidDnException;
+import org.apache.directory.shared.ldap.model.exception.LdapURLEncodingException;
 import org.apache.directory.shared.ldap.model.filter.LdapURL;
-import org.apache.directory.shared.ldap.model.message.*;
+import org.apache.directory.shared.ldap.model.message.AddResponse;
 import org.apache.directory.shared.ldap.model.message.AddResponseImpl;
 import org.apache.directory.shared.ldap.model.message.BindResponse;
 import org.apache.directory.shared.ldap.model.message.BindResponseImpl;
 import org.apache.directory.shared.ldap.model.message.CompareResponse;
 import org.apache.directory.shared.ldap.model.message.CompareResponseImpl;
+import org.apache.directory.shared.ldap.model.message.Control;
 import org.apache.directory.shared.ldap.model.message.DeleteResponse;
 import org.apache.directory.shared.ldap.model.message.DeleteResponseImpl;
 import org.apache.directory.shared.ldap.model.message.ExtendedResponse;
 import org.apache.directory.shared.ldap.model.message.ExtendedResponseImpl;
 import org.apache.directory.shared.ldap.model.message.LdapResult;
+import org.apache.directory.shared.ldap.model.message.Message;
 import org.apache.directory.shared.ldap.model.message.ModifyDnResponse;
 import org.apache.directory.shared.ldap.model.message.ModifyDnResponseImpl;
 import org.apache.directory.shared.ldap.model.message.ModifyResponse;
 import org.apache.directory.shared.ldap.model.message.ModifyResponseImpl;
 import org.apache.directory.shared.ldap.model.message.ReferralImpl;
 import org.apache.directory.shared.ldap.model.message.Response;
+import org.apache.directory.shared.ldap.model.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.model.message.ResultResponse;
-import org.apache.directory.shared.ldap.model.message.SearchResultDone;
 import org.apache.directory.shared.ldap.model.message.SearchResultDoneImpl;
-import org.apache.directory.shared.ldap.model.message.SearchResultEntry;
 import org.apache.directory.shared.ldap.model.message.SearchResultEntryImpl;
 import org.apache.directory.shared.ldap.model.message.SearchResultReference;
 import org.apache.directory.shared.ldap.model.message.SearchResultReferenceImpl;
-import org.apache.directory.shared.ldap.model.message.Control;
 import org.apache.directory.shared.ldap.model.name.Dn;
 import org.apache.directory.shared.util.Base64;
 import org.apache.directory.shared.util.Strings;
@@ -1289,7 +1294,7 @@ public final class Dsmlv2ResponseGrammar
      */
     private void createAndAddControlValue( Dsmlv2Container container, Message parent ) throws
XmlPullParserException
     {
-        Control control = parent.getCurrentControl();
+        ControlDecorator control = (ControlDecorator)((MessageDecorator)parent).getCurrentControl();
 
         XmlPullParser xpp = container.getParser();
         try
@@ -1552,7 +1557,7 @@ public final class Dsmlv2ResponseGrammar
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchResultEntry searchResultEntry = new SearchResultEntryImpl();
+            SearchResultEntryDecorator searchResultEntry = new SearchResultEntryDecorator(
new SearchResultEntryImpl() );
 
             SearchResponse searchResponse = ( SearchResponse ) container.getBatchResponse().getCurrentResponse();
 
@@ -1599,7 +1604,7 @@ public final class Dsmlv2ResponseGrammar
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchResultReference searchResultReference = new SearchResultReferenceImpl();
+            SearchResultReferenceDecorator searchResultReference = new SearchResultReferenceDecorator(
new SearchResultReferenceImpl() );
 
             SearchResponse searchResponse = ( SearchResponse ) container.getBatchResponse().getCurrentResponse();
 
@@ -1627,7 +1632,7 @@ public final class Dsmlv2ResponseGrammar
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchResultDone searchResultDone = new SearchResultDoneImpl();
+            SearchResultDoneDecorator searchResultDone = new SearchResultDoneDecorator( new
SearchResultDoneImpl() );
 
             searchResultDone.getLdapResult();
 
@@ -1673,7 +1678,7 @@ public final class Dsmlv2ResponseGrammar
         {
             SearchResponse searchResponse = ( SearchResponse ) container.getBatchResponse().getCurrentResponse();
 
-            SearchResultEntry searchResultEntry = searchResponse.getCurrentSearchResultEntry();
+            SearchResultEntryDecorator searchResultEntry = (SearchResultEntryDecorator)searchResponse.getCurrentSearchResultEntry();
 
             XmlPullParser xpp = container.getParser();
 
@@ -1709,7 +1714,7 @@ public final class Dsmlv2ResponseGrammar
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
             SearchResponse searchResponse = ( SearchResponse ) container.getBatchResponse().getCurrentResponse();
-            SearchResultEntry searchResultEntry = searchResponse.getCurrentSearchResultEntry();
+            SearchResultEntryDecorator searchResultEntry = (SearchResultEntryDecorator)searchResponse.getCurrentSearchResultEntry();
 
             XmlPullParser xpp = container.getParser();
 

Modified: directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResultEntryDsml.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResultEntryDsml.java?rev=1064392&r1=1064391&r2=1064392&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResultEntryDsml.java
(original)
+++ directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResultEntryDsml.java
Fri Jan 28 00:54:18 2011
@@ -22,6 +22,7 @@ package org.apache.directory.shared.dsml
 
 
 import org.apache.directory.shared.dsmlv2.ParserUtils;
+import org.apache.directory.shared.ldap.codec.decorators.SearchResultEntryDecorator;
 import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.model.entry.Value;
@@ -165,7 +166,7 @@ public class SearchResultEntryDsml exten
      */
     public void addAttributeType( String type ) throws LdapException
     {
-        ( ( SearchResultEntry ) instance ).addAttribute( type );
+        ( ( SearchResultEntryDecorator ) instance ).addAttribute( type );
     }
 
 
@@ -176,6 +177,6 @@ public class SearchResultEntryDsml exten
      */
     public void addAttributeValue( Object value )
     {
-        ( ( SearchResultEntry ) instance ).addAttributeValue( value );
+        ( ( SearchResultEntryDecorator ) instance ).addAttributeValue( value );
     }
 }

Modified: directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/Dsmlv2Grammar.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/Dsmlv2Grammar.java?rev=1064392&r1=1064391&r2=1064392&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/Dsmlv2Grammar.java
(original)
+++ directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/Dsmlv2Grammar.java
Fri Jan 28 00:54:18 2011
@@ -45,7 +45,12 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.codec.controls.ControlImpl;
 import org.apache.directory.shared.ldap.codec.decorators.AbandonRequestDecorator;
 import org.apache.directory.shared.ldap.codec.decorators.AddRequestDecorator;
+import org.apache.directory.shared.ldap.codec.decorators.BindRequestDecorator;
+import org.apache.directory.shared.ldap.codec.decorators.CompareRequestDecorator;
+import org.apache.directory.shared.ldap.codec.decorators.DeleteRequestDecorator;
+import org.apache.directory.shared.ldap.codec.decorators.ExtendedRequestDecorator;
 import org.apache.directory.shared.ldap.codec.decorators.MessageDecorator;
+import org.apache.directory.shared.ldap.codec.decorators.ModifyDnRequestDecorator;
 import org.apache.directory.shared.ldap.codec.decorators.ModifyRequestDecorator;
 import org.apache.directory.shared.ldap.codec.decorators.SearchRequestDecorator;
 import org.apache.directory.shared.ldap.codec.search.AndFilter;
@@ -65,17 +70,13 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.message.AbandonRequestImpl;
 import org.apache.directory.shared.ldap.model.message.AddRequestImpl;
 import org.apache.directory.shared.ldap.model.message.AliasDerefMode;
-import org.apache.directory.shared.ldap.model.message.BindRequest;
 import org.apache.directory.shared.ldap.model.message.BindRequestImpl;
 import org.apache.directory.shared.ldap.model.message.CompareRequest;
 import org.apache.directory.shared.ldap.model.message.CompareRequestImpl;
-import org.apache.directory.shared.ldap.model.message.DeleteRequest;
 import org.apache.directory.shared.ldap.model.message.DeleteRequestImpl;
 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.ModifyDnRequest;
 import org.apache.directory.shared.ldap.model.message.ModifyDnRequestImpl;
-import org.apache.directory.shared.ldap.model.message.ModifyRequest;
 import org.apache.directory.shared.ldap.model.message.ModifyRequestImpl;
 import org.apache.directory.shared.ldap.model.message.SearchRequest;
 import org.apache.directory.shared.ldap.model.message.SearchRequestImpl;
@@ -1311,7 +1312,7 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            BindRequest authRequest = new BindRequestImpl();
+            BindRequestDecorator authRequest = new BindRequestDecorator( new BindRequestImpl()
);
             container.getBatchRequest().addRequest( authRequest );
 
             authRequest.setSimple( true );
@@ -1363,7 +1364,7 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            CompareRequest compareRequest = new CompareRequestImpl();
+            CompareRequestDecorator compareRequest = new CompareRequestDecorator( new CompareRequestImpl()
);
             container.getBatchRequest().addRequest( compareRequest );
 
             XmlPullParser xpp = container.getParser();
@@ -1479,7 +1480,7 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            DeleteRequest delRequest = new DeleteRequestImpl();
+            DeleteRequestDecorator delRequest = new DeleteRequestDecorator( new DeleteRequestImpl()
);
             container.getBatchRequest().addRequest( delRequest );
 
             XmlPullParser xpp = container.getParser();
@@ -1529,7 +1530,7 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            ExtendedRequest extendedRequest = new ExtendedRequestImpl();
+            ExtendedRequestDecorator extendedRequest = new ExtendedRequestDecorator( new
ExtendedRequestImpl() );
             container.getBatchRequest().addRequest( extendedRequest );
 
             XmlPullParser xpp = container.getParser();
@@ -1638,7 +1639,7 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            ModifyDnRequest modifyDNRequest = new ModifyDnRequestImpl();
+            ModifyDnRequestDecorator modifyDNRequest = new ModifyDnRequestDecorator( new
ModifyDnRequestImpl() );
             container.getBatchRequest().addRequest( modifyDNRequest );
 
             XmlPullParser xpp = container.getParser();
@@ -1745,9 +1746,8 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            ModifyRequest modifyRequest = new ModifyRequestImpl();
-            ModifyRequestDecorator modifyRequestDecorator = new ModifyRequestDecorator( modifyRequest
);
-            container.getBatchRequest().addRequest( modifyRequestDecorator );
+            ModifyRequestDecorator modifyRequest = new ModifyRequestDecorator( new ModifyRequestImpl()
);
+            container.getBatchRequest().addRequest( modifyRequest );
 
             XmlPullParser xpp = container.getParser();
 
@@ -1888,9 +1888,8 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchRequest searchRequest = new SearchRequestImpl();
-            SearchRequestDecorator searchRequestDecorator = new SearchRequestDecorator( searchRequest
);
-            container.getBatchRequest().addRequest( searchRequestDecorator );
+            SearchRequestDecorator searchRequest = new SearchRequestDecorator( new SearchRequestImpl()
);
+            container.getBatchRequest().addRequest( searchRequest );
 
             XmlPullParser xpp = container.getParser();
 

Modified: directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/searchResponse/SearchResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/searchResponse/SearchResponseTest.java?rev=1064392&r1=1064391&r2=1064392&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/searchResponse/SearchResponseTest.java
(original)
+++ directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/searchResponse/SearchResponseTest.java
Fri Jan 28 00:54:18 2011
@@ -21,6 +21,10 @@
 package org.apache.directory.shared.dsmlv2.searchResponse;
 
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
+
 import org.apache.directory.junit.tools.Concurrent;
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.shared.dsmlv2.AbstractResponseTest;
@@ -29,10 +33,6 @@ import org.apache.directory.shared.dsmlv
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-import static org.junit.Assert.assertNotNull;
-
 /**
  * Tests for the Search Result Done Response parsing
  *



Mime
View raw message