directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Javier Alcazar (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DIRSERVER-1701) ApacheDS doesn't return all the attributes when invoking DirContext.getAttributes(Name, null)
Date Fri, 16 Mar 2012 11:17:39 GMT

    [ https://issues.apache.org/jira/browse/DIRSERVER-1701?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13231069#comment-13231069
] 

Javier Alcazar commented on DIRSERVER-1701:
-------------------------------------------


Thanks for the quick response!
And thanks for enlightening me.
=)

I haven't read "The attributes returned do not include operational attributes" under the section
"Operational Attributes" in http://docs.oracle.com/javase/6/docs/api/javax/naming/directory/DirContext.html
My mistake.


However ApacheDS 2.0.0-M3 migth not be behaving as it should.

Section "4.5.1.8.  SearchRequest.attributes" of  "Lightweight Directory Access Protocol (LDAP):
The Protocol" in http://www.ietf.org/rfc/rfc4511.txt states:
.....
 2. A list containing "*" (with zero or more attribute
         descriptions) requests the return of all user attributes in
         addition to other listed (operational) attributes.

So, if my understanding is correct, specifying "*"  should return operational attributes too,
but 
ApacheDS 2.0.0-M3 only returns user attributes.
Is this correct?

ctx.getAttributes(distinguishedName, attrIds)

attrIds=new String[]{"*"}
{postalcode=postalCode: Group Name, l=l: testgroup@test.com, ou=ou: 3809, description=description:
Description goes here, objectclass=objectClass: organizationalUnit, top}

attrIds=new String[]{"*","+"}
{ou=ou: 3809, l=l: testgroup@test.com, entryuuid=entryUUID: [B@933bcb, entrycsn=entryCSN:
20120315164829.327000Z#000000#000#000000, objectclass=objectClass: organizationalUnit, top,
modifytimestamp=modifyTimestamp: 20120315104630Z, modifiersname=modifiersName: 0.9.2342.19200300.100.1.1=admin,2.5.4.11=system,
postalcode=postalCode: Group Name, createtimestamp=createTimestamp: 20120315074829Z, creatorsname=creatorsName:
0.9.2342.19200300.100.1.1=admin,2.5.4.11=system, description=description: Description goes
here}


                
> ApacheDS doesn't return all the attributes when invoking  DirContext.getAttributes(Name,
null)
> ----------------------------------------------------------------------------------------------
>
>                 Key: DIRSERVER-1701
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1701
>             Project: Directory ApacheDS
>          Issue Type: Bug
>         Environment: (javier@lenovo trunk)$ /opt/jdk1.6.0_25/bin/java -version
> java version "1.6.0_25"
> Java(TM) SE Runtime Environment (build 1.6.0_25-b06)
> Java HotSpot(TM) Server VM (build 20.0-b11, mixed mode)
> (javier@lenovo trunk)$ cat /etc/issue
> Ubuntu 11.10 \n \l
> ApacheDS 2.0.0-M3
>            Reporter: Javier Alcazar
>
> ApacheDS doesn't return all the attributes when invoking javax.naming.directory.DirContext.getAttributes(Name,
null)
> Running some unit tests as described here: http://directory.apache.org/apacheds/1.5/42-using-apacheds-for-unit-tests.html
> Using a ldif file.
> When the following code is esecuted:
>  ...
>   env.put("java.naming.ldap.attributes.binary",
>       ATTR_OBJECTSID +' '+ ATTR_OBJECTGUID+ ' '+"entryUUID");
>   ctx = javax.naming.ldap.InitialLdapContext(env,null);
> .....
>  attrIds = null;
>  attrs = ctx.getAttributes(distinguishedName, attrIds);
> attrs doesn't contain ALL the attributes as specified by the JavaDoc 
> attrIds - the identifiers of the attributes to retrieve. null indicates that all attributes
should be retrieved;
> http://docs.oracle.com/javase/6/docs/api/javax/naming/directory/DirContext.html#getAttributes(javax.naming.Name,
java.lang.String[])
> Using the same code against other directory servers returns all the attributes.
> -----------
> Returned:
> dn: ou=3809,ou=system
> objectclass: organizationalUnit
> objectclass: top 
> ou: 3809
> description: Description goes here
> l: testgroup@test.com
> postalcode: Group Name
> Expected:
> dn: ou=3809,ou=system
> objectclass: organizationalUnit
> objectclass: top 
> ou: 3809
> description: Description goes here
> l: testgroup@test.com
> postalcode: Group Name
> createTimestamp: 20120316074659Z
> creatorsName: 0.9.2342.19200300.100.1.1=admin,2.5.4.11=system
> entryCSN: 20120316074659.800000Z#000000#000#000000
> entryParentId: 1
> entryUUID:: ZjBkNDQ5NjUtMDMxMy00YWI2LTg5YzMtYzY0NDQ5N2YwOWVh
> -------
> Log:
> 6:49:38 [DEBUG] registries.DefaultSchemaObjectRegistry - Found ATTRIBUTE_TYPE ( 2.16.840.1.113730.3.1.34
>  NAME 'ref'
>  DESC namedref: subordinate referral URL
>  EQUALITY caseExactMatch
>  SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
>  USAGE distributedOperation
>  )
>  with oid: ref (DefaultSchemaObjectRegistry.java:181)
> 16:49:38 [DEBUG] handlers.SearchHandler - Sending ou=3809,ou=system (SearchHandler.java:401)
> 16:49:38 [DEBUG] filterchain.IoFilterEvent - Event MESSAGE_RECEIVED has been fired for
session 3 (IoFilterEvent.java:118)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message