directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r503389 - in /directory/shared/trunk: asn1/src/main/java/org/apache/directory/shared/asn1/ asn1/src/main/java/org/apache/directory/shared/asn1/ber/ asn1/src/main/java/org/apache/directory/shared/asn1/ber/tlv/ ldap/src/main/java/org/apache/d...
Date Sun, 04 Feb 2007 11:26:30 GMT
Author: elecharny
Date: Sun Feb  4 03:26:28 2007
New Revision: 503389

URL: http://svn.apache.org/viewvc?view=rev&rev=503389
Log:
Fixed DIRSERVER-823 (proting the fix from 1.0.1)
Added a test for it

Modified:
    directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/AbstractAsn1Object.java
    directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/ber/AbstractContainer.java
    directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/ber/Asn1Decoder.java
    directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/ber/IAsn1Container.java
    directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/ber/tlv/TLV.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/Control.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessage.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapResult.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/ManageDsaITControl.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitAndFilterAction.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitApproxMatchFilterAction.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitEqualityMatchFilterAction.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitExtensibleMatchFilterAction.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitGreaterOrEqualFilterAction.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitLessOrEqualFilterAction.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitNotFilterAction.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitOrFilterAction.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitPresentFilterAction.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitSubstringsFilterAction.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/bind/LdapAuthentication.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/bind/SaslCredentials.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/bind/SimpleAuthentication.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/GracefulAction.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/GracefulDisconnect.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/GracefulShutdown.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/AndFilter.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/AttributeValueAssertionFilter.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/ConnectorFilter.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/ExtensibleMatchFilter.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/Filter.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/NotFilter.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/OrFilter.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/PresentFilter.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchRequest.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchResultEntry.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchResultReference.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SubstringFilter.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/EntryChangeControl.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/PSearchControl.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/SubEntryControl.java
    directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestTest.java
    directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java

Modified: directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/AbstractAsn1Object.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/AbstractAsn1Object.java?view=diff&rev=503389&r1=503388&r2=503389
==============================================================================
--- directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/AbstractAsn1Object.java (original)
+++ directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/AbstractAsn1Object.java Sun Feb  4 03:26:28 2007
@@ -45,11 +45,36 @@
     /** The encapsulating Object */
     protected AbstractAsn1Object parent;
 
+    
+    /** The identifier of the asqsocaited TLV */
+    private transient int tlvId;
 
     // ~ Methods
     // ------------------------------------------------------------------------------------
 
     /**
+     * Constructor associated with a TLV indentifier. Used when 
+     * decoded a TLV, we create an association between the decode
+     * Asn1Object and the TLV which is the encoded form.
+     * 
+     * @param tlvId The TLV Id.
+     */
+    protected AbstractAsn1Object( int tlvId )
+    {
+        this.tlvId = tlvId;
+    }
+
+    
+    /**
+     * Default constructor. The TLV Id is set to -1. This constructor
+     * is called when an Asn1Object is created to be encoded, not decoded.
+     */
+    protected AbstractAsn1Object()
+    {
+        this.tlvId = -1;
+    }
+    
+    /**
      * Get the current object length, which is the sum of all inner length
      * already decoded.
      * 
@@ -156,5 +181,13 @@
     public void setParent( AbstractAsn1Object parent )
     {
         this.parent = parent;
+    }
+
+    /**
+     * @return The TLV identifier associated with this object
+     */
+    public int getTlvId()
+    {
+        return tlvId;
     }
 }

Modified: directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/ber/AbstractContainer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/ber/AbstractContainer.java?view=diff&rev=503389&r1=503388&r2=503389
==============================================================================
--- directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/ber/AbstractContainer.java (original)
+++ directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/ber/AbstractContainer.java Sun Feb  4 03:26:28 2007
@@ -62,6 +62,9 @@
     /** The grammar end transition flag */
     protected boolean grammarEndAllowed;
 
+    /** The incremental id used to tag TLVs */
+    private int id = 0;
+    
     // ~ Methods
     // ------------------------------------------------------------------------------------
 
@@ -207,5 +210,22 @@
         parentTLV = null;
         transition = 0;
         state = TLVStateEnum.TAG_STATE_START;
+    }
+    
+    /**
+     * Return a new ID and increment the counter
+     * @return A new TLV id. 
+     */
+    public int getNewTlvId()
+    {
+        return id++;
+    }
+
+    /**
+     * @return The TLV Id
+     */
+    public int getTlvId()
+    {
+        return tlv.getId();
     }
 }

Modified: directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/ber/Asn1Decoder.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/ber/Asn1Decoder.java?view=diff&rev=503389&r1=503388&r2=503389
==============================================================================
--- directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/ber/Asn1Decoder.java (original)
+++ directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/ber/Asn1Decoder.java Sun Feb  4 03:26:28 2007
@@ -107,7 +107,7 @@
 
             byte octet = stream.get();
 
-            TLV tlv = new TLV();
+            TLV tlv = new TLV( container.getNewTlvId() );
             tlv.setTag( octet );
 
             // Store the current TLV in the container.

Modified: directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/ber/IAsn1Container.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/ber/IAsn1Container.java?view=diff&rev=503389&r1=503388&r2=503389
==============================================================================
--- directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/ber/IAsn1Container.java (original)
+++ directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/ber/IAsn1Container.java Sun Feb  4 03:26:28 2007
@@ -126,4 +126,16 @@
      * being an end or not.
      */
     public void grammarEndAllowed( boolean grammarEndAllowed );
+    
+    /**
+     * Get a new TLV id
+     * @return a unique value representing the current TLV id
+     */
+    public int getNewTlvId();
+
+    /**
+     * Get the current TLV id
+     * @return a unique value representing the current TLV id
+     */
+    public int getTlvId();
 }

Modified: directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/ber/tlv/TLV.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/ber/tlv/TLV.java?view=diff&rev=503389&r1=503388&r2=503389
==============================================================================
--- directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/ber/tlv/TLV.java (original)
+++ directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/ber/tlv/TLV.java Sun Feb  4 03:26:28 2007
@@ -51,6 +51,9 @@
     /** The current Value being processed */
     private Value value;
 
+    /** An identity for the TLV. It store the TLV hashCode */
+    private int id;
+    
     /**
      * Reference the TLV which contains the current TLV, if any. As the
      * enclosing TLV of a PDU does not have parent, it can be null in this case.
@@ -101,13 +104,14 @@
     /**
      * Creates a new TLV object.
      */
-    public TLV()
+    public TLV( int id )
     {
         tag = 0;
         length = 0;
         lengthNbBytes = 0;
         value = new Value();
-
+        this.id = id;
+        
         expectedLength = 0;
     }
 
