Hi Clement,
Hi All,
What I need to do to be reflect the following change:
If I delete some user in open ldap, then delete the same user in mysql
?
Thanks !
Regards
Yolanda
On 2017-09-14 12:29, [email protected] wrote:
> Hi Clement
> Thanks for your quick answer
>
> AS I told you before, I was using the same example for this post:
> I have the same issue that is explained here:
> https://www.mail-archive.com/[email protected]/msg01998.html
> I have been using those sames files as template, with the lsc.xml with
> the same tasks insert and update.
>
> Insert is working as expected.
>
> If I changed some value of the Attributes in OpenLDAP, and run the
> synchronization process as update , I can not see the changes.
>
> LSC do not seem to detect modifications between LDAP and the mysql
> database (see "to modify entries: 0")
>
> My pivoteAttributte is mail
> Is I add a new user in LDAP, then I get that LDAP user inserted in
> mysql database.
>
> Or if I chage the pivoteAttributte in a LDAP user , I get that user
> inserted as a new record in mysql database.
>
> But if I modify any other attribute beside the pivoteAttributte in a
> LDAP user, I have not updated that atribute in that record in mysql
> database.
>
> Please let me know if you need something else:
> Thanks! and Regards
> Yolanda
>
> I have attached all configuration files lsc.xml InetOrgPerson.xml,
> logback.xml and sql-map-config.xml
>
> I have the following table.
>
> create table users (
>
> uid varchar(50) null,
>
> cn varchar(50) null,
>
> sn varchar(50) null,
>
> mail varchar(50) null,
>
> mobile varchar(50) null
>
> );
>
> lsc.xml
>
> <lsc xmlns="http://lsc-project.org/XSD/lsc-core-2.1.xsd" revision="0">
> <connections>
> <ldapConnection>
> <name>ldap-conn</name>
> <url>ldap://107.108.219.17:10389/dc=samsung,dc=com</url>
> <username>uid=admin,ou=system</username>
> <password>secret</password>
> <authentication>SIMPLE</authentication>
> <referral>IGNORE</referral>
> <derefAliases>NEVER</derefAliases>
> <version>VERSION_3</version>
> <pageSize>-1</pageSize>
> <factory>com.sun.jndi.ldap.LdapCtxFactory</factory>
> <tlsActivated>false</tlsActivated>
> </ldapConnection>
> <databaseConnection>
> <name>mysql-conn</name>
> <url>jdbc:mysql://localhost:3306/users</url>
> <username>root</username>
> <password>root</password>
> <driver>com.mysql.jdbc.Driver</driver>
> </databaseConnection>
> </connections>
> <tasks>
> <task>
> <name>insert</name>
> <bean>org.lsc.beans.SimpleBean</bean>
> <ldapSourceService>
> <name>ldap-insert-service</name>
> <connection reference="ldap-conn"/>
> <baseDn>ou=ES,ou=people,dc=samsung,dc=com</baseDn>
> <pivotAttributes>
> <string>mail</string>
> </pivotAttributes>
> <fetchedAttributes>
> <string>cn</string>
> <string>sn</string>
> <string>mobile</string>
> <string>uid</string>
> <string>mail</string>
> </fetchedAttributes>
> <getAllFilter>(objectClass=inetOrgPerson)</getAllFilter>
> <getOneFilter>(&(objectClass=inetOrgPerson)(mail={mail}))</getOneFilter>
> <cleanFilter>(&(objectClass=inetOrgPerson)(mail={mail}))</cleanFilter>
> </ldapSourceService>
> <databaseDestinationService>
> <name>mysql-insert-service</name>
> <connection reference="mysql-conn"/>
> <requestNameForList>getPersonList</requestNameForList>
> <requestNameForObject>getPerson</requestNameForObject>
> <requestsNameForInsert>
> <string>insertPerson</string>
> </requestsNameForInsert>
> <requestsNameForUpdate>
> <string>updatePerson</string>
> </requestsNameForUpdate>
> <requestsNameForDelete>
> <string>deletePerson</string>
> </requestsNameForDelete>
> </databaseDestinationService>
>
> <propertiesBasedSyncOptions>
> <mainIdentifier>
> "mail="+srcBean.getDatasetFirstValueById("mail") +
> ",ou=ES,ou=people,dc=samsung,dc=com"
> </mainIdentifier>
> <defaultDelimiter>;</defaultDelimiter>
> <defaultPolicy>FORCE</defaultPolicy>
> <conditions>
> <create>true</create>
> <update>false</update>
> <delete>false</delete>
> <changeId>false</changeId>
> </conditions>
> </propertiesBasedSyncOptions>
> </task>
> <task>
> <name>update</name>
> <bean>org.lsc.beans.SimpleBean</bean>
> <ldapSourceService>
> <name>ldap-update-service</name>
> <connection reference="ldap-conn"/>
> <baseDn>ou=ES,ou=people,dc=samsung,dc=com</baseDn>
> <pivotAttributes>
> <string>mail</string>
> </pivotAttributes>
> <fetchedAttributes>
> <string>cn</string>
> <string>sn</string>
> <string>mobile</string>
> <string>uid</string>
> <string>mail</string>
> </fetchedAttributes>
> <getAllFilter>(objectClass=inetOrgPerson)</getAllFilter>
> <getOneFilter>(&(objectClass=inetOrgPerson)(mail={mail}))</getOneFilter>
> <cleanFilter>(&(objectClass=inetOrgPerson)(mail={mail}))</cleanFilter>
> </ldapSourceService>
> <databaseDestinationService>
> <name>mysql-update-service</name>
> <connection reference="mysql-conn"/>
> <requestNameForList>getPersonList</requestNameForList>
> <requestNameForObject>getPerson</requestNameForObject>
> <requestsNameForInsert>
> <string/>
> </requestsNameForInsert>
> <requestsNameForUpdate>
> <string>updatePerson</string>
> </requestsNameForUpdate>
> <requestsNameForDelete>
> <string/>
> </requestsNameForDelete>
> </databaseDestinationService>
> <propertiesBasedSyncOptions>
> <mainIdentifier>"mail="+srcBean.getDatasetFirstValueById("mail")</mainIdentifier>
> <defaultDelimiter>;</defaultDelimiter>
> <defaultPolicy>FORCE</defaultPolicy>
> <conditions>
> <update>true</update>
> <changeId>false</changeId>
> </conditions>
> <dataset>
> <name>objectClass</name>
> <policy>KEEP</policy>
> <createValues>
> <string>"inetOrgPerson"</string>
> <string>"organizationalPerson"</string>
> <string>"person"</string>
> <string>"top"</string>
> </createValues>
> </dataset>
> <dataset>
> <name>mobile</name>
> <policy>FORCE</policy>
> <forceValues>
> <string>
> "mobile="+srcBean.getDatasetFirstValueById("mobile")
> </string>
> </forceValues>
> </dataset>
> </propertiesBasedSyncOptions>
> </task>
> </tasks>
> </lsc>
>
> logback.xml
> <configuration>
> <!-- Standard output to console -->
> <appender name="CONSOLE"class="ch.qos.logback.core.ConsoleAppender">
> <layout class="org.lsc.utils.output.LdifLayout">
> <Pattern>%date{MMM dd HH:mm:ss} - %-5level - %message%n</Pattern>
> </layout>
> </appender>
> <root level="INFO">
> <appender-ref ref="CONSOLE"/>
> </root>
> </configuration>
>
> sql-map-config.xml
> <!--
> LDAP Synchronization Connector (LSC) - http://lsc-project.org
> This file configure iBatis to read sqlMap files.
> Settings should be generated here automatically.
> The only section you need to check is the sqlMap entries at the bottom.
> -->
> <sqlMapConfig>
> <!--
> The settings element has a number of configuration switches and properties
> that configure the SQL Maps engine. Most are performance tweaks or resource
> management. They are pretty self explanatory. The defaults are shown here.
> There can be only one settins element.
> -->
> <settings lazyLoadingEnabled="true" cacheModelsEnabled="true"
> enhancementEnabled="true"
> maxRequests="512" maxSessions="128" maxTransactions="32"/>
> <transactionManager type="JDBC">
> <dataSource type="SIMPLE">
> <property value="com.mysql.jdbc.Driver" name="JDBC.Driver"/>
> <property value="jdbc:mysql://localhost:3306/users"
> name="JDBC.ConnectionURL"/>
> <property value="root" name="JDBC.Username"/>
> <property value="root" name="JDBC.Password"/>
> <property value="15" name="Pool.MaximumActiveConnections"/>
> <property value="15" name="Pool.MaximumIdleConnections"/>
> <property value="1000" name="Pool.MaximumWait"/>
> </dataSource>
> </transactionManager>
> <!--
> Finally, the SQL Maps themselves must be registred with the configuration
> file.
> Below are some examples of some SQL Map reference elements. Notice that an
> SQL Map can be located in the classpath (resource) or at a URL (e.g. file://
> or http://). There can be any number of sqlMap elements.
> -->
> <sqlMap url="file://${lsc.config}/sql-map-config.d/InetOrgPerson.xml"/>
> </sqlMapConfig>
>
> InetOrgPerson.xml
> <sqlMap namespace="Person">
> <select id="getPerson" resultClass="java.util.HashMap"
> parameterClass="java.util.Map">
> select trim(person.uid) as uid, trim(person.cn) as cn, trim(person.sn) as sn,
> trim(person.mail) as mail, trim(person.mobile) as mobile from Person
> person where
> person.mail = #mail#
> </select>
> <insert id="insertPerson" parameterClass="java.util.Map">
> insert into person ( uid, cn, sn, mail, mobile) values ( #uid#, #cn#,
> #sn#, #mail#,
> #mobile# )
> </insert>
> <update id="updatePerson" parameterClass="java.util.Map">
> update person set uid = #uid#, cn = #cn#, sn = #sn#, mobile = #mobile#
> where mail =
> #mail#
> </update>
> <delete id="deletePerson" parameterClass="java.util.Map">delete from
> person where mail =
> #mail#</delete>
> <select id="getPersonList" resultClass="java.util.HashMap">select
> p."mail" AS mail from
> person p</select>
> </sqlMap>
>
> On 2017-09-14 01:00, Clément OUDOT wrote: Le 14/09/2017 à 00:52,
> [email protected] a écrit : Hi All
>
> Nice to meet you,is my first time in this list.
> Hello and welcome,
>
> I found and installed the LSC few days ago and is working now.
> I am making a synchronization from OpenLDAP to mysql.
> Its working fine.
>
> I have the same issue that is explained here:
> https://www.mail-archive.com/[email protected]/msg01998.html I
> have been using those sames files as template, with the lsc.xml with the same
> tasks insert and update.
>
> Insert is working as expected.
>
> If I changed some value of the Attributes in OpenLDAP, and run the
> synchronization process as update , I can not see the changes.
>
> LSC do not seem to detect modifications between LDAP and the mysql
> database (see "to modify entries: 0")
>
> What I am missing?
>
> I was following that thread in the list , but i didn't see the solution for
> that.
>
> Could you please guide me and advise through this issue?
>
> You need to provide some logs (set DEBUG in logback.xml) and your
> configuration so we can help you._______________________________________________________________
Ldap Synchronization Connector (LSC) - http://lsc-project.org
lsc-users mailing list
[email protected]
https://lists.lsc-project.org/cgi-bin/mailman/listinfo/lsc-users