Subject: Java LDAP API - LDAPControl class

From: "Steve Sonntag" <[email-masked]>
Date: Wed, 18 Oct 2000 14:35:55 -0600

The LDAPControl class needs a setValue method.

I realize that the value can be set on the constructor, but take
the following example.

Suppose I want to build a class in my application that extends
control to build my control, for example, server side sort.  

public class LDAPSortControl extends LDAPControl
{
  static String oid="1.2.840.113556.1.4.473";
  public  LDAPSortControl( boolean critical, LDAPSortKey key)
  {
     super( oid, critical, (byte[])null);  // This line must be first in the constructor
        // oops, we haven't built the control value yet - how do we pass it in to 
        // the LDAPControl object????
        // need a setValue method to get the job done.
  }

Suggested prototype -

public setValue( byte[] value);

-Steve

------------------------
Steve Sonntag
Novell, Inc., the leading provider of Net services software

---

From: Rob Weltman <[email-masked]>
Date: Wed, 18 Oct 2000 14:02:09 -0700

Does it need to be public? If it's only for use by extensions (and I
think that is the case), the method can be protected instead.

Rob

Steve Sonntag wrote:

>  The LDAPControl class needs a setValue method. I realize that the
> value can be set on the constructor, but takethe following
> example. Suppose I want to build a class in my application that
> extendscontrol to build my control, for example, server side
> sort. public class LDAPSortControl extends LDAPControl{  static String
> oid="1.2.840.113556.1.4.473";  public  LDAPSortControl( boolean
> critical, LDAPSortKey key)  {     super( oid, critical,
> (byte[])null);  // This line must be first in the constructor
> // oops, we haven't built the control value yet - how do we pass it in
> to        // the LDAPControl object????        // need a setValue
> method to get the job done.  } Suggested prototype - public setValue(
> byte[] value); -Steve ------------------------
> Steve Sonntag

---

From: "Steve Sonntag" <[email-masked]>
Date: Wed, 18 Oct 2000 16:56:18 -0600

I agree, but you still need a way to populate the
date into the LDAPControl class, i.e. still need
the method in LDAPControl.

-Steve

>>> Bruce Greenblatt <[email-masked]> 18-Oct-00 4:31:45 PM >>>
I would expect that when the LDAPControl is subclassed for a specific control that a better SetValue() method would be provided in the subclass.  For example, if the value of the control is essentially a string, I would hope to see the subclass define a SetValue() method such as:

public setValue(String value);

So, in the description of the SetValue() method, I would like to see language that indicates that implementors of subclasses of "control specific" LDAPControls SHOULD provide a setValue() method that is specific to the value of the control being implemented...

Bruce

At 03:21 PM 10/18/2000, Steve Sonntag wrote:

I agree protected is adequate
 
-Steve

>>> Rob Weltman <[email-masked]> 18-Oct-00 3:02:09 PM >>>

Rob

> Novell, Inc., the leading provider of Net services software

==============================================
Bruce Greenblatt, Ph. D.
Directory Tools and Application Services, Inc.
http://www.directory-applications.com
See my new Book on Internet Directories: http://www.phptr.com/ptrbooks/ptr_0139744525.html

---

From: Bruce Greenblatt <[email-masked]>
Date: Mon, 23 Oct 2000 11:24:12 -0700

>the method in LDAPControl.

That isn't exactly true.  You do not need to have a setValue() method in 
the LDAPControl class for it to be in the LDAPSortControl class (or any 
other subclass).  But that's just a nitpicky statement about Java.  I would 
suggest that the setValue() method is a protected method of the LDAPControl 
class.  It is not much value to the application developer since the actual 
value is generally some ASN.1 encoded structure.  It would be better to 
have the setValue() method only callable in the subclass, when it creates a 
more appropriate interface for application developers.

>I would expect that when the LDAPControl is subclassed for a specific 
>control that a better SetValue() method would be provided in the 
>subclass.  For example, if the value of the control is essentially a 
>string, I would hope to see the subclass define a SetValue() method such as:
>
>So, in the description of the SetValue() method, I would like to see 
>language that indicates that implementors of subclasses of "control 
>specific" LDAPControls SHOULD provide a setValue() method that is specific 
>to the value of the control being implemented...
>
>Bruce
>
>See my new Book on Internet Directories: 
>http://www.phptr.com/ptrbooks/ptr_0139744525.html

==============================================
Bruce Greenblatt, Ph. D.
Directory Tools and Application Services, Inc.
http://www.directory-applications.com
See my new Book on Internet Directories: 
http://www.phptr.com/ptrbooks/ptr_0139744525.html

---

From: "Steve Sonntag" <[email-masked]>
Date: Mon, 23 Oct 2000 13:13:08 -0600

Rob's comments to my initial statement suggests that it be a protected method,
and I concur.

Steve

------------------------
Steve Sonntag

>>> Bruce Greenblatt <[email-masked]> 23-Oct-00 12:24:12 PM >>>

That isn't exactly true.  You do not need to have a setValue() method in the LDAPControl class for it to be in the LDAPSortControl class (or any other subclass).  But that's just a nitpicky statement about Java.  I would suggest that the setValue() method is a protected method of the LDAPControl class.  It is not much value to the application developer since the actual value is generally some ASN.1 encoded structure.  It would be better to have the setValue() method only callable in the subclass, when it creates a more appropriate interface for application developers.

-Steve

Bruce

 
-Steve

Rob