directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r1064227 - in /directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap: codec/ codec/actions/ codec/decorators/ model/message/
Date Thu, 27 Jan 2011 17:48:19 GMT
Author: akarasulu
Date: Thu Jan 27 17:48:18 2011
New Revision: 1064227

URL: http://svn.apache.org/viewvc?rev=1064227&view=rev
Log:
making search result entry decorator implement the message interface

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/actions/SearchResultAttributeValueAction.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/AddResponseDecorator.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/SearchResultEntryDecorator.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/SearchResultEntry.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=1064227&r1=1064226&r2=1064227&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 17:48:18 2011
@@ -25,6 +25,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.codec.decorators.MessageDecorator;
 import org.apache.directory.shared.ldap.codec.decorators.ModifyRequestDecorator;
 import org.apache.directory.shared.ldap.codec.decorators.SearchRequestDecorator;
+import org.apache.directory.shared.ldap.codec.decorators.SearchResultEntryDecorator;
 import org.apache.directory.shared.ldap.message.spi.BinaryAttributeDetector;
 import org.apache.directory.shared.ldap.model.message.AbandonRequest;
 import org.apache.directory.shared.ldap.model.message.AddRequest;
@@ -45,7 +46,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.message.ModifyResponse;
 import org.apache.directory.shared.ldap.model.message.SearchRequest;
 import org.apache.directory.shared.ldap.model.message.SearchResultDone;
-import org.apache.directory.shared.ldap.model.message.SearchResultEntry;
 import org.apache.directory.shared.ldap.model.message.SearchResultReference;
 import org.apache.directory.shared.ldap.model.message.UnbindRequest;
 
@@ -290,9 +290,9 @@ public class LdapMessageContainer extend
     /**
      * @return Returns the SearchResultEntry stored in the container
      */
-    public SearchResultEntry getSearchResultEntry()
+    public SearchResultEntryDecorator getSearchResultEntry()
     {
-        return ( SearchResultEntry ) message;
+        return ( SearchResultEntryDecorator ) message;
     }
 
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/SearchResultAttributeValueAction.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/SearchResultAttributeValueAction.java?rev=1064227&r1=1064226&r2=1064227&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/SearchResultAttributeValueAction.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/SearchResultAttributeValueAction.java
Thu Jan 27 17:48:18 2011
@@ -24,7 +24,7 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.ber.grammar.GrammarAction;
 import org.apache.directory.shared.asn1.ber.tlv.TLV;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
-import org.apache.directory.shared.ldap.model.message.SearchResultEntry;
+import org.apache.directory.shared.ldap.codec.decorators.SearchResultEntryDecorator;
 import org.apache.directory.shared.util.Strings;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -59,7 +59,7 @@ public class SearchResultAttributeValueA
     public void action( Asn1Container container )
     {
         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
-        SearchResultEntry searchResultEntry = ldapMessageContainer.getSearchResultEntry();
+        SearchResultEntryDecorator searchResultEntry = ldapMessageContainer.getSearchResultEntry();
 
         TLV tlv = ldapMessageContainer.getCurrentTLV();
 
@@ -74,7 +74,7 @@ public class SearchResultAttributeValueA
         }
         else
         {
-            if ( ldapMessageContainer.isBinary( searchResultEntry.getCurrentAttribute().getId()
) )
+            if ( ldapMessageContainer.isBinary( searchResultEntry.getCurrentEntry().getId()
) )
             {
                 value = tlv.getValue().getData();
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/AddResponseDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/AddResponseDecorator.java?rev=1064227&r1=1064226&r2=1064227&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/AddResponseDecorator.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/AddResponseDecorator.java
Thu Jan 27 17:48:18 2011
@@ -36,7 +36,7 @@ public class AddResponseDecorator extend
 
 
     /**
-     * Makes a AddResponse encodable.
+     * Makes a AddResponse a MessageDecorator.
      *
      * @param decoratedMessage the decorated AddResponse
      */

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/SearchResultEntryDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/SearchResultEntryDecorator.java?rev=1064227&r1=1064226&r2=1064227&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/SearchResultEntryDecorator.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/SearchResultEntryDecorator.java
Thu Jan 27 17:48:18 2011
@@ -22,7 +22,11 @@ package org.apache.directory.shared.ldap
 
 import java.util.List;
 
+import org.apache.directory.shared.ldap.model.entry.Entry;
+import org.apache.directory.shared.ldap.model.entry.EntryAttribute;
+import org.apache.directory.shared.ldap.model.exception.LdapException;
 import org.apache.directory.shared.ldap.model.message.SearchResultEntry;
+import org.apache.directory.shared.ldap.model.name.Dn;
 
 
 /**
@@ -30,7 +34,7 @@ import org.apache.directory.shared.ldap.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class SearchResultEntryDecorator extends MessageDecorator
+public class SearchResultEntryDecorator extends MessageDecorator implements SearchResultEntry
 {
     /** A temporary storage for the byte[] representing the objectName */
     private byte[] objectNameBytes;
@@ -46,6 +50,9 @@ public class SearchResultEntryDecorator 
 
     /** The list of all vals length */
     private List<Integer> valsLength;
+    
+    /** The current attribute being processed */
+    private EntryAttribute currentEntry;
 
 
     /**
@@ -163,4 +170,46 @@ public class SearchResultEntryDecorator 
     {
         this.valsLength = valsLength;
     }
+    
+    
+    public EntryAttribute getCurrentEntry()
+    {
+        return currentEntry;
+    }
+
+
+    public Dn getObjectName()
+    {
+        return getSearchResultEntry().getObjectName();
+    }
+
+
+    public void setObjectName( Dn objectName )
+    {
+        getSearchResultEntry().setObjectName( objectName );
+    }
+
+
+    public Entry getEntry()
+    {
+        return getSearchResultEntry().getEntry();
+    }
+
+
+    public void setEntry( Entry entry )
+    {
+        getSearchResultEntry().setEntry( entry );
+    }
+
+
+    public void addAttribute( String type ) throws LdapException
+    {
+        getSearchResultEntry().addAttribute( type );
+    }
+
+
+    public void addAttributeValue( Object value )
+    {
+        getSearchResultEntry().addAttributeValue( value );
+    }
 }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/SearchResultEntry.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/SearchResultEntry.java?rev=1064227&r1=1064226&r2=1064227&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/SearchResultEntry.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/SearchResultEntry.java
Thu Jan 27 17:48:18 2011
@@ -22,7 +22,6 @@ package org.apache.directory.shared.ldap
 
 
 import org.apache.directory.shared.ldap.model.entry.Entry;
-import org.apache.directory.shared.ldap.model.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.model.exception.LdapException;
 import org.apache.directory.shared.ldap.model.name.Dn;
 
@@ -80,12 +79,6 @@ public interface SearchResultEntry exten
 
 
     /**
-     * @return Returns the currentAttribute.
-     */
-    EntryAttribute getCurrentAttribute();
-
-
-    /**
      * Add a new value to the current attribute
      * 
      * @param value The added value



Mime
View raw message