You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@directory.apache.org by Hajo Kliemeck <kl...@kybeidos.de> on 2011/05/31 23:52:23 UTC

unable to set createTimestamp and modifyTimestamp

Hi guys,

currently i'm building a LDAP facade (embedded LDAP server) for an
legacy application. I noticed the operational attributes that are
included in the LDAP RFC. I want to modify them to show up the
attributes to a LDAP visitor. I tried something like:

entry.put(SchemaConstants.CREATE_TIMESTAMP_AT,
DateUtils.getGeneralizedTime());

but the LDAP server will not show up the attribute.

Any Ideas?

greets
Hajo

-- 
------------------------------------------------------------------------
Email:   klk@kybeidos.de
Telefon: +49 (0) 6221 - 616050
Fax:     +49 (0) 6221 - 616051
------------------------------------------------------------------------
KYBEIDOS Gesellschaft für Systeme zur Unternehmenssteuerung mbH
Moltkestraße 27
69120 Heidelberg

Handelsregister: Heidelberg HRB 5460
USt.Id-Nr.: DE182073772
Geschäftsführer: Stephan Frenzel, Dietmar Hantsch, Dr. Michael Wiedemann


Re: unable to set createTimestamp and modifyTimestamp

Posted by Emmanuel Lecharny <el...@gmail.com>.
On 6/1/11 12:55 AM, Hajo Kliemeck wrote:
> Hi Stefan,
>
> hmm, my request:
>
> hajo@apo:~$ ldapsearch -x -h localhost -p 10389 -s base -b
> "uid=albert.albern,ou=users,dc=mmw,dc=ag" "modifyTimestamp"
> # extended LDIF
> #
> # LDAPv3
> # base<uid=albert.albern,ou=users,dc=mmw,dc=ag>  with scope baseObject
> # filter: (objectclass=*)
> # requesting: modifyTimestamp
> #
>
> # albert.albern, users, mmw.ag
> dn: uid=albert.albern,ou=users,dc=mmw,dc=ag
>
> # search result
> search: 2
> result: 0 Success
>
> # numResponses: 2
> # numEntries: 1
>
> the modifyTimestamp should appear, but its not shown.. any idea?

Which server version are you using ?

The ModifyTimestamp AT should be returned.
>> Normally there is no need to set the createTimestamp and
>> modifyTimestamp manually. They are automatically set by the
>> OperationalAttributesInterceptor in the interceptor chain (I assume
>> you use the DirectoryService interface to modify your entries).
> i'm using the DirectoryService, but i want to set it manually because i
> have to set it to a timestamp i will get from a database
You can't set it. It's an operational attribute which is set by the 
server. If you want to inject a timestamp in your entry, then you'll 
have to define a special attribute for that.

>> Not sure if that's your problem, but operational attributes are not
>> returned by default. The client must request them explicitely by using
>> the attribute name or '+' to request all operational attributes.
> it is possible to show up the attributes by default?

No. You either have to list the attributes you want using their name, or 
use the special '+' symbole.


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


Re: unable to set createTimestamp and modifyTimestamp

Posted by Hajo Kliemeck <kl...@kybeidos.de>.
Hi Stefan,

hmm, my request:

hajo@apo:~$ ldapsearch -x -h localhost -p 10389 -s base -b
"uid=albert.albern,ou=users,dc=mmw,dc=ag" "modifyTimestamp"
# extended LDIF
#
# LDAPv3
# base <uid=albert.albern,ou=users,dc=mmw,dc=ag> with scope baseObject
# filter: (objectclass=*)
# requesting: modifyTimestamp
#

# albert.albern, users, mmw.ag
dn: uid=albert.albern,ou=users,dc=mmw,dc=ag

# search result
search: 2
result: 0 Success

# numResponses: 2
# numEntries: 1

the modifyTimestamp should appear, but its not shown.. any idea?


> Normally there is no need to set the createTimestamp and
> modifyTimestamp manually. They are automatically set by the
> OperationalAttributesInterceptor in the interceptor chain (I assume
> you use the DirectoryService interface to modify your entries).
i'm using the DirectoryService, but i want to set it manually because i
have to set it to a timestamp i will get from a database

> Not sure if that's your problem, but operational attributes are not
> returned by default. The client must request them explicitely by using
> the attribute name or '+' to request all operational attributes.
it is possible to show up the attributes by default?

greets
Hajo

On 01.06.2011 00:17, Stefan Seelmann wrote:
> Hi Hajo,
> 
> On Tue, May 31, 2011 at 11:52 PM, Hajo Kliemeck <kl...@kybeidos.de> wrote:
>> currently i'm building a LDAP facade (embedded LDAP server) for an
>> legacy application. I noticed the operational attributes that are
>> included in the LDAP RFC. I want to modify them to show up the
>> attributes to a LDAP visitor. I tried something like:
>>
>> entry.put(SchemaConstants.CREATE_TIMESTAMP_AT,
>> DateUtils.getGeneralizedTime());
> 
> Normally there is no need to set the createTimestamp and
> modifyTimestamp manually. They are automatically set by the
> OperationalAttributesInterceptor in the interceptor chain (I assume
> you use the DirectoryService interface to modify your entries).
> 
>> but the LDAP server will not show up the attribute.
> 
> Not sure if that's your problem, but operational attributes are not
> returned by default. The client must request them explicitely by using
> the attribute name or '+' to request all operational attributes.
> 
> Kind Regards,
> Stefan

-- 
------------------------------------------------------------------------
Email:   klk@kybeidos.de
Telefon: +49 (0) 6221 - 616050
Fax:     +49 (0) 6221 - 616051
------------------------------------------------------------------------
KYBEIDOS Gesellschaft für Systeme zur Unternehmenssteuerung mbH
Moltkestraße 27
69120 Heidelberg

Handelsregister: Heidelberg HRB 5460
USt.Id-Nr.: DE182073772
Geschäftsführer: Stephan Frenzel, Dietmar Hantsch, Dr. Michael Wiedemann


Re: unable to set createTimestamp and modifyTimestamp

Posted by Stefan Seelmann <ma...@stefan-seelmann.de>.
Hi Hajo,

On Tue, May 31, 2011 at 11:52 PM, Hajo Kliemeck <kl...@kybeidos.de> wrote:
> currently i'm building a LDAP facade (embedded LDAP server) for an
> legacy application. I noticed the operational attributes that are
> included in the LDAP RFC. I want to modify them to show up the
> attributes to a LDAP visitor. I tried something like:
>
> entry.put(SchemaConstants.CREATE_TIMESTAMP_AT,
> DateUtils.getGeneralizedTime());

Normally there is no need to set the createTimestamp and
modifyTimestamp manually. They are automatically set by the
OperationalAttributesInterceptor in the interceptor chain (I assume
you use the DirectoryService interface to modify your entries).

> but the LDAP server will not show up the attribute.

Not sure if that's your problem, but operational attributes are not
returned by default. The client must request them explicitely by using
the attribute name or '+' to request all operational attributes.

Kind Regards,
Stefan