the other scheduled job I need should update users from LDAP to the database
here are all bean definitions in applicationContext.xml
<!-- quartz scheduler related -->
<!-- jobs definitions -->
<!-- export to Austrian statistics -->
<bean id="export2StatisticsJob" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="targetObject"><ref bean="scheduledexportservice"/></property>
<property name="targetMethod"><value>executeScheduledExportsIfAny</value></property>
<property name="concurrent" value="false"/>
</bean>
<bean id="ldapProperties" class="at.kds.epb5.common.LdapProperties" >
<property name="providerUrl"><value>ldap://here comes ip address/</value></property>
<property name="securityAuthentication"><value>simple</value></property>
<property name="securityPrincipal"><value>here comes user</value></property>
<property name="securityCredentials"><value>here comes pwd</value></property>
<property name="root"><value>dc=oeamtc,dc=at</value></property>
<property name="filter"><value>(&(objectclass=person) (| (sAMAccountName=a*) (sAMAccountName=t*)))</value></property>
<property name="userId"><value>sAMAccountName</value></property>
<property name="userFirstName"><value>givenName</value></property>
<property name="userLastName"><value>sn</value></property>
<property name="userValidTo"><value>accountExpires</value></property>
<property name="userPrefix"><value>a</value></property>
<property name="userClubCardNumber"><value>extensionAttribute13</value></property>
</bean>
<bean name="ldapUsersUpdateJob" class="org.springframework.scheduling.quartz.JobDetailBean">
<property name="jobClass" value="at.kds.epb5.bl.EpbUsersUpdateJob" />
<property name="jobDataAsMap">
<map>
<entry key="ldapProperties" value-ref="ldapProperties"/>
<entry key="userservice" value-ref="userservice"/>
</map>
</property>
</bean>
<!-- cron trigger definitions -->
<bean id="export2StatisticsTriggerBean" class="org.springframework.scheduling.quartz.CronTriggerBean">
<property name="jobDetail" ref="export2StatisticsJob" />
<!-- run at 01 AM every day -->
<property name="cronExpression" value="0 0 01 * * ?" />
</bean>
<bean id="ldapUsersUpdateTriggerBean" class="org.springframework.scheduling.quartz.CronTriggerBean">
<property name="jobDetail" ref="ldapUsersUpdateJob" />
<!-- run at 02 AM every day -->
<property name="cronExpression" value="0 0 02 * * ?" />
</bean>
<!-- scheduler -->
<bean id="scheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="triggers">
<list>
<ref bean="export2StatisticsTriggerBean" />
<ref bean="ldapUsersUpdateTriggerBean" />
</list>
</property>
</bean>
where
public class EpbUsersUpdateJob extends QuartzJobBean {
@SpringBean
private UserService userservice;
LdapProperties ldapProperties;
@Override
protected void executeInternal(JobExecutionContext context)
throws JobExecutionException {
//implementation not shown
}
//
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment