directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lecharny <elecha...@apache.org>
Subject Re: Another LdapDN constructor will be added
Date Tue, 06 Oct 2009 09:30:29 GMT
Stefan Seelmann wrote:
> Emmanuel Lecharny schrieb:
>   
>> Hi,
>>
>> as we have added a AttributeUtils.createAttributes() method which
>> benefits from varargs, I have also added a new LdapDN constructor doing
>> the same :
>>
>> LdapDN dn = new LdapDN(
>>    "cn=varargs",
>>    "ou=" + place,
>>    baseDN );
>>
>> which is creating the "cn=varargs,ou=example,dc=com" DN, if 'place' =
>> example and 'baseDN' = 'dc=com'.
>>
>> Do you think it's usefull ?
>>
>>     
>
> Yes, very useful.
>
> Just a step further: Would it be possible to allow attribute type and
> value as separate arguments? The constructor could check if an argument
> contains an '=' in which case it would be handle the argument as the
> string representation of an RDN. If there is no '=' then the argument is
> handled as RDN attribute type and the next argument as RDN value. In the
> latter case the RDN value could also be provided unencoded so the user
> don't need to deal with RDN value encoding. For example:
>
> LdapDN dn = new LdapDN(
>    "cn=varargs", // contains an '=' -> parse as RDN
>    "ou", place,  // no '=' -> construct RDN, unencoded value
>    baseDN );
>   
Sure. But I will look for a ':' instead of a '=' ;)

The same for Attribute, I guess ?


-- 
--
cordialement, regards,
Emmanuel L├ęcharny
www.iktek.com
directory.apache.org



Mime
View raw message