directory-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jörg Schaible <joerg.schai...@gmx.de>
Subject Accessing schema data
Date Thu, 25 Mar 2010 18:59:52 GMT
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


Mime
View raw message