Results 1 to 7 of 7

Thread: ldap result caching

  1. #1

    Default ldap result caching

    Yes, I would be interested see result caching cabability on ldaptempalte. Any ideas how this could be done?

  2. #2
    Join Date
    Mar 2005
    Location
    Landskrona, Sweden
    Posts
    505

    Default

    The spring-modules project includes support for declarative caching. Using it for caching LDAP results should be no different from using it on any other dao class so I guess it should be pretty straightforward.
    Mattias Arthursson
    Jayway AB (www.jayway.se)
    Spring-LDAP project member

  3. #3

    Default

    Hi Rasky. Man you are quick on your comments

    Anyway, thanks for the tip, it worked beautifully.
    I used CacheProxyFactoryBean to apply caching into my ldap dao.

    If somebody is intrested, I can post full config etc + details.

  4. #4
    Join Date
    Sep 2006
    Posts
    7

    Talking Do it...

    Quote Originally Posted by kakoni View Post
    Hi Rasky. Man you are quick on your comments

    Anyway, thanks for the tip, it worked beautifully.
    I used CacheProxyFactoryBean to apply caching into my ldap dao.

    If somebody is intrested, I can post full config etc + details.
    Can you please post your conf? Thanks a lot!

  5. #5

    Default

    Code:
    	
    	<!-- The created cache manager is an instance of net.sf.ehcache.CacheManager -->
    	<bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean" >
    		<property name="configLocation"><value>classpath:ehcache.xml</value></property>
    	</bean>
    
    	<bean id="cacheProviderFacade" class="org.springmodules.cache.provider.ehcache.EhCacheFacade">
    		<property name="cacheManager" ref="cacheManager" />
    	</bean>
    
    
    
              <bean id="myLdapDAO" class="org.springmodules.cache.interceptor.proxy.CacheProxyFactoryBean">
    	  <property name="cacheProviderFacade" ref="cacheProviderFacade" />
    	  <property name="cachingModels">
    	    <props>
    	      <prop key="getMethod*">cacheName=ldapCache</prop>
    	    </props>
    	  </property>
    	  <property name="target">
    		<bean class="org.foo.bar.ldapdaoclass">
    			<property name="ldapTemplate" ref="ldapTemplate" />
    		</bean>
    	  </property>
    	</bean>
    
    	<bean id="ldapTemplate" class="org.springframework.ldap.LdapTemplate">
    		<constructor-arg ref="contextSource" />
    	</bean>
    So as you can see, I've got a dao class, that wraps nicely that ldaptemplate.

  6. #6
    Join Date
    Nov 2006
    Location
    Columbus, OH
    Posts
    143

    Default

    Where are you injecting/using your "myLdapDAO" bean?

    I'm new to both ehcache and the spring ldap. I've got it loading without error, however, its also not caching anything...

    Thanks!

  7. #7
    Join Date
    Dec 2012
    Posts
    2

    Default

    hiiiii thanks for the code ...but i am in little bit confuse....
    i dont know the code where to apply and my code is in bean.xml ....


    <bean id="ldapTemplate" class="org.springframework.ldap.core.LdapTemplate" >
    <property name="contextSource" ref="contextSource" />
    </bean>

    <bean id="contextSource" class="org.springframework.ldap.core.support.LdapC ontextSource">
    <property name="url" value="url/>"
    <property name="userDn" value="uid=admin,ou=system" />
    <property name="password" value="system" />
    <property name="pooled" value="false" />
    </bean>


    <bean name="ldapOfficeServiceImpl" class="com.iton.ioffice.admin.services.impl.LdapOf ficeServiceImpl">
    <property name="ldapOfficeDao" ref="ldapOfficeDaoImpl"></property>
    </bean>

    <bean name="ldapOfficeDaoImpl" class="com.iton.ioffice.admin.DAO.impl.LdapOfficeD aoImpl">
    <property name="ldapTemplate" ref="ldapTemplate"></property>
    </bean>
    <bean name="ldapUserDaoImpl" class="com.iton.ioffice.admin.DAO.impl.LdapUserDao Impl">
    <property name="ldapTemplate" ref="ldapTemplate"></property>
    <property name="hibernateTemplate" ref="hibernateTemplate" />
    </bean>
    <bean name="ldapUserServiceImpl" class="com.iton.ioffice.admin.services.impl.LdapUs erServiceImpl">
    <property name="ldapUserDao" ref="ldapUserDaoImpl"></property>
    </bean>*/*******
    this is thec ode where i used to use the ldap

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •