All Downloads are FREE. Search and download functionalities are using the official Maven repository.

iutest.conf.apacheDsContext.xml Maven / Gradle / Ivy

Go to download

Java framework to simplify LDAP operations, based on the pattern of Spring's JdbcTemplate. Relieves the users of the burden of looking up and closing contexts, looping through NamingEnumerations, encoding/decoding values and filters, and more.

There is a newer version: 1.0.2
Show newest version
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">

<!--
	This context automatically starts the Apache Directory Server
	and sets up the test data
-->
<beans>
	<!-- JNDI environment variable -->
	<bean id="environment"
		class="org.springframework.beans.factory.config.PropertiesFactoryBean">
		<property name="properties">
			<props>
				<prop key="java.naming.security.authentication">
					simple
				</prop>
				<prop key="java.naming.security.principal">
					${userName}
				</prop>
				<prop key="java.naming.security.credentials">
					${password}
				</prop>
			</props>
		</property>
	</bean>

	<bean id="configuration" class="org.apache.directory.server.configuration.MutableServerStartupConfiguration">
    	<property name="ldapPort" value="389" />
    	<property name="contextPartitionConfigurations">
      		<set>
        		<ref bean="jaywayPartitionConfiguration"/>
      		</set>
    	</property>
	</bean>

	<bean id="jaywayPartitionConfiguration"
		class="org.apache.directory.server.core.configuration.MutableDirectoryPartitionConfiguration">
		<property name="name" value="jayway" />
		<property name="suffix" value="dc=jayway,dc=se" />
		<property name="contextEntry">
			<value>
				objectClass: top
				objectClass: domain
				objectClass: extensibleObject
				dc: jayway
			</value>
		</property>
	</bean>
	
	<bean id="configEnvHelper" class="net.sf.ldaptemplate.ConfigEnvHelper">
		<constructor-arg ref="environment" />
		<constructor-arg ref="configuration" />
	</bean>
	
	<bean name="serverContext" class="javax.naming.InitialContext">
		<constructor-arg>
	    	<bean class="org.springframework.beans.factory.config.PropertyPathFactoryBean">
            	<property name="targetObject" ref="configEnvHelper" />
             	<property name="propertyPath" value="env" />
           	</bean>
        </constructor-arg>
	</bean>
	
	<bean name="ldapServerManager" class="net.sf.ldaptemplate.LdapServerManager">
		<property name="contextSource" ref="contextSource" />
	 </bean>
	 
	 <!-- Custom editors required to launch ApacheDS -->
  	<bean class="org.springframework.beans.factory.config.CustomEditorConfigurer">
    	<property name="customEditors">
      		<map>
        		<entry key="javax.naming.directory.Attributes">
          			<bean class="org.apache.directory.server.core.configuration.AttributesPropertyEditor"/>
        		</entry>
      		</map>
   		</property>
  	</bean>
</beans>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy