directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r1064311 - in /directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec: LdapEncoder.java decorators/SearchRequestDecorator.java
Date Thu, 27 Jan 2011 21:16:51 GMT
Author: akarasulu
Date: Thu Jan 27 21:16:49 2011
New Revision: 1064311

URL: http://svn.apache.org/viewvc?rev=1064311&view=rev
Log:
Took care of SearchRequestDecorator's SearchRequest implementation. Had to rename 
getFilter used in decorator to getCodecFilter due to conflict with 
SearchRequest.getFilter.

Modified:
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapEncoder.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/SearchRequestDecorator.java

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapEncoder.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapEncoder.java?rev=1064311&r1=1064310&r2=1064311&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapEncoder.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapEncoder.java
Thu Jan 27 21:16:49 2011
@@ -1165,7 +1165,7 @@ public class LdapEncoder
 
         // The filter
         searchRequestDecorator.setFilter( searchRequest.getFilter() );
-        searchRequestLength += searchRequestDecorator.getFilter().computeLength();
+        searchRequestLength += searchRequestDecorator.getCodecFilter().computeLength();
 
         // The attributes description list
         int attributeDescriptionListLength = 0;
@@ -2227,7 +2227,7 @@ public class LdapEncoder
             Value.encode( buffer, searchRequest.getTypesOnly() );
 
             // The filter
-            decorator.getFilter().encode( buffer );
+            decorator.getCodecFilter().encode( buffer );
 
             // The attributeDescriptionList
             buffer.put( UniversalTag.SEQUENCE.getValue() );

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/SearchRequestDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/SearchRequestDecorator.java?rev=1064311&r1=1064310&r2=1064311&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/SearchRequestDecorator.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/SearchRequestDecorator.java
Thu Jan 27 21:16:49 2011
@@ -53,9 +53,13 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.filter.NotNode;
 import org.apache.directory.shared.ldap.model.filter.OrNode;
 import org.apache.directory.shared.ldap.model.filter.PresenceNode;
+import org.apache.directory.shared.ldap.model.filter.SearchScope;
 import org.apache.directory.shared.ldap.model.filter.SimpleNode;
 import org.apache.directory.shared.ldap.model.filter.SubstringNode;
+import org.apache.directory.shared.ldap.model.message.AliasDerefMode;
+import org.apache.directory.shared.ldap.model.message.MessageTypeEnum;
 import org.apache.directory.shared.ldap.model.message.SearchRequest;
+import org.apache.directory.shared.ldap.model.name.Dn;
 
 
 /**
@@ -63,7 +67,7 @@ import org.apache.directory.shared.ldap.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class SearchRequestDecorator extends MessageDecorator
+public class SearchRequestDecorator extends AbandonableResultResponseRequestDecorator implements
SearchRequest
 {
     /** The searchRequest length */
     private int searchRequestLength;
@@ -163,7 +167,7 @@ public class SearchRequestDecorator exte
      *
      * @return the expression node for the root of the filter expression tree.
      */
-    public Filter getFilter()
+    public Filter getCodecFilter()
     {
         return topFilter;
     }
@@ -872,4 +876,162 @@ public class SearchRequestDecorator exte
 
         return sb.toString();
     }
+
+
+    //-------------------------------------------------------------------------
+    // The SearchRequest methods
+    //-------------------------------------------------------------------------
+    
+    
+    /**
+     * {@inheritDoc}
+     */
+    public MessageTypeEnum[] getResponseTypes()
+    {
+        return getSearchRequest().getResponseTypes();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public Dn getBase()
+    {
+        return getSearchRequest().getBase();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setBase( Dn baseDn )
+    {
+        getSearchRequest().setBase( baseDn );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public SearchScope getScope()
+    {
+        return getSearchRequest().getScope();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setScope( SearchScope scope )
+    {
+        getSearchRequest().setScope( scope );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public AliasDerefMode getDerefAliases()
+    {
+        return getSearchRequest().getDerefAliases();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setDerefAliases( AliasDerefMode aliasDerefAliases )
+    {
+        getSearchRequest().setDerefAliases( aliasDerefAliases );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public long getSizeLimit()
+    {
+        return getSearchRequest().getSizeLimit();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setSizeLimit( long entriesMax )
+    {
+        getSearchRequest().setSizeLimit( entriesMax );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public int getTimeLimit()
+    {
+        return getSearchRequest().getTimeLimit();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setTimeLimit( int secondsMax )
+    {
+        getSearchRequest().setTimeLimit( secondsMax );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean getTypesOnly()
+    {
+        return getSearchRequest().getTypesOnly();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setTypesOnly( boolean typesOnly )
+    {
+        getSearchRequest().setTypesOnly( typesOnly );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public ExprNode getFilter()
+    {
+        return getSearchRequest().getFilter();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public List<String> getAttributes()
+    {
+        return getSearchRequest().getAttributes();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void addAttributes( String... attributes )
+    {
+        getSearchRequest().addAttributes( attributes );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void removeAttribute( String attribute )
+    {
+        getSearchRequest().removeAttribute( attribute );
+    }
 }



Mime
View raw message