You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ak...@apache.org on 2011/01/31 16:37:17 UTC
svn commit: r1065653 - in
/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap:
codec/BasicControlDecorator.java model/message/controls/BasicControl.java
Author: akarasulu
Date: Mon Jan 31 15:37:17 2011
New Revision: 1065653
URL: http://svn.apache.org/viewvc?rev=1065653&view=rev
Log:
cleaning up and documenting BasicControl and its IDecorator
Modified:
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/BasicControlDecorator.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/BasicControl.java
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/BasicControlDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/BasicControlDecorator.java?rev=1065653&r1=1065652&r2=1065653&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/BasicControlDecorator.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/BasicControlDecorator.java Mon Jan 31 15:37:17 2011
@@ -32,15 +32,23 @@ import org.apache.directory.shared.ldap.
/**
- * A decorator for an opaque control where we know nothing about encoded values.
+ * A decorator for handling opaque Control objects where we know nothing about
+ * their encoded value. These Controls are generated by default when an
+ * {@link IControlFactory} for them has not been registered with the
+ * {@link ILdapCodecService}.
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
* @version $Rev$, $Date$
*/
public class BasicControlDecorator extends ControlDecorator<BasicControl>
{
- private ILdapCodecService codec;
-
+ /**
+ * Creates a new instance of BasicControlDecorator, decorating a
+ * {@link BasicControl}.
+ *
+ * @param codec The LDAP codec service.
+ * @param control The {@link BasicControl} to decorate.
+ */
public BasicControlDecorator( ILdapCodecService codec, BasicControl control )
{
super( codec, control );
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/BasicControl.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/BasicControl.java?rev=1065653&r1=1065652&r2=1065653&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/BasicControl.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/BasicControl.java Mon Jan 31 15:37:17 2011
@@ -20,11 +20,15 @@
package org.apache.directory.shared.ldap.model.message.controls;
+import org.apache.directory.shared.ldap.codec.ILdapCodecService;
import org.apache.directory.shared.ldap.model.message.Control;
/**
- * A Control base class.
+ * A simple implementation of the {@link Control} interface with storage for
+ * the OID and the criticality properties. When a {@link ILdapCodecService}
+ * implementation 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>
*/
@@ -49,6 +53,19 @@ public class BasicControl implements Con
/**
+ * 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 BasicControl( String oid, boolean criticality )
+ {
+ this.oid = oid;
+ this.criticality = criticality;
+ }
+
+
+ /**
* Get the OID
*
* @return A string which represent the control oid