directory-api mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lecharny <elecha...@gmail.com>
Subject About the Control interface
Date Mon, 25 Jan 2010 00:30:00 GMT
Hi guys,

as I'm working on the messages, I have looked at the Control Interface. 
Here is the way it's used in all the different APIs :

ADS :
we used the JNDI interface, and we will change to switch to a LDAP API 
Control

jLdap/LDAPSdk
=============
class :
  LDAPControl

constructors :
  LDAPControl()
  LDAPControl(String, boolean byte[]))

methods :
  getID()
  getValue()
  isCritical()
  newInstance(byte[])
  clone()


JNDI
====
interface :
  Control

methods :
  getEncodedValue()
  getID()
  isCritical()


ODS
===
abstract class :
  Control

constructors :
  Control( String, boolean)

methods :
  getOID()
  getValue()
  hasValue()
  isCritical()


UID
===
class :
 Control

constructors :
  Control(String)
  Control(String, boolean)
  Control(String, boolean, ASN1OctetString)

methods :
  encode()
  equals( Object )
  getControlName()
  getOID()
  getValue()
  hasValue()
  isCritical()


Checking all those implementations, I would suggest that we stick with 
something like :

interface Control

<discussion>
Not sure we need a class, when most of the controls will be named, like 
VLVControl, PageSearchControl, ...
ODS define an abstract class, which means nobody can create an instance 
of it. At this point, I think it's probably better to go for an 
interface, hidding the asbtract class to the client.
</discussion>

constructors :
<discussion>
No need of them, if it's an interface. From the server POV, this will be 
an issue, as we must be able to create Controls while decoding them and 
we don't necessarily know if the control will be supported or not. We 
will probably need an intermediate ControlImpl and an AbstractControl 
class in order to deal with this, but from the Client POV, this is nt 
relevant
</discussion>

methods :
  getOid() or getOID().
  getValue()
  isCritical()

<discussion>
Those three methoda re the bare minimum we need from the client side. 
I'm not sure that the hasValue() method is necessary, when the 
getValue() returning a null value will provide the same result.
</discussion>

Thoughts ?


-- 
Regards,
Cordialement,
Emmanuel L├ęcharny
www.nextury.com



Mime
View raw message