You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@directory.apache.org by david jones <jo...@gmail.com> on 2011/09/15 21:57:39 UTC

How to retrieve/display ModifyTimestamp attribute with embedded server in code?

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.)

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

Re: How to retrieve/display ModifyTimestamp attribute with embedded server in code?

Posted by david jones <jo...@gmail.com>.
great, thanks for both answers

On Thu, Sep 15, 2011 at 4:29 PM, Stefan Seelmann <se...@apache.org>wrote:

> On Thu, Sep 15, 2011 at 9:57 PM, david jones <jo...@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
> >
>



-- 
David Jones
jonesda24@gmail.com
c) 302-5648

Re: How to retrieve/display ModifyTimestamp attribute with embedded server in code?

Posted by Stefan Seelmann <se...@apache.org>.
On Thu, Sep 15, 2011 at 9:57 PM, david jones <jo...@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
>