You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@directory.apache.org by Jörg Schaible <jo...@gmx.de> on 2010/03/25 19:59:52 UTC

Accessing schema data

Hi folks,

porting our integration LDAP tests from ApacheDS 1.5.4 to 1.5.6 I activated 
now the code to access the LDAP schema (which is AFAICS not available since 
1.5.5). However, the data is returned in a strange way.

When I enumerate the mandatory attributes of a class I'd expected to get an 
Attribute with an enumeration for the individual attributes:

========= %< =========
Set<String> mandatory = new HashSet<String>();
Attributes attributes = schemaCtx.getAttributes("ClassDefinition/person");
Attribute attribute = attributes.get("must");
if (attribute != null) {
    NamingEnumeration<String> enumeration = 
        (NamingEnumeration<String>) attribute.getAll();
    for (NamingEnumeration<String> values = enumeration; values.hasMore();) 
{
        mandatory.add(values.next());
    }
    JndiUtils.closeLogged(enumeration, LOG);
}
========= %< =========

With SunOne the mandatory set contains the two elements "cn" and "sn". With 
ApacheDS the mandatory set contains one element with "'cn' 'sn'", which is 
kinda strange ...

- Jörg


Re: Accessing schema data

Posted by Jörg Schaible <jo...@gmx.de>.
Hi Stefan,

Stefan Seelmann wrote at Donnerstag, 25. März 2010 20:26:

> Hi Jörg,
> 
> In ApacheDS 1.5.5 the person object class description in cn=schema looks
> like this:
> ( 2.5.6.6 NAME 'person' DESC 'RFC2256: a person' SUP top STRUCTURAL MUST
> ( sn $ cn ) MAY ( userPassword $ telephoneNumber $ seeAlso $ description
> ) X-SCHEMA 'core' )
> 
> In ApacheDS 1.5.6 it looks like this:
> ( 2.5.6.6 NAME 'person' DESC 'RFC2256: a person' SUP 'top' STRUCTURAL
> MUST ( 'sn' 'cn' ) MAY ( 'userPassword' 'telephoneNumber' 'seeAlso'
> 'description' ) X-SCHEMA 'core' )
> 
> This is not correct according to RFC4512 and JNDI doesn't seem to be
> flexible enough to parse this syntax.
> 
> Could you please file a Jira? Thanks for the finding.

Done: https://issues.apache.org/jira/browse/DIRSERVER-1488

- Jörg

BTW: 1.5.6 is not yet marked in JIRA as released.



Re: Accessing schema data

Posted by Alex Karasulu <ak...@gmail.com>.
BTW is the schema rendered in the schema subentry off of cn=schema right?

On Thu, Mar 25, 2010 at 11:00 PM, Alex Karasulu <ak...@gmail.com> wrote:

> Wow this is pretty bad. Why did we not catch this with our test cases I
> wonder.  I guess we need a quick fix of this and then a release because this
> is a total show stopper.
>
> Alex
>
>
> On Thu, Mar 25, 2010 at 9:26 PM, Stefan Seelmann <se...@apache.org>wrote:
>
>> Hi Jörg,
>>
>> In ApacheDS 1.5.5 the person object class description in cn=schema looks
>> like this:
>> ( 2.5.6.6 NAME 'person' DESC 'RFC2256: a person' SUP top STRUCTURAL MUST
>> ( sn $ cn ) MAY ( userPassword $ telephoneNumber $ seeAlso $ description
>> ) X-SCHEMA 'core' )
>>
>> In ApacheDS 1.5.6 it looks like this:
>> ( 2.5.6.6 NAME 'person' DESC 'RFC2256: a person' SUP 'top' STRUCTURAL
>> MUST ( 'sn' 'cn' ) MAY ( 'userPassword' 'telephoneNumber' 'seeAlso'
>> 'description' ) X-SCHEMA 'core' )
>>
>> This is not correct according to RFC4512 and JNDI doesn't seem to be
>> flexible enough to parse this syntax.
>>
>> Could you please file a Jira? Thanks for the finding.
>>
>> Kind Regards,
>> Stefan
>>
>>
>> Jörg Schaible schrieb:
>> > Hi folks,
>> >
>> > porting our integration LDAP tests from ApacheDS 1.5.4 to 1.5.6 I
>> activated
>> > now the code to access the LDAP schema (which is AFAICS not available
>> since
>> > 1.5.5). However, the data is returned in a strange way.
>> >
>> > When I enumerate the mandatory attributes of a class I'd expected to get
>> an
>> > Attribute with an enumeration for the individual attributes:
>> >
>> > ========= %< =========
>> > Set<String> mandatory = new HashSet<String>();
>> > Attributes attributes =
>> schemaCtx.getAttributes("ClassDefinition/person");
>> > Attribute attribute = attributes.get("must");
>> > if (attribute != null) {
>> >     NamingEnumeration<String> enumeration =
>> >         (NamingEnumeration<String>) attribute.getAll();
>> >     for (NamingEnumeration<String> values = enumeration;
>> values.hasMore();)
>> > {
>> >         mandatory.add(values.next());
>> >     }
>> >     JndiUtils.closeLogged(enumeration, LOG);
>> > }
>> > ========= %< =========
>> >
>> > With SunOne the mandatory set contains the two elements "cn" and "sn".
>> With
>> > ApacheDS the mandatory set contains one element with "'cn' 'sn'", which
>> is
>> > kinda strange ...
>> >
>> > - Jörg
>> >
>>
>>
>
>
> --
> Alex Karasulu
> My Blog :: http://www.jroller.com/akarasulu/
> Apache Directory Server :: http://directory.apache.org
> Apache MINA :: http://mina.apache.org
> To set up a meeting with me: http://tungle.me/AlexKarasulu
>



-- 
Alex Karasulu
My Blog :: http://www.jroller.com/akarasulu/
Apache Directory Server :: http://directory.apache.org
Apache MINA :: http://mina.apache.org
To set up a meeting with me: http://tungle.me/AlexKarasulu

Re: Accessing schema data

Posted by Alex Karasulu <ak...@gmail.com>.
Wow this is pretty bad. Why did we not catch this with our test cases I
wonder.  I guess we need a quick fix of this and then a release because this
is a total show stopper.

Alex

On Thu, Mar 25, 2010 at 9:26 PM, Stefan Seelmann <se...@apache.org>wrote:

> Hi Jörg,
>
> In ApacheDS 1.5.5 the person object class description in cn=schema looks
> like this:
> ( 2.5.6.6 NAME 'person' DESC 'RFC2256: a person' SUP top STRUCTURAL MUST
> ( sn $ cn ) MAY ( userPassword $ telephoneNumber $ seeAlso $ description
> ) X-SCHEMA 'core' )
>
> In ApacheDS 1.5.6 it looks like this:
> ( 2.5.6.6 NAME 'person' DESC 'RFC2256: a person' SUP 'top' STRUCTURAL
> MUST ( 'sn' 'cn' ) MAY ( 'userPassword' 'telephoneNumber' 'seeAlso'
> 'description' ) X-SCHEMA 'core' )
>
> This is not correct according to RFC4512 and JNDI doesn't seem to be
> flexible enough to parse this syntax.
>
> Could you please file a Jira? Thanks for the finding.
>
> Kind Regards,
> Stefan
>
>
> Jörg Schaible schrieb:
> > Hi folks,
> >
> > porting our integration LDAP tests from ApacheDS 1.5.4 to 1.5.6 I
> activated
> > now the code to access the LDAP schema (which is AFAICS not available
> since
> > 1.5.5). However, the data is returned in a strange way.
> >
> > When I enumerate the mandatory attributes of a class I'd expected to get
> an
> > Attribute with an enumeration for the individual attributes:
> >
> > ========= %< =========
> > Set<String> mandatory = new HashSet<String>();
> > Attributes attributes =
> schemaCtx.getAttributes("ClassDefinition/person");
> > Attribute attribute = attributes.get("must");
> > if (attribute != null) {
> >     NamingEnumeration<String> enumeration =
> >         (NamingEnumeration<String>) attribute.getAll();
> >     for (NamingEnumeration<String> values = enumeration;
> values.hasMore();)
> > {
> >         mandatory.add(values.next());
> >     }
> >     JndiUtils.closeLogged(enumeration, LOG);
> > }
> > ========= %< =========
> >
> > With SunOne the mandatory set contains the two elements "cn" and "sn".
> With
> > ApacheDS the mandatory set contains one element with "'cn' 'sn'", which
> is
> > kinda strange ...
> >
> > - Jörg
> >
>
>


-- 
Alex Karasulu
My Blog :: http://www.jroller.com/akarasulu/
Apache Directory Server :: http://directory.apache.org
Apache MINA :: http://mina.apache.org
To set up a meeting with me: http://tungle.me/AlexKarasulu

Re: Accessing schema data

Posted by Emmanuel Lecharny <el...@gmail.com>.
On 3/25/10 8:26 PM, Stefan Seelmann wrote:
> Hi Jörg,
>
> In ApacheDS 1.5.5 the person object class description in cn=schema looks
> like this:
> ( 2.5.6.6 NAME 'person' DESC 'RFC2256: a person' SUP top STRUCTURAL MUST
> ( sn $ cn ) MAY ( userPassword $ telephoneNumber $ seeAlso $ description
> ) X-SCHEMA 'core' )
>
> In ApacheDS 1.5.6 it looks like this:
> ( 2.5.6.6 NAME 'person' DESC 'RFC2256: a person' SUP 'top' STRUCTURAL
> MUST ( 'sn' 'cn' ) MAY ( 'userPassword' 'telephoneNumber' 'seeAlso'
> 'description' ) X-SCHEMA 'core' )
>
> This is not correct according to RFC4512 and JNDI doesn't seem to be
> flexible enough to parse this syntax.
>    

Good catch ! The method used to pretty print the OC is probably broken.

-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.nextury.com



Re: Accessing schema data

Posted by Stefan Seelmann <se...@apache.org>.
Hi Jörg,

In ApacheDS 1.5.5 the person object class description in cn=schema looks
like this:
( 2.5.6.6 NAME 'person' DESC 'RFC2256: a person' SUP top STRUCTURAL MUST
( sn $ cn ) MAY ( userPassword $ telephoneNumber $ seeAlso $ description
) X-SCHEMA 'core' )

In ApacheDS 1.5.6 it looks like this:
( 2.5.6.6 NAME 'person' DESC 'RFC2256: a person' SUP 'top' STRUCTURAL
MUST ( 'sn' 'cn' ) MAY ( 'userPassword' 'telephoneNumber' 'seeAlso'
'description' ) X-SCHEMA 'core' )

This is not correct according to RFC4512 and JNDI doesn't seem to be
flexible enough to parse this syntax.

Could you please file a Jira? Thanks for the finding.

Kind Regards,
Stefan


Jörg Schaible schrieb:
> Hi folks,
> 
> porting our integration LDAP tests from ApacheDS 1.5.4 to 1.5.6 I activated 
> now the code to access the LDAP schema (which is AFAICS not available since 
> 1.5.5). However, the data is returned in a strange way.
> 
> When I enumerate the mandatory attributes of a class I'd expected to get an 
> Attribute with an enumeration for the individual attributes:
> 
> ========= %< =========
> Set<String> mandatory = new HashSet<String>();
> Attributes attributes = schemaCtx.getAttributes("ClassDefinition/person");
> Attribute attribute = attributes.get("must");
> if (attribute != null) {
>     NamingEnumeration<String> enumeration = 
>         (NamingEnumeration<String>) attribute.getAll();
>     for (NamingEnumeration<String> values = enumeration; values.hasMore();) 
> {
>         mandatory.add(values.next());
>     }
>     JndiUtils.closeLogged(enumeration, LOG);
> }
> ========= %< =========
> 
> With SunOne the mandatory set contains the two elements "cn" and "sn". With 
> ApacheDS the mandatory set contains one element with "'cn' 'sn'", which is 
> kinda strange ...
> 
> - Jörg
>