Announcement Announcement Module
Collapse
No announcement yet.
ldap result caching Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • ldap result caching

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

  • #2
    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.

    Comment


    • #3
      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.

      Comment


      • #4
        Do it...

        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!

        Comment


        • #5
          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.

          Comment


          • #6
            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!

            Comment


            • #7
              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

              Comment

              Working...
              X