directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r1063117 - in /directory: apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/ apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/ shared/trunk/dsml-parser/src/main/java/...
Date Tue, 25 Jan 2011 03:01:05 GMT
Author: akarasulu
Date: Tue Jan 25 03:01:04 2011
New Revision: 1063117

URL: http://svn.apache.org/viewvc?rev=1063117&view=rev
Log:
added encoding decorator to decouple SearchResultReferenceImpl

Added:
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/decorators/SearchResultReferenceDecorator.java
      - copied, changed from r1063097, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/decorators/FooDecorator.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/SearchResultReferenceImpl.java
  (contents, props changed)
      - copied, changed from r1063113, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/SearchResultReferenceImpl.java
Removed:
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/SearchResultReferenceImpl.java
Modified:
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchHandler.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplProvider.java
    directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/Dsmlv2ResponseGrammar.java
    directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResultReferenceDsml.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/LdapEncoder.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/decorators/MessageDecorator.java

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchHandler.java?rev=1063117&r1=1063116&r2=1063117&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchHandler.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchHandler.java
Tue Jan 25 03:01:04 2011
@@ -59,7 +59,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.message.SearchResultDone;
 import org.apache.directory.shared.ldap.model.message.SearchResultEntry;
 import org.apache.directory.shared.ldap.message.SearchResultEntryImpl;
-import org.apache.directory.shared.ldap.message.SearchResultReferenceImpl;
+import org.apache.directory.shared.ldap.model.message.SearchResultReferenceImpl;
 import org.apache.directory.shared.ldap.model.name.Dn;
 import org.apache.directory.shared.ldap.model.schema.AttributeType;
 import org.apache.directory.shared.ldap.model.filter.LdapURL;

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplProvider.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplProvider.java?rev=1063117&r1=1063116&r2=1063117&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplProvider.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplProvider.java
Tue Jan 25 03:01:04 2011
@@ -73,7 +73,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.message.SearchResultEntry;
 import org.apache.directory.shared.ldap.message.SearchResultEntryImpl;
 import org.apache.directory.shared.ldap.model.message.SearchResultReference;
-import org.apache.directory.shared.ldap.message.SearchResultReferenceImpl;
+import org.apache.directory.shared.ldap.model.message.SearchResultReferenceImpl;
 import org.apache.directory.shared.ldap.message.control.replication.SyncStateTypeEnum;
 import org.apache.directory.shared.ldap.message.control.replication.SynchronizationInfoEnum;
 import org.apache.directory.shared.ldap.message.control.replication.SynchronizationModeEnum;

Modified: directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/Dsmlv2ResponseGrammar.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/Dsmlv2ResponseGrammar.java?rev=1063117&r1=1063116&r2=1063117&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/Dsmlv2ResponseGrammar.java
(original)
+++ directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/Dsmlv2ResponseGrammar.java
Tue Jan 25 03:01:04 2011
@@ -67,7 +67,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.message.SearchResultEntry;
 import org.apache.directory.shared.ldap.message.SearchResultEntryImpl;
 import org.apache.directory.shared.ldap.model.message.SearchResultReference;
-import org.apache.directory.shared.ldap.message.SearchResultReferenceImpl;
+import org.apache.directory.shared.ldap.model.message.SearchResultReferenceImpl;
 import org.apache.directory.shared.ldap.model.message.Control;
 import org.apache.directory.shared.ldap.model.name.Dn;
 import org.apache.directory.shared.util.Base64;

Modified: directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResultReferenceDsml.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResultReferenceDsml.java?rev=1063117&r1=1063116&r2=1063117&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResultReferenceDsml.java
(original)
+++ directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResultReferenceDsml.java
Tue Jan 25 03:01:04 2011
@@ -27,7 +27,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.message.Message;
 import org.apache.directory.shared.ldap.model.message.MessageTypeEnum;
 import org.apache.directory.shared.ldap.model.message.SearchResultReference;
-import org.apache.directory.shared.ldap.message.SearchResultReferenceImpl;
+import org.apache.directory.shared.ldap.model.message.SearchResultReferenceImpl;
 import org.dom4j.Element;
 
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java?rev=1063117&r1=1063116&r2=1063117&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java
Tue Jan 25 03:01:04 2011
@@ -111,7 +111,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.message.SearchResultEntry;
 import org.apache.directory.shared.ldap.message.SearchResultEntryImpl;
 import org.apache.directory.shared.ldap.model.message.SearchResultReference;
-import org.apache.directory.shared.ldap.message.SearchResultReferenceImpl;
+import org.apache.directory.shared.ldap.model.message.SearchResultReferenceImpl;
 import org.apache.directory.shared.ldap.model.message.UnbindRequest;
 import org.apache.directory.shared.ldap.model.message.UnbindRequestImpl;
 import org.apache.directory.shared.ldap.model.message.Control;

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/LdapEncoder.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/LdapEncoder.java?rev=1063117&r1=1063116&r2=1063117&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/LdapEncoder.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/LdapEncoder.java
Tue Jan 25 03:01:04 2011
@@ -1309,8 +1309,9 @@ public class LdapEncoder
      * Length(SearchResultReference) = Length(0x73 + Length(L1) + L1
      * </pre>
      */
-    private int computeSearchResultReferenceLength( SearchResultReferenceImpl searchResultReference
)
+    private int computeSearchResultReferenceLength( SearchResultReferenceDecorator decorator
)
     {
+        SearchResultReference searchResultReference = decorator.getSearchResultReference();
         int searchResultReferenceLength = 0;
 
         // We may have more than one reference.
@@ -1326,7 +1327,7 @@ public class LdapEncoder
         }
 
         // Store the length of the response 
-        searchResultReference.setSearchResultReferenceLength( searchResultReferenceLength
);
+        decorator.setSearchResultReferenceLength( searchResultReferenceLength );
 
         return 1 + TLV.getNbBytes( searchResultReferenceLength ) + searchResultReferenceLength;
     }
@@ -2342,14 +2343,15 @@ public class LdapEncoder
      * @param buffer The buffer where to put the PDU
      * @return The PDU.
      */
-    private void encodeSearchResultReference( ByteBuffer buffer, SearchResultReferenceImpl
searchResultReference )
+    private void encodeSearchResultReference( ByteBuffer buffer, SearchResultReferenceDecorator
decorator )
         throws EncoderException
     {
+        SearchResultReference searchResultReference = decorator.getSearchResultReference();
         try
         {
             // The SearchResultReference Tag
             buffer.put( LdapConstants.SEARCH_RESULT_REFERENCE_TAG );
-            buffer.put( TLV.getBytes( searchResultReference.getSearchResultReferenceLength()
) );
+            buffer.put( TLV.getBytes( decorator.getSearchResultReferenceLength() ) );
 
             // The referrals, if any
             Referral referral = searchResultReference.getReferral();
@@ -2438,7 +2440,7 @@ public class LdapEncoder
                 return computeSearchResultEntryLength( ( SearchResultEntryImpl ) message
);
 
             case SEARCH_RESULT_REFERENCE:
-                return computeSearchResultReferenceLength( ( SearchResultReferenceImpl )
message );
+                return computeSearchResultReferenceLength( ( SearchResultReferenceDecorator
) decorator );
 
             case UNBIND_REQUEST:
                 return computeUnbindRequestLength( );
@@ -2532,7 +2534,7 @@ public class LdapEncoder
                 break;
 
             case SEARCH_RESULT_REFERENCE:
-                encodeSearchResultReference( bb, ( SearchResultReferenceImpl ) message );
+                encodeSearchResultReference( bb, ( SearchResultReferenceDecorator ) decorator
);
                 break;
 
             case UNBIND_REQUEST:

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/decorators/MessageDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/decorators/MessageDecorator.java?rev=1063117&r1=1063116&r2=1063117&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/decorators/MessageDecorator.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/decorators/MessageDecorator.java
Tue Jan 25 03:01:04 2011
@@ -73,6 +73,8 @@ public class MessageDecorator
                 return new ExtendedResponseDecorator( ( ExtendedResponse ) decoratedMessage
);
             case INTERMEDIATE_RESPONSE:
                 return new IntermediateResponseDecorator( ( IntermediateResponse ) decoratedMessage
);
+            case SEARCH_RESULT_REFERENCE:
+                return new SearchResultReferenceDecorator( ( SearchResultReference ) decoratedMessage
);
             default:
                 return new MessageDecorator( decoratedMessage );
         }

Copied: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/decorators/SearchResultReferenceDecorator.java
(from r1063097, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/decorators/FooDecorator.java)
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/decorators/SearchResultReferenceDecorator.java?p2=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/decorators/SearchResultReferenceDecorator.java&p1=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/decorators/FooDecorator.java&r1=1063097&r2=1063117&rev=1063117&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/decorators/FooDecorator.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/decorators/SearchResultReferenceDecorator.java
Tue Jan 25 03:01:04 2011
@@ -20,9 +20,7 @@
 package org.apache.directory.shared.ldap.message.decorators;
 
 
-import org.apache.directory.shared.ldap.model.message.AddRequest;
-
-import java.util.List;
+import org.apache.directory.shared.ldap.model.message.SearchResultReference;
 
 
 /**
@@ -30,22 +28,66 @@ import java.util.List;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class FooDecorator extends MessageDecorator
+public class SearchResultReferenceDecorator extends MessageDecorator
 {
+    /** The length of the referral */
+    private int referralLength;
+
+    /** The search result reference length */
+    private int searchResultReferenceLength;
+
 
     /**
-     * Makes a Foo encodable.
+     * Makes a SearchResultReference encodable.
      *
-     * @param decoratedMessage the decorated Foo
+     * @param decoratedMessage the decorated SearchResultReference
      */
-    public FooDecorator( AddRequest decoratedMessage )
+    public SearchResultReferenceDecorator( SearchResultReference decoratedMessage )
     {
         super( decoratedMessage );
     }
 
 
-    public AddRequest getAddRequest()
+    public SearchResultReference getSearchResultReference()
+    {
+        return ( SearchResultReference ) getMessage();
+    }
+
+
+    /**
+     * @return The encoded Referral's length
+     */
+    public int getReferralLength()
+    {
+        return referralLength;
+    }
+
+
+    /**
+     * Stores the encoded length for the Referrals
+     * @param referralLength The encoded length
+     */
+    public void setReferralLength( int referralLength )
+    {
+        this.referralLength = referralLength;
+    }
+
+
+    /**
+     * @return The encoded SearchResultReference's length
+     */
+    public int getSearchResultReferenceLength()
+    {
+        return searchResultReferenceLength;
+    }
+
+
+    /**
+     * Stores the encoded length for the SearchResultReference's
+     * @param searchResultReferenceLength The encoded length
+     */
+    public void setSearchResultReferenceLength( int searchResultReferenceLength )
     {
-        return ( AddRequest ) getMessage();
+        this.searchResultReferenceLength = searchResultReferenceLength;
     }
 }

Copied: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/SearchResultReferenceImpl.java
(from r1063113, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/SearchResultReferenceImpl.java)
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/SearchResultReferenceImpl.java?p2=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/SearchResultReferenceImpl.java&p1=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/SearchResultReferenceImpl.java&r1=1063113&r2=1063117&rev=1063117&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/SearchResultReferenceImpl.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/SearchResultReferenceImpl.java
Tue Jan 25 03:01:04 2011
@@ -17,7 +17,7 @@
  *  under the License. 
  *  
  */
-package org.apache.directory.shared.ldap.message;
+package org.apache.directory.shared.ldap.model.message;
 
 
 import org.apache.directory.shared.ldap.model.message.*;
@@ -35,16 +35,7 @@ public class SearchResultReferenceImpl e
     /** Referral holding the reference urls */
     private Referral referral = new ReferralImpl();
 
-    /** The length of the referral */
-    private int referralLength;
 
-    /** The search result reference length */
-    private int searchResultReferenceLength;
-
-
-    // ------------------------------------------------------------------------
-    // Constructors
-    // ------------------------------------------------------------------------
     /**
      * Creates a SearchResponseReference as a reply to an SearchRequest
      * to indicate the end of a search operation.
@@ -71,6 +62,7 @@ public class SearchResultReferenceImpl e
     // SearchResponseReference Interface Method Implementations
     // ------------------------------------------------------------------------
 
+
     /**
      * Gets the sequence of LdapUrls as a Referral instance.
      * 
@@ -94,25 +86,6 @@ public class SearchResultReferenceImpl e
 
 
     /**
-     * @return The encoded Referral's length
-     */
-    /* No qualifier */int getReferralLength()
-    {
-        return referralLength;
-    }
-
-
-    /**
-     * Stores the encoded length for the Referrals
-     * @param searchReferralLength The encoded length
-     */
-    /* No qualifier */void setReferralLength( int referralLength )
-    {
-        this.referralLength = referralLength;
-    }
-
-
-    /**
      * {@inheritDoc}
      */
     @Override
@@ -165,25 +138,6 @@ public class SearchResultReferenceImpl e
 
 
     /**
-     * @return The encoded SearchResultReference's length
-     */
-    /* No qualifier */int getSearchResultReferenceLength()
-    {
-        return searchResultReferenceLength;
-    }
-
-
-    /**
-     * Stores the encoded length for the SearchResultReference's
-     * @param searchResultReferenceLength The encoded length
-     */
-    /* No qualifier */void setSearchResultReferenceLength( int searchResultReferenceLength
)
-    {
-        this.searchResultReferenceLength = searchResultReferenceLength;
-    }
-
-
-    /**
      * Returns the Search Result Reference string
      * 
      * @return The Search Result Reference string
@@ -220,3 +174,5 @@ public class SearchResultReferenceImpl e
         return sb.toString();
     }
 }
+
+

Propchange: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/SearchResultReferenceImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message