directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r1064346 - in /directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec: LdapMessageContainer.java decorators/MessageDecorator.java decorators/ResponseDecorator.java
Date Thu, 27 Jan 2011 22:50:56 GMT
Author: akarasulu
Date: Thu Jan 27 22:50:56 2011
New Revision: 1064346

URL: http://svn.apache.org/viewvc?rev=1064346&view=rev
Log:
fixing some bugs due to missing LdapResult

Modified:
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageContainer.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/MessageDecorator.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/ResponseDecorator.java

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageContainer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageContainer.java?rev=1064346&r1=1064345&r2=1064346&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageContainer.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageContainer.java
Thu Jan 27 22:50:56 2011
@@ -59,9 +59,6 @@ import org.apache.directory.shared.ldap.
  */
 public class LdapMessageContainer extends AbstractContainer
 {
-    /** The internal ldap message */
-    private Message message;
-
     /** The Message decorator to store various temporary values */
     private MessageDecorator messageDecorator;
 
@@ -121,7 +118,7 @@ public class LdapMessageContainer extend
      */
     public AbandonRequest getAbandonRequest()
     {
-        return ( AbandonRequest ) message;
+        return ( AbandonRequest ) messageDecorator;
     }
 
 
@@ -130,7 +127,7 @@ public class LdapMessageContainer extend
      */
     public AddRequest getAddRequest()
     {
-        return ( AddRequest ) message;
+        return ( AddRequest ) messageDecorator;
     }
 
 
@@ -139,7 +136,7 @@ public class LdapMessageContainer extend
      */
     public AddResponse getAddResponse()
     {
-        return ( AddResponse ) message;
+        return ( AddResponse ) messageDecorator;
     }
 
 
@@ -148,7 +145,7 @@ public class LdapMessageContainer extend
      */
     public BindRequest getBindRequest()
     {
-        return ( BindRequest ) message;
+        return ( BindRequest ) messageDecorator;
     }
 
 
@@ -157,7 +154,7 @@ public class LdapMessageContainer extend
      */
     public BindResponse getBindResponse()
     {
-        return ( BindResponse ) message;
+        return ( BindResponse ) messageDecorator;
     }
 
 
@@ -166,7 +163,7 @@ public class LdapMessageContainer extend
      */
     public CompareRequest getCompareRequest()
     {
-        return ( CompareRequest ) message;
+        return ( CompareRequest ) messageDecorator;
     }
 
 
@@ -175,7 +172,7 @@ public class LdapMessageContainer extend
      */
     public CompareResponse getCompareResponse()
     {
-        return ( CompareResponse ) message;
+        return ( CompareResponse ) messageDecorator;
     }
 
 
@@ -184,7 +181,7 @@ public class LdapMessageContainer extend
      */
     public DeleteRequest getDeleteRequest()
     {
-        return ( DeleteRequest ) message;
+        return ( DeleteRequest ) messageDecorator;
     }
 
 
@@ -193,7 +190,7 @@ public class LdapMessageContainer extend
      */
     public DeleteResponse getDeleteResponse()
     {
-        return ( DeleteResponse ) message;
+        return ( DeleteResponse ) messageDecorator;
     }
 
 
@@ -202,7 +199,7 @@ public class LdapMessageContainer extend
      */
     public ExtendedRequest getExtendedRequest()
     {
-        return (ExtendedRequest) message;
+        return (ExtendedRequest) messageDecorator;
     }
 
 
@@ -211,7 +208,7 @@ public class LdapMessageContainer extend
      */
     public ExtendedResponse getExtendedResponse()
     {
-        return ( ExtendedResponse ) message;
+        return ( ExtendedResponse ) messageDecorator;
     }
 
 
@@ -220,7 +217,7 @@ public class LdapMessageContainer extend
      */
     public IntermediateResponse getIntermediateResponse()
     {
-        return ( IntermediateResponse ) message;
+        return ( IntermediateResponse ) messageDecorator;
     }
 
 
@@ -229,7 +226,7 @@ public class LdapMessageContainer extend
      */
     public ModifyRequestDecorator getModifyRequestDecorator()
     {
-        return ( ModifyRequestDecorator ) message;
+        return ( ModifyRequestDecorator ) messageDecorator;
     }
 
 
@@ -238,7 +235,7 @@ public class LdapMessageContainer extend
      */
     public ModifyRequest getModifyRequest()
     {
-        return (ModifyRequest)(( ModifyRequestDecorator ) message).getDecoratedMessage();
+        return ( ModifyRequest ) messageDecorator;
     }
 
 
@@ -247,7 +244,7 @@ public class LdapMessageContainer extend
      */
     public ModifyResponse getModifyResponse()
     {
-        return ( ModifyResponse ) message;
+        return ( ModifyResponse ) messageDecorator;
     }
 
 
@@ -256,7 +253,7 @@ public class LdapMessageContainer extend
      */
     public ModifyDnRequest getModifyDnRequest()
     {
-        return ( ModifyDnRequest ) message;
+        return ( ModifyDnRequest ) messageDecorator;
     }
 
 
@@ -265,7 +262,7 @@ public class LdapMessageContainer extend
      */
     public ModifyDnResponse getModifyDnResponse()
     {
-        return ( ModifyDnResponse ) message;
+        return ( ModifyDnResponse ) messageDecorator;
     }
 
 
@@ -274,7 +271,7 @@ public class LdapMessageContainer extend
      */
     public SearchRequest getSearchRequest()
     {
-        return ( SearchRequest ) message;
+        return ( SearchRequest ) messageDecorator;
     }
 
 
@@ -292,7 +289,7 @@ public class LdapMessageContainer extend
      */
     public SearchResultEntryDecorator getSearchResultEntry()
     {
-        return ( SearchResultEntryDecorator ) message;
+        return ( SearchResultEntryDecorator ) messageDecorator;
     }
 
 
@@ -301,7 +298,7 @@ public class LdapMessageContainer extend
      */
     public SearchResultReference getSearchResultReference()
     {
-        return ( SearchResultReference ) message;
+        return ( SearchResultReference ) messageDecorator;
     }
 
 
@@ -310,7 +307,7 @@ public class LdapMessageContainer extend
      */
     public SearchResultDone getSearchResultDone()
     {
-        return ( SearchResultDone ) message;
+        return ( SearchResultDone ) messageDecorator;
     }
 
 
@@ -319,7 +316,7 @@ public class LdapMessageContainer extend
      */
     public UnbindRequest getUnbindRequest()
     {
-        return ( UnbindRequest ) message;
+        return ( UnbindRequest ) messageDecorator.getDecoratedMessage();
     }
 
 
@@ -331,7 +328,14 @@ public class LdapMessageContainer extend
      */
     public void setMessage( Message message )
     {
-        this.message = message;
+        if ( message instanceof MessageDecorator )
+        {
+            messageDecorator = ( MessageDecorator ) message;
+        }
+        else
+        {
+            messageDecorator = MessageDecorator.getDecorator( message );
+        }
     }
 
 
@@ -360,7 +364,6 @@ public class LdapMessageContainer extend
     {
         super.clean();
 
-        message = null;
         messageDecorator = null;
         messageId = 0;
         currentControl = null;

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/MessageDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/MessageDecorator.java?rev=1064346&r1=1064345&r2=1064346&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/MessageDecorator.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/MessageDecorator.java
Thu Jan 27 22:50:56 2011
@@ -30,6 +30,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.message.CompareRequest;
 import org.apache.directory.shared.ldap.model.message.CompareResponse;
 import org.apache.directory.shared.ldap.model.message.Control;
+import org.apache.directory.shared.ldap.model.message.DeleteRequest;
 import org.apache.directory.shared.ldap.model.message.DeleteResponse;
 import org.apache.directory.shared.ldap.model.message.ExtendedRequest;
 import org.apache.directory.shared.ldap.model.message.ExtendedResponse;
@@ -93,7 +94,7 @@ public class MessageDecorator implements
                 return new CompareResponseDecorator( ( CompareResponse ) decoratedMessage
);
                 
             case DEL_REQUEST:
-                return new MessageDecorator( decoratedMessage );
+                return new DeleteRequestDecorator( ( DeleteRequest ) decoratedMessage );
 
             case DEL_RESPONSE:
                 return new DeleteResponseDecorator( ( DeleteResponse ) decoratedMessage );

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/ResponseDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/ResponseDecorator.java?rev=1064346&r1=1064345&r2=1064346&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/ResponseDecorator.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/ResponseDecorator.java
Thu Jan 27 22:50:56 2011
@@ -21,6 +21,7 @@ package org.apache.directory.shared.ldap
 
 
 import org.apache.directory.shared.ldap.model.message.LdapResult;
+import org.apache.directory.shared.ldap.model.message.LdapResultImpl;
 import org.apache.directory.shared.ldap.model.message.Message;
 import org.apache.directory.shared.ldap.model.message.ResultResponse;
 
@@ -33,7 +34,7 @@ import org.apache.directory.shared.ldap.
 public abstract class ResponseDecorator extends MessageDecorator implements ResultResponse
 {
     /** The LdapResult decorator */
-    private LdapResultDecorator ldapResultDecorator;
+    private LdapResultDecorator ldapResultDecorator = new LdapResultDecorator( new LdapResultImpl()
);
 
 
     /**



Mime
View raw message