2012/5/30 <[email protected]>: > Hello, > i'm tying to achieve synchronization based on modification time of records in > MySQL > database and OpenLDAP directory. I have field in MySQL and attribute in LDAP > which contains > modification time. These field/attribute are automagically updated by > database (ON UPDATE > statement) and LDAP (modifyTimestamp). I would like LSC to make decision "to > synchronize or not > to synchronize" by comparing these fields BUT not to change them. > Rules can be described like that: > .___________________________________. > |source |destination|rule | > +-----------------+-----------+-----+ > |uid | id | = | > |mail | email | = | > |sn | lastname | = | > |objectClass | - | - | > |modifyTimestamp | - | - | > \-----------------+-----------+-----/ > > I only consider situation where only update operation can occur (no adding > and deleting, yet). > I would like these rules to apply only when modifyTimestamp of source is > grater then in destination. > A purpose of this is ability to run two way synchronization, for example > first LDAP to MySQL and then > MySQL to LDAP. > > I wrote a config file (full text in attachment). > A condition to compare entries goes like this: > > <conditions> > <create>false</create> > <update> > <![CDATA[ > srcBean.getDatasetFirstValueById('modifyTimestamp') > > Math.round(new Date( > > dstBean.getDatasetFirstValueById('modifyTimestamp').substring(0,4), // year > > dstBean.getDatasetFirstValueById('modifyTimestamp').substring(4,6), // month > > dstBean.getDatasetFirstValueById('modifyTimestamp').substring(6,8), // day > > dstBean.getDatasetFirstValueById('modifyTimestamp').substring(8,10), // hour > > dstBean.getDatasetFirstValueById('modifyTimestamp').substring(10,12), // > minute > > dstBean.getDatasetFirstValueById('modifyTimestamp').substring(12,14) // > secound > ).getTime()/1000) // dirty and ugly convertion of LDAP time > format to unixtimestamp > ]]> > </update> > <delete>false</delete> > <changeId>false</changeId> > </conditions> > > Then I have objectClass attribute which is required by LDAP, but does not > occurs in database: > > <dataset> > <name>objectClass</name> > <policy>FORCE</policy> > <forceValues><string>"inetOrgPerson"</string></forceValues> > </dataset> > > and here I have my problem. How to define dataset of modifyTimestamp to > prevent LSC from modifying this > attribute? > > <dataset> > <name>modifyTimestamp</name> > <policy>FORCE</policy> > <!-- magic to prevent LSC from touching modifyTimestamp --> > </dataset> > > Well - It's also possible that i completely misunderstood configuration and > doing everything wrong. :D > I will be very grateful if someone show me a right direction.
Hello, your configuration seems OK. You set an update condition that will update dst entry if the timestamp is higher in source thant in destination. Use a KEEP policy in the modifyTimeStamp to prevent LSC from writing the attribute. Clément. > -- > Regards > ______________________ > Jakub Skory > > System Operator > kuba(at)ukw(dot)edu(dot)pl > > IT Center: > __________________________________________________ > tel: +48 52 3257 649, +48 52 3257 647 > fax: +48 52 3257 646, +48 52 3257 647 > > working hours: 08a.m. - 04p.m. > > mail: di(at)ukw(dot)edu(dot)pl > web: www(dot)ukw(dot)edu(dot)pl > postal address: M. Kopernika 1 (room 8/9), > 85-074, Bydgoszcz. > __________________________________________________ > > Kazimierz Wielki University, > J. K. Chodkiewicza 30, > 85-064, Bydgoszcz, Poland. > __________________________________________________ > > www(dot)ukw(dot)edu(dot)pl > > MID: 339813 > 11:14:14 05/30/12 > > _______________________________________________________________ > Ldap Synchronization Connector (LSC) - http://lsc-project.org > > lsc-users mailing list > [email protected] > http://lists.lsc-project.org/listinfo/lsc-users > _______________________________________________________________ Ldap Synchronization Connector (LSC) - http://lsc-project.org lsc-users mailing list [email protected] http://lists.lsc-project.org/listinfo/lsc-users

