diff --git a/samples/odm/src/main/resources/applicationContext.xml b/samples/odm/src/main/resources/applicationContext.xml index 946f0e8c..89a193c7 100644 --- a/samples/odm/src/main/resources/applicationContext.xml +++ b/samples/odm/src/main/resources/applicationContext.xml @@ -7,37 +7,53 @@ - + password="${sample.ldap.password}" + url="${sample.ldap.url}" + username="${sample.ldap.userDn}" + base="${sample.ldap.base}" /> - - - - - - - + + - - - + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/samples/odm/src/main/resources/ldap.properties b/samples/odm/src/main/resources/ldap.properties index 58dd2aab..8466d98d 100644 --- a/samples/odm/src/main/resources/ldap.properties +++ b/samples/odm/src/main/resources/ldap.properties @@ -1,4 +1,5 @@ -urls=ldap://127.0.0.1:18880 -userDn=uid=admin,ou=system -password=secret -base=dc=jayway,dc=se +sample.ldap.url=ldap://127.0.0.1:18880 +sample.ldap.userDn=uid=admin,ou=system +sample.ldap.password=secret +sample.ldap.base=dc=jayway,dc=se +sample.ldap.clean=true diff --git a/samples/odm/src/test/resources/config/ldap.properties b/samples/odm/src/test/resources/config/ldap.properties deleted file mode 100644 index 58dd2aab..00000000 --- a/samples/odm/src/test/resources/config/ldap.properties +++ /dev/null @@ -1,4 +0,0 @@ -urls=ldap://127.0.0.1:18880 -userDn=uid=admin,ou=system -password=secret -base=dc=jayway,dc=se diff --git a/samples/odm/src/test/resources/config/testContext.xml b/samples/odm/src/test/resources/config/testContext.xml index 10a688cb..cd022e09 100644 --- a/samples/odm/src/test/resources/config/testContext.xml +++ b/samples/odm/src/test/resources/config/testContext.xml @@ -1,24 +1,40 @@ + http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/ldap http://www.springframework.org/schema/ldap/spring-ldap.xsd"> - + - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + diff --git a/samples/plain/src/main/resources/applicationContext.xml b/samples/plain/src/main/resources/applicationContext.xml index 6c89fe90..03b01dfd 100644 --- a/samples/plain/src/main/resources/applicationContext.xml +++ b/samples/plain/src/main/resources/applicationContext.xml @@ -8,27 +8,13 @@ + password="${sample.ldap.password}" + url="${sample.ldap.url}" + username="${sample.ldap.userDn}" + base="${sample.ldap.base}" /> - - - - - - - - - @@ -39,4 +25,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/samples/plain/src/main/resources/ldap.properties b/samples/plain/src/main/resources/ldap.properties index 58dd2aab..8466d98d 100644 --- a/samples/plain/src/main/resources/ldap.properties +++ b/samples/plain/src/main/resources/ldap.properties @@ -1,4 +1,5 @@ -urls=ldap://127.0.0.1:18880 -userDn=uid=admin,ou=system -password=secret -base=dc=jayway,dc=se +sample.ldap.url=ldap://127.0.0.1:18880 +sample.ldap.userDn=uid=admin,ou=system +sample.ldap.password=secret +sample.ldap.base=dc=jayway,dc=se +sample.ldap.clean=true diff --git a/samples/plain/src/test/resources/config/testContext.xml b/samples/plain/src/test/resources/config/testContext.xml index 7b38dc02..cbd5779d 100644 --- a/samples/plain/src/test/resources/config/testContext.xml +++ b/samples/plain/src/test/resources/config/testContext.xml @@ -1,22 +1,37 @@ + http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/ldap http://www.springframework.org/schema/ldap/spring-ldap.xsd"> - - - - - - - - - - + + + + + + + + + + + + + + + + + + + diff --git a/samples/readme.md b/samples/readme.md new file mode 100644 index 00000000..e34a5baf --- /dev/null +++ b/samples/readme.md @@ -0,0 +1,7 @@ +## Spring LDAP Samples + +Refer to these sample projects for some examples on using Spring LDAP + +* plain - demonstrates 'plain' usage of Spring LDAP +* odm - demonstrates the Object-Directory mapping functionality +* user-admin - a fully functional user admin application implemented using Spring LDAP \ No newline at end of file diff --git a/samples/simple-odm/build.gradle b/samples/simple-odm/build.gradle deleted file mode 100644 index 68450cd7..00000000 --- a/samples/simple-odm/build.gradle +++ /dev/null @@ -1,22 +0,0 @@ -apply from: JAVA_SCRIPT - -sonarRunner { - skipProject = true -} - -dependencies { - compile project(":spring-ldap-core"), - project(":spring-ldap-odm"), - "org.springframework:spring-core:$springVersion", - "org.springframework:spring-context:$springVersion", - "commons-pool:commons-pool:$commonsPoolVersion" - - runtime ("log4j:log4j:$log4jVersion") { - exclude group: 'javax.jms' - exclude group: 'com.sun.jdmk' - exclude group: 'com.sun.jmx' - } - - testCompile project(":spring-ldap-test"), - "junit:junit:$junitVersion" -} \ No newline at end of file diff --git a/samples/simple-odm/src/main/java/org/springframework/ldap/odm/sample/SearchForPeople.java b/samples/simple-odm/src/main/java/org/springframework/ldap/odm/sample/SearchForPeople.java deleted file mode 100755 index 05c5b135..00000000 --- a/samples/simple-odm/src/main/java/org/springframework/ldap/odm/sample/SearchForPeople.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2005-2013 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.ldap.odm.sample; - -import org.springframework.context.ApplicationContext; -import org.springframework.context.support.ClassPathXmlApplicationContext; -import org.springframework.ldap.odm.core.OdmManager; -import org.springframework.ldap.support.LdapUtils; - -import javax.naming.ldap.LdapName; -import java.util.List; - -import static org.springframework.ldap.query.LdapQueryBuilder.query; - -// A very simple example - just showing how little code you actually need to write -// when using Spring LDAP ODM -public class SearchForPeople { - private static final LdapName baseDn = LdapUtils.newLdapName("o=Whoniverse"); - - private static void print(List personList) { - for (SimplePerson person : personList) { - System.out.println(person); - } - } - - public static void main(String[] argv) { - ApplicationContext context = new ClassPathXmlApplicationContext(new String[] { "spring.xml" }); - - // Grab the OdmManager wired by Spring - OdmManager odmManager = (OdmManager)context.getBean("odmManager"); - - // Find people with a surname of Harvey - List searchResults = odmManager.search(SimplePerson.class, query().base(baseDn).where("sn").is("Harvey")); - - // Print the results - print(searchResults); - } -} diff --git a/samples/simple-odm/src/main/java/org/springframework/ldap/odm/sample/SimplePerson.java b/samples/simple-odm/src/main/java/org/springframework/ldap/odm/sample/SimplePerson.java deleted file mode 100755 index e1b55a57..00000000 --- a/samples/simple-odm/src/main/java/org/springframework/ldap/odm/sample/SimplePerson.java +++ /dev/null @@ -1,233 +0,0 @@ -/* - * Copyright 2005-2013 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.ldap.odm.sample; - -import org.springframework.ldap.odm.annotations.Attribute; -import org.springframework.ldap.odm.annotations.Entry; -import org.springframework.ldap.odm.annotations.Id; - -import javax.naming.Name; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; - -import static org.springframework.ldap.odm.annotations.Attribute.Type; - -/** -* Automatically generated to represent the LDAP object classes -* "person", "top". -*/ -@Entry(objectClasses={"person", "top"}) -public final class SimplePerson { - - @Id - private Name dn; - - @Attribute(name="objectClass", syntax="1.3.6.1.4.1.1466.115.121.1.38") - private List objectClass=new ArrayList(); - - - @Attribute(name="cn", syntax="1.3.6.1.4.1.1466.115.121.1.15") - private List cn=new ArrayList(); - - - @Attribute(name="sn", syntax="1.3.6.1.4.1.1466.115.121.1.15") - private List sn=new ArrayList(); - - - @Attribute(name="description", syntax="1.3.6.1.4.1.1466.115.121.1.15") - private List description=new ArrayList(); - - - @Attribute(name="userPassword", syntax="1.3.6.1.4.1.1466.115.121.1.40", type=Type.BINARY) - private List userPassword=new ArrayList(); - - - @Attribute(name="telephoneNumber", syntax="1.3.6.1.4.1.1466.115.121.1.50") - private List telephoneNumber=new ArrayList(); - - - @Attribute(name="seeAlso", syntax="1.3.6.1.4.1.1466.115.121.1.12") - private List seeAlso=new ArrayList(); - - public Name getDn() { - return dn; - } - - public void setDn(Name dn) { - this.dn=dn; - } - - public Iterator getObjectClassIterator() { - return Collections.unmodifiableList(objectClass).iterator(); - } - - public void addCn(String cn) { - this.cn.add(cn); - } - - public void removeCn(String cn) { - this.cn.remove(cn); - } - - public Iterator getCnIterator() { - return cn.iterator(); - } - - public void addSn(String sn) { - this.sn.add(sn); - } - - public void removeSn(String sn) { - this.sn.remove(sn); - } - - public Iterator getSnIterator() { - return sn.iterator(); - } - - public void addDescription(String description) { - this.description.add(description); - } - - public void removeDescription(String description) { - this.description.remove(description); - } - - public Iterator getDescriptionIterator() { - return description.iterator(); - } - - public void addUserPassword(byte[] userPassword) { - this.userPassword.add(userPassword); - } - - public void removeUserPassword(byte[] userPassword) { - this.userPassword.remove(userPassword); - } - - public Iterator getUserPasswordIterator() { - return userPassword.iterator(); - } - - public void addTelephoneNumber(String telephoneNumber) { - this.telephoneNumber.add(telephoneNumber); - } - - public void removeTelephoneNumber(String telephoneNumber) { - this.telephoneNumber.remove(telephoneNumber); - } - - public Iterator getTelephoneNumberIterator() { - return telephoneNumber.iterator(); - } - - public void addSeeAlso(String seeAlso) { - this.seeAlso.add(seeAlso); - } - - public void removeSeeAlso(String seeAlso) { - this.seeAlso.remove(seeAlso); - } - - public Iterator getSeeAlsoIterator() { - return seeAlso.iterator(); - } - - @Override - public String toString() { - StringBuilder result=new StringBuilder(); - result.append(String.format("dn=%1$s", dn)); - result.append(String.format(" | objectClass=%1$s", objectClass)); - result.append(String.format(" | cn=%1$s", cn)); - result.append(String.format(" | sn=%1$s", sn)); - result.append(String.format(" | description=%1$s", description)); - result.append(String.format(" | userPassword=%1$s", userPassword)); - result.append(String.format(" | telephoneNumber=%1$s", telephoneNumber)); - result.append(String.format(" | seeAlso=%1$s", seeAlso)); - return result.toString(); - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((dn == null) ? 0 : dn.hashCode()); - result = prime * result + ((objectClass == null) ? 0 : (new HashSet(objectClass)).hashCode()); - result = prime * result + ((cn == null) ? 0 : (new HashSet(cn)).hashCode()); - result = prime * result + ((sn == null) ? 0 : (new HashSet(sn)).hashCode()); - result = prime * result + ((description == null) ? 0 : (new HashSet(description)).hashCode()); - result = prime * result + ((userPassword == null) ? 0 : (new HashSet(userPassword)).hashCode()); - result = prime * result + ((telephoneNumber == null) ? 0 : (new HashSet(telephoneNumber)).hashCode()); - result = prime * result + ((seeAlso == null) ? 0 : (new HashSet(seeAlso)).hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - SimplePerson other = (SimplePerson) obj; - if (dn == null) { - if (other.dn != null) - return false; - } else if (!dn.equals(other.dn)) - return false; - if (objectClass == null) { - if (other.objectClass != null) - return false; - } else if (!(new HashSet(objectClass)).equals(new HashSet(other.objectClass))) - return false; - if (cn == null) { - if (other.cn != null) - return false; - } else if (!(new HashSet(cn)).equals(new HashSet(other.cn))) - return false; - if (sn == null) { - if (other.sn != null) - return false; - } else if (!(new HashSet(sn)).equals(new HashSet(other.sn))) - return false; - if (description == null) { - if (other.description != null) - return false; - } else if (!(new HashSet(description)).equals(new HashSet(other.description))) - return false; - if (userPassword == null) { - if (other.userPassword != null) - return false; - } else if (!(new HashSet(userPassword)).equals(new HashSet(other.userPassword))) - return false; - if (telephoneNumber == null) { - if (other.telephoneNumber != null) - return false; - } else if (!(new HashSet(telephoneNumber)).equals(new HashSet(other.telephoneNumber))) - return false; - if (seeAlso == null) { - if (other.seeAlso != null) - return false; - } else if (!(new HashSet(seeAlso)).equals(new HashSet(other.seeAlso))) - return false; - return true; - } -} diff --git a/samples/simple-odm/src/main/java/org/springframework/ldap/odm/sample/package-info.java b/samples/simple-odm/src/main/java/org/springframework/ldap/odm/sample/package-info.java deleted file mode 100755 index 4c5cdbbc..00000000 --- a/samples/simple-odm/src/main/java/org/springframework/ldap/odm/sample/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -/** - * A very simple example of the use of Spring ODM. - * - * @author Paul Harvey <paul.at.pauls-place.me.uk> - */ - -package org.springframework.ldap.odm.sample; \ No newline at end of file diff --git a/samples/simple-odm/src/main/resources/log4j.properties b/samples/simple-odm/src/main/resources/log4j.properties deleted file mode 100755 index aa4032c5..00000000 --- a/samples/simple-odm/src/main/resources/log4j.properties +++ /dev/null @@ -1,19 +0,0 @@ -log4j.rootLogger=error, stdout -log4j.logger.org.springframework.ldap.odm=error -log4j.logger.org.springframework=error - -# Messages to the console -log4j.appender.stdout=org.apache.log4j.ConsoleAppender -log4j.appender.stdout.layout=org.apache.log4j.PatternLayout - -log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n - -# Message to a log file -log4j.appender.log=org.apache.log4j.RollingFileAppender -log4j.appender.log.File=jndi.log - -log4j.appender.log.MaxFileSize=100KB -log4j.appender.log.MaxBackupIndex=1 - -log4j.appender.log.layout=org.apache.log4j.PatternLayout -log4j.appender.log.layout.ConversionPattern=%p %t %c - %m%n diff --git a/samples/simple-odm/src/main/resources/spring.xml b/samples/simple-odm/src/main/resources/spring.xml deleted file mode 100755 index 60b69896..00000000 --- a/samples/simple-odm/src/main/resources/spring.xml +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - - - - - - - - - - - java.lang.String - - - - - java.lang.Byte - java.lang.Short - java.lang.Integer - java.lang.Long - java.lang.Float - java.lang.Double - java.lang.Boolean - - - - - - - - java.lang.Byte - java.lang.Short - java.lang.Integer - java.lang.Long - java.lang.Float - java.lang.Double - java.lang.Boolean - - - - - java.lang.String - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - org.springframework.ldap.odm.sample.SimplePerson - - - - - diff --git a/samples/simple-odm/src/test/java/org/springframework/ldap/odm/sample/test/TestSearchForPeople.java b/samples/simple-odm/src/test/java/org/springframework/ldap/odm/sample/test/TestSearchForPeople.java deleted file mode 100755 index 751d2e1c..00000000 --- a/samples/simple-odm/src/test/java/org/springframework/ldap/odm/sample/test/TestSearchForPeople.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright 2005-2013 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.ldap.odm.sample.test; - -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; -import org.springframework.core.io.ClassPathResource; -import org.springframework.ldap.core.LdapTemplate; -import org.springframework.ldap.core.support.LdapContextSource; -import org.springframework.ldap.odm.sample.SearchForPeople; -import org.springframework.ldap.support.LdapUtils; -import org.springframework.ldap.test.LdapTestUtils; - -import javax.naming.ldap.LdapName; -import java.io.ByteArrayOutputStream; -import java.io.PrintStream; - -import static org.junit.Assert.assertEquals; - -public class TestSearchForPeople { - // Base DN for test data - private static final LdapName baseName = LdapUtils.newLdapName("o=Whoniverse"); - - private static final String PRINCIPAL="uid=admin,ou=system"; - private static final String CREDENTIALS="secret"; - - // This port MUST be free on local host for these unit tests to function. - private static int PORT=10389; - - @BeforeClass - public static void setUpClass() throws Exception { - // Start an LDAP server and import test data - LdapTestUtils.startEmbeddedServer(PORT, baseName.toString(), "odm-test"); - } - - @AfterClass - public static void tearDownClass() throws Exception { - LdapTestUtils.shutdownEmbeddedServer(); - } - - @Before - public void setUp() throws Exception { - // Bind to the directory - LdapContextSource contextSource = new LdapContextSource(); - contextSource.setUrl("ldap://127.0.0.1:" + PORT); - contextSource.setUserDn(""); - contextSource.setPassword(""); - contextSource.setPooled(false); - contextSource.afterPropertiesSet(); - - // Create the Sprint LDAP template - LdapTemplate template = new LdapTemplate(contextSource); - - // Clear out any old data - and load the test data - LdapTestUtils.cleanAndSetup(template.getContextSource(), baseName, new ClassPathResource("testdata.ldif")); - } - - @After - public void tearDown() { - } - - // Very simple test - mainly just to exercise the code and to - // ensure we get representative test coverage - @Test - public void runSample() throws Exception { - PrintStream originalOut=System.out; - try { - ByteArrayOutputStream output = new ByteArrayOutputStream(); - System.setOut(new PrintStream(output)); - - SearchForPeople.main(null); - - assertEquals("dn=cn=Bramble Harvey,ou=Doctors,o=Whoniverse | objectClass=[person, top] | cn=[Bramble Harvey] | sn=[Harvey] | description=[Really not a Doctor] | userPassword=[] | telephoneNumber=[22] | seeAlso=[]", - output.toString().trim()); - } finally { - System.setOut(originalOut); - } - } -} diff --git a/samples/simple-odm/src/test/resources/testdata.ldif b/samples/simple-odm/src/test/resources/testdata.ldif deleted file mode 100755 index 5bd52d35..00000000 --- a/samples/simple-odm/src/test/resources/testdata.ldif +++ /dev/null @@ -1,105 +0,0 @@ -dn: ou=Enemies,o=Whoniverse -objectClass: organizationalUnit -objectClass: top -ou: Blizzard - -dn: ou=Assistants,o=Whoniverse -objectClass: organizationalUnit -objectClass: top -ou: Blizzard - -dn: ou=Doctors,o=Whoniverse -objectClass: organizationalUnit -objectClass: top -ou: NCSoft - -dn: cn=William Hartnell,ou=Doctors,o=Whoniverse -objectClass: person -objectClass: inetorgperson -objectclass: organizationalperson -objectClass: top -cn: William Hartnell -description: First Doctor -description: Grumpy -sn: Hartnell -telephonenumber: 1 - -dn: cn=Patrick Troughton,ou=Doctors,o=Whoniverse -objectClass: person -objectClass: inetorgperson -objectclass: organizationalperson -objectClass: top -cn: Patrick Troughton -description: Second Doctor -description:Clown -sn: Troughton -telephonenumber: 2 - -dn: cn=Jon Pertwee,ou=Doctors,o=Whoniverse -objectClass: person -objectClass: inetorgperson -objectclass: organizationalperson -objectClass: top -cn: Jon Pertwee -description: Third Doctor -description: Dandy -sn: Pertwee -telephonenumber: 3 - -dn: cn=Tom Baker,ou=Doctors,o=Whoniverse -objectClass: person -objectClass: inetorgperson -objectclass: organizationalperson -objectClass: top -cn: Tom Baker -description: Fourth Doctor -description: The one and only! -sn: Baker -telephonenumber: 4 - -dn: cn=Peter Davison,ou=Doctors,o=Whoniverse -objectClass: person -objectClass: inetorgperson -objectclass: organizationalperson -objectClass: top -cn: Peter Davison -description: Fifth Doctor -sn: Davison -telephonenumber: 5 - -dn: cn=Bramble Harvey,ou=Doctors,o=Whoniverse -objectClass: person -objectClass: top -cn: Bramble Harvey -description: Really not a Doctor -sn: Harvey -telephonenumber: 22 - -dn: cn=Davros,ou=Enemies,o=Whoniverse -objectClass: person -objectClass: inetorgperson -objectclass: organizationalperson -objectClass: top -cn: Davros -description: Creator of the Daleks -description: Kaled head scientist -sn: Unknown - -dn: cn=Daleks,ou=Enemies,o=Whoniverse -objectClass: person -objectClass: inetorgperson -objectclass: organizationalperson -objectClass: top -cn: Daleks -description: The Doctor's greatest foe -sn: NA - -dn: cn=Master,ou=Enemies,o=Whoniverse -objectClass: person -objectClass: inetorgperson -objectclass: organizationalperson -objectClass: top -cn: Master -description: An evil Time Lord -sn: Unknown - diff --git a/samples/user-admin/src/main/java/org/springframework/ldap/samples/useradmin/domain/Group.java b/samples/user-admin/src/main/java/org/springframework/ldap/samples/useradmin/domain/Group.java index 33e42b03..af3c5f95 100644 --- a/samples/user-admin/src/main/java/org/springframework/ldap/samples/useradmin/domain/Group.java +++ b/samples/user-admin/src/main/java/org/springframework/ldap/samples/useradmin/domain/Group.java @@ -29,7 +29,7 @@ import java.util.Set; * @author Mattias Hellborg Arthursson */ @Entry(objectClasses = {"groupOfNames", "top"}, base = "ou=Groups") -public class Group { +public final class Group { @Id private Name id; diff --git a/samples/user-admin/src/main/java/org/springframework/ldap/samples/useradmin/domain/User.java b/samples/user-admin/src/main/java/org/springframework/ldap/samples/useradmin/domain/User.java index 9b43616a..15dac009 100644 --- a/samples/user-admin/src/main/java/org/springframework/ldap/samples/useradmin/domain/User.java +++ b/samples/user-admin/src/main/java/org/springframework/ldap/samples/useradmin/domain/User.java @@ -29,7 +29,7 @@ import javax.naming.Name; * @author Mattias Hellborg Arthursson */ @Entry(objectClasses = { "inetOrgPerson", "organizationalPerson", "person", "top" }, base = "ou=Departments") -public class User { +public final class User { @Id private Name id; diff --git a/samples/user-admin/src/main/resources/applicationContext.xml b/samples/user-admin/src/main/resources/applicationContext.xml index 9b4a48a2..22ddead4 100644 --- a/samples/user-admin/src/main/resources/applicationContext.xml +++ b/samples/user-admin/src/main/resources/applicationContext.xml @@ -62,6 +62,7 @@ + - - - - - + + + - - - -