directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1066753 - in /directory: apacheds/branches/m1/server-integ/src/test/java/org/apache/directory/server/operations/bind/ shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/ shared/branches/m1/ldap-client-a...
Date Thu, 03 Feb 2011 08:24:52 GMT
Author: elecharny
Date: Thu Feb  3 08:24:51 2011
New Revision: 1066753

URL: http://svn.apache.org/viewvc?rev=1066753&view=rev
Log:
o Created the AbstractControl class
o Renamed the BasicControl class to OpaqueControlImpl

Added:
    directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/AbstractControl.java
      - copied, changed from r1066738, directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/BasicControl.java
    directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/OpaqueControlImpl.java
Removed:
    directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/BasicControl.java
Modified:
    directory/apacheds/branches/m1/server-integ/src/test/java/org/apache/directory/server/operations/bind/MiscBindIT.java
    directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/Dsmlv2ResponseGrammar.java
    directory/shared/branches/m1/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
    directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/codec/BasicControlDecorator.java
    directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/codec/DefaultLdapCodecService.java
    directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/CascadeImpl.java
    directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/EntryChangeImpl.java
    directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/ManageDsaITImpl.java
    directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/PagedResultsImpl.java
    directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/PersistentSearchImpl.java
    directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/SubentriesImpl.java
    directory/shared/branches/m1/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestPerfTest.java

Modified: directory/apacheds/branches/m1/server-integ/src/test/java/org/apache/directory/server/operations/bind/MiscBindIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/server-integ/src/test/java/org/apache/directory/server/operations/bind/MiscBindIT.java?rev=1066753&r1=1066752&r2=1066753&view=diff
==============================================================================
--- directory/apacheds/branches/m1/server-integ/src/test/java/org/apache/directory/server/operations/bind/MiscBindIT.java
(original)
+++ directory/apacheds/branches/m1/server-integ/src/test/java/org/apache/directory/server/operations/bind/MiscBindIT.java
Thu Feb  3 08:24:51 2011
@@ -67,7 +67,8 @@ import org.apache.directory.server.ldap.
 import org.apache.directory.shared.asn1.util.Asn1StringUtils;
 import org.apache.directory.shared.ldap.model.constants.SupportedSaslMechanisms;
 import org.apache.directory.shared.ldap.model.message.Control;
-import org.apache.directory.shared.ldap.model.message.controls.BasicControl;
+import org.apache.directory.shared.ldap.model.message.controls.AbstractControl;
+import org.apache.directory.shared.ldap.model.message.controls.OpaqueControlImpl;
 import org.apache.directory.shared.ldap.util.JndiUtils;
 import org.junit.After;
 import org.junit.Before;
@@ -354,7 +355,7 @@ public class MiscBindIT extends Abstract
     @Test
     public void testFailureWithUnsupportedControl() throws Exception
     {
-        Control unsupported = new BasicControl( "1.1.1.1" );
+        Control unsupported = new OpaqueControlImpl( "1.1.1.1" );
         unsupported.setCritical( true );
         
         ldapServer.getDirectoryService().setAllowAnonymousAccess( true );

Modified: directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/Dsmlv2ResponseGrammar.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/Dsmlv2ResponseGrammar.java?rev=1066753&r1=1066752&r2=1066753&view=diff
==============================================================================
--- directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/Dsmlv2ResponseGrammar.java
(original)
+++ directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/Dsmlv2ResponseGrammar.java
Thu Feb  3 08:24:51 2011
@@ -74,7 +74,8 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.message.SearchResultEntryImpl;
 import org.apache.directory.shared.ldap.model.message.SearchResultReference;
 import org.apache.directory.shared.ldap.model.message.SearchResultReferenceImpl;
-import org.apache.directory.shared.ldap.model.message.controls.BasicControl;
+import org.apache.directory.shared.ldap.model.message.controls.AbstractControl;
+import org.apache.directory.shared.ldap.model.message.controls.OpaqueControlImpl;
 import org.apache.directory.shared.ldap.model.name.Dn;
 import org.apache.directory.shared.util.Base64;
 import org.apache.directory.shared.util.Strings;
@@ -1213,7 +1214,7 @@ public final class Dsmlv2ResponseGrammar
                 throw new XmlPullParserException( I18n.err( I18n.ERR_03006 ), xpp, null );
             }
 
-            control = container.getLdapCodecService().decorate( new BasicControl( attributeValue
) );
+            control = container.getLdapCodecService().decorate( new OpaqueControlImpl( attributeValue
) );
             parent.addControl( control );
         }
         else

Modified: directory/shared/branches/m1/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java?rev=1066753&r1=1066752&r2=1066753&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
(original)
+++ directory/shared/branches/m1/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
Thu Feb  3 08:24:51 2011
@@ -126,7 +126,8 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.message.SearchResultReference;
 import org.apache.directory.shared.ldap.model.message.UnbindRequest;
 import org.apache.directory.shared.ldap.model.message.UnbindRequestImpl;
-import org.apache.directory.shared.ldap.model.message.controls.BasicControl;
+import org.apache.directory.shared.ldap.model.message.controls.AbstractControl;
+import org.apache.directory.shared.ldap.model.message.controls.OpaqueControlImpl;
 import org.apache.directory.shared.ldap.model.name.Dn;
 import org.apache.directory.shared.ldap.model.name.Rdn;
 import org.apache.directory.shared.ldap.model.schema.AttributeType;
@@ -2497,7 +2498,7 @@ public class LdapNetworkConnection exten
         {
             DeleteRequest deleteRequest = new DeleteRequestImpl();
             deleteRequest.setName( dn );
-            deleteRequest.addControl( new BasicControl( treeDeleteOid ) );
+            deleteRequest.addControl( new OpaqueControlImpl( treeDeleteOid ) );
             return delete( deleteRequest );
         }
         else
@@ -2528,7 +2529,7 @@ public class LdapNetworkConnection exten
             {
                 DeleteRequest deleteRequest = new DeleteRequestImpl();
                 deleteRequest.setName( newDn );
-                deleteRequest.addControl( new BasicControl( treeDeleteOid ) );
+                deleteRequest.addControl( new OpaqueControlImpl( treeDeleteOid ) );
                 return delete( deleteRequest );
             }
             else

Modified: directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/codec/BasicControlDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/codec/BasicControlDecorator.java?rev=1066753&r1=1066752&r2=1066753&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/codec/BasicControlDecorator.java
(original)
+++ directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/codec/BasicControlDecorator.java
Thu Feb  3 08:24:51 2011
@@ -27,7 +27,7 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.EncoderException;
 import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.codec.controls.ControlDecorator;
-import org.apache.directory.shared.ldap.model.message.controls.BasicControl;
+import org.apache.directory.shared.ldap.model.message.controls.AbstractControl;
 
 
 /**
@@ -39,16 +39,16 @@ import org.apache.directory.shared.ldap.
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class BasicControlDecorator extends ControlDecorator<BasicControl>
+public class BasicControlDecorator extends ControlDecorator<AbstractControl>
 {
     /**
      * Creates a new instance of BasicControlDecorator, decorating a 
-     * {@link BasicControl}.
+     * {@link AbstractControl}.
      *
      * @param codec The LDAP codec service.
-     * @param control The {@link BasicControl} to decorate.
+     * @param control The {@link AbstractControl} to decorate.
      */
-    public BasicControlDecorator( ILdapCodecService codec, BasicControl control )
+    public BasicControlDecorator( ILdapCodecService codec, AbstractControl control )
     {
         super( codec, control );
     }

Modified: directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/codec/DefaultLdapCodecService.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/codec/DefaultLdapCodecService.java?rev=1066753&r1=1066752&r2=1066753&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/codec/DefaultLdapCodecService.java
(original)
+++ directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/codec/DefaultLdapCodecService.java
Thu Feb  3 08:24:51 2011
@@ -47,10 +47,11 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.codec.controls.search.persistentSearch.PersistentSearchFactory;
 import org.apache.directory.shared.ldap.codec.controls.search.subentries.SubentriesFactory;
 import org.apache.directory.shared.ldap.model.message.Control;
-import org.apache.directory.shared.ldap.model.message.controls.BasicControl;
+import org.apache.directory.shared.ldap.model.message.controls.AbstractControl;
 import org.apache.directory.shared.ldap.model.message.controls.Cascade;
 import org.apache.directory.shared.ldap.model.message.controls.EntryChange;
 import org.apache.directory.shared.ldap.model.message.controls.ManageDsaIT;
+import org.apache.directory.shared.ldap.model.message.controls.OpaqueControlImpl;
 import org.apache.directory.shared.ldap.model.message.controls.PagedResults;
 import org.apache.directory.shared.ldap.model.message.controls.PersistentSearch;
 import org.apache.directory.shared.ldap.model.message.controls.Subentries;
@@ -248,7 +249,7 @@ public class DefaultLdapCodecService imp
             
             if ( factory == null )
             {
-                return ( E ) new BasicControl( oid );
+                return ( E ) new OpaqueControlImpl( oid );
             }
             
             return ( E ) factory.newControl();
@@ -270,7 +271,7 @@ public class DefaultLdapCodecService imp
             
             if ( factory == null )
             {
-                return new BasicControlDecorator( this, (BasicControl)control ); 
+                return new BasicControlDecorator( this, (AbstractControl)control ); 
             }
             
             return factory.decorate( control );
@@ -302,7 +303,7 @@ public class DefaultLdapCodecService imp
         
         if ( factory == null )
         {
-            BasicControl ourControl = new BasicControl( control.getID() );
+            AbstractControl ourControl = new OpaqueControlImpl( control.getID() );
             ourControl.setCritical( control.isCritical() );
             BasicControlDecorator decorator = new BasicControlDecorator( this, ourControl
);
             decorator.setValue( control.getEncodedValue() );

Copied: directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/AbstractControl.java
(from r1066738, directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/BasicControl.java)
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/AbstractControl.java?p2=directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/AbstractControl.java&p1=directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/BasicControl.java&r1=1066738&r2=1066753&rev=1066753&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/BasicControl.java
(original)
+++ directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/AbstractControl.java
Thu Feb  3 08:24:51 2011
@@ -31,7 +31,7 @@ import org.apache.directory.shared.ldap.
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class BasicControl implements Control
+public abstract class AbstractControl implements Control
 {
     /** The control type */
     private String oid;
@@ -45,7 +45,7 @@ public class BasicControl implements Con
      *
      * @param oid The OID of this Control.
      */
-    public BasicControl( String oid )
+    public AbstractControl( String oid )
     {
         this.oid = oid;
     }
@@ -57,7 +57,7 @@ public class BasicControl implements Con
      * @param oid The OID of this Control.
      * @param criticality true if this Control is critical, false otherwise. 
      */
-    public BasicControl( String oid, boolean criticality )
+    public AbstractControl( String oid, boolean criticality )
     {
         this.oid = oid;
         this.criticality = criticality;
@@ -137,7 +137,6 @@ public class BasicControl implements Con
             return false;
         }
 
-        //noinspection SimplifiableIfStatement
         return criticality == otherControl.isCritical();
     }
 

Modified: directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/CascadeImpl.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/CascadeImpl.java?rev=1066753&r1=1066752&r2=1066753&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/CascadeImpl.java
(original)
+++ directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/CascadeImpl.java
Thu Feb  3 08:24:51 2011
@@ -24,7 +24,7 @@ package org.apache.directory.shared.ldap
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class CascadeImpl extends BasicControl implements Cascade
+public class CascadeImpl extends AbstractControl implements Cascade
 {
     /**
      * Default constructor

Modified: directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/EntryChangeImpl.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/EntryChangeImpl.java?rev=1066753&r1=1066752&r2=1066753&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/EntryChangeImpl.java
(original)
+++ directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/EntryChangeImpl.java
Thu Feb  3 08:24:51 2011
@@ -28,7 +28,7 @@ import org.apache.directory.shared.ldap.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class EntryChangeImpl extends BasicControl implements EntryChange
+public class EntryChangeImpl extends AbstractControl implements EntryChange
 {
     /** The changeType */
     private ChangeType changeType = ChangeType.ADD;

Modified: directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/ManageDsaITImpl.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/ManageDsaITImpl.java?rev=1066753&r1=1066752&r2=1066753&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/ManageDsaITImpl.java
(original)
+++ directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/ManageDsaITImpl.java
Thu Feb  3 08:24:51 2011
@@ -25,7 +25,7 @@ package org.apache.directory.shared.ldap
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class ManageDsaITImpl extends BasicControl implements ManageDsaIT
+public class ManageDsaITImpl extends AbstractControl implements ManageDsaIT
 {
     /**
      * Default constructor.

Added: directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/OpaqueControlImpl.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/OpaqueControlImpl.java?rev=1066753&view=auto
==============================================================================
--- directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/OpaqueControlImpl.java
(added)
+++ directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/OpaqueControlImpl.java
Thu Feb  3 08:24:51 2011
@@ -0,0 +1,59 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.directory.shared.ldap.model.message.controls;
+
+
+import org.apache.directory.shared.ldap.model.message.Control;
+
+
+/**
+ * A simple implementation of the {@link Control} interface with storage for 
+ * the OID and the criticality properties. When the codec factory service
+ * does not have specific control factories available, hence the control is
+ * unrecognized, it creates instances of this control for them.
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class OpaqueControlImpl extends AbstractControl implements Control
+{
+    /**
+     * Creates a Control with a specific OID.
+     *
+     * @param oid The OID of this Control.
+     */
+    public OpaqueControlImpl( String oid )
+    {
+        super( oid );
+    }
+
+
+    /**
+     * Creates a Control with a specific OID, and criticality set.
+     *
+     * @param oid The OID of this Control.
+     * @param criticality true if this Control is critical, false otherwise. 
+     */
+    public OpaqueControlImpl( String oid, boolean criticality )
+    {
+        super( oid, criticality);
+    }
+
+
+}

Modified: directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/PagedResultsImpl.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/PagedResultsImpl.java?rev=1066753&r1=1066752&r2=1066753&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/PagedResultsImpl.java
(original)
+++ directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/PagedResultsImpl.java
Thu Feb  3 08:24:51 2011
@@ -57,7 +57,7 @@ import java.util.Arrays;
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class PagedResultsImpl extends BasicControl implements PagedResults
+public class PagedResultsImpl extends AbstractControl implements PagedResults
 {
 
     /** The number of entries to return, or returned */

Modified: directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/PersistentSearchImpl.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/PersistentSearchImpl.java?rev=1066753&r1=1066752&r2=1066753&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/PersistentSearchImpl.java
(original)
+++ directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/PersistentSearchImpl.java
Thu Feb  3 08:24:51 2011
@@ -27,7 +27,7 @@ package org.apache.directory.shared.ldap
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class PersistentSearchImpl extends BasicControl implements PersistentSearch
+public class PersistentSearchImpl extends AbstractControl implements PersistentSearch
 {
 
     /**

Modified: directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/SubentriesImpl.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/SubentriesImpl.java?rev=1066753&r1=1066752&r2=1066753&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/SubentriesImpl.java
(original)
+++ directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/SubentriesImpl.java
Thu Feb  3 08:24:51 2011
@@ -23,11 +23,38 @@ package org.apache.directory.shared.ldap
 
 
 /**
- * A simple Subentries Control implementation.
+ * A simple Subentries Control implementation. This control is described in 
+ * RFC 3672 :
+ *    The subentries control MAY be sent with a searchRequest to control
+ *    the visibility of entries and subentries which are within scope.
+ *    Non-visible entries or subentries are not returned in response to the
+ *    request.
+ * 
+ *    The subentries control is an LDAP Control whose controlType is
+ *    1.3.6.1.4.1.4203.1.10.1, criticality is TRUE or FALSE (hence absent),
+ *    and controlValue contains a BER-encoded BOOLEAN indicating
+ *    visibility.  A controlValue containing the value TRUE indicates that
+ *    subentries are visible and normal entries are not.  A controlValue
+ *    containing the value FALSE indicates that normal entries are visible
+ *    and subentries are not.
+ * 
+ *    Note that TRUE visibility has the three octet encoding { 01 01 FF }
+ *    and FALSE visibility has the three octet encoding { 01 01 00 }.
+ * 
+ *    The controlValue SHALL NOT be absent.
+ * 
+ *    In absence of this control, subentries are not visible to singleLevel
+ *    and wholeSubtree scope Search requests but are visible to baseObject
+ *    scope Search requests.
+ * 
+ *    There is no corresponding response control.
+ * 
+ *    This control is not appropriate for non-Search operations.
+ * 
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class SubentriesImpl extends BasicControl implements Subentries
+public class SubentriesImpl extends AbstractControl implements Subentries
 {
     private boolean visibility = false;
 
@@ -41,12 +68,18 @@ public class SubentriesImpl extends Basi
     }
 
 
+    /**
+     * returns Tells if the Subentry values are visible or not
+     */
     public boolean isVisible()
     {
         return visibility;
     }
 
 
+    /**
+     * @param visibility Set the visibility flag
+     */
     public void setVisibility( boolean visibility )
     {
         this.visibility = visibility;

Modified: directory/shared/branches/m1/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestPerfTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestPerfTest.java?rev=1066753&r1=1066752&r2=1066753&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestPerfTest.java
(original)
+++ directory/shared/branches/m1/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestPerfTest.java
Thu Feb  3 08:24:51 2011
@@ -41,7 +41,8 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.message.BindRequest;
 import org.apache.directory.shared.ldap.model.message.BindRequestImpl;
 import org.apache.directory.shared.ldap.model.message.Control;
-import org.apache.directory.shared.ldap.model.message.controls.BasicControl;
+import org.apache.directory.shared.ldap.model.message.controls.AbstractControl;
+import org.apache.directory.shared.ldap.model.message.controls.OpaqueControlImpl;
 import org.apache.directory.shared.ldap.model.name.Dn;
 import org.apache.directory.shared.util.Strings;
 import org.junit.Ignore;
@@ -188,7 +189,7 @@ public class BindRequestPerfTest
             bindRequest.setSimple( true );
             bindRequest.setName( name );
             bindRequest.setCredentials( Strings.getBytesUtf8("password") );
-            Control control = new BasicControl( "2.16.840.1.113730.3.4.2" );
+            Control control = new OpaqueControlImpl( "2.16.840.1.113730.3.4.2" );
 
             bindRequest.addControl( control );
 



Mime
View raw message