directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r986999 [2/6] - in /directory/shared/branches/shared-codec-merge/dsml-parser/src: main/java/org/apache/directory/shared/dsmlv2/ main/java/org/apache/directory/shared/dsmlv2/engine/ main/java/org/apache/directory/shared/dsmlv2/reponse/ main/...
Date Thu, 19 Aug 2010 01:23:43 GMT
Modified: directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/Dsmlv2ResponseGrammar.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/Dsmlv2ResponseGrammar.java?rev=986999&r1=986998&r2=986999&view=diff
==============================================================================
--- directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/Dsmlv2ResponseGrammar.java (original)
+++ directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/Dsmlv2ResponseGrammar.java Thu Aug 19 01:23:41 2010
@@ -39,27 +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.LdapMessageCodec;
-import org.apache.directory.shared.ldap.codec.LdapResponseCodec;
-import org.apache.directory.shared.ldap.codec.LdapResultCodec;
-import org.apache.directory.shared.ldap.codec.add.AddResponseCodec;
-import org.apache.directory.shared.ldap.codec.bind.BindResponseCodec;
-import org.apache.directory.shared.ldap.codec.compare.CompareResponseCodec;
 import org.apache.directory.shared.ldap.codec.controls.ControlImpl;
-import org.apache.directory.shared.ldap.codec.del.DelResponseCodec;
-import org.apache.directory.shared.ldap.codec.extended.ExtendedResponseCodec;
-import org.apache.directory.shared.ldap.codec.modify.ModifyResponseCodec;
-import org.apache.directory.shared.ldap.codec.modifyDn.ModifyDNResponseCodec;
-import org.apache.directory.shared.ldap.codec.search.SearchResultDoneCodec;
-import org.apache.directory.shared.ldap.codec.search.SearchResultEntryCodec;
-import org.apache.directory.shared.ldap.codec.search.SearchResultReferenceCodec;
 import org.apache.directory.shared.ldap.codec.util.LdapURLEncodingException;
+import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
+import org.apache.directory.shared.ldap.message.AddResponse;
+import org.apache.directory.shared.ldap.message.AddResponseImpl;
+import org.apache.directory.shared.ldap.message.BindResponse;
+import org.apache.directory.shared.ldap.message.BindResponseImpl;
+import org.apache.directory.shared.ldap.message.CompareResponse;
+import org.apache.directory.shared.ldap.message.CompareResponseImpl;
+import org.apache.directory.shared.ldap.message.DeleteResponse;
+import org.apache.directory.shared.ldap.message.DeleteResponseImpl;
+import org.apache.directory.shared.ldap.message.ExtendedResponse;
+import org.apache.directory.shared.ldap.message.ExtendedResponseImpl;
+import org.apache.directory.shared.ldap.message.LdapResult;
+import org.apache.directory.shared.ldap.message.Message;
+import org.apache.directory.shared.ldap.message.ModifyDnResponse;
+import org.apache.directory.shared.ldap.message.ModifyDnResponseImpl;
+import org.apache.directory.shared.ldap.message.ModifyResponse;
+import org.apache.directory.shared.ldap.message.ModifyResponseImpl;
+import org.apache.directory.shared.ldap.message.ReferralImpl;
+import org.apache.directory.shared.ldap.message.Response;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
+import org.apache.directory.shared.ldap.message.ResultResponse;
+import org.apache.directory.shared.ldap.message.SearchResultDone;
+import org.apache.directory.shared.ldap.message.SearchResultDoneImpl;
+import org.apache.directory.shared.ldap.message.SearchResultEntry;
+import org.apache.directory.shared.ldap.message.SearchResultEntryImpl;
+import org.apache.directory.shared.ldap.message.SearchResultReference;
+import org.apache.directory.shared.ldap.message.SearchResultReferenceImpl;
 import org.apache.directory.shared.ldap.message.control.Control;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.util.Base64;
 import org.apache.directory.shared.ldap.util.LdapURL;
+import org.apache.directory.shared.ldap.util.StringTools;
 import org.xmlpull.v1.XmlPullParser;
 import org.xmlpull.v1.XmlPullParserException;
 
@@ -763,6 +777,7 @@ public class Dsmlv2ResponseGrammar exten
             String attributeValue;
             // requestID
             attributeValue = xpp.getAttributeValue( "", "requestID" );
+
             if ( attributeValue != null )
             {
                 batchResponse.setRequestID( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) );
@@ -777,13 +792,11 @@ public class Dsmlv2ResponseGrammar exten
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            AddResponseCodec addResponse = new AddResponseCodec();
+            AddResponse addResponse = new AddResponseImpl();
 
             container.getBatchResponse().addResponse( addResponse );
 
-            LdapResultCodec ldapResult = new LdapResultCodec();
-
-            addResponse.setLdapResult( ldapResult );
+            LdapResult ldapResult = addResponse.getLdapResult();
 
             XmlPullParser xpp = container.getParser();
 
@@ -791,17 +804,20 @@ public class Dsmlv2ResponseGrammar exten
             String attributeValue;
             // requestID
             attributeValue = xpp.getAttributeValue( "", "requestID" );
+
             if ( attributeValue != null )
             {
                 addResponse.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) );
             }
+
             // MatchedDN
             attributeValue = xpp.getAttributeValue( "", "matchedDN" );
+
             if ( attributeValue != null )
             {
                 try
                 {
-                    ldapResult.setMatchedDN( new DN( attributeValue ) );
+                    ldapResult.setMatchedDn( new DN( attributeValue ) );
                 }
                 catch ( LdapInvalidDnException e )
                 {
@@ -818,13 +834,11 @@ public class Dsmlv2ResponseGrammar exten
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            BindResponseCodec bindResponse = new BindResponseCodec();
+            BindResponse bindResponse = new BindResponseImpl();
 
             container.getBatchResponse().addResponse( bindResponse );
 
-            LdapResultCodec ldapResult = new LdapResultCodec();
-
-            bindResponse.setLdapResult( ldapResult );
+            LdapResult ldapResult = bindResponse.getLdapResult();
 
             XmlPullParser xpp = container.getParser();
 
@@ -832,18 +846,21 @@ public class Dsmlv2ResponseGrammar exten
             String attributeValue;
             // requestID
             attributeValue = xpp.getAttributeValue( "", "requestID" );
+
             if ( attributeValue != null )
             {
                 bindResponse.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) );
 
             }
+
             // MatchedDN
             attributeValue = xpp.getAttributeValue( "", "matchedDN" );
+
             if ( attributeValue != null )
             {
                 try
                 {
-                    ldapResult.setMatchedDN( new DN( attributeValue ) );
+                    ldapResult.setMatchedDn( new DN( attributeValue ) );
                 }
                 catch ( LdapInvalidDnException e )
                 {
@@ -860,13 +877,11 @@ public class Dsmlv2ResponseGrammar exten
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            CompareResponseCodec compareResponse = new CompareResponseCodec();
+            CompareResponse compareResponse = new CompareResponseImpl();
 
             container.getBatchResponse().addResponse( compareResponse );
 
-            LdapResultCodec ldapResult = new LdapResultCodec();
-
-            compareResponse.setLdapResult( ldapResult );
+            LdapResult ldapResult = compareResponse.getLdapResult();
 
             XmlPullParser xpp = container.getParser();
 
@@ -874,17 +889,20 @@ public class Dsmlv2ResponseGrammar exten
             String attributeValue;
             // requestID
             attributeValue = xpp.getAttributeValue( "", "requestID" );
+
             if ( attributeValue != null )
             {
                 compareResponse.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) );
             }
+
             // MatchedDN
             attributeValue = xpp.getAttributeValue( "", "matchedDN" );
+
             if ( attributeValue != null )
             {
                 try
                 {
-                    ldapResult.setMatchedDN( new DN( attributeValue ) );
+                    ldapResult.setMatchedDn( new DN( attributeValue ) );
                 }
                 catch ( LdapInvalidDnException e )
                 {
@@ -901,13 +919,11 @@ public class Dsmlv2ResponseGrammar exten
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            DelResponseCodec delResponse = new DelResponseCodec();
+            DeleteResponse delResponse = new DeleteResponseImpl();
 
             container.getBatchResponse().addResponse( delResponse );
 
-            LdapResultCodec ldapResult = new LdapResultCodec();
-
-            delResponse.setLdapResult( ldapResult );
+            LdapResult ldapResult = delResponse.getLdapResult();
 
             XmlPullParser xpp = container.getParser();
 
@@ -915,17 +931,20 @@ public class Dsmlv2ResponseGrammar exten
             String attributeValue;
             // requestID
             attributeValue = xpp.getAttributeValue( "", "requestID" );
+
             if ( attributeValue != null )
             {
                 delResponse.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) );
             }
+
             // MatchedDN
             attributeValue = xpp.getAttributeValue( "", "matchedDN" );