@@ -406,6 +410,11 @@
     public void incLengthBytesRead()
     {
         lengthBytesRead++;
+    }
+
+    public int getId()
+    {
+        return id;
     }
 }
  

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/Control.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/Control.java?view=diff&rev=503389&r1=503388&r2=503389
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/Control.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/Control.java Sun Feb  4 03:26:28 2007
@@ -61,6 +61,14 @@
     // ------------------------------------------------------------------------------------
 
     /**
+     * Default constructor.
+     */
+    public Control()
+    {
+        super();
+    }
+
+    /**
      * Get the control type
      * 
      * @return A string which represent the control type

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessage.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessage.java?view=diff&rev=503389&r1=503388&r2=503389
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessage.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessage.java Sun Feb  4 03:26:28 2007
@@ -95,6 +95,7 @@
      */
     public LdapMessage()
     {
+        super();
         // We should not create this kind of object directly
     }
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapResult.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapResult.java?view=diff&rev=503389&r1=503388&r2=503389
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapResult.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapResult.java Sun Feb  4 03:26:28 2007
@@ -123,10 +123,11 @@
     // -------------------------------------------------------------------------------
 
     /**
-     * Creates a new BindResponse object.
+     * Creates a new LdapResult object.
      */
     public LdapResult()
     {
+        super();
     }
 
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/ManageDsaITControl.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/ManageDsaITControl.java?view=diff&rev=503389&r1=503388&r2=503389
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/ManageDsaITControl.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/ManageDsaITControl.java Sun Feb  4 03:26:28 2007
@@ -68,6 +68,14 @@
 {
     private static final ByteBuffer EMPTY_BUFFER = ByteBuffer.allocate( 0 );
 
+    /**
+     * Default constructor
+     *
+     */
+    public ManageDsaITControl()
+    {
+        super();
+    }
 
     /**
      * Returns 0 everytime.

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitAndFilterAction.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitAndFilterAction.java?view=diff&rev=503389&r1=503388&r2=503389
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitAndFilterAction.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitAndFilterAction.java Sun Feb  4 03:26:28 2007
@@ -71,7 +71,7 @@
         SearchRequest searchRequest = ldapMessage.getSearchRequest();
 
         // We can allocate the SearchRequest
-        Filter andFilter = new AndFilter();
+        Filter andFilter = new AndFilter( ldapMessageContainer.getTlvId() );
 
         // Set the filter
         searchRequest.addCurrentFilter( andFilter );

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitApproxMatchFilterAction.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitApproxMatchFilterAction.java?view=diff&rev=503389&r1=503388&r2=503389
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitApproxMatchFilterAction.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitApproxMatchFilterAction.java Sun Feb  4 03:26:28 2007
@@ -59,7 +59,9 @@
         SearchRequest searchRequest = ldapMessage.getSearchRequest();
 
         // We can allocate the Attribute Value Assertion
-        Filter filter = new AttributeValueAssertionFilter( LdapConstants.APPROX_MATCH_FILTER );
+        Filter filter = new AttributeValueAssertionFilter( 
+            ldapMessageContainer.getTlvId(),
+            LdapConstants.APPROX_MATCH_FILTER );
 
         searchRequest.addCurrentFilter( filter );
         

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitEqualityMatchFilterAction.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitEqualityMatchFilterAction.java?view=diff&rev=503389&r1=503388&r2=503389
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitEqualityMatchFilterAction.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitEqualityMatchFilterAction.java Sun Feb  4 03:26:28 2007
@@ -62,7 +62,9 @@
         SearchRequest searchRequest = ldapMessage.getSearchRequest();
 
         // We can allocate the Attribute Value Assertion
-        Filter filter = new AttributeValueAssertionFilter( LdapConstants.EQUALITY_MATCH_FILTER );
+        Filter filter = new AttributeValueAssertionFilter( 
+            ldapMessageContainer.getTlvId(),
+            LdapConstants.EQUALITY_MATCH_FILTER );
 
         searchRequest.addCurrentFilter( filter );
         

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitExtensibleMatchFilterAction.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitExtensibleMatchFilterAction.java?view=diff&rev=503389&r1=503388&r2=503389
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitExtensibleMatchFilterAction.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitExtensibleMatchFilterAction.java Sun Feb  4 03:26:28 2007
@@ -58,7 +58,7 @@
         SearchRequest searchRequest = ldapMessage.getSearchRequest();
 
         // We can allocate the ExtensibleMatch Filter
-        Filter extensibleMatchFilter = new ExtensibleMatchFilter();
+        Filter extensibleMatchFilter = new ExtensibleMatchFilter( ldapMessageContainer.getTlvId() );
 
         searchRequest.addCurrentFilter( extensibleMatchFilter );
         searchRequest.setTerminalFilter( extensibleMatchFilter );

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitGreaterOrEqualFilterAction.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitGreaterOrEqualFilterAction.java?view=diff&rev=503389&r1=503388&r2=503389
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitGreaterOrEqualFilterAction.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitGreaterOrEqualFilterAction.java Sun Feb  4 03:26:28 2007
@@ -62,7 +62,9 @@
         SearchRequest searchRequest = ldapMessage.getSearchRequest();
 
         // We can allocate the Attribute Value Assertion
-        Filter filter = new AttributeValueAssertionFilter( LdapConstants.GREATER_OR_EQUAL_FILTER );
+        Filter filter = new AttributeValueAssertionFilter( 
+            ldapMessageContainer.getTlvId(),
+            LdapConstants.GREATER_OR_EQUAL_FILTER );
 
         searchRequest.addCurrentFilter( filter );
         

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitLessOrEqualFilterAction.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitLessOrEqualFilterAction.java?view=diff&rev=503389&r1=503388&r2=503389
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitLessOrEqualFilterAction.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitLessOrEqualFilterAction.java Sun Feb  4 03:26:28 2007
@@ -62,7 +62,9 @@
         SearchRequest searchRequest = ldapMessage.getSearchRequest();
 
         // We can allocate the Attribute Value Assertion
-        Filter filter = new AttributeValueAssertionFilter( LdapConstants.LESS_OR_EQUAL_FILTER );
+        Filter filter = new AttributeValueAssertionFilter( 
+            ldapMessageContainer.getTlvId(),
+            LdapConstants.LESS_OR_EQUAL_FILTER );
 
         searchRequest.addCurrentFilter( filter );
         

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitNotFilterAction.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitNotFilterAction.java?view=diff&rev=503389&r1=503388&r2=503389
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitNotFilterAction.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitNotFilterAction.java Sun Feb  4 03:26:28 2007
@@ -71,7 +71,7 @@
         SearchRequest searchRequest = ldapMessage.getSearchRequest();
 
         // We can allocate the SearchRequest
-        Filter notFilter = new NotFilter();
+        Filter notFilter = new NotFilter( ldapMessageContainer.getTlvId() );
 
         // Set the filter
         searchRequest.addCurrentFilter( notFilter );

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitOrFilterAction.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitOrFilterAction.java?view=diff&rev=503389&r1=503388&r2=503389
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitOrFilterAction.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitOrFilterAction.java Sun Feb  4 03:26:28 2007
@@ -71,7 +71,7 @@
         SearchRequest searchRequest = ldapMessage.getSearchRequest();
 
         // We can allocate the SearchRequest
-        Filter orFilter = new OrFilter();
+        Filter orFilter = new OrFilter( ldapMessageContainer.getTlvId() );
 
         // Set the filter
         searchRequest.addCurrentFilter( orFilter );

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitPresentFilterAction.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitPresentFilterAction.java?view=diff&rev=503389&r1=503388&r2=503389
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitPresentFilterAction.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitPresentFilterAction.java Sun Feb  4 03:26:28 2007
@@ -61,7 +61,7 @@
         TLV tlv = ldapMessageContainer.getCurrentTLV();
 
         // We can allocate the Attribute Value Assertion
-        PresentFilter presentFilter = new PresentFilter();
+        PresentFilter presentFilter = new PresentFilter( ldapMessageContainer.getTlvId() );
 
         // add the filter to the request filter
         searchRequest.addCurrentFilter( presentFilter );

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitSubstringsFilterAction.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitSubstringsFilterAction.java?view=diff&rev=503389&r1=503388&r2=503389
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitSubstringsFilterAction.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitSubstringsFilterAction.java Sun Feb  4 03:26:28 2007
@@ -72,7 +72,7 @@
         }
 
         // We can allocate the SearchRequest
-        Filter substringFilter = new SubstringFilter();
+        Filter substringFilter = new SubstringFilter( ldapMessageContainer.getTlvId() );
 
         searchRequest.addCurrentFilter( substringFilter );
         searchRequest.setTerminalFilter( substringFilter );

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/bind/LdapAuthentication.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/bind/LdapAuthentication.java?view=diff&rev=503389&r1=503388&r2=503389
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/bind/LdapAuthentication.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/bind/LdapAuthentication.java Sun Feb  4 03:26:28 2007
@@ -32,4 +32,11 @@
  */
 public abstract class LdapAuthentication extends AbstractAsn1Object
 {
+    /**
+     * @see Asn1Object#Asn1Object
+     */
+    public LdapAuthentication()
+    {
+        super();
+    }
 }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/bind/SaslCredentials.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/bind/SaslCredentials.java?view=diff&rev=503389&r1=503388&r2=503389
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/bind/SaslCredentials.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/bind/SaslCredentials.java Sun Feb  4 03:26:28 2007
@@ -66,6 +66,14 @@
     private int credentialsLength;
 
 
+    /**
+     * @see Asn1Object#Asn1Object
+     */
+    public SaslCredentials()
+    {
+        super();
+    }
+
     // ~ Methods
     // ------------------------------------------------------------------------------------
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/bind/SimpleAuthentication.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/bind/SimpleAuthentication.java?view=diff&rev=503389&r1=503388&r2=503389
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/bind/SimpleAuthentication.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/bind/SimpleAuthentication.java Sun Feb  4 03:26:28 2007
@@ -51,6 +51,14 @@
     private byte[] simple;
 
 
+    /**
+     * @see Asn1Object#Asn1Object
+     */
+    public SimpleAuthentication()
+    {
+        super();
+    }
+
     // ~ Methods
     // ------------------------------------------------------------------------------------
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/GracefulAction.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/GracefulAction.java?view=diff&rev=503389&r1=503388&r2=503389
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/GracefulAction.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/GracefulAction.java Sun Feb  4 03:26:28 2007
@@ -38,10 +38,10 @@
     public static final int NOW = 0;
 
     /** offline Time after disconnection */
-    protected int timeOffline;
+    protected int timeOffline = UNDETERMINED;
 
     /** Delay before disconnection */
-    protected int delay;
+    protected int delay = NOW;
 
 
     /**
@@ -50,8 +50,7 @@
      */
     public GracefulAction()
     {
-        timeOffline = UNDETERMINED;
-        delay = NOW;
+        super();
     }
 
 
@@ -61,8 +60,9 @@
      * @param timeOffline The time the server will be offline
      * @param delay The delay before the disconnection
      */
-    public GracefulAction(int timeOffline, int delay)
+    public GracefulAction( int timeOffline, int delay )
     {
+        super();
         this.timeOffline = timeOffline;
         this.delay = delay;
     }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/GracefulDisconnect.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/GracefulDisconnect.java?view=diff&rev=503389&r1=503388&r2=503389
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/GracefulDisconnect.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/GracefulDisconnect.java Sun Feb  4 03:26:28 2007
@@ -50,7 +50,8 @@
 public class GracefulDisconnect extends GracefulAction
 {
     /** List of the alternate servers to use */
-    private List<LdapURL> replicatedContexts;
+    // Two urls will be enough, generally
+    private List<LdapURL> replicatedContexts = new ArrayList<LdapURL>( 2 );
 
     /** Length of the sequence */
     private int gracefulDisconnectSequenceLength;
@@ -68,9 +69,6 @@
     public GracefulDisconnect( int timeOffline, int delay )
     {
         super( timeOffline, delay );
-
-        // Two urls will be enough, generally
-        replicatedContexts = new ArrayList<LdapURL>( 2 );
     }
 
 
@@ -80,9 +78,6 @@
     public GracefulDisconnect()
     {
         super();
-
-        // Two urls will be enough, generally
-        replicatedContexts = new ArrayList<LdapURL>( 2 );
     }
 
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/GracefulShutdown.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/GracefulShutdown.java?view=diff&rev=503389&r1=503388&r2=503389
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/GracefulShutdown.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/GracefulShutdown.java Sun Feb  4 03:26:28 2007
@@ -47,6 +47,13 @@
     /** Length of the sequence */
     private int gracefulSequenceLength;
 
+    /**
+     * @see Asn1Object#Asn1Object
+     */
+    public GracefulShutdown()
+    {
+        super();
+    }
 
     /**
      * Compute the GracefulShutdown length 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/AndFilter.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/AndFilter.java?view=diff&rev=503389&r1=503388&r2=503389
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/AndFilter.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/AndFilter.java Sun Feb  4 03:26:28 2007
@@ -43,9 +43,9 @@
      * The constructor. We wont initialize the ArrayList as they may not be
      * used.
      */
-    public AndFilter()
+    public AndFilter( int tlvId )
     {
-        super();
+        super( tlvId );
     }
 
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/AttributeValueAssertionFilter.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/AttributeValueAssertionFilter.java?view=diff&rev=503389&r1=503388&r2=503389
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/AttributeValueAssertionFilter.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/AttributeValueAssertionFilter.java Sun Feb  4 03:26:28 2007
@@ -59,8 +59,9 @@
      * 
      * @param filterType The filter type
      */
-    public AttributeValueAssertionFilter( int filterType )
+    public AttributeValueAssertionFilter( int tlvId, int filterType )
     {
+        super( tlvId );
         this.filterType = filterType;
     }
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/ConnectorFilter.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/ConnectorFilter.java?view=diff&rev=503389&r1=503388&r2=503389
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/ConnectorFilter.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/ConnectorFilter.java Sun Feb  4 03:26:28 2007
@@ -53,8 +53,9 @@
     /**
      * The constructor. We wont initialize the ArrayList as it may not be used.
      */
-    public ConnectorFilter()
+    public ConnectorFilter( int tlvId )
     {
+        super( tlvId );
     }
 
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/ExtensibleMatchFilter.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/ExtensibleMatchFilter.java?view=diff&rev=503389&r1=503388&r2=503389
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/ExtensibleMatchFilter.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/ExtensibleMatchFilter.java Sun Feb  4 03:26:28 2007
@@ -58,7 +58,7 @@
     private Object matchValue;
 
     /** The dnAttributes flag */
-    private boolean dnAttributes;
+    private boolean dnAttributes = false;
 
     /** The extensible match length */
     private int extensibleMatchLength;
@@ -69,9 +69,9 @@
      * Creates a new ExtensibleMatchFilter object. The dnAttributes flag
      * defaults to false.
      */
-    public ExtensibleMatchFilter()
+    public ExtensibleMatchFilter( int tlvId )
     {
-        dnAttributes = false;
+        super( tlvId );
     }
 
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/Filter.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/Filter.java?view=diff&rev=503389&r1=503388&r2=503389
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/Filter.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/Filter.java Sun Feb  4 03:26:28 2007
@@ -35,7 +35,8 @@
     /**
      * The constructor.
      */
-    public Filter()
+    public Filter( int tlvId )
     {
+        super( tlvId );
     }
 }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/NotFilter.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/NotFilter.java?view=diff&rev=503389&r1=503388&r2=503389
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/NotFilter.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/NotFilter.java Sun Feb  4 03:26:28 2007
@@ -42,8 +42,9 @@
     /**
      * The constructor.
      */
-    public NotFilter()
+    public NotFilter( int tlvId )
     {
+        super( tlvId );
     }
 
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/OrFilter.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/OrFilter.java?view=diff&rev=503389&r1=503388&r2=503389
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/OrFilter.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/OrFilter.java Sun Feb  4 03:26:28 2007
@@ -43,8 +43,9 @@
      * The constructor. We wont initialize the ArrayList as they may not be
      * used.
      */
-    public OrFilter()
+    public OrFilter( int tlvId )
     {
+        super( tlvId );
     }
 
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/PresentFilter.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/PresentFilter.java?view=diff&rev=503389&r1=503388&r2=503389
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/PresentFilter.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/PresentFilter.java Sun Feb  4 03:26:28 2007
@@ -52,8 +52,9 @@
     /**
      * The constructor.
      */
-    public PresentFilter()
+    public PresentFilter( int tlvId )
     {
+        super( tlvId );
     }
 
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchRequest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchRequest.java?view=diff&rev=503389&r1=503388&r2=503389
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchRequest.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchRequest.java Sun Feb  4 03:26:28 2007
@@ -88,7 +88,7 @@
     private Filter filter;
     
     /** The list of attributes to get */
-    private Attributes attributes;
+    private Attributes attributes = new AttributesImpl( true );
 
     /** The current filter. This is used while decoding a PDU */
     private Filter currentFilter;
@@ -112,9 +112,6 @@
     public SearchRequest()
     {
         super();
-
-        currentFilter = null;
-        attributes = new AttributesImpl( true );
     }
 
 
@@ -404,27 +401,39 @@
         // The parent has been completed, so fold it
         while ( ( localParent != null ) && ( localParent.getExpectedLength() == 0 ) )
         {
-            Asn1Object filterParent = localFilter.getParent();
-            
-            // We have a special case with PresentFilter, which has not been 
-            // pushed on the stack, so we need to get its parent's parent
-            if ( localFilter instanceof PresentFilter )
-            {
-                filterParent = filterParent.getParent();
-            }
-
-            if ( filterParent instanceof Filter )
+            if ( localParent.getId() != localFilter.getParent().getTlvId() )
             {
-                // The parent is a filter ; it will become the new currentFilter
-                // and we will loop again. 
-                currentFilter = (Filter)filterParent;
-                localFilter = currentFilter;
                 localParent = localParent.getParent();
+                
             }
             else
             {
-                // We can stop the recursion, we have reached the searchResult Object
-                break;
+                Asn1Object filterParent = localFilter.getParent();
+                
+                // We have a special case with PresentFilter, which has not been 
+                // pushed on the stack, so we need to get its parent's parent
+                if ( localFilter instanceof Filter )
+                {
+                    filterParent = filterParent.getParent();
+                }
+                else if ( filterParent instanceof Filter )
+                {
+                    filterParent = filterParent.getParent();
+                }
+                
+                if ( filterParent instanceof Filter )
+                {
+                    // The parent is a filter ; it will become the new currentFilter
+                    // and we will loop again. 
+                    currentFilter = (Filter)filterParent;
+                    localFilter = currentFilter;
+                    localParent = localParent.getParent();
+                }
+                else
+                {
+                    // We can stop the recursion, we have reached the searchResult Object
+                    break;
+                }
             }
         }
     }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchResultEntry.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchResultEntry.java?view=diff&rev=503389&r1=503388&r2=503389
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchResultEntry.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchResultEntry.java Sun Feb  4 03:26:28 2007
@@ -76,7 +76,7 @@
     private byte[] objectNameBytes;
 
     /** The attributes list. It contains javax.naming.directory.Attribute */
-    private Attributes partialAttributeList;
+    private Attributes partialAttributeList = new AttributesImpl( true );
 
     /** The current attribute being decoded */
     private Attribute currentAttributeValue;
@@ -103,7 +103,6 @@
     public SearchResultEntry()
     {
         super();
-        partialAttributeList = new AttributesImpl( true );
     }
 
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchResultReference.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchResultReference.java?view=diff&rev=503389&r1=503388&r2=503389
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchResultReference.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchResultReference.java Sun Feb  4 03:26:28 2007
@@ -47,7 +47,7 @@
     // ----------------------------------------------------------------------------
 
     /** The set of LdapURLs */
-    private List<LdapURL> searchResultReferences;
+    private List<LdapURL> searchResultReferences = new ArrayList<LdapURL>();
 
     /** The search result reference length */
     private int searchResultReferenceLength;
@@ -62,7 +62,6 @@
     public SearchResultReference()
     {
         super();
-        searchResultReferences = new ArrayList<LdapURL>();
     }
 
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SubstringFilter.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SubstringFilter.java?view=diff&rev=503389&r1=503388&r2=503389
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SubstringFilter.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SubstringFilter.java Sun Feb  4 03:26:28 2007
@@ -71,7 +71,7 @@
     private String initialSubstrings;
 
     /** The any filter. It's a list of LdapString */
-    private List<String> anySubstrings;
+    private List<String> anySubstrings = new ArrayList<String>( 1 );
 
     /** The final filter */
     private String finalSubstrings;
@@ -90,9 +90,9 @@
      * The constructor. We will create the 'any' subsring arraylist with only
      * one element.
      */
-    public SubstringFilter()
+    public SubstringFilter( int tlvId )
     {
-        anySubstrings = new ArrayList<String>( 1 );
+        super( tlvId );
     }
 
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/EntryChangeControl.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/EntryChangeControl.java?view=diff&rev=503389&r1=503388&r2=503389
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/EntryChangeControl.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/EntryChangeControl.java Sun Feb  4 03:26:28 2007
@@ -97,6 +97,14 @@
 
 
     /**
+     * @see Asn1Object#Asn1Object
+     */
+    public EntryChangeControl()
+    {
+        super();
+    }
+
+    /**
      * Compute the EntryChangeControl length 
      * 
      * 0x30 L1 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/PSearchControl.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/PSearchControl.java?view=diff&rev=503389&r1=503388&r2=503389
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/PSearchControl.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/PSearchControl.java Sun Feb  4 03:26:28 2007
@@ -74,6 +74,14 @@
     /** A temporary storage for a psearch length */
     private int psearchSeqLength;
 
+    /**
+     * Default constructor
+     *
+     */
+    public PSearchControl()
+    {
+        super();
+    }
 
     public void setChangesOnly( boolean changesOnly )
     {

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/SubEntryControl.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/SubEntryControl.java?view=diff&rev=503389&r1=503388&r2=503389
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/SubEntryControl.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/SubEntryControl.java Sun Feb  4 03:26:28 2007
@@ -37,6 +37,14 @@
 {
     private boolean visibility = false;
 
+    /**
+     * Default constructor
+     *
+     */
+    public SubEntryControl()
+    {
+        super();
+    }
 
     /**
      * Check if the subEntry is visible

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestTest.java?view=diff&rev=503389&r1=503388&r2=503389
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestTest.java Sun Feb  4 03:26:28 2007
@@ -198,7 +198,7 @@
         AttributeValueAssertion assertion = equalityMatch.getAssertion();
         assertNotNull( assertion );
 
-        assertEquals( "objectclass", assertion.getAttributeDesc().toString() );
+        assertEquals( "objectclass", assertion.getAttributeDesc() );
         assertEquals( "top", assertion.getAssertionValue().toString() );
 
         // (& (| (objectclass=top) (ou=contacts) ) (...
@@ -208,7 +208,7 @@
         assertion = equalityMatch.getAssertion();
         assertNotNull( assertion );
 
-        assertEquals( "ou", assertion.getAttributeDesc().toString() );
+        assertEquals( "ou", assertion.getAttributeDesc() );
         assertEquals( "contacts", assertion.getAssertionValue().toString() );
 
         // (& (| (objectclass=top) (ou=contacts) ) (! ...
@@ -222,7 +222,7 @@
         assertion = equalityMatch.getAssertion();
         assertNotNull( assertion );
 
-        assertEquals( "objectclass", assertion.getAttributeDesc().toString() );
+        assertEquals( "objectclass", assertion.getAttributeDesc() );
         assertEquals( "ttt", assertion.getAssertionValue().toString() );
 
         Attributes attributes = sr.getAttributes();
@@ -367,7 +367,7 @@
         AttributeValueAssertion assertion = approxMatch.getAssertion();
         assertNotNull( assertion );
 
-        assertEquals( "objectclass", assertion.getAttributeDesc().toString() );
+        assertEquals( "objectclass", assertion.getAttributeDesc() );
         assertEquals( "top", assertion.getAssertionValue().toString() );
 
         // (& (| (objectclass~=top) (ou<=contacts) ) (...
@@ -377,7 +377,7 @@
         assertion = lessOrEqual.getAssertion();
         assertNotNull( assertion );
 
-        assertEquals( "ou", assertion.getAttributeDesc().toString() );
+        assertEquals( "ou", assertion.getAttributeDesc() );
         assertEquals( "contacts", assertion.getAssertionValue().toString() );
 
         // (& (| (objectclass~=top) (ou<=contacts) ) (! ...
@@ -391,7 +391,7 @@
         assertion = greaterOrEqual.getAssertion();
         assertNotNull( assertion );
 
-        assertEquals( "objectclass", assertion.getAttributeDesc().toString() );
+        assertEquals( "objectclass", assertion.getAttributeDesc() );
         assertEquals( "ttt", assertion.getAssertionValue().toString() );
 
         // The attributes
@@ -544,13 +544,13 @@
         PresentFilter presentFilter = ( PresentFilter ) orFilters.get( 0 );
         assertNotNull( presentFilter );
 
-        assertEquals( "objectclass", presentFilter.getAttributeDescription().toString() );
+        assertEquals( "objectclass", presentFilter.getAttributeDescription() );
 
         // (& (| (objectclass=*) (ou=*) ) (...
         presentFilter = ( PresentFilter ) orFilters.get( 1 );
         assertNotNull( presentFilter );
 
-        assertEquals( "ou", presentFilter.getAttributeDescription().toString() );
+        assertEquals( "ou", presentFilter.getAttributeDescription() );
 
         // (& (| (objectclass=*) (ou=*) ) (! ...
         NotFilter notFilter = ( NotFilter ) andFilters.get( 1 );
@@ -563,7 +563,7 @@
         AttributeValueAssertion assertion = greaterOrEqual.getAssertion();
         assertNotNull( assertion );
 
-        assertEquals( "objectclass", assertion.getAttributeDesc().toString() );
+        assertEquals( "objectclass", assertion.getAttributeDesc() );
         assertEquals( "ttt", assertion.getAssertionValue().toString() );
 
         // The attributes
@@ -674,7 +674,7 @@
         // (objectClass = *)
         PresentFilter presentFilter = ( PresentFilter ) sr.getFilter();
         assertNotNull( presentFilter );
-        assertEquals( "objectClass", presentFilter.getAttributeDescription().toString() );
+        assertEquals( "objectClass", presentFilter.getAttributeDescription() );
 
         // The attributes
         Attributes attributes = sr.getAttributes();
@@ -801,31 +801,31 @@
         AttributeValueAssertion assertion = ( ( AttributeValueAssertionFilter ) orFilter.getOrFilter().get( 0 ) )
             .getAssertion();
 
-        assertEquals( "uid", assertion.getAttributeDesc().toString() );
+        assertEquals( "uid", assertion.getAttributeDesc() );
         assertEquals( "akarasulu", assertion.getAssertionValue().toString() );
 
         // cn=aok
         assertion = ( ( AttributeValueAssertionFilter ) orFilter.getOrFilter().get( 1 ) ).getAssertion();
 
-        assertEquals( "cn", assertion.getAttributeDesc().toString() );
+        assertEquals( "cn", assertion.getAttributeDesc() );
         assertEquals( "aok", assertion.getAssertionValue().toString() );
 
         // ou = Human Resources
         assertion = ( ( AttributeValueAssertionFilter ) orFilter.getOrFilter().get( 2 ) ).getAssertion();
 
-        assertEquals( "ou", assertion.getAttributeDesc().toString() );
+        assertEquals( "ou", assertion.getAttributeDesc() );
         assertEquals( "Human Resources", assertion.getAssertionValue().toString() );
 
         // l=Santa Clara
         assertion = ( ( AttributeValueAssertionFilter ) orFilter.getOrFilter().get( 3 ) ).getAssertion();
 
-        assertEquals( "l", assertion.getAttributeDesc().toString() );
+        assertEquals( "l", assertion.getAttributeDesc() );
         assertEquals( "Santa Clara", assertion.getAssertionValue().toString() );
 
         // cn=abok
         assertion = ( ( AttributeValueAssertionFilter ) orFilter.getOrFilter().get( 4 ) ).getAssertion();
 
-        assertEquals( "cn", assertion.getAttributeDesc().toString() );
+        assertEquals( "cn", assertion.getAttributeDesc() );
         assertEquals( "abok", assertion.getAssertionValue().toString() );
 
         // The attributes
@@ -1092,7 +1092,7 @@
         AttributeValueAssertion assertion = equalityMatch.getAssertion();
         assertNotNull( assertion );
 
-        assertEquals( "objectclass", assertion.getAttributeDesc().toString() );
+        assertEquals( "objectclass", assertion.getAttributeDesc() );
         assertEquals( "top", assertion.getAssertionValue().toString() );
 
         // (& (| (objectclass=top) (ou=contacts) ) (...
@@ -1102,7 +1102,7 @@
         assertion = equalityMatch.getAssertion();
         assertNotNull( assertion );
 
-        assertEquals( "2.5.4.11", assertion.getAttributeDesc().toString() );
+        assertEquals( "2.5.4.11", assertion.getAttributeDesc() );
         assertEquals( "contacts", assertion.getAssertionValue().toString() );
 
         // (& (| (objectclass=top) (ou=contacts) ) (! ...
@@ -1116,7 +1116,7 @@
         assertion = equalityMatch.getAssertion();
         assertNotNull( assertion );
 
-        assertEquals( "organizationalUnitName", assertion.getAttributeDesc().toString() );
+        assertEquals( "organizationalUnitName", assertion.getAttributeDesc() );
         assertEquals( "ttt", assertion.getAssertionValue().toString() );
 
         Attributes attributes = sr.getAttributes();
@@ -1419,7 +1419,7 @@
         AttributeValueAssertion assertion = equalityMatch.getAssertion();
         assertNotNull( assertion );
 
-        assertEquals( "objectclass", assertion.getAttributeDesc().toString() );
+        assertEquals( "objectclass", assertion.getAttributeDesc() );
         assertEquals( "top", assertion.getAssertionValue().toString() );
 
         // (& (| (objectclass=top) (ou=contacts) ) (...
@@ -1429,7 +1429,7 @@
         assertion = equalityMatch.getAssertion();
         assertNotNull( assertion );
 
-        assertEquals( "ou", assertion.getAttributeDesc().toString() );
+        assertEquals( "ou", assertion.getAttributeDesc() );
         assertEquals( "contacts", assertion.getAssertionValue().toString() );
 
         // (& (| (objectclass=top) (ou=contacts) ) (! ...
@@ -1443,7 +1443,7 @@
         assertion = equalityMatch.getAssertion();
         assertNotNull( assertion );
 
-        assertEquals( "objectclass", assertion.getAttributeDesc().toString() );
+        assertEquals( "objectclass", assertion.getAttributeDesc() );
         assertEquals( "ttt", assertion.getAssertionValue().toString() );
 
         Attributes attributes = sr.getAttributes();
@@ -2460,7 +2460,7 @@
 
         AttributeValueAssertion assertion = greaterThanFilter.getAssertion();
 
-        assertEquals( "test", assertion.getAttributeDesc().toString() );
+        assertEquals( "test", assertion.getAttributeDesc() );
         assertEquals( "", assertion.getAssertionValue().toString() );
 
         Attributes attributes = sr.getAttributes();
@@ -2547,7 +2547,7 @@
 
         AttributeValueAssertion assertion = greaterThanFilter.getAssertion();
 
-        assertEquals( "test", assertion.getAttributeDesc().toString() );
+        assertEquals( "test", assertion.getAttributeDesc() );
         assertEquals( "", assertion.getAssertionValue().toString() );
 
         Attributes attributes = sr.getAttributes();
@@ -2638,7 +2638,7 @@
 
         AttributeValueAssertion assertion = greaterThanFilter.getAssertion();
 
-        assertEquals( "test", assertion.getAttributeDesc().toString() );
+        assertEquals( "test", assertion.getAttributeDesc() );
         assertEquals( "", assertion.getAssertionValue().toString() );
 
         Attributes attributes = sr.getAttributes();
@@ -2918,7 +2918,7 @@
         assertNotNull( substringFilter );
 
         assertEquals( "pgpuserid", substringFilter.getType() );
-        assertEquals( "vgjokjev@netcetera.com.mk", substringFilter.getInitialSubstrings().toString() );
+        assertEquals( "vgjokjev@netcetera.com.mk", substringFilter.getInitialSubstrings() );
         assertEquals( 0, substringFilter.getAnySubstrings().size() );
         assertEquals( null, substringFilter.getFinalSubstrings() );
 
@@ -2928,7 +2928,7 @@
         AttributeValueAssertion assertion = equalityMatch.getAssertion();
         assertNotNull( assertion );
 
-        assertEquals( "pgpdisabled", assertion.getAttributeDesc().toString() );
+        assertEquals( "pgpdisabled", assertion.getAttributeDesc() );
         assertEquals( "0", assertion.getAssertionValue().toString() );
 
         // Check the encoding
@@ -3030,7 +3030,7 @@
         AttributeValueAssertion assertion = equalityMatch.getAssertion();
         assertNotNull( assertion );
 
-        assertEquals( "a", assertion.getAttributeDesc().toString() );
+        assertEquals( "a", assertion.getAttributeDesc() );
         assertEquals( "b", assertion.getAssertionValue().toString() );
 
         Attributes attributes = sr.getAttributes();
@@ -3143,7 +3143,7 @@
         AttributeValueAssertion assertion = equalityMatch.getAssertion();
         assertNotNull( assertion );
 
-        assertEquals( "a", assertion.getAttributeDesc().toString() );
+        assertEquals( "a", assertion.getAttributeDesc() );
         assertEquals( "b", assertion.getAssertionValue().toString() );
 
         Attributes attributes = sr.getAttributes();
@@ -3261,7 +3261,7 @@
         AttributeValueAssertion assertion = equalityMatch.getAssertion();
         assertNotNull( assertion );
 
-        assertEquals( "a", assertion.getAttributeDesc().toString() );
+        assertEquals( "a", assertion.getAttributeDesc() );
         assertEquals( "b", assertion.getAssertionValue().toString() );
 
         // (&(a=b)(c=d))
@@ -3271,7 +3271,7 @@
         assertion = equalityMatch.getAssertion();
         assertNotNull( assertion );
 
-        assertEquals( "c", assertion.getAttributeDesc().toString() );
+        assertEquals( "c", assertion.getAttributeDesc() );
         assertEquals( "d", assertion.getAssertionValue().toString() );
 
         Attributes attributes = sr.getAttributes();
@@ -3390,7 +3390,7 @@
         AttributeValueAssertion assertion = equalityMatch.getAssertion();
         assertNotNull( assertion );
 
-        assertEquals( "a", assertion.getAttributeDesc().toString() );
+        assertEquals( "a", assertion.getAttributeDesc() );
         assertEquals( "b", assertion.getAssertionValue().toString() );
 
         Attributes attributes = sr.getAttributes();
@@ -3515,7 +3515,7 @@
         AttributeValueAssertion assertion = equalityMatch.getAssertion();
         assertNotNull( assertion );
 
-        assertEquals( "a", assertion.getAttributeDesc().toString() );
+        assertEquals( "a", assertion.getAttributeDesc() );
         assertEquals( "b", assertion.getAssertionValue().toString() );
 
         // (&(&(a=b)(c=d)
@@ -3525,7 +3525,7 @@
         assertion = equalityMatch.getAssertion();
         assertNotNull( assertion );
 
-        assertEquals( "c", assertion.getAttributeDesc().toString() );
+        assertEquals( "c", assertion.getAttributeDesc() );
         assertEquals( "d", assertion.getAssertionValue().toString() );
 
         Attributes attributes = sr.getAttributes();
@@ -3649,7 +3649,7 @@
         AttributeValueAssertion assertion = equalityMatch.getAssertion();
         assertNotNull( assertion );
 
-        assertEquals( "a", assertion.getAttributeDesc().toString() );
+        assertEquals( "a", assertion.getAttributeDesc() );
         assertEquals( "b", assertion.getAssertionValue().toString() );
 
         // (&(&(a=b))(c=d))
@@ -3659,7 +3659,7 @@
         assertion = equalityMatch.getAssertion();
         assertNotNull( assertion );
 
-        assertEquals( "c", assertion.getAttributeDesc().toString() );
+        assertEquals( "c", assertion.getAttributeDesc() );
         assertEquals( "d", assertion.getAssertionValue().toString() );
 
         Attributes attributes = sr.getAttributes();
@@ -3787,7 +3787,7 @@
         AttributeValueAssertion assertion = equalityMatch.getAssertion();
         assertNotNull( assertion );
 
-        assertEquals( "a", assertion.getAttributeDesc().toString() );
+        assertEquals( "a", assertion.getAttributeDesc() );
         assertEquals( "b", assertion.getAssertionValue().toString() );
 
         // (&(&(a=b)(c=d)...
@@ -3797,7 +3797,7 @@
         assertion = equalityMatch.getAssertion();
         assertNotNull( assertion );
 
-        assertEquals( "c", assertion.getAttributeDesc().toString() );
+        assertEquals( "c", assertion.getAttributeDesc() );
         assertEquals( "d", assertion.getAssertionValue().toString() );
         
         // (&(&(a=b)(c=d))(e=f))
@@ -3807,7 +3807,7 @@
         assertion = equalityMatch.getAssertion();
         assertNotNull( assertion );
 
-        assertEquals( "e", assertion.getAttributeDesc().toString() );
+        assertEquals( "e", assertion.getAttributeDesc() );
         assertEquals( "f", assertion.getAssertionValue().toString() );
 
         Attributes attributes = sr.getAttributes();
@@ -3932,7 +3932,7 @@
         AttributeValueAssertion assertion = equalityMatch.getAssertion();
         assertNotNull( assertion );
 
-        assertEquals( "a", assertion.getAttributeDesc().toString() );
+        assertEquals( "a", assertion.getAttributeDesc() );
         assertEquals( "b", assertion.getAssertionValue().toString() );
 
         // (&(&(a=b))(&...
@@ -3949,7 +3949,7 @@
         assertion = equalityMatch.getAssertion();
         assertNotNull( assertion );
 
-        assertEquals( "c", assertion.getAttributeDesc().toString() );
+        assertEquals( "c", assertion.getAttributeDesc() );
         assertEquals( "d", assertion.getAssertionValue().toString() );
 
         Attributes attributes = sr.getAttributes();
@@ -4078,7 +4078,7 @@
         AttributeValueAssertion assertion = equalityMatch.getAssertion();
         assertNotNull( assertion );
 
-        assertEquals( "a", assertion.getAttributeDesc().toString() );
+        assertEquals( "a", assertion.getAttributeDesc() );
         assertEquals( "b", assertion.getAssertionValue().toString() );
 
         // (&(&(a=b)(c=d))...
@@ -4088,7 +4088,7 @@
         assertion = equalityMatch.getAssertion();
         assertNotNull( assertion );
 
-        assertEquals( "c", assertion.getAttributeDesc().toString() );
+        assertEquals( "c", assertion.getAttributeDesc() );
         assertEquals( "d", assertion.getAssertionValue().toString() );
         
         // (&(&(a=b)(c=d))(&...
@@ -4105,7 +4105,7 @@
         assertion = equalityMatch.getAssertion();
         assertNotNull( assertion );
 
-        assertEquals( "e", assertion.getAttributeDesc().toString() );
+        assertEquals( "e", assertion.getAttributeDesc() );
         assertEquals( "f", assertion.getAssertionValue().toString() );
 
         Attributes attributes = sr.getAttributes();
@@ -4228,13 +4228,13 @@
         PresentFilter presentFilter = ( PresentFilter ) orFilters.get( 0 );
         assertNotNull( presentFilter );
 
-        assertEquals( "abcdef", presentFilter.getAttributeDescription().toString() );
+        assertEquals( "abcdef", presentFilter.getAttributeDescription() );
 
         // (&(&(abcdef=*)(ghijkl=*))...
         presentFilter = ( PresentFilter ) orFilters.get( 1 );
         assertNotNull( presentFilter );
 
-        assertEquals( "ghijkl", presentFilter.getAttributeDescription().toString() );
+        assertEquals( "ghijkl", presentFilter.getAttributeDescription() );
         
         // (&(&(abcdef=*)(ghijkl=*))(&...
         NotFilter notFilter = ( NotFilter ) andFilters.get( 1 );
@@ -4247,7 +4247,7 @@
         AttributeValueAssertion assertion = equalityMatch.getAssertion();
         assertNotNull( assertion );
 
-        assertEquals( "e", assertion.getAttributeDesc().toString() );
+        assertEquals( "e", assertion.getAttributeDesc() );
         assertEquals( "f", assertion.getAssertionValue().toString() );
 
         Attributes attributes = sr.getAttributes();
@@ -4331,7 +4331,7 @@
         
         PresentFilter presentFilter = ( PresentFilter ) sr.getFilter();
         assertNotNull( presentFilter );
-        assertEquals( "objectClass", presentFilter.getAttributeDescription().toString() );
+        assertEquals( "objectClass", presentFilter.getAttributeDescription() );
         
         Attributes attributes = sr.getAttributes();
         assertEquals( 0, attributes.size() );
@@ -4419,7 +4419,7 @@
         AttributeValueAssertion assertion = equalityMatch.getAssertion();
         assertNotNull( assertion );
 
-        assertEquals( "uid", assertion.getAttributeDesc().toString() );
+        assertEquals( "uid", assertion.getAttributeDesc() );
         assertEquals( "buster ", assertion.getAssertionValue().toString() );
 
         // (&(uid=buster)(sbAttribute=Buy))
@@ -4429,10 +4429,137 @@
         assertion = equalityMatch.getAssertion();
         assertNotNull( assertion );
 
-        assertEquals( "sbAttribute", assertion.getAttributeDesc().toString() );
+        assertEquals( "sbAttribute", assertion.getAttributeDesc() );
         assertEquals( "Buy ", assertion.getAssertionValue().toString() );
 
         Attributes attributes = sr.getAttributes();
         assertEquals( 0, attributes.size() );
+    }
+    
+    
+    /**
+     * Test the decoding of a SearchRequest with a complex filter :
+     * (&(objectClass=person)(|(cn=Tori*)(sn=Jagger)))
+     */
+    public void testDecodeSearchRequestComplexFilter()
+    {
+        Asn1Decoder ldapDecoder = new LdapDecoder();
+    
+        ByteBuffer stream = ByteBuffer.allocate( 0x77 );
+        stream.put( new byte[]
+            {
+               0x30, 0x75,                  // LdapMessage
+                 0x02, 0x01, 0x06,          // message Id = 6
+                 0x63, 0x53,                // SearchRequest
+                   0x04, 0x09,              // BasDN 'ou=system'
+                     0x6F, 0x75, 0x3D, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6D, 
+                   0x0A, 0x01, 0x02,        // scope = SUBTREE
+                   0x0A, 0x01, 0x03,        // derefAlias = 3
+                   0x02, 0x01, 0x00,        // sizeLimit = none
+                   0x02, 0x01, 0x00,        // timeLimit = none
+                   0x01, 0x01, 0x00,        // types only = false
+                   (byte)0xA0, 0x35,        // AND
+                     (byte)0xA3, 0x15,      // equals
+                       0x04, 0x0B,          // 'objectclass'
+                         0x6F, 0x62, 0x6A, 0x65, 0x63, 0x74, 0x43, 0x6C, 
+                         0x61, 0x73, 0x73, 
+                       0x04, 0x06,          // 'person'
+                         0x70, 0x65, 0x72, 0x73, 0x6F, 0x6E, 
+                     (byte)0xA1, 0x1C,      // OR
+                       (byte)0xA4, 0x0C,    // substrings : 'cn=Tori*'
+                         0x04, 0x02,        // 'cn'
+                           0x63, 0x6E, 
+                         0x30, 0x06,        // initial = 'Tori'
+                           (byte)0x80, 0x04, 
+                               0x54, 0x6F, 0x72, 0x69, 
+                       (byte)0xA3, 0x0C,    // equals
+                         0x04, 0x02,        // 'sn'
+                           0x73, 0x6E,    
+                         0x04, 0x06,        // 'Jagger'
+                           0x4A, 0x61, 0x67, 0x67, 0x65, 0x72, 
+                   0x30, 0x00,              // Control
+                   (byte)0xA0, 0x1B, 
+                     0x30, 0x19, 
+                       0x04, 0x17, 
+                         '2', '.', '1', '6', '.', '8', '4', '0', '.',
+                         '1', '.', '1', '1', '3', '7', '3', '0', '.',
+                         '3', '.', '4', '.', '2'
+            } );
+        
+        stream.flip();
+    
+        // Allocate a BindRequest Container
+        IAsn1Container ldapMessageContainer = new LdapMessageContainer();
+    
+        try
+        {
+            ldapDecoder.decode( stream, ldapMessageContainer );
+        }
+        catch ( DecoderException de )
+        {
+            de.printStackTrace();
+            fail( de.getMessage() );
+        }
+        catch ( NamingException ne )
+        {
+            ne.printStackTrace();
+            fail( ne.getMessage() );
+        }
+
+        assertEquals( TLVStateEnum.PDU_DECODED, ldapMessageContainer.getState() );
+        
+        LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
+        SearchRequest sr = message.getSearchRequest();
+
+        assertEquals( 6, message.getMessageId() );
+        assertEquals( "ou=system", sr.getBaseObject().toString() );
+        assertEquals( ScopeEnum.WHOLE_SUBTREE, sr.getScope() );
+        assertEquals( LdapConstants.DEREF_ALWAYS, sr.getDerefAliases() );
+        assertEquals( 0, sr.getSizeLimit() );
+        assertEquals( 0, sr.getTimeLimit() );
+        assertEquals( false, sr.isTypesOnly() );
+
+        // (&(...
+        AndFilter andFilter = ( AndFilter ) sr.getFilter();
+        assertNotNull( andFilter );
+
+        List<Filter> andFilters = andFilter.getAndFilter();
+        assertEquals( 2, andFilters.size() );
+        
+        // (&(objectClass=person)..
+        AttributeValueAssertionFilter equalityMatch = ( AttributeValueAssertionFilter ) andFilters.get( 0 );
+        assertNotNull( equalityMatch );
+
+        AttributeValueAssertion assertion = equalityMatch.getAssertion();
+        assertNotNull( assertion );
+
+        assertEquals( "objectClass", assertion.getAttributeDesc() );
+        assertEquals( "person", assertion.getAssertionValue().toString() );
+
+        // (&(a=b)(|
+        OrFilter orFilter = ( OrFilter ) andFilters.get( 1 );
+        assertNotNull( orFilter );
+
+        List<Filter> orFilters = orFilter.getOrFilter();
+        assertEquals( 2, orFilters.size() );
+        
+        // (&(a=b)(|(cn=Tori*
+        SubstringFilter substringFilter = ( SubstringFilter ) orFilters.get( 0 );
+        assertNotNull( substringFilter );
+
+        assertEquals( "cn", substringFilter.getType() );
+        assertEquals( "Tori", substringFilter.getInitialSubstrings() );
+        assertEquals( 0, substringFilter.getAnySubstrings().size() );
+        assertEquals( null, substringFilter.getFinalSubstrings() );
+
+        // (&(a=b)(|(cn=Tori*)(sn=Jagger)))
+        equalityMatch = ( AttributeValueAssertionFilter ) orFilters.get( 1 );
+        assertNotNull( equalityMatch );
+
+        assertion = equalityMatch.getAssertion();
+        assertNotNull( assertion );
+
+        assertEquals( "sn", assertion.getAttributeDesc() );
+        assertEquals( "Jagger", assertion.getAssertionValue().toString() );
     }
 }

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java?view=diff&rev=503389&r1=503388&r2=503389
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java Sun Feb  4 03:26:28 2007
@@ -1905,26 +1905,6 @@
        assertTrue( name0.endsWith( name6 ) );
        assertTrue( name0.endsWith( name7 ) );
        assertTrue( name0.endsWith( name8 ) );
-
-       /*
-        * Hashtable env = new Hashtable() ; env.put(
-        * Context.SECURITY_AUTHENTICATION, "simple" ) ; env.put(
-        * Context.SECURITY_PRINCIPAL, "cn=admin,dc=example,dc=com" ) ; env.put(
-        * Context.SECURITY_CREDENTIALS, "jPasswordField1" ) ; env.put(
-        * Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory" ) ;
-        * env.put( Context.PROVIDER_URL,
-        * "ldap://localhost:1396/dc=example,dc=com" ) ; DirContext ctx = new
-        * InitialDirContext( env ) ; NamingEnumeration enum = ctx.listBindings( "" ) ;
-        * Name name0 = new LdapDN( "ou=Special Users,dc=example,dc=com" ) ;
-        * Name name1 = new LdapDN( "dc=example,dc=com" ) ; Name name2 = new
-        * LdapDN( "dc=com" ) ; Name name3 = new LdapDN( "ou=Special Users" ) ;
-        * Name name4 = new LdapDN( "ou=Special Users,dc=example" ) ; Name name5 =
-        * new LdapDN( "" ) ; while ( enum.hasMore() ) { Binding binding = (
-        * Binding ) enum.next() ; DirContext dirCtx = ( DirContext )
-        * binding.getObject() ; NameParser parser = dirCtx.getNameParser( "" ) ;
-        * Name namex = parser.parse( dirCtx.getNameInNamespace() ) ; //
-        * DirContext dirCtx = ( DirContext ) enum.next() ; }
-        */
    }
 
 



Mime
View raw message