directory-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Seelmann <seelm...@apache.org>
Subject Re: How to retrieve/display ModifyTimestamp attribute with embedded server in code?
Date Thu, 15 Sep 2011 20:29:46 GMT
On Thu, Sep 15, 2011 at 9:57 PM, david jones <jonesda24@gmail.com> wrote:
> Using ApacheDS 1.5 as an embedded server.
> I Added a new user:
> context.createSubcontext(userName, attributes);
>
> and then retrieve it:
> Attributes attrs = context.getAttributes(userName);
>
> When looping through attrs i get all the expected info (ObjectClass, sn, cn,
> uid, etc),
> but i don't see several attributes that DS is adding under the covers (ex.
> AccessControlSubentries, modifyTimestamp, entryUUID, etc.)

You must explicitely request those "operational" attributes:
    Attributes attrs = context.getAttributes(userName, new
String[]{"modifyTimestamp", "entryUUID"});

Or use the following shortcut to get all user and operational attributes:
    Attributes attrs = context.getAttributes(userName, new String[]{"*", "+"});


> I do see the additional attributes when looking at the entry with Apache
> Directory Studio.
> How can I get to them with java code?
>
> Thanks,
> David
>

Mime
View raw message