directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r1064354 - 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 23:13:25 GMT
Author: akarasulu
Date: Thu Jan 27 23:13:24 2011
New Revision: 1064354

URL: http://svn.apache.org/viewvc?rev=1064354&view=rev
Log:
fixed bug where search current entry attribute was not being set

Modified:
    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/codec/actions/SearchResultAttributeValueAction.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
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/SearchResultEntryImpl.java

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=1064354&r1=1064353&r2=1064354&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
Thu Jan 27 23:13:24 2011
@@ -74,6 +74,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.codec.search.ExtensibleMatchFilter;
 import org.apache.directory.shared.ldap.codec.search.SubstringFilter;
 import org.apache.directory.shared.ldap.model.exception.LdapException;
@@ -1233,7 +1234,7 @@ public final class LdapMessageGrammar ex
                 public void action( Asn1Container container ) throws DecoderException
                 {
                     LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer )
container;
-                    SearchResultEntry searchResultEntry = ldapMessageContainer.getSearchResultEntry();
+                    SearchResultEntryDecorator searchResultEntry = ldapMessageContainer.getSearchResultEntry();
 
                     TLV tlv = ldapMessageContainer.getCurrentTLV();
 

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=1064354&r1=1064353&r2=1064354&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 23:13:24 2011
@@ -74,7 +74,7 @@ public class SearchResultAttributeValueA
         }
         else
         {
-            if ( ldapMessageContainer.isBinary( searchResultEntry.getCurrentEntry().getId()
) )
+            if ( ldapMessageContainer.isBinary( searchResultEntry.getCurrentAttribute().getId()
) )
             {
                 value = tlv.getValue().getData();
 

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=1064354&r1=1064353&r2=1064354&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 23:13:24 2011
@@ -22,6 +22,7 @@ package org.apache.directory.shared.ldap
 
 import java.util.List;
 
+import org.apache.directory.shared.ldap.model.entry.DefaultEntryAttribute;
 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;
@@ -52,7 +53,7 @@ public class SearchResultEntryDecorator 
     private List<Integer> valsLength;
     
     /** The current attribute being processed */
-    private EntryAttribute currentEntry;
+    private EntryAttribute currentAttribute;
 
 
     /**
@@ -172,9 +173,40 @@ public class SearchResultEntryDecorator 
     }
     
     
-    public EntryAttribute getCurrentEntry()
+    public EntryAttribute getCurrentAttribute()
     {
-        return currentEntry;
+        return currentAttribute;
+    }
+
+
+    /**
+     * Create a new attribute
+     * 
+     * @param type The attribute's type
+     */
+    public void addAttribute( String type ) throws LdapException
+    {
+        currentAttribute = new DefaultEntryAttribute( type );
+
+        getSearchResultEntry().getEntry().put( currentAttribute );
+    }
+
+
+    /**
+     * Add a new value to the current attribute
+     * 
+     * @param value The added value
+     */
+    public void addAttributeValue( Object value )
+    {
+        if ( value instanceof String )
+        {
+            currentAttribute.add( ( String ) value );
+        }
+        else
+        {
+            currentAttribute.add( ( byte[] ) value );
+        }
     }
 
 
@@ -217,19 +249,4 @@ public class SearchResultEntryDecorator 
     {
         getSearchResultEntry().setEntry( entry );
     }
-
-
-    /**
-     * {@inheritDoc}
-     */
-    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=1064354&r1=1064353&r2=1064354&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 23:13:24 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.exception.LdapException;
 import org.apache.directory.shared.ldap.model.name.Dn;
 
 
@@ -68,20 +67,4 @@ public interface SearchResultEntry exten
      * @param entry the entry
      */
     void setEntry( Entry entry );
-
-
-    /**
-     * Create a new attribute
-     * 
-     * @param type The attribute's type
-     */
-    void addAttribute( String type ) throws LdapException;
-
-
-    /**
-     * Add a new value to the current attribute
-     * 
-     * @param value The added value
-     */
-    void addAttributeValue( Object value );
 }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/SearchResultEntryImpl.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/SearchResultEntryImpl.java?rev=1064354&r1=1064353&r2=1064354&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/SearchResultEntryImpl.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/SearchResultEntryImpl.java
Thu Jan 27 23:13:24 2011
@@ -43,9 +43,6 @@ public class SearchResultEntryImpl exten
     /** Entry returned in response to search */
     private Entry entry = new DefaultEntry();
 
-    /** The current attribute being decoded */
-    private EntryAttribute currentAttribute;
-
 
     /**
      * Creates a SearchResponseEntry as a reply to an SearchRequest to
@@ -85,46 +82,6 @@ public class SearchResultEntryImpl exten
 
 
     /**
-     * Create a new attribute
-     * 
-     * @param type The attribute's type
-     */
-    public void addAttribute( String type ) throws LdapException
-    {
-        currentAttribute = new DefaultEntryAttribute( type );
-
-        entry.put( currentAttribute );
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
-    public EntryAttribute getCurrentAttribute()
-    {
-        return currentAttribute;
-    }
-
-
-    /**
-     * Add a new value to the current attribute
-     * 
-     * @param value The added value
-     */
-    public void addAttributeValue( Object value )
-    {
-        if ( value instanceof String )
-        {
-            currentAttribute.add( ( String ) value );
-        }
-        else
-        {
-            currentAttribute.add( ( byte[] ) value );
-        }
-    }
-
-
-    /**
      * Sets the entry.
      * 
      * @param entry the entry



Mime
View raw message