+
             if ( attributeValue != null )
             {
                 try
                 {
-                    ldapResult.setMatchedDN( new DN( attributeValue ) );
+                    ldapResult.setMatchedDn( new DN( attributeValue ) );
                 }
                 catch ( LdapInvalidDnException e )
                 {
@@ -942,13 +961,11 @@ public class Dsmlv2ResponseGrammar exten
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            ModifyResponseCodec modifyResponse = new ModifyResponseCodec();
+            ModifyResponse modifyResponse = new ModifyResponseImpl();
 
             container.getBatchResponse().addResponse( modifyResponse );
 
-            LdapResultCodec ldapResult = new LdapResultCodec();
-
-            modifyResponse.setLdapResult( ldapResult );
+            LdapResult ldapResult = modifyResponse.getLdapResult();
 
             XmlPullParser xpp = container.getParser();
 
@@ -956,17 +973,20 @@ public class Dsmlv2ResponseGrammar exten
             String attributeValue;
             // requestID
             attributeValue = xpp.getAttributeValue( "", "requestID" );
+
             if ( attributeValue != null )
             {
                 modifyResponse.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) );
             }
+
             // MatchedDN
             attributeValue = xpp.getAttributeValue( "", "matchedDN" );
+
             if ( attributeValue != null )
             {
                 try
                 {
-                    ldapResult.setMatchedDN( new DN( attributeValue ) );
+                    ldapResult.setMatchedDn( new DN( attributeValue ) );
                 }
                 catch ( LdapInvalidDnException e )
                 {
@@ -983,13 +1003,11 @@ public class Dsmlv2ResponseGrammar exten
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            ModifyDNResponseCodec modifyDNResponse = new ModifyDNResponseCodec();
+            ModifyDnResponse modifyDNResponse = new ModifyDnResponseImpl();
 
             container.getBatchResponse().addResponse( modifyDNResponse );
 
-            LdapResultCodec ldapResult = new LdapResultCodec();
-
-            modifyDNResponse.setLdapResult( ldapResult );
+            LdapResult ldapResult = modifyDNResponse.getLdapResult();
 
             XmlPullParser xpp = container.getParser();
 
@@ -997,17 +1015,20 @@ public class Dsmlv2ResponseGrammar exten
             String attributeValue;
             // requestID
             attributeValue = xpp.getAttributeValue( "", "requestID" );
+
             if ( attributeValue != null )
             {
                 modifyDNResponse.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) );
             }
+
             // MatchedDN
             attributeValue = xpp.getAttributeValue( "", "matchedDN" );
+
             if ( attributeValue != null )
             {
                 try
                 {
-                    ldapResult.setMatchedDN( new DN( attributeValue ) );
+                    ldapResult.setMatchedDn( new DN( attributeValue ) );
                 }
                 catch ( LdapInvalidDnException e )
                 {
@@ -1024,31 +1045,33 @@ public class Dsmlv2ResponseGrammar exten
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            ExtendedResponseCodec extendedResponse = new ExtendedResponseCodec();
-
-            container.getBatchResponse().addResponse( extendedResponse );
+            ExtendedResponse extendedResponse = null;
 
-            LdapResultCodec ldapResult = new LdapResultCodec();
-
-            extendedResponse.setLdapResult( ldapResult );
+            // Checking and adding the batchRequest's attributes
+            String attributeValue;
 
             XmlPullParser xpp = container.getParser();
 
-            // Checking and adding the batchRequest's attributes
-            String attributeValue;
             // requestID
             attributeValue = xpp.getAttributeValue( "", "requestID" );
+
             if ( attributeValue != null )
             {
-                extendedResponse.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) );
+                extendedResponse = new ExtendedResponseImpl( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) );
             }
+
+            container.getBatchResponse().addResponse( extendedResponse );
+
+            LdapResult ldapResult = extendedResponse.getLdapResult();
+
             // MatchedDN
             attributeValue = xpp.getAttributeValue( "", "matchedDN" );
+
             if ( attributeValue != null )
             {
                 try
                 {
-                    ldapResult.setMatchedDN( new DN( attributeValue ) );
+                    ldapResult.setMatchedDn( new DN( attributeValue ) );
                 }
                 catch ( LdapInvalidDnException e )
                 {
@@ -1065,19 +1088,19 @@ public class Dsmlv2ResponseGrammar exten
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            ErrorResponse errorResponse = new ErrorResponse();
-
-            container.getBatchResponse().addResponse( errorResponse );
-
+            ErrorResponse errorResponse = null;
             XmlPullParser xpp = container.getParser();
 
             // Checking and adding the batchRequest's attributes
             String attributeValue;
             // requestID
             attributeValue = xpp.getAttributeValue( "", "requestID" );
+
             if ( attributeValue != null )
             {
-                errorResponse.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) );
+                errorResponse = new ErrorResponse( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ), null );
+
+                container.getBatchResponse().addResponse( errorResponse );
             }
             // type
             attributeValue = xpp.getAttributeValue( "", "type" );
@@ -1085,36 +1108,36 @@ public class Dsmlv2ResponseGrammar exten
             {
                 if ( attributeValue.equals( errorResponse.getTypeDescr( ErrorResponseType.NOT_ATTEMPTED ) ) )
                 {
-                    errorResponse.setType( ErrorResponseType.NOT_ATTEMPTED );
+                    errorResponse.setErrorType( ErrorResponseType.NOT_ATTEMPTED );
                 }
                 else if ( attributeValue.equals( errorResponse.getTypeDescr( ErrorResponseType.COULD_NOT_CONNECT ) ) )
                 {
-                    errorResponse.setType( ErrorResponseType.COULD_NOT_CONNECT );
+                    errorResponse.setErrorType( ErrorResponseType.COULD_NOT_CONNECT );
                 }
                 else if ( attributeValue.equals( errorResponse.getTypeDescr( ErrorResponseType.CONNECTION_CLOSED ) ) )
                 {
-                    errorResponse.setType( ErrorResponseType.CONNECTION_CLOSED );
+                    errorResponse.setErrorType( ErrorResponseType.CONNECTION_CLOSED );
                 }
                 else if ( attributeValue.equals( errorResponse.getTypeDescr( ErrorResponseType.MALFORMED_REQUEST ) ) )
                 {
-                    errorResponse.setType( ErrorResponseType.MALFORMED_REQUEST );
+                    errorResponse.setErrorType( ErrorResponseType.MALFORMED_REQUEST );
                 }
                 else if ( attributeValue
                     .equals( errorResponse.getTypeDescr( ErrorResponseType.GATEWAY_INTERNAL_ERROR ) ) )
                 {
-                    errorResponse.setType( ErrorResponseType.GATEWAY_INTERNAL_ERROR );
+                    errorResponse.setErrorType( ErrorResponseType.GATEWAY_INTERNAL_ERROR );
                 }
                 else if ( attributeValue.equals( errorResponse.getTypeDescr( ErrorResponseType.AUTHENTICATION_FAILED ) ) )
                 {
-                    errorResponse.setType( ErrorResponseType.AUTHENTICATION_FAILED );
+                    errorResponse.setErrorType( ErrorResponseType.AUTHENTICATION_FAILED );
                 }
                 else if ( attributeValue.equals( errorResponse.getTypeDescr( ErrorResponseType.UNRESOLVABLE_URI ) ) )
                 {
-                    errorResponse.setType( ErrorResponseType.UNRESOLVABLE_URI );
+                    errorResponse.setErrorType( ErrorResponseType.UNRESOLVABLE_URI );
                 }
                 else if ( attributeValue.equals( errorResponse.getTypeDescr( ErrorResponseType.OTHER ) ) )
                 {
-                    errorResponse.setType( ErrorResponseType.OTHER );
+                    errorResponse.setErrorType( ErrorResponseType.OTHER );
                 }
                 else
                 {
@@ -1165,8 +1188,7 @@ public class Dsmlv2ResponseGrammar exten
      * @param parent the parent 
      * @throws XmlPullParserException
      */
-    private void createAndAddControl( Dsmlv2Container container, LdapMessageCodec parent )
-        throws XmlPullParserException
+    private void createAndAddControl( Dsmlv2Container container, Message parent ) throws XmlPullParserException
     {
         Control control = null;
 
@@ -1218,7 +1240,7 @@ public class Dsmlv2ResponseGrammar exten
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            LdapResponseCodec ldapResponse = container.getBatchResponse().getCurrentResponse();
+            Response ldapResponse = container.getBatchResponse().getCurrentResponse();
             // Search Response is a special case
             if ( ldapResponse instanceof SearchResponse )
             {
@@ -1237,7 +1259,7 @@ public class Dsmlv2ResponseGrammar exten
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            LdapMessageCodec ldapMessage = ( ( SearchResponse ) container.getBatchResponse().getCurrentResponse() )
+            Message ldapMessage = ( ( SearchResponse ) container.getBatchResponse().getCurrentResponse() )
                 .getCurrentSearchResultEntry();
             createAndAddControl( container, ldapMessage );
         }
@@ -1251,7 +1273,7 @@ public class Dsmlv2ResponseGrammar exten
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            LdapMessageCodec ldapMessage = ( ( SearchResponse ) container.getBatchResponse().getCurrentResponse() )
+            Message ldapMessage = ( ( SearchResponse ) container.getBatchResponse().getCurrentResponse() )
                 .getCurrentSearchResultReference();
             createAndAddControl( container, ldapMessage );
         }
@@ -1264,8 +1286,7 @@ public class Dsmlv2ResponseGrammar exten
      * @param parent the parent 
      * @throws XmlPullParserException
      */
-    private void createAndAddControlValue( Dsmlv2Container container, LdapMessageCodec parent )
-        throws XmlPullParserException
+    private void createAndAddControlValue( Dsmlv2Container container, Message parent ) throws XmlPullParserException
     {
         Control control = parent.getCurrentControl();
 
@@ -1304,7 +1325,7 @@ public class Dsmlv2ResponseGrammar exten
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            LdapResponseCodec ldapResponse = container.getBatchResponse().getCurrentResponse();
+            Response ldapResponse = container.getBatchResponse().getCurrentResponse();
             // Search Response is a special case
             if ( ldapResponse instanceof SearchResponse )
             {
@@ -1323,7 +1344,7 @@ public class Dsmlv2ResponseGrammar exten
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            LdapMessageCodec ldapMessage = ( ( SearchResponse ) container.getBatchResponse().getCurrentResponse() )
+            Message ldapMessage = ( ( SearchResponse ) container.getBatchResponse().getCurrentResponse() )
                 .getCurrentSearchResultEntry();
             createAndAddControlValue( container, ldapMessage );
         }
@@ -1337,7 +1358,7 @@ public class Dsmlv2ResponseGrammar exten
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            LdapMessageCodec ldapMessage = ( ( SearchResponse ) container.getBatchResponse().getCurrentResponse() )
+            Message ldapMessage = ( ( SearchResponse ) container.getBatchResponse().getCurrentResponse() )
                 .getCurrentSearchResultReference();
             createAndAddControlValue( container, ldapMessage );
         }
@@ -1350,9 +1371,9 @@ public class Dsmlv2ResponseGrammar exten
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            LdapResponseCodec ldapResponse = container.getBatchResponse().getCurrentResponse();
+            Response ldapResponse = container.getBatchResponse().getCurrentResponse();
 
-            LdapResultCodec ldapResult = null;
+            LdapResult ldapResult = null;
 
             // Search Response is a special case
             // ResultCode can only occur in a case of Search Result Done in a Search Response
@@ -1363,7 +1384,7 @@ public class Dsmlv2ResponseGrammar exten
             }
             else
             {
-                ldapResult = ldapResponse.getLdapResult();
+                ldapResult = ( ( ResultResponse ) ldapResponse ).getLdapResult();
             }
 
             XmlPullParser xpp = container.getParser();
@@ -1372,6 +1393,7 @@ public class Dsmlv2ResponseGrammar exten
             String attributeValue;
             // code
             attributeValue = xpp.getAttributeValue( "", "code" );
+
             if ( attributeValue != null )
             {
                 try
@@ -1387,6 +1409,7 @@ public class Dsmlv2ResponseGrammar exten
             {
                 throw new XmlPullParserException( I18n.err( I18n.ERR_03010 ), xpp, null );
             }
+
             // descr
             attributeValue = xpp.getAttributeValue( "", "descr" );
 
@@ -1404,9 +1427,9 @@ public class Dsmlv2ResponseGrammar exten
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            LdapResponseCodec ldapResponse = container.getBatchResponse().getCurrentResponse();
+            ResultResponse ldapResponse = ( ResultResponse ) container.getBatchResponse().getCurrentResponse();
 
-            LdapResultCodec ldapResult = null;
+            LdapResult ldapResult = null;
 
             // Search Response is a special case
             // ResultCode can only occur in a case of Search Result Done in a Search Response
@@ -1421,9 +1444,11 @@ public class Dsmlv2ResponseGrammar exten
             }
 
             XmlPullParser xpp = container.getParser();
+
             try
             {
                 String nextText = xpp.nextText();
+
                 if ( !nextText.equals( "" ) )
                 {
                     ldapResult.setErrorMessage( nextText.trim() );
@@ -1443,9 +1468,9 @@ public class Dsmlv2ResponseGrammar exten
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            LdapResponseCodec ldapResponse = container.getBatchResponse().getCurrentResponse();
+            Response ldapResponse = container.getBatchResponse().getCurrentResponse();
 
-            LdapResultCodec ldapResult = null;
+            LdapResult ldapResult = null;
 
             // Search Response is a special case
             // ResultCode can only occur in a case of Search Result Done in a Search Response
@@ -1456,24 +1481,28 @@ public class Dsmlv2ResponseGrammar exten
             }
             else
             {
-                ldapResult = ldapResponse.getLdapResult();
+                ldapResult = ( ( ResultResponse ) ldapResponse ).getLdapResult();
             }
 
             // Initialization of the Referrals if needed
-            if ( ldapResult.getReferrals() == null )
+            if ( ldapResult.getReferral() == null )
             {
-                ldapResult.initReferrals();
+                ldapResult.setReferral( new ReferralImpl() );
             }
 
             XmlPullParser xpp = container.getParser();
+
             try
             {
                 String nextText = xpp.nextText();
+
                 if ( !nextText.equals( "" ) )
                 {
                     try
                     {
-                        ldapResult.addReferral( new LdapURL( nextText.trim() ) );
+                        String urlStr = nextText.trim();
+                        LdapURL ldapUrl = new LdapURL( urlStr );
+                        ldapResult.getReferral().addLdapUrl( ldapUrl.toString() );
                     }
                     catch ( LdapURLEncodingException e )
                     {
@@ -1495,20 +1524,22 @@ public class Dsmlv2ResponseGrammar exten
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchResponse searchResponse = new SearchResponse();
-
-            container.getBatchResponse().addResponse( searchResponse );
-
             XmlPullParser xpp = container.getParser();
+            SearchResponse searchResponse = null;
 
             // Checking and adding the batchRequest's attributes
-            String attributeValue;
-            // requestID
-            attributeValue = xpp.getAttributeValue( "", "requestID" );
+            String attributeValue = xpp.getAttributeValue( "", "requestID" );
+
             if ( attributeValue != null )
             {
-                searchResponse.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) );
+                searchResponse = new SearchResponse( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ), null );
+            }
+            else
+            {
+                searchResponse = new SearchResponse( -1, null );
             }
+
+            container.getBatchResponse().addResponse( searchResponse );
         }
     };
 
@@ -1520,7 +1551,7 @@ public class Dsmlv2ResponseGrammar exten
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchResultEntryCodec searchResultEntry = new SearchResultEntryCodec();
+            SearchResultEntry searchResultEntry = new SearchResultEntryImpl();
 
             SearchResponse searchResponse = ( SearchResponse ) container.getBatchResponse().getCurrentResponse();
 
@@ -1532,12 +1563,15 @@ public class Dsmlv2ResponseGrammar exten
             String attributeValue;
             // requestID
             attributeValue = xpp.getAttributeValue( "", "requestID" );
+
             if ( attributeValue != null )
             {
                 searchResultEntry.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) );
             }
+
             // dn
             attributeValue = xpp.getAttributeValue( "", "dn" );
+
             if ( attributeValue != null )
             {
                 try
@@ -1564,7 +1598,7 @@ public class Dsmlv2ResponseGrammar exten
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchResultReferenceCodec searchResultReference = new SearchResultReferenceCodec();
+            SearchResultReference searchResultReference = new SearchResultReferenceImpl();
 
             SearchResponse searchResponse = ( SearchResponse ) container.getBatchResponse().getCurrentResponse();
 
@@ -1576,6 +1610,7 @@ public class Dsmlv2ResponseGrammar exten
             String attributeValue;
             // requestID
             attributeValue = xpp.getAttributeValue( "", "requestID" );
+
             if ( attributeValue != null )
             {
                 searchResultReference.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) );
@@ -1591,9 +1626,9 @@ public class Dsmlv2ResponseGrammar exten
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchResultDoneCodec searchResultDone = new SearchResultDoneCodec();
+            SearchResultDone searchResultDone = new SearchResultDoneImpl();
 
-            searchResultDone.setLdapResult( new LdapResultCodec() );
+            LdapResult ldapResult = searchResultDone.getLdapResult();
 
             SearchResponse searchResponse = ( SearchResponse ) container.getBatchResponse().getCurrentResponse();
 
@@ -1605,17 +1640,20 @@ public class Dsmlv2ResponseGrammar exten
             String attributeValue;
             // requestID
             attributeValue = xpp.getAttributeValue( "", "requestID" );
+
             if ( attributeValue != null )
             {
                 searchResultDone.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) );
             }
+
             // MatchedDN
             attributeValue = xpp.getAttributeValue( "", "matchedDN" );
+
             if ( attributeValue != null )
             {
                 try
                 {
-                    searchResultDone.getLdapResult().setMatchedDN( new DN( attributeValue ) );
+                    searchResultDone.getLdapResult().setMatchedDn( new DN( attributeValue ) );
                 }
                 catch ( LdapInvalidDnException e )
                 {
@@ -1634,7 +1672,7 @@ public class Dsmlv2ResponseGrammar exten
         {
             SearchResponse searchResponse = ( SearchResponse ) container.getBatchResponse().getCurrentResponse();
 
-            SearchResultEntryCodec searchResultEntry = searchResponse.getCurrentSearchResultEntry();
+            SearchResultEntry searchResultEntry = searchResponse.getCurrentSearchResultEntry();
 
             XmlPullParser xpp = container.getParser();
 
@@ -1642,9 +1680,17 @@ public class Dsmlv2ResponseGrammar exten
             String attributeValue;
             // name
             attributeValue = xpp.getAttributeValue( "", "name" );
+
             if ( attributeValue != null )
             {
-                searchResultEntry.addAttributeValues( attributeValue );
+                try
+                {
+                    searchResultEntry.addAttribute( attributeValue );
+                }
+                catch ( LdapException le )
+                {
+                    throw new XmlPullParserException( I18n.err( I18n.ERR_03012 ), xpp, null );
+                }
             }
             else
             {
@@ -1662,9 +1708,10 @@ public class Dsmlv2ResponseGrammar exten
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
             SearchResponse searchResponse = ( SearchResponse ) container.getBatchResponse().getCurrentResponse();
-            SearchResultEntryCodec searchResultEntry = searchResponse.getCurrentSearchResultEntry();
+            SearchResultEntry searchResultEntry = searchResponse.getCurrentSearchResultEntry();
 
             XmlPullParser xpp = container.getParser();
+
             try
             {
                 // We have to catch the type Attribute Value before going to the next Text node
@@ -1672,6 +1719,7 @@ public class Dsmlv2ResponseGrammar exten
 
                 // Getting the value
                 String nextText = xpp.nextText();
+
                 if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) )
                 {
                     searchResultEntry.addAttributeValue( Base64.decode( nextText.toCharArray() ) );
@@ -1697,15 +1745,19 @@ public class Dsmlv2ResponseGrammar exten
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
             SearchResponse searchResponse = ( SearchResponse ) container.getBatchResponse().getCurrentResponse();
-            SearchResultReferenceCodec searchResultReference = searchResponse.getCurrentSearchResultReference();
+            SearchResultReference searchResultReference = searchResponse.getCurrentSearchResultReference();
 
             XmlPullParser xpp = container.getParser();
+
             try
             {
                 String nextText = xpp.nextText();
+
                 if ( !nextText.equals( "" ) )
                 {
-                    searchResultReference.addSearchResultReference( new LdapURL( nextText ) );
+                    LdapURL ldapUrl = new LdapURL( nextText );
+
+                    searchResultReference.getReferral().addLdapUrl( ldapUrl.toString() );
                 }
             }
             catch ( IOException e )
@@ -1742,16 +1794,17 @@ public class Dsmlv2ResponseGrammar exten
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            ExtendedResponseCodec extendedResponse = ( ExtendedResponseCodec ) container.getBatchResponse()
-                .getCurrentResponse();
+            ExtendedResponse extendedResponse = ( ExtendedResponse ) container.getBatchResponse().getCurrentResponse();
 
             XmlPullParser xpp = container.getParser();
+
             try
             {
                 String nextText = xpp.nextText();
+
                 if ( !nextText.equals( "" ) )
                 {
-                    extendedResponse.setResponseName( new OID( nextText.trim() ) );
+                    extendedResponse.setResponseName( new OID( nextText.trim() ).toString() );
                 }
 
             }
@@ -1773,10 +1826,10 @@ public class Dsmlv2ResponseGrammar exten
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            ExtendedResponseCodec extendedResponse = ( ExtendedResponseCodec ) container.getBatchResponse()
-                .getCurrentResponse();
+            ExtendedResponse extendedResponse = ( ExtendedResponse ) container.getBatchResponse().getCurrentResponse();
 
             XmlPullParser xpp = container.getParser();
+
             try
             {
                 // We have to catch the type Attribute Value before going to the next Text node
@@ -1784,13 +1837,14 @@ public class Dsmlv2ResponseGrammar exten
 
                 // Getting the value
                 String nextText = xpp.nextText();
+
                 if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) )
                 {
-                    extendedResponse.setResponse( Base64.decode( nextText.trim().toCharArray() ) );
+                    extendedResponse.setResponseValue( Base64.decode( nextText.trim().toCharArray() ) );
                 }
                 else
                 {
-                    extendedResponse.setResponse( nextText.trim() );
+                    extendedResponse.setResponseValue( StringTools.getBytesUtf8( nextText.trim() ) );
                 }
             }
             catch ( IOException e )

Modified: directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/ErrorResponse.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/ErrorResponse.java?rev=986999&r1=986998&r2=986999&view=diff
==============================================================================
--- directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/ErrorResponse.java (original)
+++ directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/ErrorResponse.java Thu Aug 19 01:23:41 2010
@@ -21,12 +21,10 @@
 package org.apache.directory.shared.dsmlv2.reponse;
 
 
-import java.nio.ByteBuffer;
-
-import org.apache.directory.shared.asn1.codec.EncoderException;
 import org.apache.directory.shared.dsmlv2.DsmlDecorator;
-import org.apache.directory.shared.ldap.codec.LdapResponseCodec;
 import org.apache.directory.shared.ldap.codec.MessageTypeEnum;
+import org.apache.directory.shared.ldap.message.AbstractResponse;
+import org.apache.directory.shared.ldap.message.Response;
 import org.dom4j.Element;
 
 
@@ -47,7 +45,7 @@ import org.dom4j.Element;
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class ErrorResponse extends LdapResponseCodec implements DsmlDecorator
+public class ErrorResponse extends AbstractResponse implements Response, DsmlDecorator
 {
     /**
      * This enum represents the different types of error response
@@ -60,7 +58,7 @@ public class ErrorResponse extends LdapR
     };
 
     /** The type of error response */
-    private ErrorResponseType type;
+    private ErrorResponseType errorType;
 
     /** The associated message */
     private String message;
@@ -72,8 +70,9 @@ public class ErrorResponse extends LdapR
     /**
      * Creates a new instance of ErrorResponse.
      */
-    public ErrorResponse()
+    public ErrorResponse( int id, MessageTypeEnum type )
     {
+        super( id, type );
     }
 
 
@@ -89,8 +88,9 @@ public class ErrorResponse extends LdapR
      */
     public ErrorResponse( int requestID, ErrorResponseType type, String message )
     {
+        super( requestID, null );
         this.requestID = requestID;
-        this.type = type;
+        this.errorType = type;
         this.message = message;
     }
 
@@ -109,7 +109,7 @@ public class ErrorResponse extends LdapR
         }
 
         // Type
-        element.addAttribute( "type", getTypeDescr( type ) );
+        element.addAttribute( "type", getTypeDescr( errorType ) );
 
         // TODO Add Detail
 
@@ -223,50 +223,21 @@ public class ErrorResponse extends LdapR
     /**
      * Gets the type of error response
      *
-     * @return
-     *      the type of error response
+     * @returnvthe type of error response
      */
-    public ErrorResponseType getType()
+    public ErrorResponseType getErrorType()
     {
-        return type;
+        return errorType;
     }
 
 
     /**
      * Sets the type of error response
      *
-     * @param type
-     *      the type of error response to set
+     * @param errorType the type of error response to set
      */
-    public void setType( ErrorResponseType type )
-    {
-        this.type = type;
-    }
-
-
-    @Override
-    protected int computeLengthProtocolOp()
-    {
-        return 0;
-    }
-
-
-    @Override
-    protected void encodeProtocolOp( ByteBuffer buffer ) throws EncoderException
-    {
-    }
-
-
-    @Override
-    public MessageTypeEnum getMessageType()
-    {
-        return null;
-    }
-
-
-    @Override
-    public String getMessageTypeName()
+    public void setErrorType( ErrorResponseType errorType )
     {
-        return null;
+        this.errorType = errorType;
     }
 }

Modified: directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/ExtendedResponseDsml.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/ExtendedResponseDsml.java?rev=986999&r1=986998&r2=986999&view=diff
==============================================================================
--- directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/ExtendedResponseDsml.java (original)
+++ directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/ExtendedResponseDsml.java Thu Aug 19 01:23:41 2010
@@ -22,10 +22,10 @@ package org.apache.directory.shared.dsml
 
 
 import org.apache.directory.shared.asn1.primitives.OID;
-import org.apache.directory.shared.dsmlv2.DsmlDecorator;
 import org.apache.directory.shared.dsmlv2.ParserUtils;
 import org.apache.directory.shared.ldap.codec.MessageTypeEnum;
-import org.apache.directory.shared.ldap.codec.extended.ExtendedResponseCodec;
+import org.apache.directory.shared.ldap.message.ExtendedResponse;
+import org.apache.directory.shared.ldap.message.ExtendedResponseImpl;
 import org.dom4j.Element;
 import org.dom4j.Namespace;
 import org.dom4j.QName;
@@ -36,14 +36,14 @@ import org.dom4j.QName;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class ExtendedResponseDsml extends LdapResponseDecorator implements DsmlDecorator
+public class ExtendedResponseDsml extends AbstractResponseDsml
 {
     /**
      * Creates a new instance of ExtendedResponseDsml.
      */
     public ExtendedResponseDsml()
     {
-        super( new ExtendedResponseCodec() );
+        super( new ExtendedResponseImpl( "" ) );
     }
 
 
@@ -53,18 +53,18 @@ public class ExtendedResponseDsml extend
      * @param ldapMessage
      *      the message to decorate
      */
-    public ExtendedResponseDsml( ExtendedResponseCodec ldapMessage )
+    public ExtendedResponseDsml( ExtendedResponse ldapMessage )
     {
         super( ldapMessage );
     }
 
 
     /* (non-Javadoc)
-     * @see org.apache.directory.shared.dsmlv2.reponse.LdapMessageDecorator#getMessageType()
+     * @see org.apache.directory.shared.dsmlv2.reponse.LdapMessageDecorator#getType()
      */
-    public MessageTypeEnum getMessageType()
+    public MessageTypeEnum getType()
     {
-        return instance.getMessageType();
+        return instance.getType();
     }
 
 
@@ -74,7 +74,7 @@ public class ExtendedResponseDsml extend
     public Element toDsml( Element root )
     {
         Element element = root.addElement( "extendedResponse" );
-        ExtendedResponseCodec extendedResponse = ( ExtendedResponseCodec ) instance;
+        ExtendedResponse extendedResponse = ( ExtendedResponse ) instance;
 
         // LDAP Result
         LdapResultDsml ldapResultDsml = new LdapResultDsml( extendedResponse.getLdapResult(), instance );
@@ -88,7 +88,8 @@ public class ExtendedResponseDsml extend
         }
 
         // Response
-        Object response = extendedResponse.getResponse();
+        Object response = extendedResponse.getResponseValue();
+
         if ( response != null )
         {
             if ( ParserUtils.needsBase64Encoding( response ) )
@@ -120,7 +121,7 @@ public class ExtendedResponseDsml extend
      */
     public String getResponseName()
     {
-        return ( ( ExtendedResponseCodec ) instance ).getResponseName();
+        return ( ( ExtendedResponse ) instance ).getResponseName();
     }
 
 
@@ -131,7 +132,7 @@ public class ExtendedResponseDsml extend
      */
     public void setResponseName( OID responseName )
     {
-        ( ( ExtendedResponseCodec ) instance ).setResponseName( responseName );
+        ( ( ExtendedResponse ) instance ).setResponseName( responseName.toString() );
     }
 
 
@@ -140,9 +141,9 @@ public class ExtendedResponseDsml extend
      * 
      * @return Returns the response.
      */
-    public Object getResponse()
+    public Object getResponseValue()
     {
-        return ( ( ExtendedResponseCodec ) instance ).getResponse();
+        return ( ( ExtendedResponse ) instance ).getResponseValue();
     }
 
 
@@ -151,8 +152,8 @@ public class ExtendedResponseDsml extend
      * 
      * @param response The response to set.
      */
-    public void setResponse( Object response )
+    public void setResponseValue( byte[] response )
     {
-        ( ( ExtendedResponseCodec ) instance ).setResponse( response );
+        ( ( ExtendedResponse ) instance ).setResponseValue( response );
     }
 }

Modified: directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/LdapResponseDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/LdapResponseDecorator.java?rev=986999&r1=986998&r2=986999&view=diff
==============================================================================
--- directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/LdapResponseDecorator.java (original)
+++ directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/LdapResponseDecorator.java Thu Aug 19 01:23:41 2010
@@ -22,9 +22,9 @@ package org.apache.directory.shared.dsml
 
 
 import org.apache.directory.shared.dsmlv2.LdapMessageDecorator;
-import org.apache.directory.shared.ldap.codec.LdapMessageCodec;
-import org.apache.directory.shared.ldap.codec.LdapResponseCodec;
-import org.apache.directory.shared.ldap.codec.LdapResultCodec;
+import org.apache.directory.shared.ldap.message.LdapResult;
+import org.apache.directory.shared.ldap.message.Message;
+import org.apache.directory.shared.ldap.message.ResultResponse;
 
 
 /**
@@ -40,35 +40,17 @@ public abstract class LdapResponseDecora
      * @param ldapMessage
      *      the message to decorate
      */
-    public LdapResponseDecorator( LdapMessageCodec ldapMessage )
+    public LdapResponseDecorator( Message ldapMessage )
     {
         super( ldapMessage );
     }
 
 
     /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.codec.LdapResponse#getLdapResponseLength()
-     */
-    public int getLdapResponseLength()
-    {
-        return ( ( LdapResponseCodec ) instance ).getLdapResponseLength();
-    }
-
-
-    /* (non-Javadoc)
      * @see org.apache.directory.shared.ldap.codec.LdapResponse#getLdapResult()
      */
-    public LdapResultCodec getLdapResult()
-    {
-        return ( ( LdapResponseCodec ) instance ).getLdapResult();
-    }
-
-
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.codec.LdapResponse#setLdapResult(org.apache.directory.shared.ldap.codec.LdapResult)
-     */
-    public void setLdapResult( LdapResultCodec ldapResult )
+    public LdapResult getLdapResult()
     {
-        ( ( LdapResponseCodec ) instance ).setLdapResult( ldapResult );
+        return ( ( ResultResponse ) instance ).getLdapResult();
     }
 }

Modified: directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/LdapResultDsml.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/LdapResultDsml.java?rev=986999&r1=986998&r2=986999&view=diff
==============================================================================
--- directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/LdapResultDsml.java (original)
+++ directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/LdapResultDsml.java Thu Aug 19 01:23:41 2010
@@ -25,11 +25,11 @@ import java.util.List;
 
 import org.apache.directory.shared.dsmlv2.DsmlDecorator;
 import org.apache.directory.shared.dsmlv2.ParserUtils;
-import org.apache.directory.shared.ldap.codec.LdapMessageCodec;
-import org.apache.directory.shared.ldap.codec.LdapResultCodec;
-import org.apache.directory.shared.ldap.util.LdapURL;
+import org.apache.directory.shared.ldap.message.LdapResult;
+import org.apache.directory.shared.ldap.message.Message;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.DN;
+import org.apache.directory.shared.ldap.util.LdapURL;
 import org.dom4j.Element;
 
 
@@ -41,10 +41,10 @@ import org.dom4j.Element;
 public class LdapResultDsml implements DsmlDecorator
 {
     /** The LDAP Result to decorate */
-    private LdapResultCodec result;
+    private LdapResult result;
 
     /** The associated LDAP Message */
-    private LdapMessageCodec message;
+    private Message message;
 
 
     /**
@@ -55,7 +55,7 @@ public class LdapResultDsml implements D
      * @param message
      *      the associated message
      */
-    public LdapResultDsml( LdapResultCodec result, LdapMessageCodec message )
+    public LdapResultDsml( LdapResult result, Message message )
     {
         this.result = result;
         this.message = message;
@@ -76,14 +76,15 @@ public class LdapResultDsml implements D
         }
 
         // Matched DN
-        String matchedDN = result.getMatchedDN();
+        String matchedDN = result.getMatchedDn().getName();
+
         if ( !matchedDN.equals( "" ) )
         {
             root.addAttribute( "matchedDN", matchedDN );
         }
 
         // Controls
-        ParserUtils.addControls( root, message.getControls() );
+        ParserUtils.addControls( root, message.getControls().values() );
 
         // ResultCode
         Element resultCodeElement = root.addElement( "resultCode" );
@@ -99,13 +100,14 @@ public class LdapResultDsml implements D
         }
 
         // Referals
-        List<LdapURL> referals = result.getReferrals();
+        List<String> referals = ( List<String> ) result.getReferral().getLdapUrls();
+
         if ( referals != null )
         {
-            for ( int i = 0; i < referals.size(); i++ )
+            for ( String url : referals )
             {
                 Element referalElement = root.addElement( "referal" );
-                referalElement.addText( referals.get( i ).toString() );
+                referalElement.addText( url );
             }
         }
 
@@ -114,15 +116,6 @@ public class LdapResultDsml implements D
 
 
     /**
-     * Initialize the referrals list
-     */
-    public void initReferrals()
-    {
-        result.initReferrals();
-    }
-
-
-    /**
      * Get the error message
      * 
      * @return Returns the errorMessage.
@@ -149,9 +142,9 @@ public class LdapResultDsml implements D
      * 
      * @return Returns the matchedDN.
      */
-    public String getMatchedDN()
+    public String getMatchedDn()
     {
-        return result.getMatchedDN();
+        return result.getMatchedDn().getName();
     }
 
 
@@ -160,9 +153,9 @@ public class LdapResultDsml implements D
      * 
      * @param matchedDN The matchedDN to set.
      */
-    public void setMatchedDN( DN matchedDN )
+    public void setMatchedDn( DN matchedDN )
     {
-        result.setMatchedDN( matchedDN );
+        result.setMatchedDn( matchedDN );
     }
 
 
@@ -171,9 +164,9 @@ public class LdapResultDsml implements D
      * 
      * @return Returns the referrals.
      */
-    public List<LdapURL> getReferrals()
+    public List<String> getReferrals()
     {
-        return result.getReferrals();
+        return ( List<String> ) result.getReferral().getLdapUrls();
     }
 
 
@@ -184,7 +177,7 @@ public class LdapResultDsml implements D
      */
     public void addReferral( LdapURL referral )
     {
-        result.addReferral( referral );
+        result.getReferral().addLdapUrl( referral.toString() );
     }
 
 

Modified: directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/ModDNResponseDsml.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/ModDNResponseDsml.java?rev=986999&r1=986998&r2=986999&view=diff
==============================================================================
--- directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/ModDNResponseDsml.java (original)
+++ directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/ModDNResponseDsml.java Thu Aug 19 01:23:41 2010
@@ -21,9 +21,9 @@
 package org.apache.directory.shared.dsmlv2.reponse;
 
 
-import org.apache.directory.shared.dsmlv2.DsmlDecorator;
 import org.apache.directory.shared.ldap.codec.MessageTypeEnum;
-import org.apache.directory.shared.ldap.codec.modifyDn.ModifyDNResponseCodec;
+import org.apache.directory.shared.ldap.message.ModifyDnResponse;
+import org.apache.directory.shared.ldap.message.ModifyDnResponseImpl;
 import org.dom4j.Element;
 
 
@@ -32,14 +32,14 @@ import org.dom4j.Element;
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class ModDNResponseDsml extends LdapResponseDecorator implements DsmlDecorator
+public class ModDNResponseDsml extends AbstractResponseDsml
 {
     /**
      * Creates a new instance of ModDNResponseDsml.
      */
     public ModDNResponseDsml()
     {
-        super( new ModifyDNResponseCodec() );
+        super( new ModifyDnResponseImpl() );
     }
 
 
@@ -49,18 +49,18 @@ public class ModDNResponseDsml extends L
      * @param ldapMessage
      *      the message to decorate
      */
-    public ModDNResponseDsml( ModifyDNResponseCodec ldapMessage )
+    public ModDNResponseDsml( ModifyDnResponse ldapMessage )
     {
         super( ldapMessage );
     }
 
 
     /* (non-Javadoc)
-     * @see org.apache.directory.shared.dsmlv2.reponse.LdapMessageDecorator#getMessageType()
+     * @see org.apache.directory.shared.dsmlv2.reponse.LdapMessageDecorator#getType()
      */
-    public MessageTypeEnum getMessageType()
+    public MessageTypeEnum getType()
     {
-        return instance.getMessageType();
+        return instance.getType();
     }
 
 
@@ -71,7 +71,7 @@ public class ModDNResponseDsml extends L
     {
         Element element = root.addElement( "modDNResponse" );
 
-        LdapResultDsml ldapResultDsml = new LdapResultDsml( ( ( ModifyDNResponseCodec ) instance ).getLdapResult(), instance );
+        LdapResultDsml ldapResultDsml = new LdapResultDsml( ( ( ModifyDnResponse ) instance ).getLdapResult(), instance );
         ldapResultDsml.toDsml( element );
         return element;
     }

Modified: directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/ModifyResponseDsml.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/ModifyResponseDsml.java?rev=986999&r1=986998&r2=986999&view=diff
==============================================================================
--- directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/ModifyResponseDsml.java (original)
+++ directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/ModifyResponseDsml.java Thu Aug 19 01:23:41 2010
@@ -21,9 +21,9 @@
 package org.apache.directory.shared.dsmlv2.reponse;
 
 
-import org.apache.directory.shared.dsmlv2.DsmlDecorator;
 import org.apache.directory.shared.ldap.codec.MessageTypeEnum;
-import org.apache.directory.shared.ldap.codec.modify.ModifyResponseCodec;
+import org.apache.directory.shared.ldap.message.ModifyResponse;
+import org.apache.directory.shared.ldap.message.ModifyResponseImpl;
 import org.dom4j.Element;
 
 
@@ -32,14 +32,14 @@ import org.dom4j.Element;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class ModifyResponseDsml extends LdapResponseDecorator implements DsmlDecorator
+public class ModifyResponseDsml extends AbstractResponseDsml
 {
     /**
      * Creates a new instance of ModifyResponseDsml.
      */
     public ModifyResponseDsml()
     {
-        super( new ModifyResponseCodec() );
+        super( new ModifyResponseImpl() );
     }
 
 
@@ -49,18 +49,18 @@ public class ModifyResponseDsml extends 
      * @param ldapMessage
      *      the message to decorate
      */
-    public ModifyResponseDsml( ModifyResponseCodec ldapMessage )
+    public ModifyResponseDsml( ModifyResponse ldapMessage )
     {
         super( ldapMessage );
     }
 
 
     /* (non-Javadoc)
-     * @see org.apache.directory.shared.dsmlv2.reponse.LdapMessageDecorator#getMessageType()
+     * @see org.apache.directory.shared.dsmlv2.reponse.LdapMessageDecorator#getType()
      */
-    public MessageTypeEnum getMessageType()
+    public MessageTypeEnum getType()
     {
-        return instance.getMessageType();
+        return instance.getType();
     }
 
 
@@ -71,7 +71,7 @@ public class ModifyResponseDsml extends 
     {
         Element element = root.addElement( "modifyResponse" );
 
-        LdapResultDsml ldapResultDsml = new LdapResultDsml( ( ( ModifyResponseCodec ) instance ).getLdapResult(), instance );
+        LdapResultDsml ldapResultDsml = new LdapResultDsml( ( ( ModifyResponse ) instance ).getLdapResult(), instance );
         ldapResultDsml.toDsml( element );
         return element;
     }

Modified: directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResponse.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResponse.java?rev=986999&r1=986998&r2=986999&view=diff
==============================================================================
--- directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResponse.java (original)
+++ directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResponse.java Thu Aug 19 01:23:41 2010
@@ -21,16 +21,14 @@
 package org.apache.directory.shared.dsmlv2.reponse;
 
 
-import java.nio.ByteBuffer;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.directory.shared.asn1.codec.EncoderException;
-import org.apache.directory.shared.ldap.codec.LdapResponseCodec;
 import org.apache.directory.shared.ldap.codec.MessageTypeEnum;
-import org.apache.directory.shared.ldap.codec.search.SearchResultDoneCodec;
-import org.apache.directory.shared.ldap.codec.search.SearchResultEntryCodec;
-import org.apache.directory.shared.ldap.codec.search.SearchResultReferenceCodec;
+import org.apache.directory.shared.ldap.message.AbstractResponse;
+import org.apache.directory.shared.ldap.message.SearchResultDone;
+import org.apache.directory.shared.ldap.message.SearchResultEntry;
+import org.apache.directory.shared.ldap.message.SearchResultReference;
 
 
 /**
@@ -38,25 +36,24 @@ import org.apache.directory.shared.ldap.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class SearchResponse extends LdapResponseCodec
+public class SearchResponse extends AbstractResponse
 {
     /** The List of contained Search Result Entries */
-    private List<SearchResultEntryCodec> searchResultEntryList;
+    private List<SearchResultEntry> searchResultEntryList = new ArrayList<SearchResultEntry>();
 
     /** The List of contained Search Result References */
-    private List<SearchResultReferenceCodec> searchResultReferenceList;
+    private List<SearchResultReference> searchResultReferenceList = new ArrayList<SearchResultReference>();
 
     /** The Search Result Done object */
-    private SearchResultDoneCodec searchResultDone;
+    private SearchResultDone searchResultDone;
 
 
     /**
      * Creates a new instance of SearchResponse.
      */
-    public SearchResponse()
+    public SearchResponse( int messageId, MessageTypeEnum type )
     {
-        searchResultEntryList = new ArrayList<SearchResultEntryCodec>();
-        searchResultReferenceList = new ArrayList<SearchResultReferenceCodec>();
+        super( -1, type );
     }
 
 
@@ -68,7 +65,7 @@ public class SearchResponse extends Ldap
      * @return
      *      true (as per the general contract of the Collection.add method)
      */
-    public boolean addSearchResultEntry( SearchResultEntryCodec searchResultEntry )
+    public boolean addSearchResultEntry( SearchResultEntry searchResultEntry )
     {
         return searchResultEntryList.add( searchResultEntry );
     }
@@ -80,7 +77,7 @@ public class SearchResponse extends Ldap
      * @return
      *      the current Searche Result Entry
      */
-    public SearchResultEntryCodec getCurrentSearchResultEntry()
+    public SearchResultEntry getCurrentSearchResultEntry()
     {
         if ( searchResultEntryList.size() > 0 )
         {
@@ -99,7 +96,7 @@ public class SearchResponse extends Ldap
      * @return
      *      the Search Result Entry List
      */
-    public List<SearchResultEntryCodec> getSearchResultEntryList()
+    public List<SearchResultEntry> getSearchResultEntryList()
     {
         return searchResultEntryList;
     }
@@ -113,7 +110,7 @@ public class SearchResponse extends Ldap
      * @return
      *      true (as per the general contract of the Collection.add method)
      */
-    public boolean addSearchResultReference( SearchResultReferenceCodec searchResultReference )
+    public boolean addSearchResultReference( SearchResultReference searchResultReference )
     {
         return searchResultReferenceList.add( searchResultReference );
     }
@@ -125,7 +122,7 @@ public class SearchResponse extends Ldap
      * @return
      *      the current Search Result Reference
      */
-    public SearchResultReferenceCodec getCurrentSearchResultReference()
+    public SearchResultReference getCurrentSearchResultReference()
     {
         if ( searchResultReferenceList.size() > 0 )
         {
@@ -144,7 +141,7 @@ public class SearchResponse extends Ldap
      * @return
      *      the Search Result Reference List
      */
-    public List<SearchResultReferenceCodec> getSearchResultReferenceList()
+    public List<SearchResultReference> getSearchResultReferenceList()
     {
         return searchResultReferenceList;
     }
@@ -156,7 +153,7 @@ public class SearchResponse extends Ldap
      * @return
      *      the Search Result Entry
      */
-    public SearchResultDoneCodec getSearchResultDone()
+    public SearchResultDone getSearchResultDone()
     {
         return searchResultDone;
     }
@@ -168,34 +165,14 @@ public class SearchResponse extends Ldap
      * @param searchResultDone
      *      the Search Result Entry to set
      */
-    public void setSearchResultDone( SearchResultDoneCodec searchResultDone )
+    public void setSearchResultDone( SearchResultDone searchResultDone )
     {
         this.searchResultDone = searchResultDone;
     }
 
 
     @Override
-    protected int computeLengthProtocolOp()
-    {
-        return 0;
-    }
-
-
-    @Override
-    protected void encodeProtocolOp( ByteBuffer buffer ) throws EncoderException
-    {
-    }
-
-
-    @Override
-    public MessageTypeEnum getMessageType()
-    {
-        return null;
-    }
-
-
-    @Override
-    public String getMessageTypeName()
+    public MessageTypeEnum getType()
     {
         return null;
     }

Modified: directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResponseDsml.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResponseDsml.java?rev=986999&r1=986998&r2=986999&view=diff
==============================================================================
--- directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResponseDsml.java (original)
+++ directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResponseDsml.java Thu Aug 19 01:23:41 2010
@@ -24,7 +24,7 @@ import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.directory.shared.dsmlv2.DsmlDecorator;
-import org.apache.directory.shared.ldap.codec.LdapMessageCodec;
+import org.apache.directory.shared.ldap.message.Message;
 import org.dom4j.Element;
 
 
@@ -35,7 +35,7 @@ import org.dom4j.Element;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class SearchResponseDsml extends LdapResponseDecorator implements DsmlDecorator
+public class SearchResponseDsml extends AbstractResponseDsml
 {
     /** The responses */
     private List<DsmlDecorator> responses = new ArrayList<DsmlDecorator>();
@@ -44,7 +44,7 @@ public class SearchResponseDsml extends 
     /**
      * Creates a new instance of SearchResponseDsml.
      */
-    public SearchResponseDsml( LdapMessageCodec response )
+    public SearchResponseDsml( Message response )
     {
         super( response );
     }

Modified: directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResultDoneDsml.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResultDoneDsml.java?rev=986999&r1=986998&r2=986999&view=diff
==============================================================================
--- directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResultDoneDsml.java (original)
+++ directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResultDoneDsml.java Thu Aug 19 01:23:41 2010
@@ -21,9 +21,9 @@
 package org.apache.directory.shared.dsmlv2.reponse;
 
 
-import org.apache.directory.shared.dsmlv2.DsmlDecorator;
 import org.apache.directory.shared.ldap.codec.MessageTypeEnum;
-import org.apache.directory.shared.ldap.codec.search.SearchResultDoneCodec;
+import org.apache.directory.shared.ldap.message.SearchResultDone;
+import org.apache.directory.shared.ldap.message.SearchResultDoneImpl;
 import org.dom4j.Element;
 
 
@@ -32,14 +32,14 @@ import org.dom4j.Element;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class SearchResultDoneDsml extends LdapResponseDecorator implements DsmlDecorator
+public class SearchResultDoneDsml extends AbstractResponseDsml
 {
     /**
      * Creates a new instance of SearchResultDoneDsml.
      */
     public SearchResultDoneDsml()
     {
-        super( new SearchResultDoneCodec() );
+        super( new SearchResultDoneImpl() );
     }
 
 
@@ -49,18 +49,18 @@ public class SearchResultDoneDsml extend
      * @param ldapMessage
      *      the message to decorate
      */
-    public SearchResultDoneDsml( SearchResultDoneCodec ldapMessage )
+    public SearchResultDoneDsml( SearchResultDone ldapMessage )
     {
         super( ldapMessage );
     }
 
 
     /* (non-Javadoc)
-     * @see org.apache.directory.shared.dsmlv2.reponse.LdapMessageDecorator#getMessageType()
+     * @see org.apache.directory.shared.dsmlv2.reponse.LdapMessageDecorator#getType()
      */
-    public MessageTypeEnum getMessageType()
+    public MessageTypeEnum getType()
     {
-        return instance.getMessageType();
+        return instance.getType();
     }
 
 
@@ -71,12 +71,12 @@ public class SearchResultDoneDsml extend
     {
         Element element = root.addElement( "searchResultDone" );
 
-        LdapResultDsml ldapResultDsml = new LdapResultDsml( ( ( SearchResultDoneCodec ) instance ).getLdapResult(), instance );
-        if ( ldapResultDsml != null)
+        LdapResultDsml ldapResultDsml = new LdapResultDsml( ( ( SearchResultDone ) instance ).getLdapResult(), instance );
+        if ( ldapResultDsml != null )
         {
-            ldapResultDsml.toDsml( element ); 
+            ldapResultDsml.toDsml( element );
         }
-        
+
         return element;
     }
 }

Modified: directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResultEntryDsml.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResultEntryDsml.java?rev=986999&r1=986998&r2=986999&view=diff
==============================================================================
--- directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResultEntryDsml.java (original)
+++ directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResultEntryDsml.java Thu Aug 19 01:23:41 2010
@@ -21,13 +21,14 @@
 package org.apache.directory.shared.dsmlv2.reponse;
 
 
-import org.apache.directory.shared.dsmlv2.DsmlDecorator;
 import org.apache.directory.shared.dsmlv2.ParserUtils;
 import org.apache.directory.shared.ldap.codec.MessageTypeEnum;
-import org.apache.directory.shared.ldap.codec.search.SearchResultEntryCodec;
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.entry.Value;
+import org.apache.directory.shared.ldap.exception.LdapException;
+import org.apache.directory.shared.ldap.message.SearchResultEntry;
+import org.apache.directory.shared.ldap.message.SearchResultEntryImpl;
 import org.apache.directory.shared.ldap.name.DN;
 import org.dom4j.Element;
 import org.dom4j.Namespace;
@@ -39,14 +40,14 @@ import org.dom4j.QName;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class SearchResultEntryDsml extends LdapResponseDecorator implements DsmlDecorator
+public class SearchResultEntryDsml extends AbstractResponseDsml
 {
     /**
      * Creates a new instance of SearchResultEntryDsml.
      */
     public SearchResultEntryDsml()
     {
-        super( new SearchResultEntryCodec() );
+        super( new SearchResultEntryImpl() );
     }
 
 
@@ -56,18 +57,18 @@ public class SearchResultEntryDsml exten
      * @param ldapMessage
      *      the message to decorate
      */
-    public SearchResultEntryDsml( SearchResultEntryCodec ldapMessage )
+    public SearchResultEntryDsml( SearchResultEntry ldapMessage )
     {
         super( ldapMessage );
     }
 
 
     /* (non-Javadoc)
-     * @see org.apache.directory.shared.dsmlv2.reponse.LdapMessageDecorator#getMessageType()
+     * @see org.apache.directory.shared.dsmlv2.reponse.LdapMessageDecorator#getType()
      */
-    public MessageTypeEnum getMessageType()
+    public MessageTypeEnum getType()
     {
-        return instance.getMessageType();
+        return instance.getType();
     }
 
 
@@ -77,7 +78,7 @@ public class SearchResultEntryDsml exten
     public Element toDsml( Element root )
     {
         Element element = root.addElement( "searchResultEntry" );
-        SearchResultEntryCodec searchResultEntry = ( SearchResultEntryCodec ) instance;
+        SearchResultEntry searchResultEntry = ( SearchResultEntry ) instance;
         element.addAttribute( "dn", searchResultEntry.getObjectName().getName() );
 
         Entry entry = searchResultEntry.getEntry();
@@ -119,7 +120,7 @@ public class SearchResultEntryDsml exten
      */
     public DN getObjectName()
     {
-        return ( ( SearchResultEntryCodec ) instance ).getObjectName();
+        return ( ( SearchResultEntry ) instance ).getObjectName();
     }
 
 
@@ -130,7 +131,7 @@ public class SearchResultEntryDsml exten
      */
     public void setObjectName( DN objectName )
     {
-        ( ( SearchResultEntryCodec ) instance ).setObjectName( objectName );
+        ( ( SearchResultEntry ) instance ).setObjectName( objectName );
     }
 
 
@@ -141,7 +142,7 @@ public class SearchResultEntryDsml exten
      */
     public Entry getEntry()
     {
-        return ( ( SearchResultEntryCodec ) instance ).getEntry();
+        return ( ( SearchResultEntry ) instance ).getEntry();
     }
 
 
@@ -152,7 +153,7 @@ public class SearchResultEntryDsml exten
      */
     public void setEntry( Entry entry )
     {
-        ( ( SearchResultEntryCodec ) instance ).setEntry( entry );
+        ( ( SearchResultEntry ) instance ).setEntry( entry );
     }
 
 
@@ -161,9 +162,9 @@ public class SearchResultEntryDsml exten
      * 
      * @param type The attribute's name
      */
-    public void addAttributeValues( String type )
+    public void addAttributeType( String type ) throws LdapException
     {
-        ( ( SearchResultEntryCodec ) instance ).addAttributeValues( type );
+        ( ( SearchResultEntry ) instance ).addAttribute( type );
     }
 
 
@@ -174,15 +175,6 @@ public class SearchResultEntryDsml exten
      */
     public void addAttributeValue( Object value )
     {
-        ( ( SearchResultEntryCodec ) instance ).addAttributeValue( value );
-    }
-
-
-    /**
-     * @return Returns the currentAttributeValue.
-     */
-    public String getCurrentAttributeValueType()
-    {
-        return ( ( SearchResultEntryCodec ) instance ).getCurrentAttributeValueType();
+        ( ( SearchResultEntry ) instance ).addAttributeValue( value );
     }
 }

Modified: directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResultReferenceDsml.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResultReferenceDsml.java?rev=986999&r1=986998&r2=986999&view=diff
==============================================================================
--- directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResultReferenceDsml.java (original)
+++ directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResultReferenceDsml.java Thu Aug 19 01:23:41 2010
@@ -23,10 +23,10 @@ package org.apache.directory.shared.dsml
 
 import java.util.List;
 
-import org.apache.directory.shared.dsmlv2.DsmlDecorator;
-import org.apache.directory.shared.ldap.codec.LdapMessageCodec;
 import org.apache.directory.shared.ldap.codec.MessageTypeEnum;
-import org.apache.directory.shared.ldap.codec.search.SearchResultReferenceCodec;
+import org.apache.directory.shared.ldap.message.Message;
+import org.apache.directory.shared.ldap.message.SearchResultReference;
+import org.apache.directory.shared.ldap.message.SearchResultReferenceImpl;
 import org.apache.directory.shared.ldap.util.LdapURL;
 import org.dom4j.Element;
 
@@ -36,14 +36,14 @@ import org.dom4j.Element;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class SearchResultReferenceDsml extends LdapResponseDecorator implements DsmlDecorator
+public class SearchResultReferenceDsml extends AbstractResponseDsml
 {
     /**
      * Creates a new instance of SearchResultReferenceDsml.
      */
     public SearchResultReferenceDsml()
     {
-        super( new SearchResultReferenceCodec() );
+        super( new SearchResultReferenceImpl() );
     }
 
 
@@ -53,18 +53,18 @@ public class SearchResultReferenceDsml e
      * @param ldapMessage
      *      the message to decorate
      */
-    public SearchResultReferenceDsml( LdapMessageCodec ldapMessage )
+    public SearchResultReferenceDsml( Message ldapMessage )
     {
         super( ldapMessage );
     }
 
 
     /* (non-Javadoc)
-     * @see org.apache.directory.shared.dsmlv2.reponse.LdapMessageDecorator#getMessageType()
+     * @see org.apache.directory.shared.dsmlv2.reponse.LdapMessageDecorator#getType()
      */
-    public MessageTypeEnum getMessageType()
+    public MessageTypeEnum getType()
     {
-        return instance.getMessageType();
+        return instance.getType();
     }
 
 
@@ -74,10 +74,11 @@ public class SearchResultReferenceDsml e
     public Element toDsml( Element root )
     {
         Element element = root.addElement( "searchResultReference" );
-        SearchResultReferenceCodec searchResultReference = ( SearchResultReferenceCodec ) instance;
+        SearchResultReference searchResultReference = ( SearchResultReference ) instance;
 
         // Adding References
-        List<LdapURL> refsList = searchResultReference.getSearchResultReferences();
+        List<String> refsList = ( List<String> ) searchResultReference.getReferral().getLdapUrls();
+
         for ( int i = 0; i < refsList.size(); i++ )
         {
             element.addElement( "ref" ).addText( refsList.get( i ).toString() );
@@ -94,7 +95,7 @@ public class SearchResultReferenceDsml e
      */
     public void addSearchResultReference( LdapURL searchResultReference )
     {
-        ( ( SearchResultReferenceCodec ) instance ).addSearchResultReference( searchResultReference );
+        ( ( SearchResultReference ) instance ).getReferral().addLdapUrl( searchResultReference.toString() );
     }
 
 
@@ -103,8 +104,8 @@ public class SearchResultReferenceDsml e
      * 
      * @return An ArrayList of SearchResultReferences
      */
-    public List<LdapURL> getSearchResultReferences()
+    public List<String> getSearchResultReferences()
     {
-        return ( ( SearchResultReferenceCodec ) instance ).getSearchResultReferences();
+        return ( List<String> ) ( ( SearchResultReference ) instance ).getReferral().getLdapUrls();
     }
 }

Modified: directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/AbandonRequestDsml.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/AbandonRequestDsml.java?rev=986999&r1=986998&r2=986999&view=diff
==============================================================================
--- directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/AbandonRequestDsml.java (original)
+++ directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/AbandonRequestDsml.java Thu Aug 19 01:23:41 2010
@@ -21,7 +21,8 @@ package org.apache.directory.shared.dsml
 
 
 import org.apache.directory.shared.ldap.codec.MessageTypeEnum;
-import org.apache.directory.shared.ldap.codec.abandon.AbandonRequestCodec;
+import org.apache.directory.shared.ldap.message.AbandonRequest;
+import org.apache.directory.shared.ldap.message.AbandonRequestImpl;
 import org.dom4j.Element;
 
 
@@ -37,17 +38,16 @@ public class AbandonRequestDsml extends 
      */
     public AbandonRequestDsml()
     {
-        super( new AbandonRequestCodec() );
+        super( new AbandonRequestImpl() );
     }
 
 
     /**
      * Creates a new instance of AbandonRequestDsml.
      *
-     * @param ldapMessage
-     *      the message to decorate
+     * @param ldapMessage the message to decorate
      */
-    public AbandonRequestDsml( AbandonRequestCodec ldapMessage )
+    public AbandonRequestDsml( AbandonRequest ldapMessage )
     {
         super( ldapMessage );
     }
@@ -56,9 +56,9 @@ public class AbandonRequestDsml extends 
     /**
      * {@inheritDoc}
      */
-    public MessageTypeEnum getMessageType()
+    public MessageTypeEnum getType()
     {
-        return instance.getMessageType();
+        return instance.getType();
     }
 
 
@@ -69,12 +69,12 @@ public class AbandonRequestDsml extends 
     {
         Element element = super.toDsml( root );
 
-        AbandonRequestCodec request = ( AbandonRequestCodec ) instance;
+        AbandonRequest request = ( AbandonRequest ) instance;
 
         // AbandonID
-        if ( request.getAbandonedMessageId() != 0 )
+        if ( request.getAbandoned() != 0 )
         {
-            element.addAttribute( "abandonID", "" + request.getAbandonedMessageId() );
+            element.addAttribute( "abandonID", "" + request.getAbandoned() );
         }
 
         return element;
@@ -88,7 +88,7 @@ public class AbandonRequestDsml extends 
      */
     public int getAbandonedMessageId()
     {
-        return ( ( AbandonRequestCodec ) instance ).getAbandonedMessageId();
+        return ( ( AbandonRequest ) instance ).getAbandoned();
     }
 
 
@@ -99,6 +99,6 @@ public class AbandonRequestDsml extends 
      */
     public void setAbandonedMessageId( int abandonedMessageId )
     {
-        ( ( AbandonRequestCodec ) instance ).setAbandonedMessageId( abandonedMessageId );
+        ( ( AbandonRequest ) instance ).setAbandoned( abandonedMessageId );
     }
 }

Modified: directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/AbstractRequestDsml.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/AbstractRequestDsml.java?rev=986999&r1=986998&r2=986999&view=diff
==============================================================================
--- directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/AbstractRequestDsml.java (original)
+++ directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/AbstractRequestDsml.java Thu Aug 19 01:23:41 2010
@@ -17,12 +17,12 @@
  *  under the License. 
  *  
  */
- package org.apache.directory.shared.dsmlv2.request;
+package org.apache.directory.shared.dsmlv2.request;
 
 
 import org.apache.directory.shared.dsmlv2.DsmlDecorator;
 import org.apache.directory.shared.dsmlv2.ParserUtils;
-import org.apache.directory.shared.ldap.codec.LdapMessageCodec;
+import org.apache.directory.shared.ldap.message.Message;
 import org.dom4j.Element;
 
 
@@ -34,7 +34,7 @@ public abstract class AbstractRequestDsm
      * @param ldapMessage
      *      the message to decorate
      */
-    public AbstractRequestDsml( LdapMessageCodec ldapMessage )
+    public AbstractRequestDsml( Message ldapMessage )
     {
         super( ldapMessage );
     }
@@ -51,7 +51,7 @@ public abstract class AbstractRequestDsm
     public Element toDsml( Element root )
     {
         Element element = root.addElement( getRequestName() );
-        
+
         // Request ID
         int requestID = instance.getMessageId();
         if ( requestID != 0 )
@@ -60,11 +60,12 @@ public abstract class AbstractRequestDsm
         }
 
         // Controls
-        ParserUtils.addControls( element, instance.getControls() );
-        
+        ParserUtils.addControls( element, instance.getControls().values() );
+
         return element;
     }
-    
+
+
     /**
      * Gets the name of the request according to the type of the decorated element.
      *
@@ -73,35 +74,35 @@ public abstract class AbstractRequestDsm
      */
     private String getRequestName()
     {
-        switch ( instance.getMessageType() )
+        switch ( instance.getType() )
         {
             case ABANDON_REQUEST:
                 return "abandonRequest";
-                
+
             case ADD_REQUEST:
                 return "addRequest";
-                
+
             case BIND_REQUEST:
                 return "authRequest";
-                
+
             case COMPARE_REQUEST:
                 return "compareRequest";
-                
+
             case DEL_REQUEST:
                 return "delRequest";
-                
+
             case EXTENDED_REQUEST:
                 return "extendedRequest";
-                
+
             case MODIFYDN_REQUEST:
                 return "modDNRequest";
-                
+
             case MODIFY_REQUEST:
                 return "modifyRequest";
-                
+
             case SEARCH_REQUEST:
                 return "searchRequest";
-                
+
             default:
                 return "error";
         }



Mime
View raw message