diff --git a/core/src/itest-openldap/java/org/springframework/ldap/LdapTemplateLookupOpenLdapITest.java b/core/src/itest-openldap/java/org/springframework/ldap/LdapTemplateLookupOpenLdapITest.java
index e490a7fa..508d6dd4 100644
--- a/core/src/itest-openldap/java/org/springframework/ldap/LdapTemplateLookupOpenLdapITest.java
+++ b/core/src/itest-openldap/java/org/springframework/ldap/LdapTemplateLookupOpenLdapITest.java
@@ -1,220 +1,220 @@
-/*
- * Copyright 2005-2016 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
- *
- * https://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;
-
-import javax.naming.NamingException;
-import javax.naming.directory.Attributes;
-
-import org.springframework.ldap.core.AttributesMapper;
-import org.springframework.ldap.core.ContextMapper;
-import org.springframework.ldap.core.DirContextAdapter;
-import org.springframework.ldap.core.DistinguishedName;
-import org.springframework.ldap.core.LdapTemplate;
-import org.springframework.test.AbstractDependencyInjectionSpringContextTests;
-
-/**
- * Tests the lookup methods of LdapTemplate on OpenLdap.
- *
- * @author Mattias Hellborg Arthursson
- * @author Ulrik Sandberg
- */
-public class LdapTemplateLookupOpenLdapITest extends
- AbstractDependencyInjectionSpringContextTests {
-
- private LdapTemplate tested;
-
- protected String[] getConfigLocations() {
- return new String[] { "/conf/ldapTemplateTestContext-openldap.xml" };
- }
-
- /**
- * This method depends on a DirObjectFactory ({@link org.springframework.ldap.core.support.DefaultDirObjectFactory})
- * being set in the ContextSource.
- */
- public void testLookup_Plain() {
- DirContextAdapter result = (DirContextAdapter) tested
- .lookup("cn=Some Person2, ou=company1,c=Sweden");
-
- assertThat(result.getStringAttribute("cn")).isEqualTo("Some Person2");
- assertThat(result.getStringAttribute("sn")).isEqualTo("Person2");
- assertEquals("Sweden, Company1, Some Person2", result
- .getStringAttribute("description"));
- }
-
- public void testLookup_AttributesMapper() {
- AttributesMapper mapper = new PersonAttributesMapper();
- Person person = (Person) tested.lookup(
- "cn=Some Person2, ou=company1,c=Sweden", mapper);
-
- assertThat(person.getFullname()).isEqualTo("Some Person2");
- assertThat(person.getLastname()).isEqualTo("Person2");
- assertThat(person.getDescription()).isEqualTo("Sweden, Company1, Some Person2");
- }
-
- public void testLookup_AttributesMapper_DistinguishedName() {
- AttributesMapper mapper = new PersonAttributesMapper();
- Person person = (Person) tested.lookup(new DistinguishedName(
- "cn=Some Person2, ou=company1,c=Sweden"), mapper);
-
- assertThat(person.getFullname()).isEqualTo("Some Person2");
- assertThat(person.getLastname()).isEqualTo("Person2");
- assertThat(person.getDescription()).isEqualTo("Sweden, Company1, Some Person2");
- }
-
- /**
- * An {@link AttributesMapper} that only maps a subset of the full
- * attributes list. Used in tests where the return attributes list has been
- * limited.
- *
- * @author Ulrik Sandberg
- */
- private final class SubsetPersonAttributesMapper implements
- AttributesMapper {
- /**
- * Maps the cn attribute into a {@link Person} object.
- * Also verifies that the other attributes haven't been set.
- *
- * @see org.springframework.ldap.core.AttributesMapper#mapFromAttributes(javax.naming.directory.Attributes)
- */
- public Object mapFromAttributes(Attributes attributes)
- throws NamingException {
- Person person = new Person();
- person.setFullname((String) attributes.get("cn").get());
- assertThat(attributes.get("sn")).as("sn should be null").isNull();
- assertNull("description should be null", attributes
- .get("description"));
- return person;
- }
- }
-
- /**
- * Verifies that only the subset is used when specifying a subset of the
- * available attributes as return attributes.
- */
- public void testLookup_ReturnAttributes_AttributesMapper() {
- AttributesMapper mapper = new SubsetPersonAttributesMapper();
-
- Person person = (Person) tested.lookup(
- "cn=Some Person2, ou=company1,c=Sweden", new String[] { "cn" },
- mapper);
-
- assertThat(person.getFullname()).isEqualTo("Some Person2");
- assertThat(person.getLastname()).as("lastName should not be set").isNull();
- assertThat(person.getDescription()).as("description should not be set").isNull();
- }
-
- /**
- * Verifies that only the subset is used when specifying a subset of the
- * available attributes as return attributes. Uses DistinguishedName instead
- * of plain string as name.
- */
- public void testLookup_ReturnAttributes_AttributesMapper_DistinguishedName() {
- AttributesMapper mapper = new SubsetPersonAttributesMapper();
- Person person = (Person) tested.lookup(new DistinguishedName(
- "cn=Some Person2, ou=company1,c=Sweden"),
- new String[] { "cn" }, mapper);
-
- assertThat(person.getFullname()).isEqualTo("Some Person2");
- assertThat(person.getLastname()).as("lastName should not be set").isNull();
- assertThat(person.getDescription()).as("description should not be set").isNull();
- }
-
- /**
- * This method depends on a DirObjectFactory ({@link org.springframework.ldap.core.support.DefaultDirObjectFactory})
- * being set in the ContextSource.
- */
- public void testLookup_ContextMapper() {
- ContextMapper mapper = new PersonContextMapper();
- Person person = (Person) tested.lookup(
- "cn=Some Person2, ou=company1,c=Sweden", mapper);
-
- assertThat(person.getFullname()).isEqualTo("Some Person2");
- assertThat(person.getLastname()).isEqualTo("Person2");
- assertThat(person.getDescription()).isEqualTo("Sweden, Company1, Some Person2");
- }
-
- /**
- * Verifies that only the subset is used when specifying a subset of the
- * available attributes as return attributes.
- */
- public void testLookup_ReturnAttributes_ContextMapper() {
- ContextMapper mapper = new PersonContextMapper();
-
- Person person = (Person) tested.lookup(
- "cn=Some Person2, ou=company1,c=Sweden", new String[] { "cn" },
- mapper);
-
- assertThat(person.getFullname()).isEqualTo("Some Person2");
- assertThat(person.getLastname()).as("lastName should not be set").isNull();
- assertThat(person.getDescription()).as("description should not be set").isNull();
- }
-
- /**
- * Verifies that we can lookup an entry that has a multi-valued rdn, which
- * means more than one attribute is part of the relative DN for the entry.
- */
- public void testLookup_MultiValuedRdn() {
- AttributesMapper mapper = new PersonAttributesMapper();
- Person person = (Person) tested.lookup(
- "cn=Some Person+sn=Person, ou=company1,c=Norway", mapper);
-
- assertThat(person.getFullname()).isEqualTo("Some Person");
- assertThat(person.getLastname()).isEqualTo("Person");
- assertEquals("Norway, Company1, Some Person+Person", person
- .getDescription());
- }
-
- /**
- * Verifies that we can lookup an entry that has a multi-valued rdn, which
- * means more than one attribute is part of the relative DN for the entry.
- */
- public void testLookup_MultiValuedRdn_DirContextAdapter() {
- DirContextAdapter result = (DirContextAdapter) tested
- .lookup("cn=Some Person+sn=Person, ou=company1,c=Norway");
-
- assertThat(result.getStringAttribute("cn")).isEqualTo("Some Person");
- assertThat(result.getStringAttribute("sn")).isEqualTo("Person");
- assertEquals("Norway, Company1, Some Person+Person", result
- .getStringAttribute("description"));
- }
-
- public void testLookup_GetNameInNamespace_Plain() {
- DirContextAdapter result = (DirContextAdapter) tested
- .lookup("cn=Some Person2, ou=company1,c=Sweden");
-
- assertThat(result.getDn().isEqualTo("cn=Some Person2, ou=company1, c=Sweden")
- .toString());
- assertEquals(
- "cn=Some Person2, ou=company1, c=Sweden, dc=jayway, dc=se",
- result.getNameInNamespace());
- }
-
- public void testLookup_GetNameInNamespace_MultiRdn() {
- DirContextAdapter result = (DirContextAdapter) tested
- .lookup("cn=Some Person+sn=Person, ou=company1,c=Norway");
-
- assertEquals("cn=Some Person+sn=Person, ou=company1, c=Norway", result
- .getDn().toString());
- assertEquals(
- "cn=Some Person+sn=Person, ou=company1, c=Norway, dc=jayway, dc=se",
- result.getNameInNamespace());
- }
-
- public void setTested(LdapTemplate tested) {
- this.tested = tested;
- }
-}
+/*
+ * Copyright 2005-2016 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
+ *
+ * https://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;
+
+import javax.naming.NamingException;
+import javax.naming.directory.Attributes;
+
+import org.springframework.ldap.core.AttributesMapper;
+import org.springframework.ldap.core.ContextMapper;
+import org.springframework.ldap.core.DirContextAdapter;
+import org.springframework.ldap.core.DistinguishedName;
+import org.springframework.ldap.core.LdapTemplate;
+import org.springframework.test.AbstractDependencyInjectionSpringContextTests;
+
+/**
+ * Tests the lookup methods of LdapTemplate on OpenLdap.
+ *
+ * @author Mattias Hellborg Arthursson
+ * @author Ulrik Sandberg
+ */
+public class LdapTemplateLookupOpenLdapITest extends
+ AbstractDependencyInjectionSpringContextTests {
+
+ private LdapTemplate tested;
+
+ protected String[] getConfigLocations() {
+ return new String[] { "/conf/ldapTemplateTestContext-openldap.xml" };
+ }
+
+ /**
+ * This method depends on a DirObjectFactory ({@link org.springframework.ldap.core.support.DefaultDirObjectFactory})
+ * being set in the ContextSource.
+ */
+ public void testLookup_Plain() {
+ DirContextAdapter result = (DirContextAdapter) tested
+ .lookup("cn=Some Person2, ou=company1,c=Sweden");
+
+ assertThat(result.getStringAttribute("cn")).isEqualTo("Some Person2");
+ assertThat(result.getStringAttribute("sn")).isEqualTo("Person2");
+ assertEquals("Sweden, Company1, Some Person2", result
+ .getStringAttribute("description"));
+ }
+
+ public void testLookup_AttributesMapper() {
+ AttributesMapper mapper = new PersonAttributesMapper();
+ Person person = (Person) tested.lookup(
+ "cn=Some Person2, ou=company1,c=Sweden", mapper);
+
+ assertThat(person.getFullname()).isEqualTo("Some Person2");
+ assertThat(person.getLastname()).isEqualTo("Person2");
+ assertThat(person.getDescription()).isEqualTo("Sweden, Company1, Some Person2");
+ }
+
+ public void testLookup_AttributesMapper_DistinguishedName() {
+ AttributesMapper mapper = new PersonAttributesMapper();
+ Person person = (Person) tested.lookup(new DistinguishedName(
+ "cn=Some Person2, ou=company1,c=Sweden"), mapper);
+
+ assertThat(person.getFullname()).isEqualTo("Some Person2");
+ assertThat(person.getLastname()).isEqualTo("Person2");
+ assertThat(person.getDescription()).isEqualTo("Sweden, Company1, Some Person2");
+ }
+
+ /**
+ * An {@link AttributesMapper} that only maps a subset of the full
+ * attributes list. Used in tests where the return attributes list has been
+ * limited.
+ *
+ * @author Ulrik Sandberg
+ */
+ private final class SubsetPersonAttributesMapper implements
+ AttributesMapper {
+ /**
+ * Maps the cn attribute into a {@link Person} object.
+ * Also verifies that the other attributes haven't been set.
+ *
+ * @see org.springframework.ldap.core.AttributesMapper#mapFromAttributes(javax.naming.directory.Attributes)
+ */
+ public Object mapFromAttributes(Attributes attributes)
+ throws NamingException {
+ Person person = new Person();
+ person.setFullname((String) attributes.get("cn").get());
+ assertThat(attributes.get("sn")).as("sn should be null").isNull();
+ assertNull("description should be null", attributes
+ .get("description"));
+ return person;
+ }
+ }
+
+ /**
+ * Verifies that only the subset is used when specifying a subset of the
+ * available attributes as return attributes.
+ */
+ public void testLookup_ReturnAttributes_AttributesMapper() {
+ AttributesMapper mapper = new SubsetPersonAttributesMapper();
+
+ Person person = (Person) tested.lookup(
+ "cn=Some Person2, ou=company1,c=Sweden", new String[] { "cn" },
+ mapper);
+
+ assertThat(person.getFullname()).isEqualTo("Some Person2");
+ assertThat(person.getLastname()).as("lastName should not be set").isNull();
+ assertThat(person.getDescription()).as("description should not be set").isNull();
+ }
+
+ /**
+ * Verifies that only the subset is used when specifying a subset of the
+ * available attributes as return attributes. Uses DistinguishedName instead
+ * of plain string as name.
+ */
+ public void testLookup_ReturnAttributes_AttributesMapper_DistinguishedName() {
+ AttributesMapper mapper = new SubsetPersonAttributesMapper();
+ Person person = (Person) tested.lookup(new DistinguishedName(
+ "cn=Some Person2, ou=company1,c=Sweden"),
+ new String[] { "cn" }, mapper);
+
+ assertThat(person.getFullname()).isEqualTo("Some Person2");
+ assertThat(person.getLastname()).as("lastName should not be set").isNull();
+ assertThat(person.getDescription()).as("description should not be set").isNull();
+ }
+
+ /**
+ * This method depends on a DirObjectFactory ({@link org.springframework.ldap.core.support.DefaultDirObjectFactory})
+ * being set in the ContextSource.
+ */
+ public void testLookup_ContextMapper() {
+ ContextMapper mapper = new PersonContextMapper();
+ Person person = (Person) tested.lookup(
+ "cn=Some Person2, ou=company1,c=Sweden", mapper);
+
+ assertThat(person.getFullname()).isEqualTo("Some Person2");
+ assertThat(person.getLastname()).isEqualTo("Person2");
+ assertThat(person.getDescription()).isEqualTo("Sweden, Company1, Some Person2");
+ }
+
+ /**
+ * Verifies that only the subset is used when specifying a subset of the
+ * available attributes as return attributes.
+ */
+ public void testLookup_ReturnAttributes_ContextMapper() {
+ ContextMapper mapper = new PersonContextMapper();
+
+ Person person = (Person) tested.lookup(
+ "cn=Some Person2, ou=company1,c=Sweden", new String[] { "cn" },
+ mapper);
+
+ assertThat(person.getFullname()).isEqualTo("Some Person2");
+ assertThat(person.getLastname()).as("lastName should not be set").isNull();
+ assertThat(person.getDescription()).as("description should not be set").isNull();
+ }
+
+ /**
+ * Verifies that we can lookup an entry that has a multi-valued rdn, which
+ * means more than one attribute is part of the relative DN for the entry.
+ */
+ public void testLookup_MultiValuedRdn() {
+ AttributesMapper mapper = new PersonAttributesMapper();
+ Person person = (Person) tested.lookup(
+ "cn=Some Person+sn=Person, ou=company1,c=Norway", mapper);
+
+ assertThat(person.getFullname()).isEqualTo("Some Person");
+ assertThat(person.getLastname()).isEqualTo("Person");
+ assertEquals("Norway, Company1, Some Person+Person", person
+ .getDescription());
+ }
+
+ /**
+ * Verifies that we can lookup an entry that has a multi-valued rdn, which
+ * means more than one attribute is part of the relative DN for the entry.
+ */
+ public void testLookup_MultiValuedRdn_DirContextAdapter() {
+ DirContextAdapter result = (DirContextAdapter) tested
+ .lookup("cn=Some Person+sn=Person, ou=company1,c=Norway");
+
+ assertThat(result.getStringAttribute("cn")).isEqualTo("Some Person");
+ assertThat(result.getStringAttribute("sn")).isEqualTo("Person");
+ assertEquals("Norway, Company1, Some Person+Person", result
+ .getStringAttribute("description"));
+ }
+
+ public void testLookup_GetNameInNamespace_Plain() {
+ DirContextAdapter result = (DirContextAdapter) tested
+ .lookup("cn=Some Person2, ou=company1,c=Sweden");
+
+ assertThat(result.getDn().isEqualTo("cn=Some Person2, ou=company1, c=Sweden")
+ .toString());
+ assertEquals(
+ "cn=Some Person2, ou=company1, c=Sweden, dc=jayway, dc=se",
+ result.getNameInNamespace());
+ }
+
+ public void testLookup_GetNameInNamespace_MultiRdn() {
+ DirContextAdapter result = (DirContextAdapter) tested
+ .lookup("cn=Some Person+sn=Person, ou=company1,c=Norway");
+
+ assertEquals("cn=Some Person+sn=Person, ou=company1, c=Norway", result
+ .getDn().toString());
+ assertEquals(
+ "cn=Some Person+sn=Person, ou=company1, c=Norway, dc=jayway, dc=se",
+ result.getNameInNamespace());
+ }
+
+ public void setTested(LdapTemplate tested) {
+ this.tested = tested;
+ }
+}
diff --git a/core/src/itest-openldap/java/org/springframework/ldap/control/LdapTemplatePagedSearchITest.java b/core/src/itest-openldap/java/org/springframework/ldap/control/LdapTemplatePagedSearchITest.java
index dcc9b05e..3d152fa2 100644
--- a/core/src/itest-openldap/java/org/springframework/ldap/control/LdapTemplatePagedSearchITest.java
+++ b/core/src/itest-openldap/java/org/springframework/ldap/control/LdapTemplatePagedSearchITest.java
@@ -1,157 +1,157 @@
-/*
- * Copyright 2005-2016 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
- *
- * https://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.control;
-
-import java.util.List;
-
-import javax.naming.Name;
-import javax.naming.NamingEnumeration;
-import javax.naming.NamingException;
-import javax.naming.directory.DirContext;
-import javax.naming.directory.SearchControls;
-
-import org.springframework.ldap.Person;
-import org.springframework.ldap.PersonAttributesMapper;
-import org.springframework.ldap.core.AttributesMapperCallbackHandler;
-import org.springframework.ldap.core.CollectingNameClassPairCallbackHandler;
-import org.springframework.ldap.core.DistinguishedName;
-import org.springframework.ldap.core.LdapTemplate;
-import org.springframework.ldap.core.SearchExecutor;
-import org.springframework.test.AbstractDependencyInjectionSpringContextTests;
-
-/**
- * Tests the paged search result capability of LdapTemplate.
- *
- * Note: Currently, ApacheDS does not support paged results controls, so this - * test must be run under another directory server, for example OpenLdap. This - * test will not run under ApacheDS, and the other integration tests assume - * ApacheDS and will probably not run under OpenLdap. - * - * @author Ulrik Sandberg - */ -public class LdapTemplatePagedSearchITest extends - AbstractDependencyInjectionSpringContextTests { - - private static final Name BASE = DistinguishedName.EMPTY_PATH; - - private static final String FILTER_STRING = "(&(objectclass=person))"; - - private LdapTemplate tested; - - private CollectingNameClassPairCallbackHandler callbackHandler; - - private SearchControls searchControls; - - protected String[] getConfigLocations() { - return new String[] { "/conf/ldapTemplateTestContext-openldap.xml" }; - } - - protected void onSetUp() throws Exception { - super.onSetUp(); - PersonAttributesMapper mapper = new PersonAttributesMapper(); - callbackHandler = new AttributesMapperCallbackHandler(mapper); - searchControls = new SearchControls(); - searchControls.setSearchScope(SearchControls.SUBTREE_SCOPE); - } - - protected void onTearDown() throws Exception { - super.onTearDown(); - callbackHandler = null; - tested = null; - searchControls = null; - } - - public void testSearch_PagedResult() { - SearchExecutor searchExecutor = new SearchExecutor() { - public NamingEnumeration executeSearch(DirContext ctx) - throws NamingException { - return ctx.search(BASE, FILTER_STRING, searchControls); - } - }; - Person person; - List list; - PagedResultsCookie cookie; - PagedResultsRequestControl requestControl; - - // Prepare for first search - requestControl = new PagedResultsRequestControl(3); - tested.search(searchExecutor, callbackHandler, requestControl); - cookie = requestControl.getCookie(); - assertThat(cookie.getCookie()).as("Cookie should not be null yet").isNotNull(); - list = callbackHandler.getList(); - assertThat(list).hasSize(3); - person = (Person) list.get(0); - assertThat(person.getFullname()).isEqualTo("Some Person"); - assertThat(person.getPhone()).isEqualTo("+46 555-123456"); - person = (Person) list.get(1); - assertThat(person.getFullname()).isEqualTo("Some Person2"); - assertThat(person.getPhone()).isEqualTo("+46 555-654321"); - person = (Person) list.get(2); - assertThat(person.getFullname()).isEqualTo("Some Person3"); - assertThat(person.getPhone()).isEqualTo("+46 555-123654"); - - // Prepare for second and last search - requestControl = new PagedResultsRequestControl(3, cookie); - tested.search(searchExecutor, callbackHandler, requestControl); - cookie = requestControl.getCookie(); - assertThat(cookie.getCookie()).as("Cookie should be null now").isNull(); - assertThat(list).hasSize(5); - person = (Person) list.get(3); - assertThat(person.getFullname()).isEqualTo("Some Person"); - assertThat(person.getPhone()).isEqualTo("+46 555-456321"); - person = (Person) list.get(4); - assertThat(person.getFullname()).isEqualTo("Some Person"); - assertThat(person.getPhone()).isEqualTo("+45 555-654123"); - } - - public void testSearch_PagedResult_ConvenienceMethod() { - Person person; - List list; - PagedResultsCookie cookie; - PagedResultsRequestControl requestControl; - - // Prepare for first search - requestControl = new PagedResultsRequestControl(3); - tested.search(BASE, FILTER_STRING, searchControls, - callbackHandler, requestControl); - cookie = requestControl.getCookie(); - assertThat(cookie.getCookie()).as("Cookie should not be null yet").isNotNull(); - list = callbackHandler.getList(); - assertThat(list).hasSize(3); - person = (Person) list.get(0); - assertThat(person.getFullname()).isEqualTo("Some Person"); - person = (Person) list.get(1); - assertThat(person.getFullname()).isEqualTo("Some Person2"); - person = (Person) list.get(2); - assertThat(person.getFullname()).isEqualTo("Some Person3"); - - // Prepare for second and last search - requestControl = new PagedResultsRequestControl(3, cookie); - tested.search(BASE, FILTER_STRING, searchControls, - callbackHandler, requestControl); - cookie = requestControl.getCookie(); - assertThat(cookie.getCookie()).as("Cookie should be null now").isNull(); - assertThat(list).hasSize(5); - person = (Person) list.get(3); - assertThat(person.getFullname()).isEqualTo("Some Person"); - person = (Person) list.get(4); - assertThat(person.getFullname()).isEqualTo("Some Person"); - } - - public void setTested(LdapTemplate tested) { - this.tested = tested; - } -} +/* + * Copyright 2005-2016 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 + * + * https://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.control; + +import java.util.List; + +import javax.naming.Name; +import javax.naming.NamingEnumeration; +import javax.naming.NamingException; +import javax.naming.directory.DirContext; +import javax.naming.directory.SearchControls; + +import org.springframework.ldap.Person; +import org.springframework.ldap.PersonAttributesMapper; +import org.springframework.ldap.core.AttributesMapperCallbackHandler; +import org.springframework.ldap.core.CollectingNameClassPairCallbackHandler; +import org.springframework.ldap.core.DistinguishedName; +import org.springframework.ldap.core.LdapTemplate; +import org.springframework.ldap.core.SearchExecutor; +import org.springframework.test.AbstractDependencyInjectionSpringContextTests; + +/** + * Tests the paged search result capability of LdapTemplate. + *
+ * Note: Currently, ApacheDS does not support paged results controls, so this
+ * test must be run under another directory server, for example OpenLdap. This
+ * test will not run under ApacheDS, and the other integration tests assume
+ * ApacheDS and will probably not run under OpenLdap.
+ *
+ * @author Ulrik Sandberg
+ */
+public class LdapTemplatePagedSearchITest extends
+ AbstractDependencyInjectionSpringContextTests {
+
+ private static final Name BASE = DistinguishedName.EMPTY_PATH;
+
+ private static final String FILTER_STRING = "(&(objectclass=person))";
+
+ private LdapTemplate tested;
+
+ private CollectingNameClassPairCallbackHandler callbackHandler;
+
+ private SearchControls searchControls;
+
+ protected String[] getConfigLocations() {
+ return new String[] { "/conf/ldapTemplateTestContext-openldap.xml" };
+ }
+
+ protected void onSetUp() throws Exception {
+ super.onSetUp();
+ PersonAttributesMapper mapper = new PersonAttributesMapper();
+ callbackHandler = new AttributesMapperCallbackHandler(mapper);
+ searchControls = new SearchControls();
+ searchControls.setSearchScope(SearchControls.SUBTREE_SCOPE);
+ }
+
+ protected void onTearDown() throws Exception {
+ super.onTearDown();
+ callbackHandler = null;
+ tested = null;
+ searchControls = null;
+ }
+
+ public void testSearch_PagedResult() {
+ SearchExecutor searchExecutor = new SearchExecutor() {
+ public NamingEnumeration executeSearch(DirContext ctx)
+ throws NamingException {
+ return ctx.search(BASE, FILTER_STRING, searchControls);
+ }
+ };
+ Person person;
+ List list;
+ PagedResultsCookie cookie;
+ PagedResultsRequestControl requestControl;
+
+ // Prepare for first search
+ requestControl = new PagedResultsRequestControl(3);
+ tested.search(searchExecutor, callbackHandler, requestControl);
+ cookie = requestControl.getCookie();
+ assertThat(cookie.getCookie()).as("Cookie should not be null yet").isNotNull();
+ list = callbackHandler.getList();
+ assertThat(list).hasSize(3);
+ person = (Person) list.get(0);
+ assertThat(person.getFullname()).isEqualTo("Some Person");
+ assertThat(person.getPhone()).isEqualTo("+46 555-123456");
+ person = (Person) list.get(1);
+ assertThat(person.getFullname()).isEqualTo("Some Person2");
+ assertThat(person.getPhone()).isEqualTo("+46 555-654321");
+ person = (Person) list.get(2);
+ assertThat(person.getFullname()).isEqualTo("Some Person3");
+ assertThat(person.getPhone()).isEqualTo("+46 555-123654");
+
+ // Prepare for second and last search
+ requestControl = new PagedResultsRequestControl(3, cookie);
+ tested.search(searchExecutor, callbackHandler, requestControl);
+ cookie = requestControl.getCookie();
+ assertThat(cookie.getCookie()).as("Cookie should be null now").isNull();
+ assertThat(list).hasSize(5);
+ person = (Person) list.get(3);
+ assertThat(person.getFullname()).isEqualTo("Some Person");
+ assertThat(person.getPhone()).isEqualTo("+46 555-456321");
+ person = (Person) list.get(4);
+ assertThat(person.getFullname()).isEqualTo("Some Person");
+ assertThat(person.getPhone()).isEqualTo("+45 555-654123");
+ }
+
+ public void testSearch_PagedResult_ConvenienceMethod() {
+ Person person;
+ List list;
+ PagedResultsCookie cookie;
+ PagedResultsRequestControl requestControl;
+
+ // Prepare for first search
+ requestControl = new PagedResultsRequestControl(3);
+ tested.search(BASE, FILTER_STRING, searchControls,
+ callbackHandler, requestControl);
+ cookie = requestControl.getCookie();
+ assertThat(cookie.getCookie()).as("Cookie should not be null yet").isNotNull();
+ list = callbackHandler.getList();
+ assertThat(list).hasSize(3);
+ person = (Person) list.get(0);
+ assertThat(person.getFullname()).isEqualTo("Some Person");
+ person = (Person) list.get(1);
+ assertThat(person.getFullname()).isEqualTo("Some Person2");
+ person = (Person) list.get(2);
+ assertThat(person.getFullname()).isEqualTo("Some Person3");
+
+ // Prepare for second and last search
+ requestControl = new PagedResultsRequestControl(3, cookie);
+ tested.search(BASE, FILTER_STRING, searchControls,
+ callbackHandler, requestControl);
+ cookie = requestControl.getCookie();
+ assertThat(cookie.getCookie()).as("Cookie should be null now").isNull();
+ assertThat(list).hasSize(5);
+ person = (Person) list.get(3);
+ assertThat(person.getFullname()).isEqualTo("Some Person");
+ person = (Person) list.get(4);
+ assertThat(person.getFullname()).isEqualTo("Some Person");
+ }
+
+ public void setTested(LdapTemplate tested) {
+ this.tested = tested;
+ }
+}
diff --git a/core/src/itest-openldap/java/org/springframework/ldap/control/LdapTemplateSortedSearchITest.java b/core/src/itest-openldap/java/org/springframework/ldap/control/LdapTemplateSortedSearchITest.java
index c90b87a7..d84680b4 100644
--- a/core/src/itest-openldap/java/org/springframework/ldap/control/LdapTemplateSortedSearchITest.java
+++ b/core/src/itest-openldap/java/org/springframework/ldap/control/LdapTemplateSortedSearchITest.java
@@ -1,143 +1,143 @@
-/*
- * Copyright 2005-2016 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
- *
- * https://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.control;
-
-import java.util.List;
-
-import javax.naming.Name;
-import javax.naming.NamingEnumeration;
-import javax.naming.NamingException;
-import javax.naming.directory.Attributes;
-import javax.naming.directory.DirContext;
-import javax.naming.directory.SearchControls;
-
-import org.springframework.ldap.Person;
-import org.springframework.ldap.core.AttributesMapper;
-import org.springframework.ldap.core.AttributesMapperCallbackHandler;
-import org.springframework.ldap.core.CollectingNameClassPairCallbackHandler;
-import org.springframework.ldap.core.DistinguishedName;
-import org.springframework.ldap.core.LdapTemplate;
-import org.springframework.ldap.core.SearchExecutor;
-import org.springframework.test.AbstractDependencyInjectionSpringContextTests;
-
-/**
- * Tests the still experimental sorted search result capability of LdapTemplate.
- *
- * @author Ulrik Sandberg
- */
-public class LdapTemplateSortedSearchITest extends
- AbstractDependencyInjectionSpringContextTests {
-
- private static final Name BASE = DistinguishedName.EMPTY_PATH;
-
- private static final String FILTER_STRING = "(&(objectclass=ikeaperson)(cn=gor*))";
-
- private LdapTemplate tested;
-
- private CollectingNameClassPairCallbackHandler callbackHandler;
-
- private SearchControls searchControls;
-
- protected String[] getConfigLocations() {
- return new String[] { "/conf/ldapTemplateTestContext-openldap.xml" };
- }
-
- protected void onSetUp() throws Exception {
- super.onSetUp();
- PersonAttributesMapper mapper = new PersonAttributesMapper();
- callbackHandler = new AttributesMapperCallbackHandler(mapper);
- searchControls = new SearchControls();
- searchControls.setSearchScope(SearchControls.SUBTREE_SCOPE);
- }
-
- protected void onTearDown() throws Exception {
- super.onTearDown();
- callbackHandler = null;
- tested = null;
- searchControls = null;
- }
-
- public void testSearch_SortControl() {
- SearchExecutor searchExecutor = new SearchExecutor() {
- public NamingEnumeration executeSearch(DirContext ctx)
- throws NamingException {
- return ctx.search(BASE, FILTER_STRING, searchControls);
- }
- };
- SortControlDirContextProcessor requestControl;
-
- // Prepare for first search
- requestControl = new SortControlDirContextProcessor("cn");
- tested.search(searchExecutor, callbackHandler, requestControl);
- int resultCode = requestControl.getResultCode();
- boolean sorted = requestControl.isSorted();
- assertThat("Search result should have been sorted: " + resultCode, sorted).isTrue();
- List list = callbackHandler.getList();
- assertSortedList(list);
- }
-
- public void testSearch_SortControl_ConvenienceMethod() {
- SortControlDirContextProcessor requestControl;
-
- // Prepare for first search
- requestControl = new SortControlDirContextProcessor("cn");
- tested.search(BASE, FILTER_STRING, searchControls, callbackHandler,
- requestControl);
- int resultCode = requestControl.getResultCode();
- boolean sorted = requestControl.isSorted();
- assertThat("Search result should have been sorted: " + resultCode, sorted).isTrue();
- List list = callbackHandler.getList();
- assertSortedList(list);
- }
-
- private void assertSortedList(List list) {
- Person person;
- assertThat(list).hasSize(6);
- person = (Person) list.get(0);
- assertThat(person.getFullname()).isEqualTo("Goran Milenkovic");
- person = (Person) list.get(1);
- assertThat(person.getFullname()).isEqualTo("Goran Sundberg");
- person = (Person) list.get(2);
- assertThat(person.getFullname()).isEqualTo("Goran Westerberg");
- person = (Person) list.get(3);
- assertThat(person.getFullname()).isEqualTo("Gorana Milicevic");
- person = (Person) list.get(4);
- assertThat(person.getFullname()).isEqualTo("Gordana Canic");
- person = (Person) list.get(5);
- assertThat(person.getFullname()).isEqualTo("Gordana Russ");
- }
-
- public void setTested(LdapTemplate tested) {
- this.tested = tested;
- }
-
- private class PersonAttributesMapper implements AttributesMapper {
-
- /**
- * Maps the given attributes into a {@link Person} object.
- *
- * @see org.springframework.ldap.core.AttributesMapper#mapFromAttributes(javax.naming.directory.Attributes)
- */
- public Object mapFromAttributes(Attributes attributes)
- throws NamingException {
- Person person = new Person();
- person.setFullname((String) attributes.get("cn").get());
- person.setLastname((String) attributes.get("sn").get());
- person.setDescription((String) attributes.get("givenName").get());
- return person;
- }
- }
-}
+/*
+ * Copyright 2005-2016 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
+ *
+ * https://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.control;
+
+import java.util.List;
+
+import javax.naming.Name;
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.DirContext;
+import javax.naming.directory.SearchControls;
+
+import org.springframework.ldap.Person;
+import org.springframework.ldap.core.AttributesMapper;
+import org.springframework.ldap.core.AttributesMapperCallbackHandler;
+import org.springframework.ldap.core.CollectingNameClassPairCallbackHandler;
+import org.springframework.ldap.core.DistinguishedName;
+import org.springframework.ldap.core.LdapTemplate;
+import org.springframework.ldap.core.SearchExecutor;
+import org.springframework.test.AbstractDependencyInjectionSpringContextTests;
+
+/**
+ * Tests the still experimental sorted search result capability of LdapTemplate.
+ *
+ * @author Ulrik Sandberg
+ */
+public class LdapTemplateSortedSearchITest extends
+ AbstractDependencyInjectionSpringContextTests {
+
+ private static final Name BASE = DistinguishedName.EMPTY_PATH;
+
+ private static final String FILTER_STRING = "(&(objectclass=ikeaperson)(cn=gor*))";
+
+ private LdapTemplate tested;
+
+ private CollectingNameClassPairCallbackHandler callbackHandler;
+
+ private SearchControls searchControls;
+
+ protected String[] getConfigLocations() {
+ return new String[] { "/conf/ldapTemplateTestContext-openldap.xml" };
+ }
+
+ protected void onSetUp() throws Exception {
+ super.onSetUp();
+ PersonAttributesMapper mapper = new PersonAttributesMapper();
+ callbackHandler = new AttributesMapperCallbackHandler(mapper);
+ searchControls = new SearchControls();
+ searchControls.setSearchScope(SearchControls.SUBTREE_SCOPE);
+ }
+
+ protected void onTearDown() throws Exception {
+ super.onTearDown();
+ callbackHandler = null;
+ tested = null;
+ searchControls = null;
+ }
+
+ public void testSearch_SortControl() {
+ SearchExecutor searchExecutor = new SearchExecutor() {
+ public NamingEnumeration executeSearch(DirContext ctx)
+ throws NamingException {
+ return ctx.search(BASE, FILTER_STRING, searchControls);
+ }
+ };
+ SortControlDirContextProcessor requestControl;
+
+ // Prepare for first search
+ requestControl = new SortControlDirContextProcessor("cn");
+ tested.search(searchExecutor, callbackHandler, requestControl);
+ int resultCode = requestControl.getResultCode();
+ boolean sorted = requestControl.isSorted();
+ assertThat("Search result should have been sorted: " + resultCode, sorted).isTrue();
+ List list = callbackHandler.getList();
+ assertSortedList(list);
+ }
+
+ public void testSearch_SortControl_ConvenienceMethod() {
+ SortControlDirContextProcessor requestControl;
+
+ // Prepare for first search
+ requestControl = new SortControlDirContextProcessor("cn");
+ tested.search(BASE, FILTER_STRING, searchControls, callbackHandler,
+ requestControl);
+ int resultCode = requestControl.getResultCode();
+ boolean sorted = requestControl.isSorted();
+ assertThat("Search result should have been sorted: " + resultCode, sorted).isTrue();
+ List list = callbackHandler.getList();
+ assertSortedList(list);
+ }
+
+ private void assertSortedList(List list) {
+ Person person;
+ assertThat(list).hasSize(6);
+ person = (Person) list.get(0);
+ assertThat(person.getFullname()).isEqualTo("Goran Milenkovic");
+ person = (Person) list.get(1);
+ assertThat(person.getFullname()).isEqualTo("Goran Sundberg");
+ person = (Person) list.get(2);
+ assertThat(person.getFullname()).isEqualTo("Goran Westerberg");
+ person = (Person) list.get(3);
+ assertThat(person.getFullname()).isEqualTo("Gorana Milicevic");
+ person = (Person) list.get(4);
+ assertThat(person.getFullname()).isEqualTo("Gordana Canic");
+ person = (Person) list.get(5);
+ assertThat(person.getFullname()).isEqualTo("Gordana Russ");
+ }
+
+ public void setTested(LdapTemplate tested) {
+ this.tested = tested;
+ }
+
+ private class PersonAttributesMapper implements AttributesMapper {
+
+ /**
+ * Maps the given attributes into a {@link Person} object.
+ *
+ * @see org.springframework.ldap.core.AttributesMapper#mapFromAttributes(javax.naming.directory.Attributes)
+ */
+ public Object mapFromAttributes(Attributes attributes)
+ throws NamingException {
+ Person person = new Person();
+ person.setFullname((String) attributes.get("cn").get());
+ person.setLastname((String) attributes.get("sn").get());
+ person.setDescription((String) attributes.get("givenName").get());
+ return person;
+ }
+ }
+}
diff --git a/core/src/main/java/org/springframework/ldap/AttributeInUseException.java b/core/src/main/java/org/springframework/ldap/AttributeInUseException.java
index 62929877..418f1d0f 100644
--- a/core/src/main/java/org/springframework/ldap/AttributeInUseException.java
+++ b/core/src/main/java/org/springframework/ldap/AttributeInUseException.java
@@ -1,32 +1,32 @@
-/*
- * Copyright 2005-2010 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
- *
- * https://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;
-
-/**
- * Runtime exception mirroring the JNDI AttributeInUseException.
- *
- * @author Ulrik Sandberg
- * @since 1.2
- * @see javax.naming.directory.AttributeInUseException
- */
-public class AttributeInUseException extends NamingException {
-
- public AttributeInUseException(
- javax.naming.directory.AttributeInUseException cause) {
- super(cause);
- }
-}
+/*
+ * Copyright 2005-2010 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
+ *
+ * https://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;
+
+/**
+ * Runtime exception mirroring the JNDI AttributeInUseException.
+ *
+ * @author Ulrik Sandberg
+ * @since 1.2
+ * @see javax.naming.directory.AttributeInUseException
+ */
+public class AttributeInUseException extends NamingException {
+
+ public AttributeInUseException(
+ javax.naming.directory.AttributeInUseException cause) {
+ super(cause);
+ }
+}
diff --git a/core/src/main/java/org/springframework/ldap/AttributeModificationException.java b/core/src/main/java/org/springframework/ldap/AttributeModificationException.java
index 65b3b18b..3b74aaf2 100644
--- a/core/src/main/java/org/springframework/ldap/AttributeModificationException.java
+++ b/core/src/main/java/org/springframework/ldap/AttributeModificationException.java
@@ -1,32 +1,32 @@
-/*
- * Copyright 2005-2010 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
- *
- * https://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;
-
-/**
- * Runtime exception mirroring the JNDI AttributeModificationException.
- *
- * @author Ulrik Sandberg
- * @since 1.2
- * @see javax.naming.directory.AttributeModificationException
- */
-public class AttributeModificationException extends NamingException {
-
- public AttributeModificationException(
- javax.naming.directory.AttributeModificationException cause) {
- super(cause);
- }
-}
+/*
+ * Copyright 2005-2010 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
+ *
+ * https://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;
+
+/**
+ * Runtime exception mirroring the JNDI AttributeModificationException.
+ *
+ * @author Ulrik Sandberg
+ * @since 1.2
+ * @see javax.naming.directory.AttributeModificationException
+ */
+public class AttributeModificationException extends NamingException {
+
+ public AttributeModificationException(
+ javax.naming.directory.AttributeModificationException cause) {
+ super(cause);
+ }
+}
diff --git a/core/src/main/java/org/springframework/ldap/AuthenticationException.java b/core/src/main/java/org/springframework/ldap/AuthenticationException.java
index 0f0c392d..456120e8 100644
--- a/core/src/main/java/org/springframework/ldap/AuthenticationException.java
+++ b/core/src/main/java/org/springframework/ldap/AuthenticationException.java
@@ -1,35 +1,35 @@
-/*
- * Copyright 2005-2010 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
- *
- * https://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;
-
-/**
- * Runtime exception mirroring the JNDI AuthenticationException.
- *
- * @author Ulrik Sandberg
- * @since 1.2
- * @see javax.naming.AuthenticationException
- */
-public class AuthenticationException extends NamingSecurityException {
-
- public AuthenticationException(javax.naming.AuthenticationException cause) {
- super(cause);
- }
-
- public AuthenticationException() {
- this(null);
- }
-}
+/*
+ * Copyright 2005-2010 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
+ *
+ * https://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;
+
+/**
+ * Runtime exception mirroring the JNDI AuthenticationException.
+ *
+ * @author Ulrik Sandberg
+ * @since 1.2
+ * @see javax.naming.AuthenticationException
+ */
+public class AuthenticationException extends NamingSecurityException {
+
+ public AuthenticationException(javax.naming.AuthenticationException cause) {
+ super(cause);
+ }
+
+ public AuthenticationException() {
+ this(null);
+ }
+}
diff --git a/core/src/main/java/org/springframework/ldap/AuthenticationNotSupportedException.java b/core/src/main/java/org/springframework/ldap/AuthenticationNotSupportedException.java
index 7e47a35c..839acbc6 100644
--- a/core/src/main/java/org/springframework/ldap/AuthenticationNotSupportedException.java
+++ b/core/src/main/java/org/springframework/ldap/AuthenticationNotSupportedException.java
@@ -1,33 +1,33 @@
-/*
- * Copyright 2005-2010 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
- *
- * https://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;
-
-/**
- * Runtime exception mirroring the JNDI AuthenticationNotSupportedException.
- *
- * @author Ulrik Sandberg
- * @since 1.2
- * @see javax.naming.AuthenticationNotSupportedException
- */
-public class AuthenticationNotSupportedException extends
- NamingSecurityException {
-
- public AuthenticationNotSupportedException(
- javax.naming.AuthenticationNotSupportedException cause) {
- super(cause);
- }
-}
+/*
+ * Copyright 2005-2010 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
+ *
+ * https://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;
+
+/**
+ * Runtime exception mirroring the JNDI AuthenticationNotSupportedException.
+ *
+ * @author Ulrik Sandberg
+ * @since 1.2
+ * @see javax.naming.AuthenticationNotSupportedException
+ */
+public class AuthenticationNotSupportedException extends
+ NamingSecurityException {
+
+ public AuthenticationNotSupportedException(
+ javax.naming.AuthenticationNotSupportedException cause) {
+ super(cause);
+ }
+}
diff --git a/core/src/main/java/org/springframework/ldap/BadLdapGrammarException.java b/core/src/main/java/org/springframework/ldap/BadLdapGrammarException.java
index 2128039c..acbe79ce 100644
--- a/core/src/main/java/org/springframework/ldap/BadLdapGrammarException.java
+++ b/core/src/main/java/org/springframework/ldap/BadLdapGrammarException.java
@@ -1,36 +1,36 @@
-/*
- * Copyright 2005-2010 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
- *
- * https://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;
-
-/**
- * Thrown to indicate that an invalid value has been supplied to an LDAP
- * operation. This could be an invalid filter or dn.
- *
- * @author Mattias Hellborg Arthursson
- */
-public class BadLdapGrammarException extends NamingException {
-
- private static final long serialVersionUID = 961612585331409470L;
-
- public BadLdapGrammarException(String message) {
- super(message);
- }
-
- public BadLdapGrammarException(String message, Throwable cause) {
- super(message, cause);
- }
-}
+/*
+ * Copyright 2005-2010 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
+ *
+ * https://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;
+
+/**
+ * Thrown to indicate that an invalid value has been supplied to an LDAP
+ * operation. This could be an invalid filter or dn.
+ *
+ * @author Mattias Hellborg Arthursson
+ */
+public class BadLdapGrammarException extends NamingException {
+
+ private static final long serialVersionUID = 961612585331409470L;
+
+ public BadLdapGrammarException(String message) {
+ super(message);
+ }
+
+ public BadLdapGrammarException(String message, Throwable cause) {
+ super(message, cause);
+ }
+}
diff --git a/core/src/main/java/org/springframework/ldap/CannotProceedException.java b/core/src/main/java/org/springframework/ldap/CannotProceedException.java
index 17e6561e..68c04a15 100644
--- a/core/src/main/java/org/springframework/ldap/CannotProceedException.java
+++ b/core/src/main/java/org/springframework/ldap/CannotProceedException.java
@@ -1,31 +1,31 @@
-/*
- * Copyright 2005-2010 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
- *
- * https://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;
-
-/**
- * Runtime exception mirroring the JNDI CannotProceedException.
- *
- * @author Ulrik Sandberg
- * @since 1.2
- * @see javax.naming.CannotProceedException
- */
-public class CannotProceedException extends NamingException {
-
- public CannotProceedException(javax.naming.CannotProceedException cause) {
- super(cause);
- }
-}
+/*
+ * Copyright 2005-2010 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
+ *
+ * https://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;
+
+/**
+ * Runtime exception mirroring the JNDI CannotProceedException.
+ *
+ * @author Ulrik Sandberg
+ * @since 1.2
+ * @see javax.naming.CannotProceedException
+ */
+public class CannotProceedException extends NamingException {
+
+ public CannotProceedException(javax.naming.CannotProceedException cause) {
+ super(cause);
+ }
+}
diff --git a/core/src/main/java/org/springframework/ldap/CommunicationException.java b/core/src/main/java/org/springframework/ldap/CommunicationException.java
index f85e8779..ee1348d3 100644
--- a/core/src/main/java/org/springframework/ldap/CommunicationException.java
+++ b/core/src/main/java/org/springframework/ldap/CommunicationException.java
@@ -1,31 +1,31 @@
-/*
- * Copyright 2005-2010 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
- *
- * https://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;
-
-/**
- * Runtime exception mirroring the JNDI CommunicationException.
- *
- * @author Ulrik Sandberg
- * @since 1.2
- * @see javax.naming.CommunicationException
- */
-public class CommunicationException extends NamingException {
-
- public CommunicationException(javax.naming.CommunicationException cause) {
- super(cause);
- }
-}
+/*
+ * Copyright 2005-2010 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
+ *
+ * https://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;
+
+/**
+ * Runtime exception mirroring the JNDI CommunicationException.
+ *
+ * @author Ulrik Sandberg
+ * @since 1.2
+ * @see javax.naming.CommunicationException
+ */
+public class CommunicationException extends NamingException {
+
+ public CommunicationException(javax.naming.CommunicationException cause) {
+ super(cause);
+ }
+}
diff --git a/core/src/main/java/org/springframework/ldap/ConfigurationException.java b/core/src/main/java/org/springframework/ldap/ConfigurationException.java
index e561d6cd..8fb33bd1 100644
--- a/core/src/main/java/org/springframework/ldap/ConfigurationException.java
+++ b/core/src/main/java/org/springframework/ldap/ConfigurationException.java
@@ -1,31 +1,31 @@
-/*
- * Copyright 2005-2010 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
- *
- * https://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;
-
-/**
- * Runtime exception mirroring the JNDI ConfigurationException.
- *
- * @author Ulrik Sandberg
- * @since 1.2
- * @see javax.naming.ConfigurationException
- */
-public class ConfigurationException extends NamingException {
-
- public ConfigurationException(javax.naming.ConfigurationException cause) {
- super(cause);
- }
-}
+/*
+ * Copyright 2005-2010 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
+ *
+ * https://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;
+
+/**
+ * Runtime exception mirroring the JNDI ConfigurationException.
+ *
+ * @author Ulrik Sandberg
+ * @since 1.2
+ * @see javax.naming.ConfigurationException
+ */
+public class ConfigurationException extends NamingException {
+
+ public ConfigurationException(javax.naming.ConfigurationException cause) {
+ super(cause);
+ }
+}
diff --git a/core/src/main/java/org/springframework/ldap/ContextNotEmptyException.java b/core/src/main/java/org/springframework/ldap/ContextNotEmptyException.java
index e3d60a68..5fddd0b5 100644
--- a/core/src/main/java/org/springframework/ldap/ContextNotEmptyException.java
+++ b/core/src/main/java/org/springframework/ldap/ContextNotEmptyException.java
@@ -1,31 +1,31 @@
-/*
- * Copyright 2005-2010 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
- *
- * https://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;
-
-/**
- * Runtime exception mirroring the JNDI ContextNotEmptyException.
- *
- * @author Ulrik Sandberg
- * @since 1.2
- * @see javax.naming.ContextNotEmptyException
- */
-public class ContextNotEmptyException extends NamingException {
-
- public ContextNotEmptyException(javax.naming.ContextNotEmptyException cause) {
- super(cause);
- }
-}
+/*
+ * Copyright 2005-2010 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
+ *
+ * https://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;
+
+/**
+ * Runtime exception mirroring the JNDI ContextNotEmptyException.
+ *
+ * @author Ulrik Sandberg
+ * @since 1.2
+ * @see javax.naming.ContextNotEmptyException
+ */
+public class ContextNotEmptyException extends NamingException {
+
+ public ContextNotEmptyException(javax.naming.ContextNotEmptyException cause) {
+ super(cause);
+ }
+}
diff --git a/core/src/main/java/org/springframework/ldap/InsufficientResourcesException.java b/core/src/main/java/org/springframework/ldap/InsufficientResourcesException.java
index 8a5a4f55..656f1325 100644
--- a/core/src/main/java/org/springframework/ldap/InsufficientResourcesException.java
+++ b/core/src/main/java/org/springframework/ldap/InsufficientResourcesException.java
@@ -1,32 +1,32 @@
-/*
- * Copyright 2005-2010 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
- *
- * https://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;
-
-/**
- * Runtime exception mirroring the JNDI InsufficientResourcesException.
- *
- * @author Ulrik Sandberg
- * @since 1.2
- * @see javax.naming.InsufficientResourcesException
- */
-public class InsufficientResourcesException extends NamingException {
-
- public InsufficientResourcesException(
- javax.naming.InsufficientResourcesException cause) {
- super(cause);
- }
-}
+/*
+ * Copyright 2005-2010 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
+ *
+ * https://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;
+
+/**
+ * Runtime exception mirroring the JNDI InsufficientResourcesException.
+ *
+ * @author Ulrik Sandberg
+ * @since 1.2
+ * @see javax.naming.InsufficientResourcesException
+ */
+public class InsufficientResourcesException extends NamingException {
+
+ public InsufficientResourcesException(
+ javax.naming.InsufficientResourcesException cause) {
+ super(cause);
+ }
+}
diff --git a/core/src/main/java/org/springframework/ldap/InterruptedNamingException.java b/core/src/main/java/org/springframework/ldap/InterruptedNamingException.java
index 6d579382..dc3a0d51 100644
--- a/core/src/main/java/org/springframework/ldap/InterruptedNamingException.java
+++ b/core/src/main/java/org/springframework/ldap/InterruptedNamingException.java
@@ -1,32 +1,32 @@
-/*
- * Copyright 2005-2010 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
- *
- * https://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;
-
-/**
- * Runtime exception mirroring the JNDI InterruptedNamingException.
- *
- * @author Ulrik Sandberg
- * @since 1.2
- * @see javax.naming.InterruptedNamingException
- */
-public class InterruptedNamingException extends NamingException {
-
- public InterruptedNamingException(
- javax.naming.InterruptedNamingException cause) {
- super(cause);
- }
-}
+/*
+ * Copyright 2005-2010 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
+ *
+ * https://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;
+
+/**
+ * Runtime exception mirroring the JNDI InterruptedNamingException.
+ *
+ * @author Ulrik Sandberg
+ * @since 1.2
+ * @see javax.naming.InterruptedNamingException
+ */
+public class InterruptedNamingException extends NamingException {
+
+ public InterruptedNamingException(
+ javax.naming.InterruptedNamingException cause) {
+ super(cause);
+ }
+}
diff --git a/core/src/main/java/org/springframework/ldap/InvalidAttributeIdentifierException.java b/core/src/main/java/org/springframework/ldap/InvalidAttributeIdentifierException.java
index ad489e18..927d438e 100644
--- a/core/src/main/java/org/springframework/ldap/InvalidAttributeIdentifierException.java
+++ b/core/src/main/java/org/springframework/ldap/InvalidAttributeIdentifierException.java
@@ -1,32 +1,32 @@
-/*
- * Copyright 2005-2010 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
- *
- * https://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;
-
-/**
- * Runtime exception mirroring the JNDI InvalidAttributeIdentifierException.
- *
- * @author Ulrik Sandberg
- * @since 1.2
- * @see javax.naming.directory.InvalidAttributeIdentifierException
- */
-public class InvalidAttributeIdentifierException extends NamingException {
-
- public InvalidAttributeIdentifierException(
- javax.naming.directory.InvalidAttributeIdentifierException cause) {
- super(cause);
- }
-}
+/*
+ * Copyright 2005-2010 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
+ *
+ * https://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;
+
+/**
+ * Runtime exception mirroring the JNDI InvalidAttributeIdentifierException.
+ *
+ * @author Ulrik Sandberg
+ * @since 1.2
+ * @see javax.naming.directory.InvalidAttributeIdentifierException
+ */
+public class InvalidAttributeIdentifierException extends NamingException {
+
+ public InvalidAttributeIdentifierException(
+ javax.naming.directory.InvalidAttributeIdentifierException cause) {
+ super(cause);
+ }
+}
diff --git a/core/src/main/java/org/springframework/ldap/InvalidAttributeValueException.java b/core/src/main/java/org/springframework/ldap/InvalidAttributeValueException.java
index 8483b42b..fe6c1f99 100644
--- a/core/src/main/java/org/springframework/ldap/InvalidAttributeValueException.java
+++ b/core/src/main/java/org/springframework/ldap/InvalidAttributeValueException.java
@@ -1,32 +1,32 @@
-/*
- * Copyright 2005-2010 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
- *
- * https://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;
-
-/**
- * Runtime exception mirroring the JNDI InvalidAttributeValueException.
- *
- * @author Ulrik Sandberg
- * @since 1.2
- * @see javax.naming.directory.InvalidAttributeValueException
- */
-public class InvalidAttributeValueException extends NamingException {
-
- public InvalidAttributeValueException(
- javax.naming.directory.InvalidAttributeValueException cause) {
- super(cause);
- }
-}
+/*
+ * Copyright 2005-2010 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
+ *
+ * https://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;
+
+/**
+ * Runtime exception mirroring the JNDI InvalidAttributeValueException.
+ *
+ * @author Ulrik Sandberg
+ * @since 1.2
+ * @see javax.naming.directory.InvalidAttributeValueException
+ */
+public class InvalidAttributeValueException extends NamingException {
+
+ public InvalidAttributeValueException(
+ javax.naming.directory.InvalidAttributeValueException cause) {
+ super(cause);
+ }
+}
diff --git a/core/src/main/java/org/springframework/ldap/InvalidAttributesException.java b/core/src/main/java/org/springframework/ldap/InvalidAttributesException.java
index 9f2dd12d..92a120cd 100644
--- a/core/src/main/java/org/springframework/ldap/InvalidAttributesException.java
+++ b/core/src/main/java/org/springframework/ldap/InvalidAttributesException.java
@@ -1,32 +1,32 @@
-/*
- * Copyright 2005-2010 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
- *
- * https://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;
-
-/**
- * Runtime exception mirroring the JNDI InvalidAttributesException.
- *
- * @author Ulrik Sandberg
- * @since 1.2
- * @see javax.naming.directory.InvalidAttributesException
- */
-public class InvalidAttributesException extends NamingException {
-
- public InvalidAttributesException(
- javax.naming.directory.InvalidAttributesException cause) {
- super(cause);
- }
-}
+/*
+ * Copyright 2005-2010 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
+ *
+ * https://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;
+
+/**
+ * Runtime exception mirroring the JNDI InvalidAttributesException.
+ *
+ * @author Ulrik Sandberg
+ * @since 1.2
+ * @see javax.naming.directory.InvalidAttributesException
+ */
+public class InvalidAttributesException extends NamingException {
+
+ public InvalidAttributesException(
+ javax.naming.directory.InvalidAttributesException cause) {
+ super(cause);
+ }
+}
diff --git a/core/src/main/java/org/springframework/ldap/InvalidNameException.java b/core/src/main/java/org/springframework/ldap/InvalidNameException.java
index 71e4c93f..48dfb57b 100644
--- a/core/src/main/java/org/springframework/ldap/InvalidNameException.java
+++ b/core/src/main/java/org/springframework/ldap/InvalidNameException.java
@@ -1,31 +1,31 @@
-/*
- * Copyright 2005-2010 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
- *
- * https://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;
-
-/**
- * Runtime exception mirroring the JNDI InvalidNameException.
- *
- * @author Ulrik Sandberg
- * @since 1.2
- * @see javax.naming.InvalidNameException
- */
-public class InvalidNameException extends NamingException {
-
- public InvalidNameException(javax.naming.InvalidNameException cause) {
- super(cause);
- }
-}
+/*
+ * Copyright 2005-2010 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
+ *
+ * https://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;
+
+/**
+ * Runtime exception mirroring the JNDI InvalidNameException.
+ *
+ * @author Ulrik Sandberg
+ * @since 1.2
+ * @see javax.naming.InvalidNameException
+ */
+public class InvalidNameException extends NamingException {
+
+ public InvalidNameException(javax.naming.InvalidNameException cause) {
+ super(cause);
+ }
+}
diff --git a/core/src/main/java/org/springframework/ldap/InvalidSearchControlsException.java b/core/src/main/java/org/springframework/ldap/InvalidSearchControlsException.java
index 8e554f39..0cb3c206 100644
--- a/core/src/main/java/org/springframework/ldap/InvalidSearchControlsException.java
+++ b/core/src/main/java/org/springframework/ldap/InvalidSearchControlsException.java
@@ -1,32 +1,32 @@
-/*
- * Copyright 2005-2010 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
- *
- * https://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;
-
-/**
- * Runtime exception mirroring the JNDI InvalidSearchControlsException.
- *
- * @author Ulrik Sandberg
- * @since 1.2
- * @see javax.naming.directory.InvalidSearchControlsException
- */
-public class InvalidSearchControlsException extends NamingException {
-
- public InvalidSearchControlsException(
- javax.naming.directory.InvalidSearchControlsException cause) {
- super(cause);
- }
-}
+/*
+ * Copyright 2005-2010 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
+ *
+ * https://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;
+
+/**
+ * Runtime exception mirroring the JNDI InvalidSearchControlsException.
+ *
+ * @author Ulrik Sandberg
+ * @since 1.2
+ * @see javax.naming.directory.InvalidSearchControlsException
+ */
+public class InvalidSearchControlsException extends NamingException {
+
+ public InvalidSearchControlsException(
+ javax.naming.directory.InvalidSearchControlsException cause) {
+ super(cause);
+ }
+}
diff --git a/core/src/main/java/org/springframework/ldap/InvalidSearchFilterException.java b/core/src/main/java/org/springframework/ldap/InvalidSearchFilterException.java
index 89b3077a..71da99ec 100644
--- a/core/src/main/java/org/springframework/ldap/InvalidSearchFilterException.java
+++ b/core/src/main/java/org/springframework/ldap/InvalidSearchFilterException.java
@@ -1,32 +1,32 @@
-/*
- * Copyright 2005-2010 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
- *
- * https://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;
-
-/**
- * Runtime exception mirroring the JNDI InvalidSearchFilterException.
- *
- * @author Ulrik Sandberg
- * @since 1.2
- * @see javax.naming.directory.InvalidSearchFilterException
- */
-public class InvalidSearchFilterException extends NamingException {
-
- public InvalidSearchFilterException(
- javax.naming.directory.InvalidSearchFilterException cause) {
- super(cause);
- }
-}
+/*
+ * Copyright 2005-2010 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
+ *
+ * https://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;
+
+/**
+ * Runtime exception mirroring the JNDI InvalidSearchFilterException.
+ *
+ * @author Ulrik Sandberg
+ * @since 1.2
+ * @see javax.naming.directory.InvalidSearchFilterException
+ */
+public class InvalidSearchFilterException extends NamingException {
+
+ public InvalidSearchFilterException(
+ javax.naming.directory.InvalidSearchFilterException cause) {
+ super(cause);
+ }
+}
diff --git a/core/src/main/java/org/springframework/ldap/LdapReferralException.java b/core/src/main/java/org/springframework/ldap/LdapReferralException.java
index ee675a4f..2bd876d1 100644
--- a/core/src/main/java/org/springframework/ldap/LdapReferralException.java
+++ b/core/src/main/java/org/springframework/ldap/LdapReferralException.java
@@ -1,35 +1,35 @@
-/*
- * Copyright 2005-2010 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
- *
- * https://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;
-
-/**
- * Runtime exception mirroring the JNDI LdapReferralException.
- *
- * This class is not abstract. We need to be able to instantiate it, should the
- * caught exception be a provider-specific subclass of
- * {@link javax.naming.ldap.LdapReferralException}.
- *
- * @author Ulrik Sandberg
- * @since 1.2
- * @see javax.naming.ldap.LdapReferralException
- */
-public class LdapReferralException extends ReferralException {
-
- public LdapReferralException(javax.naming.ldap.LdapReferralException cause) {
- super(cause);
- }
-}
+/*
+ * Copyright 2005-2010 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
+ *
+ * https://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;
+
+/**
+ * Runtime exception mirroring the JNDI LdapReferralException.
+ *
+ * This class is not abstract. We need to be able to instantiate it, should the
+ * caught exception be a provider-specific subclass of
+ * {@link javax.naming.ldap.LdapReferralException}.
+ *
+ * @author Ulrik Sandberg
+ * @since 1.2
+ * @see javax.naming.ldap.LdapReferralException
+ */
+public class LdapReferralException extends ReferralException {
+
+ public LdapReferralException(javax.naming.ldap.LdapReferralException cause) {
+ super(cause);
+ }
+}
diff --git a/core/src/main/java/org/springframework/ldap/LimitExceededException.java b/core/src/main/java/org/springframework/ldap/LimitExceededException.java
index 22d5c3f2..6e16646d 100644
--- a/core/src/main/java/org/springframework/ldap/LimitExceededException.java
+++ b/core/src/main/java/org/springframework/ldap/LimitExceededException.java
@@ -1,31 +1,31 @@
-/*
- * Copyright 2005-2010 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
- *
- * https://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;
-
-/**
- * Runtime exception mirroring the JNDI LimitExceededException.
- *
- * @author Ulrik Sandberg
- * @since 1.2
- * @see javax.naming.LimitExceededException
- */
-public class LimitExceededException extends NamingException {
-
- public LimitExceededException(javax.naming.LimitExceededException cause) {
- super(cause);
- }
-}
+/*
+ * Copyright 2005-2010 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
+ *
+ * https://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;
+
+/**
+ * Runtime exception mirroring the JNDI LimitExceededException.
+ *
+ * @author Ulrik Sandberg
+ * @since 1.2
+ * @see javax.naming.LimitExceededException
+ */
+public class LimitExceededException extends NamingException {
+
+ public LimitExceededException(javax.naming.LimitExceededException cause) {
+ super(cause);
+ }
+}
diff --git a/core/src/main/java/org/springframework/ldap/LinkException.java b/core/src/main/java/org/springframework/ldap/LinkException.java
index a58747d9..b8a19d0d 100644
--- a/core/src/main/java/org/springframework/ldap/LinkException.java
+++ b/core/src/main/java/org/springframework/ldap/LinkException.java
@@ -1,31 +1,31 @@
-/*
- * Copyright 2005-2010 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
- *
- * https://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;
-
-/**
- * Runtime exception mirroring the JNDI LinkException.
- *
- * @author Ulrik Sandberg
- * @since 1.2
- * @see javax.naming.LinkException
- */
-public class LinkException extends NamingException {
-
- public LinkException(javax.naming.LinkException cause) {
- super(cause);
- }
-}
+/*
+ * Copyright 2005-2010 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
+ *
+ * https://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;
+
+/**
+ * Runtime exception mirroring the JNDI LinkException.
+ *
+ * @author Ulrik Sandberg
+ * @since 1.2
+ * @see javax.naming.LinkException
+ */
+public class LinkException extends NamingException {
+
+ public LinkException(javax.naming.LinkException cause) {
+ super(cause);
+ }
+}
diff --git a/core/src/main/java/org/springframework/ldap/LinkLoopException.java b/core/src/main/java/org/springframework/ldap/LinkLoopException.java
index 14426d11..76ea09a3 100644
--- a/core/src/main/java/org/springframework/ldap/LinkLoopException.java
+++ b/core/src/main/java/org/springframework/ldap/LinkLoopException.java
@@ -1,31 +1,31 @@
-/*
- * Copyright 2005-2010 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
- *
- * https://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;
-
-/**
- * Runtime exception mirroring the JNDI LinkLoopException.
- *
- * @author Ulrik Sandberg
- * @since 1.2
- * @see javax.naming.LinkLoopException
- */
-public class LinkLoopException extends LinkException {
-
- public LinkLoopException(javax.naming.LinkLoopException cause) {
- super(cause);
- }
-}
+/*
+ * Copyright 2005-2010 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
+ *
+ * https://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;
+
+/**
+ * Runtime exception mirroring the JNDI LinkLoopException.
+ *
+ * @author Ulrik Sandberg
+ * @since 1.2
+ * @see javax.naming.LinkLoopException
+ */
+public class LinkLoopException extends LinkException {
+
+ public LinkLoopException(javax.naming.LinkLoopException cause) {
+ super(cause);
+ }
+}
diff --git a/core/src/main/java/org/springframework/ldap/MalformedLinkException.java b/core/src/main/java/org/springframework/ldap/MalformedLinkException.java
index 7a0e6dcd..a0d5e427 100644
--- a/core/src/main/java/org/springframework/ldap/MalformedLinkException.java
+++ b/core/src/main/java/org/springframework/ldap/MalformedLinkException.java
@@ -1,31 +1,31 @@
-/*
- * Copyright 2005-2010 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
- *
- * https://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;
-
-/**
- * Runtime exception mirroring the JNDI MalformedLinkException.
- *
- * @author Ulrik Sandberg
- * @since 1.2
- * @see javax.naming.MalformedLinkException
- */
-public class MalformedLinkException extends LinkException {
-
- public MalformedLinkException(javax.naming.MalformedLinkException cause) {
- super(cause);
- }
-}
+/*
+ * Copyright 2005-2010 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
+ *
+ * https://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;
+
+/**
+ * Runtime exception mirroring the JNDI MalformedLinkException.
+ *
+ * @author Ulrik Sandberg
+ * @since 1.2
+ * @see javax.naming.MalformedLinkException
+ */
+public class MalformedLinkException extends LinkException {
+
+ public MalformedLinkException(javax.naming.MalformedLinkException cause) {
+ super(cause);
+ }
+}
diff --git a/core/src/main/java/org/springframework/ldap/NameAlreadyBoundException.java b/core/src/main/java/org/springframework/ldap/NameAlreadyBoundException.java
index 35c93431..ffd7cc0d 100644
--- a/core/src/main/java/org/springframework/ldap/NameAlreadyBoundException.java
+++ b/core/src/main/java/org/springframework/ldap/NameAlreadyBoundException.java
@@ -1,32 +1,32 @@
-/*
- * Copyright 2005-2010 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
- *
- * https://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;
-
-/**
- * Runtime exception mirroring the JNDI NameAlreadyBoundException.
- *
- * @author Ulrik Sandberg
- * @since 1.2
- * @see javax.naming.NameAlreadyBoundException
- */
-public class NameAlreadyBoundException extends NamingException {
-
- public NameAlreadyBoundException(
- javax.naming.NameAlreadyBoundException cause) {
- super(cause);
- }
-}
+/*
+ * Copyright 2005-2010 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
+ *
+ * https://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;
+
+/**
+ * Runtime exception mirroring the JNDI NameAlreadyBoundException.
+ *
+ * @author Ulrik Sandberg
+ * @since 1.2
+ * @see javax.naming.NameAlreadyBoundException
+ */
+public class NameAlreadyBoundException extends NamingException {
+
+ public NameAlreadyBoundException(
+ javax.naming.NameAlreadyBoundException cause) {
+ super(cause);
+ }
+}
diff --git a/core/src/main/java/org/springframework/ldap/NameNotFoundException.java b/core/src/main/java/org/springframework/ldap/NameNotFoundException.java
index e56bb97d..78516293 100644
--- a/core/src/main/java/org/springframework/ldap/NameNotFoundException.java
+++ b/core/src/main/java/org/springframework/ldap/NameNotFoundException.java
@@ -1,35 +1,35 @@
-/*
- * Copyright 2005-2010 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
- *
- * https://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;
-
-/**
- * Runtime exception mirroring the JNDI NameNotFoundException.
- *
- * @author Ulrik Sandberg
- * @since 1.2
- * @see javax.naming.NameNotFoundException
- */
-public class NameNotFoundException extends NamingException {
-
- public NameNotFoundException(String msg) {
- super(msg);
- }
-
- public NameNotFoundException(javax.naming.NameNotFoundException cause) {
- super(cause);
- }
-}
+/*
+ * Copyright 2005-2010 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
+ *
+ * https://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;
+
+/**
+ * Runtime exception mirroring the JNDI NameNotFoundException.
+ *
+ * @author Ulrik Sandberg
+ * @since 1.2
+ * @see javax.naming.NameNotFoundException
+ */
+public class NameNotFoundException extends NamingException {
+
+ public NameNotFoundException(String msg) {
+ super(msg);
+ }
+
+ public NameNotFoundException(javax.naming.NameNotFoundException cause) {
+ super(cause);
+ }
+}
diff --git a/core/src/main/java/org/springframework/ldap/NamingException.java b/core/src/main/java/org/springframework/ldap/NamingException.java
index b76b2e0a..785dff19 100644
--- a/core/src/main/java/org/springframework/ldap/NamingException.java
+++ b/core/src/main/java/org/springframework/ldap/NamingException.java
@@ -1,186 +1,186 @@
-/*
- * Copyright 2005-2010 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
- *
- * https://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;
-
-import java.io.IOException;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-
-import javax.naming.Name;
-
-import org.springframework.core.NestedRuntimeException;
-
-/**
- * Base class for exception thrown by the framework whenever it encounters a
- * problem related to LDAP.
- *
- * @author Ulrik Sandberg
- * @since 1.2
- */
-public abstract class NamingException extends NestedRuntimeException {
-
- private Throwable cause;
-
- /**
- * Overrides {@link NestedRuntimeException#getCause()} since serialization
- * always tries to serialize the base class before the subclass. Our
- * cause may have a resolvedObj that is not
- * serializable. By storing the cause in this class, we get a chance at
- * temporarily nulling the cause before serialization, thus in effect making
- * the current instance serializable.
- */
- public Throwable getCause() {
- // Even if you cannot set the cause of this exception other than through
- // the constructor, we check for the cause being "this" here, as the cause
- // could still be set to "this" via reflection: for example, by a remoting
- // deserializer like Hessian's.
- return (this.cause == this ? null : this.cause);
- }
-
- /**
- * Constructor that takes a message.
- *
- * @param msg
- * the detail message
- */
- public NamingException(String msg) {
- super(msg);
- }
-
- /**
- * Constructor that allows a message and a root cause.
- *
- * @param msg
- * the detail message
- * @param cause
- * the cause of the exception. This argument is generally
- * expected to be a proper subclass of
- * {@link javax.naming.NamingException}.
- */
- public NamingException(String msg, Throwable cause) {
- super(msg);
- this.cause = cause;
- }
-
- /**
- * Constructor that allows a plain root cause, intended for subclasses
- * mirroring corresponding javax.naming exceptions.
- *
- * @param cause
- * the cause of the exception. This argument is generally
- * expected to be a proper subclass of
- * {@link javax.naming.NamingException}.
- */
- public NamingException(Throwable cause) {
- this(cause != null ? cause.getMessage() : null, cause);
- }
-
- /**
- * Convenience method to get the explanation associated with this exception,
- * if the root cause was an instance of {@link javax.naming.NamingException}.
- *
- * @return a detail string explaining more about this exception if the root
- * cause is an instance of javax.naming.NamingException, or
- * null if there is no detail message for this
- * exception
- */
- public String getExplanation() {
- if (getCause() instanceof javax.naming.NamingException) {
- return ((javax.naming.NamingException) getCause()).getExplanation();
- }
- return null;
- }
-
- /**
- * Convenience method to get the unresolved part of the name associated with
- * this exception, if the root cause was an instance of
- * {@link javax.naming.NamingException}.
- *
- * @return a composite name describing the part of the name that has not
- * been resolved if the root cause is an instance of
- * javax.naming.NamingException, or null if the
- * remaining name field has not been set
- */
- public Name getRemainingName() {
- if (getCause() instanceof javax.naming.NamingException) {
- return ((javax.naming.NamingException) getCause())
- .getRemainingName();
- }
- return null;
- }
-
- /**
- * Convenience method to get the leading portion of the resolved name
- * associated with this exception, if the root cause was an instance of
- * {@link javax.naming.NamingException}.
- *
- * @return a composite name describing the leading portion of the name
- * that was resolved successfully if the root cause is an instance
- * of javax.naming.NamingException, or null if the
- * resolved name field has not been set
- */
- public Name getResolvedName() {
- if (getCause() instanceof javax.naming.NamingException) {
- return ((javax.naming.NamingException) getCause())
- .getResolvedName();
- }
- return null;
- }
-
- /**
- * Convenience method to get the resolved object associated with this
- * exception, if the root cause was an instance of
- * {@link javax.naming.NamingException}.
- *
- * @return the object that was resolved so far if the root cause is an
- * instance of javax.naming.NamingException, or null
- * if the resolved object field has not been set
- */
- public Object getResolvedObj() {
- if (getCause() instanceof javax.naming.NamingException) {
- return ((javax.naming.NamingException) getCause()).getResolvedObj();
- }
- return null;
- }
-
- /**
- * Checks if the resolvedObj of the causing exception is
- * suspected to be non-serializable, and if so temporarily nulls it before
- * calling the default serialization mechanism.
- *
- * @param stream
- * the stream onto which this object is serialized
- * @throws IOException
- * if there is an error writing this object to the stream
- */
- private void writeObject(ObjectOutputStream stream) throws IOException {
- Object resolvedObj = getResolvedObj();
- boolean serializable = resolvedObj instanceof Serializable;
- if (resolvedObj != null && !serializable) {
- // the cause is of this type, since resolvedObj is not null
- javax.naming.NamingException namingException = (javax.naming.NamingException) getCause();
- namingException.setResolvedObj(null);
- try {
- stream.defaultWriteObject();
- } finally {
- namingException.setResolvedObj(resolvedObj);
- }
- } else {
- stream.defaultWriteObject();
- }
- }
-}
+/*
+ * Copyright 2005-2010 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
+ *
+ * https://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;
+
+import java.io.IOException;
+import java.io.ObjectOutputStream;
+import java.io.Serializable;
+
+import javax.naming.Name;
+
+import org.springframework.core.NestedRuntimeException;
+
+/**
+ * Base class for exception thrown by the framework whenever it encounters a
+ * problem related to LDAP.
+ *
+ * @author Ulrik Sandberg
+ * @since 1.2
+ */
+public abstract class NamingException extends NestedRuntimeException {
+
+ private Throwable cause;
+
+ /**
+ * Overrides {@link NestedRuntimeException#getCause()} since serialization
+ * always tries to serialize the base class before the subclass. Our
+ * cause may have a resolvedObj that is not
+ * serializable. By storing the cause in this class, we get a chance at
+ * temporarily nulling the cause before serialization, thus in effect making
+ * the current instance serializable.
+ */
+ public Throwable getCause() {
+ // Even if you cannot set the cause of this exception other than through
+ // the constructor, we check for the cause being "this" here, as the cause
+ // could still be set to "this" via reflection: for example, by a remoting
+ // deserializer like Hessian's.
+ return (this.cause == this ? null : this.cause);
+ }
+
+ /**
+ * Constructor that takes a message.
+ *
+ * @param msg
+ * the detail message
+ */
+ public NamingException(String msg) {
+ super(msg);
+ }
+
+ /**
+ * Constructor that allows a message and a root cause.
+ *
+ * @param msg
+ * the detail message
+ * @param cause
+ * the cause of the exception. This argument is generally
+ * expected to be a proper subclass of
+ * {@link javax.naming.NamingException}.
+ */
+ public NamingException(String msg, Throwable cause) {
+ super(msg);
+ this.cause = cause;
+ }
+
+ /**
+ * Constructor that allows a plain root cause, intended for subclasses
+ * mirroring corresponding javax.naming exceptions.
+ *
+ * @param cause
+ * the cause of the exception. This argument is generally
+ * expected to be a proper subclass of
+ * {@link javax.naming.NamingException}.
+ */
+ public NamingException(Throwable cause) {
+ this(cause != null ? cause.getMessage() : null, cause);
+ }
+
+ /**
+ * Convenience method to get the explanation associated with this exception,
+ * if the root cause was an instance of {@link javax.naming.NamingException}.
+ *
+ * @return a detail string explaining more about this exception if the root
+ * cause is an instance of javax.naming.NamingException, or
+ * null if there is no detail message for this
+ * exception
+ */
+ public String getExplanation() {
+ if (getCause() instanceof javax.naming.NamingException) {
+ return ((javax.naming.NamingException) getCause()).getExplanation();
+ }
+ return null;
+ }
+
+ /**
+ * Convenience method to get the unresolved part of the name associated with
+ * this exception, if the root cause was an instance of
+ * {@link javax.naming.NamingException}.
+ *
+ * @return a composite name describing the part of the name that has not
+ * been resolved if the root cause is an instance of
+ * javax.naming.NamingException, or null if the
+ * remaining name field has not been set
+ */
+ public Name getRemainingName() {
+ if (getCause() instanceof javax.naming.NamingException) {
+ return ((javax.naming.NamingException) getCause())
+ .getRemainingName();
+ }
+ return null;
+ }
+
+ /**
+ * Convenience method to get the leading portion of the resolved name
+ * associated with this exception, if the root cause was an instance of
+ * {@link javax.naming.NamingException}.
+ *
+ * @return a composite name describing the leading portion of the name
+ * that was resolved successfully if the root cause is an instance
+ * of javax.naming.NamingException, or null if the
+ * resolved name field has not been set
+ */
+ public Name getResolvedName() {
+ if (getCause() instanceof javax.naming.NamingException) {
+ return ((javax.naming.NamingException) getCause())
+ .getResolvedName();
+ }
+ return null;
+ }
+
+ /**
+ * Convenience method to get the resolved object associated with this
+ * exception, if the root cause was an instance of
+ * {@link javax.naming.NamingException}.
+ *
+ * @return the object that was resolved so far if the root cause is an
+ * instance of javax.naming.NamingException, or null
+ * if the resolved object field has not been set
+ */
+ public Object getResolvedObj() {
+ if (getCause() instanceof javax.naming.NamingException) {
+ return ((javax.naming.NamingException) getCause()).getResolvedObj();
+ }
+ return null;
+ }
+
+ /**
+ * Checks if the resolvedObj of the causing exception is
+ * suspected to be non-serializable, and if so temporarily nulls it before
+ * calling the default serialization mechanism.
+ *
+ * @param stream
+ * the stream onto which this object is serialized
+ * @throws IOException
+ * if there is an error writing this object to the stream
+ */
+ private void writeObject(ObjectOutputStream stream) throws IOException {
+ Object resolvedObj = getResolvedObj();
+ boolean serializable = resolvedObj instanceof Serializable;
+ if (resolvedObj != null && !serializable) {
+ // the cause is of this type, since resolvedObj is not null
+ javax.naming.NamingException namingException = (javax.naming.NamingException) getCause();
+ namingException.setResolvedObj(null);
+ try {
+ stream.defaultWriteObject();
+ } finally {
+ namingException.setResolvedObj(resolvedObj);
+ }
+ } else {
+ stream.defaultWriteObject();
+ }
+ }
+}
diff --git a/core/src/main/java/org/springframework/ldap/NamingSecurityException.java b/core/src/main/java/org/springframework/ldap/NamingSecurityException.java
index bf0ccbb5..e339be08 100644
--- a/core/src/main/java/org/springframework/ldap/NamingSecurityException.java
+++ b/core/src/main/java/org/springframework/ldap/NamingSecurityException.java
@@ -1,31 +1,31 @@
-/*
- * Copyright 2005-2010 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
- *
- * https://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;
-
-/**
- * Runtime exception mirroring the JNDI NamingSecurityException.
- *
- * @author Ulrik Sandberg
- * @since 1.2
- * @see javax.naming.NamingSecurityException
- */
-public class NamingSecurityException extends NamingException {
-
- public NamingSecurityException(javax.naming.NamingSecurityException cause) {
- super(cause);
- }
-}
+/*
+ * Copyright 2005-2010 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
+ *
+ * https://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;
+
+/**
+ * Runtime exception mirroring the JNDI NamingSecurityException.
+ *
+ * @author Ulrik Sandberg
+ * @since 1.2
+ * @see javax.naming.NamingSecurityException
+ */
+public class NamingSecurityException extends NamingException {
+
+ public NamingSecurityException(javax.naming.NamingSecurityException cause) {
+ super(cause);
+ }
+}
diff --git a/core/src/main/java/org/springframework/ldap/NoInitialContextException.java b/core/src/main/java/org/springframework/ldap/NoInitialContextException.java
index 254734eb..01538e85 100644
--- a/core/src/main/java/org/springframework/ldap/NoInitialContextException.java
+++ b/core/src/main/java/org/springframework/ldap/NoInitialContextException.java
@@ -1,32 +1,32 @@
-/*
- * Copyright 2005-2010 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
- *
- * https://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;
-
-/**
- * Runtime exception mirroring the JNDI NoInitialContextException.
- *
- * @author Ulrik Sandberg
- * @since 1.2
- * @see javax.naming.NoInitialContextException
- */
-public class NoInitialContextException extends NamingException {
-
- public NoInitialContextException(
- javax.naming.NoInitialContextException cause) {
- super(cause);
- }
-}
+/*
+ * Copyright 2005-2010 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
+ *
+ * https://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;
+
+/**
+ * Runtime exception mirroring the JNDI NoInitialContextException.
+ *
+ * @author Ulrik Sandberg
+ * @since 1.2
+ * @see javax.naming.NoInitialContextException
+ */
+public class NoInitialContextException extends NamingException {
+
+ public NoInitialContextException(
+ javax.naming.NoInitialContextException cause) {
+ super(cause);
+ }
+}
diff --git a/core/src/main/java/org/springframework/ldap/NoPermissionException.java b/core/src/main/java/org/springframework/ldap/NoPermissionException.java
index 8f09cbed..9f73df94 100644
--- a/core/src/main/java/org/springframework/ldap/NoPermissionException.java
+++ b/core/src/main/java/org/springframework/ldap/NoPermissionException.java
@@ -1,31 +1,31 @@
-/*
- * Copyright 2005-2010 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
- *
- * https://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;
-
-/**
- * Runtime exception mirroring the JNDI NoPermissionException.
- *
- * @author Ulrik Sandberg
- * @since 1.2
- * @see javax.naming.NoPermissionException
- */
-public class NoPermissionException extends NamingSecurityException {
-
- public NoPermissionException(javax.naming.NoPermissionException cause) {
- super(cause);
- }
-}
+/*
+ * Copyright 2005-2010 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
+ *
+ * https://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;
+
+/**
+ * Runtime exception mirroring the JNDI NoPermissionException.
+ *
+ * @author Ulrik Sandberg
+ * @since 1.2
+ * @see javax.naming.NoPermissionException
+ */
+public class NoPermissionException extends NamingSecurityException {
+
+ public NoPermissionException(javax.naming.NoPermissionException cause) {
+ super(cause);
+ }
+}
diff --git a/core/src/main/java/org/springframework/ldap/NoSuchAttributeException.java b/core/src/main/java/org/springframework/ldap/NoSuchAttributeException.java
index 13d8fccd..befa8546 100644
--- a/core/src/main/java/org/springframework/ldap/NoSuchAttributeException.java
+++ b/core/src/main/java/org/springframework/ldap/NoSuchAttributeException.java
@@ -1,35 +1,35 @@
-/*
- * Copyright 2005-2010 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
- *
- * https://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;
-
-/**
- * Runtime exception mirroring the JNDI NoSuchAttributeException.
- *
- * @author Ulrik Sandberg
- * @since 1.2
- * @see javax.naming.directory.NoSuchAttributeException
- */
-public class NoSuchAttributeException extends NamingException {
-
- public NoSuchAttributeException(String message) {
- super(message);
- }
-
- public NoSuchAttributeException(javax.naming.directory.NoSuchAttributeException cause) {
- super(cause);
- }
-}
+/*
+ * Copyright 2005-2010 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
+ *
+ * https://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;
+
+/**
+ * Runtime exception mirroring the JNDI NoSuchAttributeException.
+ *
+ * @author Ulrik Sandberg
+ * @since 1.2
+ * @see javax.naming.directory.NoSuchAttributeException
+ */
+public class NoSuchAttributeException extends NamingException {
+
+ public NoSuchAttributeException(String message) {
+ super(message);
+ }
+
+ public NoSuchAttributeException(javax.naming.directory.NoSuchAttributeException cause) {
+ super(cause);
+ }
+}
diff --git a/core/src/main/java/org/springframework/ldap/NotContextException.java b/core/src/main/java/org/springframework/ldap/NotContextException.java
index 3a4c84c4..f1dc1650 100644
--- a/core/src/main/java/org/springframework/ldap/NotContextException.java
+++ b/core/src/main/java/org/springframework/ldap/NotContextException.java
@@ -1,31 +1,31 @@
-/*
- * Copyright 2005-2010 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
- *
- * https://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;
-
-/**
- * Runtime exception mirroring the JNDI NotContextException.
- *
- * @author Ulrik Sandberg
- * @since 1.2
- * @see javax.naming.NotContextException
- */
-public class NotContextException extends NamingException {
-
- public NotContextException(javax.naming.NotContextException cause) {
- super(cause);
- }
-}
+/*
+ * Copyright 2005-2010 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
+ *
+ * https://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;
+
+/**
+ * Runtime exception mirroring the JNDI NotContextException.
+ *
+ * @author Ulrik Sandberg
+ * @since 1.2
+ * @see javax.naming.NotContextException
+ */
+public class NotContextException extends NamingException {
+
+ public NotContextException(javax.naming.NotContextException cause) {
+ super(cause);
+ }
+}
diff --git a/core/src/main/java/org/springframework/ldap/OperationNotSupportedException.java b/core/src/main/java/org/springframework/ldap/OperationNotSupportedException.java
index 3c3e2947..41e33b57 100644
--- a/core/src/main/java/org/springframework/ldap/OperationNotSupportedException.java
+++ b/core/src/main/java/org/springframework/ldap/OperationNotSupportedException.java
@@ -1,32 +1,32 @@
-/*
- * Copyright 2005-2010 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
- *
- * https://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;
-
-/**
- * Runtime exception mirroring the JNDI OperationNotSupportedException.
- *
- * @author Ulrik Sandberg
- * @since 1.2
- * @see javax.naming.OperationNotSupportedException
- */
-public class OperationNotSupportedException extends NamingException {
-
- public OperationNotSupportedException(
- javax.naming.OperationNotSupportedException cause) {
- super(cause);
- }
-}
+/*
+ * Copyright 2005-2010 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
+ *
+ * https://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;
+
+/**
+ * Runtime exception mirroring the JNDI OperationNotSupportedException.
+ *
+ * @author Ulrik Sandberg
+ * @since 1.2
+ * @see javax.naming.OperationNotSupportedException
+ */
+public class OperationNotSupportedException extends NamingException {
+
+ public OperationNotSupportedException(
+ javax.naming.OperationNotSupportedException cause) {
+ super(cause);
+ }
+}
diff --git a/core/src/main/java/org/springframework/ldap/PartialResultException.java b/core/src/main/java/org/springframework/ldap/PartialResultException.java
index e208b5bf..639e6217 100644
--- a/core/src/main/java/org/springframework/ldap/PartialResultException.java
+++ b/core/src/main/java/org/springframework/ldap/PartialResultException.java
@@ -1,31 +1,31 @@
-/*
- * Copyright 2005-2010 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
- *
- * https://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;
-
-/**
- * Runtime exception mirroring the JNDI PartialResultException.
- *
- * @author Ulrik Sandberg
- * @since 1.2
- * @see javax.naming.PartialResultException
- */
-public class PartialResultException extends NamingException {
-
- public PartialResultException(javax.naming.PartialResultException cause) {
- super(cause);
- }
-}
+/*
+ * Copyright 2005-2010 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
+ *
+ * https://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;
+
+/**
+ * Runtime exception mirroring the JNDI PartialResultException.
+ *
+ * @author Ulrik Sandberg
+ * @since 1.2
+ * @see javax.naming.PartialResultException
+ */
+public class PartialResultException extends NamingException {
+
+ public PartialResultException(javax.naming.PartialResultException cause) {
+ super(cause);
+ }
+}
diff --git a/core/src/main/java/org/springframework/ldap/ReferralException.java b/core/src/main/java/org/springframework/ldap/ReferralException.java
index 8bc12329..4536c850 100644
--- a/core/src/main/java/org/springframework/ldap/ReferralException.java
+++ b/core/src/main/java/org/springframework/ldap/ReferralException.java
@@ -1,31 +1,31 @@
-/*
- * Copyright 2005-2010 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
- *
- * https://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;
-
-/**
- * Runtime exception mirroring the JNDI ReferralException.
- *
- * @author Ulrik Sandberg
- * @since 1.2
- * @see javax.naming.ReferralException
- */
-public class ReferralException extends NamingException {
-
- public ReferralException(javax.naming.ReferralException cause) {
- super(cause);
- }
-}
+/*
+ * Copyright 2005-2010 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
+ *
+ * https://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;
+
+/**
+ * Runtime exception mirroring the JNDI ReferralException.
+ *
+ * @author Ulrik Sandberg
+ * @since 1.2
+ * @see javax.naming.ReferralException
+ */
+public class ReferralException extends NamingException {
+
+ public ReferralException(javax.naming.ReferralException cause) {
+ super(cause);
+ }
+}
diff --git a/core/src/main/java/org/springframework/ldap/SchemaViolationException.java b/core/src/main/java/org/springframework/ldap/SchemaViolationException.java
index f4ea33ed..913bf000 100644
--- a/core/src/main/java/org/springframework/ldap/SchemaViolationException.java
+++ b/core/src/main/java/org/springframework/ldap/SchemaViolationException.java
@@ -1,32 +1,32 @@
-/*
- * Copyright 2005-2010 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
- *
- * https://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;
-
-/**
- * Runtime exception mirroring the JNDI SchemaViolationException.
- *
- * @author Ulrik Sandberg
- * @since 1.2
- * @see javax.naming.directory.SchemaViolationException
- */
-public class SchemaViolationException extends NamingException {
-
- public SchemaViolationException(
- javax.naming.directory.SchemaViolationException cause) {
- super(cause);
- }
-}
+/*
+ * Copyright 2005-2010 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
+ *
+ * https://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;
+
+/**
+ * Runtime exception mirroring the JNDI SchemaViolationException.
+ *
+ * @author Ulrik Sandberg
+ * @since 1.2
+ * @see javax.naming.directory.SchemaViolationException
+ */
+public class SchemaViolationException extends NamingException {
+
+ public SchemaViolationException(
+ javax.naming.directory.SchemaViolationException cause) {
+ super(cause);
+ }
+}
diff --git a/core/src/main/java/org/springframework/ldap/ServiceUnavailableException.java b/core/src/main/java/org/springframework/ldap/ServiceUnavailableException.java
index 1f8095e8..a9b8401d 100644
--- a/core/src/main/java/org/springframework/ldap/ServiceUnavailableException.java
+++ b/core/src/main/java/org/springframework/ldap/ServiceUnavailableException.java
@@ -1,32 +1,32 @@
-/*
- * Copyright 2005-2010 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
- *
- * https://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;
-
-/**
- * Runtime exception mirroring the JNDI ServiceUnavailableException.
- *
- * @author Ulrik Sandberg
- * @since 1.2
- * @see javax.naming.ServiceUnavailableException
- */
-public class ServiceUnavailableException extends NamingException {
-
- public ServiceUnavailableException(
- javax.naming.ServiceUnavailableException cause) {
- super(cause);
- }
-}
+/*
+ * Copyright 2005-2010 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
+ *
+ * https://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;
+
+/**
+ * Runtime exception mirroring the JNDI ServiceUnavailableException.
+ *
+ * @author Ulrik Sandberg
+ * @since 1.2
+ * @see javax.naming.ServiceUnavailableException
+ */
+public class ServiceUnavailableException extends NamingException {
+
+ public ServiceUnavailableException(
+ javax.naming.ServiceUnavailableException cause) {
+ super(cause);
+ }
+}
diff --git a/core/src/main/java/org/springframework/ldap/SizeLimitExceededException.java b/core/src/main/java/org/springframework/ldap/SizeLimitExceededException.java
index e42d28a9..197b968c 100644
--- a/core/src/main/java/org/springframework/ldap/SizeLimitExceededException.java
+++ b/core/src/main/java/org/springframework/ldap/SizeLimitExceededException.java
@@ -1,32 +1,32 @@
-/*
- * Copyright 2005-2010 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
- *
- * https://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;
-
-/**
- * Runtime exception mirroring the JNDI SizeLimitExceededException.
- *
- * @author Ulrik Sandberg
- * @since 1.2
- * @see javax.naming.SizeLimitExceededException
- */
-public class SizeLimitExceededException extends LimitExceededException {
-
- public SizeLimitExceededException(
- javax.naming.SizeLimitExceededException cause) {
- super(cause);
- }
-}
+/*
+ * Copyright 2005-2010 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
+ *
+ * https://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;
+
+/**
+ * Runtime exception mirroring the JNDI SizeLimitExceededException.
+ *
+ * @author Ulrik Sandberg
+ * @since 1.2
+ * @see javax.naming.SizeLimitExceededException
+ */
+public class SizeLimitExceededException extends LimitExceededException {
+
+ public SizeLimitExceededException(
+ javax.naming.SizeLimitExceededException cause) {
+ super(cause);
+ }
+}
diff --git a/core/src/main/java/org/springframework/ldap/TimeLimitExceededException.java b/core/src/main/java/org/springframework/ldap/TimeLimitExceededException.java
index 3035cad8..f63a9400 100644
--- a/core/src/main/java/org/springframework/ldap/TimeLimitExceededException.java
+++ b/core/src/main/java/org/springframework/ldap/TimeLimitExceededException.java
@@ -1,32 +1,32 @@
-/*
- * Copyright 2005-2010 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
- *
- * https://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;
-
-/**
- * Runtime exception mirroring the JNDI TimeLimitExceededException.
- *
- * @author Ulrik Sandberg
- * @since 1.2
- * @see javax.naming.TimeLimitExceededException
- */
-public class TimeLimitExceededException extends LimitExceededException {
-
- public TimeLimitExceededException(
- javax.naming.TimeLimitExceededException cause) {
- super(cause);
- }
-}
+/*
+ * Copyright 2005-2010 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
+ *
+ * https://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;
+
+/**
+ * Runtime exception mirroring the JNDI TimeLimitExceededException.
+ *
+ * @author Ulrik Sandberg
+ * @since 1.2
+ * @see javax.naming.TimeLimitExceededException
+ */
+public class TimeLimitExceededException extends LimitExceededException {
+
+ public TimeLimitExceededException(
+ javax.naming.TimeLimitExceededException cause) {
+ super(cause);
+ }
+}
diff --git a/core/src/main/java/org/springframework/ldap/UncategorizedLdapException.java b/core/src/main/java/org/springframework/ldap/UncategorizedLdapException.java
index 1cd8a289..3ac3db00 100644
--- a/core/src/main/java/org/springframework/ldap/UncategorizedLdapException.java
+++ b/core/src/main/java/org/springframework/ldap/UncategorizedLdapException.java
@@ -1,38 +1,38 @@
-/*
- * Copyright 2005-2010 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
- *
- * https://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;
-
-/**
- * NamingException to be thrown when no other matching subclass is found.
- *
- * @author Ulrik Sandberg
- * @since 1.2
- */
-public class UncategorizedLdapException extends NamingException {
-
- public UncategorizedLdapException(String msg) {
- super(msg);
- }
-
- public UncategorizedLdapException(String msg, Throwable cause) {
- super(msg, cause);
- }
-
- public UncategorizedLdapException(Throwable cause) {
- super("Uncategorized exception occured during LDAP processing", cause);
- }
-}
+/*
+ * Copyright 2005-2010 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
+ *
+ * https://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;
+
+/**
+ * NamingException to be thrown when no other matching subclass is found.
+ *
+ * @author Ulrik Sandberg
+ * @since 1.2
+ */
+public class UncategorizedLdapException extends NamingException {
+
+ public UncategorizedLdapException(String msg) {
+ super(msg);
+ }
+
+ public UncategorizedLdapException(String msg, Throwable cause) {
+ super(msg, cause);
+ }
+
+ public UncategorizedLdapException(Throwable cause) {
+ super("Uncategorized exception occured during LDAP processing", cause);
+ }
+}
diff --git a/core/src/main/java/org/springframework/ldap/authentication/DefaultValuesAuthenticationSourceDecorator.java b/core/src/main/java/org/springframework/ldap/authentication/DefaultValuesAuthenticationSourceDecorator.java
index 692b2579..1c9961b3 100644
--- a/core/src/main/java/org/springframework/ldap/authentication/DefaultValuesAuthenticationSourceDecorator.java
+++ b/core/src/main/java/org/springframework/ldap/authentication/DefaultValuesAuthenticationSourceDecorator.java
@@ -1,156 +1,156 @@
-/*
- * 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
- *
- * https://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.authentication;
-
-import org.springframework.util.StringUtils;
-import org.springframework.beans.factory.InitializingBean;
-import org.springframework.ldap.core.AuthenticationSource;
-
-/**
- * Decorator on AuthenticationSource to have default authentication information
- * be returned should the target return empty principal and credentials. Useful
- * in combination with AcegiAuthenticationSource if users are to be
- * allowed to read some information even though they are not logged in.
- *
- * Note: The defaultUser should be an non-privileged
- * user. This is important as this is the one that will be used when no user is
- * logged in (i.e. empty principal is returned from the target
- * AuthenticationSource).
- *
- * @author Mattias Hellborg Arthursson
- *
- */
-public class DefaultValuesAuthenticationSourceDecorator implements
- AuthenticationSource, InitializingBean {
-
- private AuthenticationSource target;
-
- private String defaultUser;
-
- private String defaultPassword;
-
- /**
- * Constructor for bean usage.
- */
- public DefaultValuesAuthenticationSourceDecorator() {
- }
-
- /**
- * Constructor to setup instance directly.
- *
- * @param target
- * the target AuthenticationSource.
- * @param defaultUser
- * dn of the user to use when the target returns an empty
- * principal.
- * @param defaultPassword
- * password of the user to use when the target returns an empty
- * principal.
- */
- public DefaultValuesAuthenticationSourceDecorator(
- AuthenticationSource target, String defaultUser,
- String defaultPassword) {
- this.target = target;
- this.defaultUser = defaultUser;
- this.defaultPassword = defaultPassword;
- }
-
- /**
- * Checks if the target's principal is not empty; if not, the credentials
- * from the target is returned - otherwise return the
- * defaultPassword.
- *
- * @return the target's password if the target's principal is not empty, the
- * defaultPassword otherwise.
- */
- public String getCredentials() {
- if (StringUtils.hasText(target.getPrincipal())) {
- return target.getCredentials();
- } else {
- return defaultPassword;
- }
- }
-
- /**
- * Checks if the target's principal is not empty; if not, this is returned -
- * otherwise return the defaultPassword.
- *
- * @return the target's principal if it is not empty, the
- * defaultPassword otherwise.
- */
- public String getPrincipal() {
- String principal = target.getPrincipal();
- if (StringUtils.hasText(principal)) {
- return principal;
- } else {
- return defaultUser;
- }
- }
-
- /**
- * Set the password of the default user.
- *
- * @param defaultPassword
- * the password of the default user.
- */
- public void setDefaultPassword(String defaultPassword) {
- this.defaultPassword = defaultPassword;
- }
-
- /**
- * Set the default user DN. This should be a non-privileged user, since it
- * will be used when no authentication information is returned from the
- * target.
- *
- * @param defaultUser
- * DN of the default user.
- */
- public void setDefaultUser(String defaultUser) {
- this.defaultUser = defaultUser;
- }
-
- /**
- * Set the target AuthenticationSource.
- *
- * @param target
- * the target AuthenticationSource.
- */
- public void setTarget(AuthenticationSource target) {
- this.target = target;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet()
- */
- public void afterPropertiesSet() throws Exception {
- if (target == null) {
- throw new IllegalArgumentException(
- "Property 'target' must be set.'");
- }
-
- if (defaultUser == null) {
- throw new IllegalArgumentException(
- "Property 'defaultUser' must be set.'");
- }
-
- if (defaultPassword == null) {
- throw new IllegalArgumentException(
- "Property 'defaultPassword' must be set.'");
- }
- }
-}
+/*
+ * 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
+ *
+ * https://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.authentication;
+
+import org.springframework.util.StringUtils;
+import org.springframework.beans.factory.InitializingBean;
+import org.springframework.ldap.core.AuthenticationSource;
+
+/**
+ * Decorator on AuthenticationSource to have default authentication information
+ * be returned should the target return empty principal and credentials. Useful
+ * in combination with AcegiAuthenticationSource if users are to be
+ * allowed to read some information even though they are not logged in.
+ *
+ * Note: The defaultUser should be an non-privileged
+ * user. This is important as this is the one that will be used when no user is
+ * logged in (i.e. empty principal is returned from the target
+ * AuthenticationSource).
+ *
+ * @author Mattias Hellborg Arthursson
+ *
+ */
+public class DefaultValuesAuthenticationSourceDecorator implements
+ AuthenticationSource, InitializingBean {
+
+ private AuthenticationSource target;
+
+ private String defaultUser;
+
+ private String defaultPassword;
+
+ /**
+ * Constructor for bean usage.
+ */
+ public DefaultValuesAuthenticationSourceDecorator() {
+ }
+
+ /**
+ * Constructor to setup instance directly.
+ *
+ * @param target
+ * the target AuthenticationSource.
+ * @param defaultUser
+ * dn of the user to use when the target returns an empty
+ * principal.
+ * @param defaultPassword
+ * password of the user to use when the target returns an empty
+ * principal.
+ */
+ public DefaultValuesAuthenticationSourceDecorator(
+ AuthenticationSource target, String defaultUser,
+ String defaultPassword) {
+ this.target = target;
+ this.defaultUser = defaultUser;
+ this.defaultPassword = defaultPassword;
+ }
+
+ /**
+ * Checks if the target's principal is not empty; if not, the credentials
+ * from the target is returned - otherwise return the
+ * defaultPassword.
+ *
+ * @return the target's password if the target's principal is not empty, the
+ * defaultPassword otherwise.
+ */
+ public String getCredentials() {
+ if (StringUtils.hasText(target.getPrincipal())) {
+ return target.getCredentials();
+ } else {
+ return defaultPassword;
+ }
+ }
+
+ /**
+ * Checks if the target's principal is not empty; if not, this is returned -
+ * otherwise return the defaultPassword.
+ *
+ * @return the target's principal if it is not empty, the
+ * defaultPassword otherwise.
+ */
+ public String getPrincipal() {
+ String principal = target.getPrincipal();
+ if (StringUtils.hasText(principal)) {
+ return principal;
+ } else {
+ return defaultUser;
+ }
+ }
+
+ /**
+ * Set the password of the default user.
+ *
+ * @param defaultPassword
+ * the password of the default user.
+ */
+ public void setDefaultPassword(String defaultPassword) {
+ this.defaultPassword = defaultPassword;
+ }
+
+ /**
+ * Set the default user DN. This should be a non-privileged user, since it
+ * will be used when no authentication information is returned from the
+ * target.
+ *
+ * @param defaultUser
+ * DN of the default user.
+ */
+ public void setDefaultUser(String defaultUser) {
+ this.defaultUser = defaultUser;
+ }
+
+ /**
+ * Set the target AuthenticationSource.
+ *
+ * @param target
+ * the target AuthenticationSource.
+ */
+ public void setTarget(AuthenticationSource target) {
+ this.target = target;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet()
+ */
+ public void afterPropertiesSet() throws Exception {
+ if (target == null) {
+ throw new IllegalArgumentException(
+ "Property 'target' must be set.'");
+ }
+
+ if (defaultUser == null) {
+ throw new IllegalArgumentException(
+ "Property 'defaultUser' must be set.'");
+ }
+
+ if (defaultPassword == null) {
+ throw new IllegalArgumentException(
+ "Property 'defaultPassword' must be set.'");
+ }
+ }
+}
diff --git a/core/src/main/java/org/springframework/ldap/control/CreateControlFailedException.java b/core/src/main/java/org/springframework/ldap/control/CreateControlFailedException.java
index fa2124ee..3e5c7f96 100644
--- a/core/src/main/java/org/springframework/ldap/control/CreateControlFailedException.java
+++ b/core/src/main/java/org/springframework/ldap/control/CreateControlFailedException.java
@@ -1,51 +1,51 @@
-/*
- * Copyright 2005-2010 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
- *
- * https://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.control;
-
-import org.springframework.ldap.NamingException;
-
-/**
- * Thrown by an AbstractRequestControlDirContextProcessor when it cannot create
- * a request control.
- *
- * @author Ulrik Sandberg
- * @since 1.2
- */
-public class CreateControlFailedException extends NamingException {
-
- /**
- * Create a new CreateControlFailedException.
- *
- * @param msg
- * the detail message
- */
- public CreateControlFailedException(String msg) {
- super(msg);
- }
-
- /**
- * Create a new CreateControlFailedException.
- *
- * @param msg
- * the detail message
- * @param cause
- * the root cause (if any)
- */
- public CreateControlFailedException(String msg, Throwable cause) {
- super(msg, cause);
- }
-}
+/*
+ * Copyright 2005-2010 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
+ *
+ * https://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.control;
+
+import org.springframework.ldap.NamingException;
+
+/**
+ * Thrown by an AbstractRequestControlDirContextProcessor when it cannot create
+ * a request control.
+ *
+ * @author Ulrik Sandberg
+ * @since 1.2
+ */
+public class CreateControlFailedException extends NamingException {
+
+ /**
+ * Create a new CreateControlFailedException.
+ *
+ * @param msg
+ * the detail message
+ */
+ public CreateControlFailedException(String msg) {
+ super(msg);
+ }
+
+ /**
+ * Create a new CreateControlFailedException.
+ *
+ * @param msg
+ * the detail message
+ * @param cause
+ * the root cause (if any)
+ */
+ public CreateControlFailedException(String msg, Throwable cause) {
+ super(msg, cause);
+ }
+}
diff --git a/core/src/main/java/org/springframework/ldap/control/PagedResult.java b/core/src/main/java/org/springframework/ldap/control/PagedResult.java
index 648108b3..3dc7a0a0 100644
--- a/core/src/main/java/org/springframework/ldap/control/PagedResult.java
+++ b/core/src/main/java/org/springframework/ldap/control/PagedResult.java
@@ -1,85 +1,85 @@
-/*
- * 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
- *
- * https://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.control;
-
-import java.util.List;
-
-/**
- * Bean to encapsulate a result List and a {@link PagedResultsCookie} to use for
- * returning the results when using {@link PagedResultsRequestControl}.
- *
- * @author Mattias Hellborg Arthursson
- * @author Ulrik Sandberg
- * @deprecated
- */
-public class PagedResult {
-
- private List> resultList;
-
- private PagedResultsCookie cookie;
-
- /**
- * Constructs a PagedResults using the supplied List and
- * {@link PagedResultsCookie}.
- *
- * @param resultList
- * the result list.
- * @param cookie
- * the cookie.
- */
- public PagedResult(List> resultList, PagedResultsCookie cookie) {
- this.resultList = resultList;
- this.cookie = cookie;
- }
-
- /**
- * Get the cookie.
- *
- * @return the cookie.
- */
- public PagedResultsCookie getCookie() {
- return cookie;
- }
-
- /**
- * Get the result list.
- *
- * @return the result list.
- */
- public List> getResultList() {
- return resultList;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
-
- PagedResult that = (PagedResult) o;
-
- if (cookie != null ? !cookie.equals(that.cookie) : that.cookie != null) return false;
- if (resultList != null ? !resultList.equals(that.resultList) : that.resultList != null) return false;
-
- return true;
- }
-
- @Override
- public int hashCode() {
- int result = resultList != null ? resultList.hashCode() : 0;
- result = 31 * result + (cookie != null ? cookie.hashCode() : 0);
- return result;
- }
-}
+/*
+ * 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
+ *
+ * https://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.control;
+
+import java.util.List;
+
+/**
+ * Bean to encapsulate a result List and a {@link PagedResultsCookie} to use for
+ * returning the results when using {@link PagedResultsRequestControl}.
+ *
+ * @author Mattias Hellborg Arthursson
+ * @author Ulrik Sandberg
+ * @deprecated
+ */
+public class PagedResult {
+
+ private List> resultList;
+
+ private PagedResultsCookie cookie;
+
+ /**
+ * Constructs a PagedResults using the supplied List and
+ * {@link PagedResultsCookie}.
+ *
+ * @param resultList
+ * the result list.
+ * @param cookie
+ * the cookie.
+ */
+ public PagedResult(List> resultList, PagedResultsCookie cookie) {
+ this.resultList = resultList;
+ this.cookie = cookie;
+ }
+
+ /**
+ * Get the cookie.
+ *
+ * @return the cookie.
+ */
+ public PagedResultsCookie getCookie() {
+ return cookie;
+ }
+
+ /**
+ * Get the result list.
+ *
+ * @return the result list.
+ */
+ public List> getResultList() {
+ return resultList;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ PagedResult that = (PagedResult) o;
+
+ if (cookie != null ? !cookie.equals(that.cookie) : that.cookie != null) return false;
+ if (resultList != null ? !resultList.equals(that.resultList) : that.resultList != null) return false;
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int result = resultList != null ? resultList.hashCode() : 0;
+ result = 31 * result + (cookie != null ? cookie.hashCode() : 0);
+ return result;
+ }
+}
diff --git a/core/src/main/java/org/springframework/ldap/control/PagedResultsCookie.java b/core/src/main/java/org/springframework/ldap/control/PagedResultsCookie.java
index bfb9e373..cc470e24 100644
--- a/core/src/main/java/org/springframework/ldap/control/PagedResultsCookie.java
+++ b/core/src/main/java/org/springframework/ldap/control/PagedResultsCookie.java
@@ -1,76 +1,76 @@
-/*
- * 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
- *
- * https://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.control;
-
-import javax.naming.ldap.PagedResultsControl;
-import java.util.Arrays;
-
-/**
- * Wrapper class for the cookie returned when using the
- * {@link PagedResultsControl}.
- *
- * @author Mattias Hellborg Arthursson
- * @author Ulrik Sandberg
- */
-public class PagedResultsCookie {
-
- private byte[] cookie;
-
- /**
- * Constructor.
- *
- * @param cookie
- * the cookie returned by a PagedResultsResponseControl.
- */
- public PagedResultsCookie(byte[] cookie) {
- if (cookie != null) {
- this.cookie = Arrays.copyOf(cookie, cookie.length);
- } else {
- this.cookie = null;
- }
- }
-
- /**
- * Get the cookie.
- *
- * @return the cookie. This value may be null, indicating that there are no more requests,
- * or that the control wasn't supported by the server.
- */
- public byte[] getCookie() {
- if (cookie != null) {
- return Arrays.copyOf(cookie, cookie.length);
- } else {
- return null;
- }
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
-
- PagedResultsCookie that = (PagedResultsCookie) o;
-
- if (!Arrays.equals(cookie, that.cookie)) return false;
-
- return true;
- }
-
- @Override
- public int hashCode() {
- return cookie != null ? Arrays.hashCode(cookie) : 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
+ *
+ * https://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.control;
+
+import javax.naming.ldap.PagedResultsControl;
+import java.util.Arrays;
+
+/**
+ * Wrapper class for the cookie returned when using the
+ * {@link PagedResultsControl}.
+ *
+ * @author Mattias Hellborg Arthursson
+ * @author Ulrik Sandberg
+ */
+public class PagedResultsCookie {
+
+ private byte[] cookie;
+
+ /**
+ * Constructor.
+ *
+ * @param cookie
+ * the cookie returned by a PagedResultsResponseControl.
+ */
+ public PagedResultsCookie(byte[] cookie) {
+ if (cookie != null) {
+ this.cookie = Arrays.copyOf(cookie, cookie.length);
+ } else {
+ this.cookie = null;
+ }
+ }
+
+ /**
+ * Get the cookie.
+ *
+ * @return the cookie. This value may be null, indicating that there are no more requests,
+ * or that the control wasn't supported by the server.
+ */
+ public byte[] getCookie() {
+ if (cookie != null) {
+ return Arrays.copyOf(cookie, cookie.length);
+ } else {
+ return null;
+ }
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ PagedResultsCookie that = (PagedResultsCookie) o;
+
+ if (!Arrays.equals(cookie, that.cookie)) return false;
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return cookie != null ? Arrays.hashCode(cookie) : 0;
+ }
+}
diff --git a/core/src/main/java/org/springframework/ldap/control/PagedResultsDirContextProcessor.java b/core/src/main/java/org/springframework/ldap/control/PagedResultsDirContextProcessor.java
index 2d2a417b..1c58d373 100644
--- a/core/src/main/java/org/springframework/ldap/control/PagedResultsDirContextProcessor.java
+++ b/core/src/main/java/org/springframework/ldap/control/PagedResultsDirContextProcessor.java
@@ -1,155 +1,155 @@
-/*
- * 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
- *
- * https://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.control;
-
-import javax.naming.ldap.Control;
-
-/**
- * DirContextProcessor implementation for managing the paged results control.
- * Note that due to the internal workings of LdapTemplate, the
- * target connection is closed after each LDAP call. The PagedResults control
- * require the same connection be used for each call, which means we need to
- * make sure the target connection is never actually closed. There's basically
- * two ways of making this happen: use the SingleContextSource
- * implementation or make sure all calls happen within a single LDAP transaction
- * (using ContextSourceTransactionManager).
- *
- * @author Mattias Hellborg Arthursson
- * @author Ulrik Sandberg
- */
-public class PagedResultsDirContextProcessor extends AbstractFallbackRequestAndResponseControlDirContextProcessor {
-
- private static final String DEFAULT_REQUEST_CONTROL = "javax.naming.ldap.PagedResultsControl";
-
- private static final String FALLBACK_REQUEST_CONTROL = "com.sun.jndi.ldap.ctl.PagedResultsControl";
-
- private static final String DEFAULT_RESPONSE_CONTROL = "javax.naming.ldap.PagedResultsResponseControl";
-
- private static final String FALLBACK_RESPONSE_CONTROL = "com.sun.jndi.ldap.ctl.PagedResultsResponseControl";
-
- private int pageSize;
-
- private PagedResultsCookie cookie;
-
- private int resultSize;
-
- private boolean more = true;
-
- /**
- * Constructs a new instance. This constructor should be used when
- * performing the first paged search operation, when no other results have
- * been retrieved.
- *
- * @param pageSize the page size.
- */
- public PagedResultsDirContextProcessor(int pageSize) {
- this(pageSize, null);
- }
-
- /**
- * Constructs a new instance with the supplied page size and cookie. The
- * cookie must be the exact same instance as received from a previous paged
- * results search, or null if it is the first in an operation
- * sequence.
- *
- * @param pageSize the page size.
- * @param cookie the cookie, as received from a previous search.
- */
- public PagedResultsDirContextProcessor(int pageSize, PagedResultsCookie cookie) {
- this.pageSize = pageSize;
- this.cookie = cookie;
-
- defaultRequestControl = DEFAULT_REQUEST_CONTROL;
- defaultResponseControl = DEFAULT_RESPONSE_CONTROL;
- fallbackRequestControl = FALLBACK_REQUEST_CONTROL;
- fallbackResponseControl = FALLBACK_RESPONSE_CONTROL;
-
- loadControlClasses();
- }
-
- /**
- * Get the cookie.
- *
- * @return the cookie. The cookie will always be set after at leas one query, however the actual cookie content
- * can be null, indicating that there are no more results, in which case {@link #hasMore()} will return
- * false.
- * @see #hasMore()
- */
- public PagedResultsCookie getCookie() {
- return cookie;
- }
-
- /**
- * Get the page size.
- *
- * @return the page size.
- */
- public int getPageSize() {
- return pageSize;
- }
-
- /**
- * Get the total estimated number of entries that matches the issued search.
- * Note that this value is optional for the LDAP server to return, so it
- * does not always contain any valid data.
- *
- * @return the estimated result size, if returned from the server.
- */
- public int getResultSize() {
- return resultSize;
- }
-
- /*
- * @see
- * org.springframework.ldap.control.AbstractRequestControlDirContextProcessor
- * #createRequestControl()
- */
- public Control createRequestControl() {
- byte[] actualCookie = null;
- if (cookie != null) {
- actualCookie = cookie.getCookie();
- }
- return super.createRequestControl(new Class>[] { int.class, byte[].class, boolean.class },
- new Object[] {pageSize, actualCookie, critical});
- }
-
- /**
- * Check whether there are more results to retrieved. When there are no more results to retrieve,
- * this is indicated by a null cookie being returned from the server.
- * When this happen, the internal status will set to false.
- *
- * @return true if there are more results to retrieve, false otherwise.
- * @since 2.0
- */
- public boolean hasMore() {
- return more;
- }
-
- /*
- * @seeorg.springframework.ldap.control.
- * AbstractFallbackRequestAndResponseControlDirContextProcessor
- * #handleResponse(java.lang.Object)
- */
- protected void handleResponse(Object control) {
- byte[] result = (byte[]) invokeMethod("getCookie", responseControlClass, control);
- if(result == null) {
- more = false;
- }
- this.cookie = new PagedResultsCookie(result);
- this.resultSize = (Integer) invokeMethod("getResultSize", responseControlClass, control);
- }
-}
+/*
+ * 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
+ *
+ * https://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.control;
+
+import javax.naming.ldap.Control;
+
+/**
+ * DirContextProcessor implementation for managing the paged results control.
+ * Note that due to the internal workings of LdapTemplate, the
+ * target connection is closed after each LDAP call. The PagedResults control
+ * require the same connection be used for each call, which means we need to
+ * make sure the target connection is never actually closed. There's basically
+ * two ways of making this happen: use the SingleContextSource
+ * implementation or make sure all calls happen within a single LDAP transaction
+ * (using ContextSourceTransactionManager).
+ *
+ * @author Mattias Hellborg Arthursson
+ * @author Ulrik Sandberg
+ */
+public class PagedResultsDirContextProcessor extends AbstractFallbackRequestAndResponseControlDirContextProcessor {
+
+ private static final String DEFAULT_REQUEST_CONTROL = "javax.naming.ldap.PagedResultsControl";
+
+ private static final String FALLBACK_REQUEST_CONTROL = "com.sun.jndi.ldap.ctl.PagedResultsControl";
+
+ private static final String DEFAULT_RESPONSE_CONTROL = "javax.naming.ldap.PagedResultsResponseControl";
+
+ private static final String FALLBACK_RESPONSE_CONTROL = "com.sun.jndi.ldap.ctl.PagedResultsResponseControl";
+
+ private int pageSize;
+
+ private PagedResultsCookie cookie;
+
+ private int resultSize;
+
+ private boolean more = true;
+
+ /**
+ * Constructs a new instance. This constructor should be used when
+ * performing the first paged search operation, when no other results have
+ * been retrieved.
+ *
+ * @param pageSize the page size.
+ */
+ public PagedResultsDirContextProcessor(int pageSize) {
+ this(pageSize, null);
+ }
+
+ /**
+ * Constructs a new instance with the supplied page size and cookie. The
+ * cookie must be the exact same instance as received from a previous paged
+ * results search, or null if it is the first in an operation
+ * sequence.
+ *
+ * @param pageSize the page size.
+ * @param cookie the cookie, as received from a previous search.
+ */
+ public PagedResultsDirContextProcessor(int pageSize, PagedResultsCookie cookie) {
+ this.pageSize = pageSize;
+ this.cookie = cookie;
+
+ defaultRequestControl = DEFAULT_REQUEST_CONTROL;
+ defaultResponseControl = DEFAULT_RESPONSE_CONTROL;
+ fallbackRequestControl = FALLBACK_REQUEST_CONTROL;
+ fallbackResponseControl = FALLBACK_RESPONSE_CONTROL;
+
+ loadControlClasses();
+ }
+
+ /**
+ * Get the cookie.
+ *
+ * @return the cookie. The cookie will always be set after at leas one query, however the actual cookie content
+ * can be null, indicating that there are no more results, in which case {@link #hasMore()} will return
+ * false.
+ * @see #hasMore()
+ */
+ public PagedResultsCookie getCookie() {
+ return cookie;
+ }
+
+ /**
+ * Get the page size.
+ *
+ * @return the page size.
+ */
+ public int getPageSize() {
+ return pageSize;
+ }
+
+ /**
+ * Get the total estimated number of entries that matches the issued search.
+ * Note that this value is optional for the LDAP server to return, so it
+ * does not always contain any valid data.
+ *
+ * @return the estimated result size, if returned from the server.
+ */
+ public int getResultSize() {
+ return resultSize;
+ }
+
+ /*
+ * @see
+ * org.springframework.ldap.control.AbstractRequestControlDirContextProcessor
+ * #createRequestControl()
+ */
+ public Control createRequestControl() {
+ byte[] actualCookie = null;
+ if (cookie != null) {
+ actualCookie = cookie.getCookie();
+ }
+ return super.createRequestControl(new Class>[] { int.class, byte[].class, boolean.class },
+ new Object[] {pageSize, actualCookie, critical});
+ }
+
+ /**
+ * Check whether there are more results to retrieved. When there are no more results to retrieve,
+ * this is indicated by a null cookie being returned from the server.
+ * When this happen, the internal status will set to false.
+ *
+ * @return true if there are more results to retrieve, false otherwise.
+ * @since 2.0
+ */
+ public boolean hasMore() {
+ return more;
+ }
+
+ /*
+ * @seeorg.springframework.ldap.control.
+ * AbstractFallbackRequestAndResponseControlDirContextProcessor
+ * #handleResponse(java.lang.Object)
+ */
+ protected void handleResponse(Object control) {
+ byte[] result = (byte[]) invokeMethod("getCookie", responseControlClass, control);
+ if(result == null) {
+ more = false;
+ }
+ this.cookie = new PagedResultsCookie(result);
+ this.resultSize = (Integer) invokeMethod("getResultSize", responseControlClass, control);
+ }
+}
diff --git a/core/src/main/java/org/springframework/ldap/control/PagedResultsRequestControl.java b/core/src/main/java/org/springframework/ldap/control/PagedResultsRequestControl.java
index 7906a758..1afafe3d 100644
--- a/core/src/main/java/org/springframework/ldap/control/PagedResultsRequestControl.java
+++ b/core/src/main/java/org/springframework/ldap/control/PagedResultsRequestControl.java
@@ -1,223 +1,223 @@
-/*
- * 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
- *
- * https://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.control;
-
-import org.springframework.ldap.UncategorizedLdapException;
-import org.springframework.util.ClassUtils;
-import org.springframework.util.ReflectionUtils;
-
-import javax.naming.NamingException;
-import javax.naming.directory.DirContext;
-import javax.naming.ldap.Control;
-import javax.naming.ldap.LdapContext;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Method;
-
-/**
- * DirContextProcessor implementation for managing the paged results control.
- * Note that due to the internal workings of LdapTemplate, the
- * target connection is closed after each LDAP call. The PagedResults control
- * require the same connection be used for each call, which means we need to
- * make sure the target connection is never actually closed. There's basically
- * two ways of making this happen: use the SingleContextSource
- * implementation or make sure all calls happen within a single LDAP transaction
- * (using ContextSourceTransactionManager).
- *
- * @author Mattias Hellborg Arthursson
- * @author Ulrik Sandberg
- * @deprecated Use PagedResultsDirContextProcessor instead.
- */
-public class PagedResultsRequestControl extends AbstractRequestControlDirContextProcessor {
-
- private static final boolean CRITICAL_CONTROL = true;
-
- private static final String DEFAULT_REQUEST_CONTROL = "javax.naming.ldap.PagedResultsControl";
-
- private static final String LDAPBP_REQUEST_CONTROL = "com.sun.jndi.ldap.ctl.PagedResultsControl";
-
- private static final String DEFAULT_RESPONSE_CONTROL = "javax.naming.ldap.PagedResultsResponseControl";
-
- private static final String LDAPBP_RESPONSE_CONTROL = "com.sun.jndi.ldap.ctl.PagedResultsResponseControl";
-
- private int pageSize;
-
- private PagedResultsCookie cookie;
-
- private int resultSize;
-
- private boolean critical = CRITICAL_CONTROL;
-
- private Class responseControlClass;
-
- private Class requestControlClass;
-
- /**
- * Constructs a new instance. This constructor should be used when
- * performing the first paged search operation, when no other results have
- * been retrieved.
- *
- * @param pageSize the page size.
- */
- public PagedResultsRequestControl(int pageSize) {
- this(pageSize, null);
- }
-
- /**
- * Constructs a new instance with the supplied page size and cookie. The
- * cookie must be the exact same instance as received from a previous paged
- * resullts search, or null if it is the first in an operation
- * sequence.
- *
- * @param pageSize the page size.
- * @param cookie the cookie, as received from a previous search.
- */
- public PagedResultsRequestControl(int pageSize, PagedResultsCookie cookie) {
- this.pageSize = pageSize;
- this.cookie = cookie;
-
- loadControlClasses();
- }
-
- private void loadControlClasses() {
- try {
- requestControlClass = Class.forName(DEFAULT_REQUEST_CONTROL);
- responseControlClass = Class.forName(DEFAULT_RESPONSE_CONTROL);
- }
- catch (ClassNotFoundException e) {
- log.debug("Default control classes not found - falling back to LdapBP classes", e);
-
- try {
- requestControlClass = Class.forName(LDAPBP_REQUEST_CONTROL);
- responseControlClass = Class.forName(LDAPBP_RESPONSE_CONTROL);
- }
- catch (ClassNotFoundException e1) {
- throw new UncategorizedLdapException(
- "Neither default nor fallback classes are available - unable to proceed", e);
- }
-
- }
- }
-
- /**
- * Get the cookie.
- *
- * @return the cookie.
- */
- public PagedResultsCookie getCookie() {
- return cookie;
- }
-
- /**
- * Get the page size.
- *
- * @return the page size.
- */
- public int getPageSize() {
- return pageSize;
- }
-
- /**
- * Get the total estimated number of entries that matches the issued search.
- * Note that this value is optional for the LDAP server to return, so it
- * does not always contain any valid data.
- *
- * @return the estimated result size, if returned from the server.
- */
- public int getResultSize() {
- return resultSize;
- }
-
- /**
- * Set the class of the expected ResponseControl for the paged results
- * response.
- *
- * @param responseControlClass Class of the expected response control.
- */
- public void setResponseControlClass(Class responseControlClass) {
- this.responseControlClass = responseControlClass;
- }
-
- public void setRequestControlClass(Class requestControlClass) {
- this.requestControlClass = requestControlClass;
- }
-
- /*
- * @see
- * org.springframework.ldap.control.AbstractRequestControlDirContextProcessor
- * #createRequestControl()
- */
-
- public Control createRequestControl() {
- byte[] actualCookie = null;
- if (cookie != null) {
- actualCookie = cookie.getCookie();
- }
- Constructor constructor = ClassUtils.getConstructorIfAvailable(requestControlClass, new Class[] { int.class,
- byte[].class, boolean.class });
- if (constructor == null) {
- throw new IllegalArgumentException("Failed to find an appropriate RequestControl constructor");
- }
-
- Control result = null;
- try {
- result = (Control) constructor.newInstance(pageSize, actualCookie,
- critical);
- }
- catch (Exception e) {
- ReflectionUtils.handleReflectionException(e);
- }
-
- return result;
- }
-
- /*
- * @see
- * org.springframework.ldap.core.DirContextProcessor#postProcess(javax.naming
- * .directory.DirContext)
- */
-
- public void postProcess(DirContext ctx) throws NamingException {
-
- LdapContext ldapContext = (LdapContext) ctx;
- Control[] responseControls = ldapContext.getResponseControls();
- if (responseControls == null) {
- responseControls = new Control[0];
- }
-
- // Go through response controls and get info, regardless of class
- for (int i = 0; i < responseControls.length; i++) {
- Control responseControl = responseControls[i];
-
- // check for match, try fallback otherwise
- if (responseControl.getClass().isAssignableFrom(responseControlClass)) {
- Object control = responseControl;
- byte[] result = (byte[]) invokeMethod("getCookie", responseControlClass, control);
- this.cookie = new PagedResultsCookie(result);
- Integer wrapper = (Integer) invokeMethod("getResultSize", responseControlClass, control);
- this.resultSize = wrapper.intValue();
- return;
- }
- }
-
- log.error("No matching response control found for paged results - looking for '{}", responseControlClass);
- }
-
- private Object invokeMethod(String method, Class clazz, Object control) {
- Method actualMethod = ReflectionUtils.findMethod(clazz, method);
- return ReflectionUtils.invokeMethod(actualMethod, control);
- }
-}
+/*
+ * 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
+ *
+ * https://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.control;
+
+import org.springframework.ldap.UncategorizedLdapException;
+import org.springframework.util.ClassUtils;
+import org.springframework.util.ReflectionUtils;
+
+import javax.naming.NamingException;
+import javax.naming.directory.DirContext;
+import javax.naming.ldap.Control;
+import javax.naming.ldap.LdapContext;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
+
+/**
+ * DirContextProcessor implementation for managing the paged results control.
+ * Note that due to the internal workings of LdapTemplate, the
+ * target connection is closed after each LDAP call. The PagedResults control
+ * require the same connection be used for each call, which means we need to
+ * make sure the target connection is never actually closed. There's basically
+ * two ways of making this happen: use the SingleContextSource
+ * implementation or make sure all calls happen within a single LDAP transaction
+ * (using ContextSourceTransactionManager).
+ *
+ * @author Mattias Hellborg Arthursson
+ * @author Ulrik Sandberg
+ * @deprecated Use PagedResultsDirContextProcessor instead.
+ */
+public class PagedResultsRequestControl extends AbstractRequestControlDirContextProcessor {
+
+ private static final boolean CRITICAL_CONTROL = true;
+
+ private static final String DEFAULT_REQUEST_CONTROL = "javax.naming.ldap.PagedResultsControl";
+
+ private static final String LDAPBP_REQUEST_CONTROL = "com.sun.jndi.ldap.ctl.PagedResultsControl";
+
+ private static final String DEFAULT_RESPONSE_CONTROL = "javax.naming.ldap.PagedResultsResponseControl";
+
+ private static final String LDAPBP_RESPONSE_CONTROL = "com.sun.jndi.ldap.ctl.PagedResultsResponseControl";
+
+ private int pageSize;
+
+ private PagedResultsCookie cookie;
+
+ private int resultSize;
+
+ private boolean critical = CRITICAL_CONTROL;
+
+ private Class responseControlClass;
+
+ private Class requestControlClass;
+
+ /**
+ * Constructs a new instance. This constructor should be used when
+ * performing the first paged search operation, when no other results have
+ * been retrieved.
+ *
+ * @param pageSize the page size.
+ */
+ public PagedResultsRequestControl(int pageSize) {
+ this(pageSize, null);
+ }
+
+ /**
+ * Constructs a new instance with the supplied page size and cookie. The
+ * cookie must be the exact same instance as received from a previous paged
+ * resullts search, or null if it is the first in an operation
+ * sequence.
+ *
+ * @param pageSize the page size.
+ * @param cookie the cookie, as received from a previous search.
+ */
+ public PagedResultsRequestControl(int pageSize, PagedResultsCookie cookie) {
+ this.pageSize = pageSize;
+ this.cookie = cookie;
+
+ loadControlClasses();
+ }
+
+ private void loadControlClasses() {
+ try {
+ requestControlClass = Class.forName(DEFAULT_REQUEST_CONTROL);
+ responseControlClass = Class.forName(DEFAULT_RESPONSE_CONTROL);
+ }
+ catch (ClassNotFoundException e) {
+ log.debug("Default control classes not found - falling back to LdapBP classes", e);
+
+ try {
+ requestControlClass = Class.forName(LDAPBP_REQUEST_CONTROL);
+ responseControlClass = Class.forName(LDAPBP_RESPONSE_CONTROL);
+ }
+ catch (ClassNotFoundException e1) {
+ throw new UncategorizedLdapException(
+ "Neither default nor fallback classes are available - unable to proceed", e);
+ }
+
+ }
+ }
+
+ /**
+ * Get the cookie.
+ *
+ * @return the cookie.
+ */
+ public PagedResultsCookie getCookie() {
+ return cookie;
+ }
+
+ /**
+ * Get the page size.
+ *
+ * @return the page size.
+ */
+ public int getPageSize() {
+ return pageSize;
+ }
+
+ /**
+ * Get the total estimated number of entries that matches the issued search.
+ * Note that this value is optional for the LDAP server to return, so it
+ * does not always contain any valid data.
+ *
+ * @return the estimated result size, if returned from the server.
+ */
+ public int getResultSize() {
+ return resultSize;
+ }
+
+ /**
+ * Set the class of the expected ResponseControl for the paged results
+ * response.
+ *
+ * @param responseControlClass Class of the expected response control.
+ */
+ public void setResponseControlClass(Class responseControlClass) {
+ this.responseControlClass = responseControlClass;
+ }
+
+ public void setRequestControlClass(Class requestControlClass) {
+ this.requestControlClass = requestControlClass;
+ }
+
+ /*
+ * @see
+ * org.springframework.ldap.control.AbstractRequestControlDirContextProcessor
+ * #createRequestControl()
+ */
+
+ public Control createRequestControl() {
+ byte[] actualCookie = null;
+ if (cookie != null) {
+ actualCookie = cookie.getCookie();
+ }
+ Constructor constructor = ClassUtils.getConstructorIfAvailable(requestControlClass, new Class[] { int.class,
+ byte[].class, boolean.class });
+ if (constructor == null) {
+ throw new IllegalArgumentException("Failed to find an appropriate RequestControl constructor");
+ }
+
+ Control result = null;
+ try {
+ result = (Control) constructor.newInstance(pageSize, actualCookie,
+ critical);
+ }
+ catch (Exception e) {
+ ReflectionUtils.handleReflectionException(e);
+ }
+
+ return result;
+ }
+
+ /*
+ * @see
+ * org.springframework.ldap.core.DirContextProcessor#postProcess(javax.naming
+ * .directory.DirContext)
+ */
+
+ public void postProcess(DirContext ctx) throws NamingException {
+
+ LdapContext ldapContext = (LdapContext) ctx;
+ Control[] responseControls = ldapContext.getResponseControls();
+ if (responseControls == null) {
+ responseControls = new Control[0];
+ }
+
+ // Go through response controls and get info, regardless of class
+ for (int i = 0; i < responseControls.length; i++) {
+ Control responseControl = responseControls[i];
+
+ // check for match, try fallback otherwise
+ if (responseControl.getClass().isAssignableFrom(responseControlClass)) {
+ Object control = responseControl;
+ byte[] result = (byte[]) invokeMethod("getCookie", responseControlClass, control);
+ this.cookie = new PagedResultsCookie(result);
+ Integer wrapper = (Integer) invokeMethod("getResultSize", responseControlClass, control);
+ this.resultSize = wrapper.intValue();
+ return;
+ }
+ }
+
+ log.error("No matching response control found for paged results - looking for '{}", responseControlClass);
+ }
+
+ private Object invokeMethod(String method, Class clazz, Object control) {
+ Method actualMethod = ReflectionUtils.findMethod(clazz, method);
+ return ReflectionUtils.invokeMethod(actualMethod, control);
+ }
+}
diff --git a/core/src/main/java/org/springframework/ldap/control/SortControlDirContextProcessor.java b/core/src/main/java/org/springframework/ldap/control/SortControlDirContextProcessor.java
index 9b372b5d..9708b644 100644
--- a/core/src/main/java/org/springframework/ldap/control/SortControlDirContextProcessor.java
+++ b/core/src/main/java/org/springframework/ldap/control/SortControlDirContextProcessor.java
@@ -1,119 +1,119 @@
-/*
- * 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
- *
- * https://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.control;
-
-import javax.naming.ldap.Control;
-
-/**
- * DirContextProcessor implementation for managing the SortControl. Note that
- * this class is stateful, so a new instance needs to be instantiated for each
- * new search.
- *
- * @author Ulrik Sandberg
- */
-public class SortControlDirContextProcessor extends AbstractFallbackRequestAndResponseControlDirContextProcessor {
-
- private static final String DEFAULT_REQUEST_CONTROL = "javax.naming.ldap.SortControl";
-
- private static final String FALLBACK_REQUEST_CONTROL = "com.sun.jndi.ldap.ctl.SortControl";
-
- private static final String DEFAULT_RESPONSE_CONTROL = "javax.naming.ldap.SortResponseControl";
-
- private static final String FALLBACK_RESPONSE_CONTROL = "com.sun.jndi.ldap.ctl.SortResponseControl";
-
- /**
- * What key to sort on.
- */
- String sortKey;
-
- /**
- * Whether the search result actually was sorted.
- */
- private boolean sorted;
-
- /**
- * The result code of the supposedly sorted search.
- */
- private int resultCode;
-
- /**
- * Constructs a new instance using the supplied sort key.
- *
- * @param sortKey the sort key, i.e. the attribute name to sort on.
- */
- public SortControlDirContextProcessor(String sortKey) {
- this.sortKey = sortKey;
- this.sorted = false;
- this.resultCode = -1;
-
- defaultRequestControl = DEFAULT_REQUEST_CONTROL;
- defaultResponseControl = DEFAULT_RESPONSE_CONTROL;
-
- fallbackRequestControl = FALLBACK_REQUEST_CONTROL;
- fallbackResponseControl = FALLBACK_RESPONSE_CONTROL;
-
- loadControlClasses();
- }
-
- /**
- * Check whether the returned values were actually sorted by the server.
- *
- * @return true if the result was sorted, false
- * otherwise.
- */
- public boolean isSorted() {
- return sorted;
- }
-
- /**
- * Get the result code returned by the control.
- *
- * @return result code.
- */
- public int getResultCode() {
- return resultCode;
- }
-
- /**
- * Get the sort key.
- *
- * @return the sort key.
- */
- public String getSortKey() {
- return sortKey;
- }
-
- /*
- * @see
- * org.springframework.ldap.control.AbstractRequestControlDirContextProcessor
- * #createRequestControl()
- */
- public Control createRequestControl() {
- return super.createRequestControl(new Class>[] { String[].class, boolean.class }, new Object[] {
- new String[] { sortKey }, critical});
- }
-
- /*
- * @see org.springframework.ldap.control.
- * AbstractFallbackRequestAndResponseControlDirContextProcessor
- * #handleResponse(java.lang.Object)
- */
- protected void handleResponse(Object control) {
- this.sorted = (Boolean) invokeMethod("isSorted", responseControlClass, control);
- this.resultCode = (Integer) invokeMethod("getResultCode", responseControlClass, control);
- }
-}
+/*
+ * 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
+ *
+ * https://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.control;
+
+import javax.naming.ldap.Control;
+
+/**
+ * DirContextProcessor implementation for managing the SortControl. Note that
+ * this class is stateful, so a new instance needs to be instantiated for each
+ * new search.
+ *
+ * @author Ulrik Sandberg
+ */
+public class SortControlDirContextProcessor extends AbstractFallbackRequestAndResponseControlDirContextProcessor {
+
+ private static final String DEFAULT_REQUEST_CONTROL = "javax.naming.ldap.SortControl";
+
+ private static final String FALLBACK_REQUEST_CONTROL = "com.sun.jndi.ldap.ctl.SortControl";
+
+ private static final String DEFAULT_RESPONSE_CONTROL = "javax.naming.ldap.SortResponseControl";
+
+ private static final String FALLBACK_RESPONSE_CONTROL = "com.sun.jndi.ldap.ctl.SortResponseControl";
+
+ /**
+ * What key to sort on.
+ */
+ String sortKey;
+
+ /**
+ * Whether the search result actually was sorted.
+ */
+ private boolean sorted;
+
+ /**
+ * The result code of the supposedly sorted search.
+ */
+ private int resultCode;
+
+ /**
+ * Constructs a new instance using the supplied sort key.
+ *
+ * @param sortKey the sort key, i.e. the attribute name to sort on.
+ */
+ public SortControlDirContextProcessor(String sortKey) {
+ this.sortKey = sortKey;
+ this.sorted = false;
+ this.resultCode = -1;
+
+ defaultRequestControl = DEFAULT_REQUEST_CONTROL;
+ defaultResponseControl = DEFAULT_RESPONSE_CONTROL;
+
+ fallbackRequestControl = FALLBACK_REQUEST_CONTROL;
+ fallbackResponseControl = FALLBACK_RESPONSE_CONTROL;
+
+ loadControlClasses();
+ }
+
+ /**
+ * Check whether the returned values were actually sorted by the server.
+ *
+ * @return true if the result was sorted, false
+ * otherwise.
+ */
+ public boolean isSorted() {
+ return sorted;
+ }
+
+ /**
+ * Get the result code returned by the control.
+ *
+ * @return result code.
+ */
+ public int getResultCode() {
+ return resultCode;
+ }
+
+ /**
+ * Get the sort key.
+ *
+ * @return the sort key.
+ */
+ public String getSortKey() {
+ return sortKey;
+ }
+
+ /*
+ * @see
+ * org.springframework.ldap.control.AbstractRequestControlDirContextProcessor
+ * #createRequestControl()
+ */
+ public Control createRequestControl() {
+ return super.createRequestControl(new Class>[] { String[].class, boolean.class }, new Object[] {
+ new String[] { sortKey }, critical});
+ }
+
+ /*
+ * @see org.springframework.ldap.control.
+ * AbstractFallbackRequestAndResponseControlDirContextProcessor
+ * #handleResponse(java.lang.Object)
+ */
+ protected void handleResponse(Object control) {
+ this.sorted = (Boolean) invokeMethod("isSorted", responseControlClass, control);
+ this.resultCode = (Integer) invokeMethod("getResultCode", responseControlClass, control);
+ }
+}
diff --git a/core/src/main/java/org/springframework/ldap/core/AttributeModificationsAware.java b/core/src/main/java/org/springframework/ldap/core/AttributeModificationsAware.java
index 9cd28368..aacbd491 100644
--- a/core/src/main/java/org/springframework/ldap/core/AttributeModificationsAware.java
+++ b/core/src/main/java/org/springframework/ldap/core/AttributeModificationsAware.java
@@ -1,37 +1,37 @@
-/*
- * Copyright 2005-2010 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
- *
- * https://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.core;
-
-import javax.naming.directory.ModificationItem;
-
-/**
- * Indicates that the implementing class is capable of keeping track of any
- * attribute modifications and return them as ModificationItems.
- *
- * @author Mattias Hellborg Arthursson
- *
- */
-public interface AttributeModificationsAware {
-
- /**
- * Creates an array of which attributes have been changed, added or removed
- * since the initialization of this object.
- *
- * @return an array of modification items.
- */
- ModificationItem[] getModificationItems();
-}
+/*
+ * Copyright 2005-2010 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
+ *
+ * https://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.core;
+
+import javax.naming.directory.ModificationItem;
+
+/**
+ * Indicates that the implementing class is capable of keeping track of any
+ * attribute modifications and return them as ModificationItems.
+ *
+ * @author Mattias Hellborg Arthursson
+ *
+ */
+public interface AttributeModificationsAware {
+
+ /**
+ * Creates an array of which attributes have been changed, added or removed
+ * since the initialization of this object.
+ *
+ * @return an array of modification items.
+ */
+ ModificationItem[] getModificationItems();
+}
diff --git a/core/src/main/java/org/springframework/ldap/core/AttributesMapper.java b/core/src/main/java/org/springframework/ldap/core/AttributesMapper.java
index 3288ba9f..3ab1b38c 100644
--- a/core/src/main/java/org/springframework/ldap/core/AttributesMapper.java
+++ b/core/src/main/java/org/springframework/ldap/core/AttributesMapper.java
@@ -1,55 +1,55 @@
-/*
- * 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
- *
- * https://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.core;
-
-import javax.naming.Name;
-import javax.naming.NamingException;
-import javax.naming.directory.Attributes;
-
-/**
- * An interface used by LdapTemplate for mapping LDAP Attributes to beans.
- * Implementions of this interface perform the actual work of extracting
- * results, but need not worry about exception handling. NamingExceptions will
- * be caught and handled correctly by the {@link LdapTemplate} class.
- *
- * Typically used in search methods of {@link LdapTemplate}.
- * AttributeMapper objects are normally stateless and thus
- * reusable; they are ideal for implementing attribute-mapping logic in one
- * place.
- *
- * Alternatively, consider using a {@link ContextMapper} in stead.
- *
- * @see LdapTemplate#search(Name, String, AttributesMapper)
- * @see LdapTemplate#lookup(Name, AttributesMapper)
- * @see ContextMapper
- *
- * @author Mattias Hellborg Arthursson
- */
-public interface AttributesMapper
+ * Typically used in search methods of {@link LdapTemplate}.
+ *
+ * Alternatively, consider using a {@link ContextMapper} in stead.
+ *
+ * @see LdapTemplate#search(Name, String, AttributesMapper)
+ * @see LdapTemplate#lookup(Name, AttributesMapper)
+ * @see ContextMapper
+ *
+ * @author Mattias Hellborg Arthursson
+ */
+public interface AttributesMapper
- * ContextMapper implementations are typically stateless and thus reusable; they
- * are ideal for implementing mapping logic in one place.
- *
- * Alternatively, consider using an {@link AttributesMapper} in stead.
- *
- * @see LdapTemplate#search(Name, String, ContextMapper)
- * @see LdapTemplate#listBindings(Name, ContextMapper)
- * @see LdapTemplate#lookup(Name, ContextMapper)
- * @see AttributesMapper
- * @see DefaultDirObjectFactory
- * @see DirContextAdapter
- * @see AbstractContextMapper
- *
- * @author Mattias Hellborg Arthursson
- */
-public interface ContextMapper
+ * ContextMapper implementations are typically stateless and thus reusable; they
+ * are ideal for implementing mapping logic in one place.
+ *
+ * Alternatively, consider using an {@link AttributesMapper} in stead.
+ *
+ * @see LdapTemplate#search(Name, String, ContextMapper)
+ * @see LdapTemplate#listBindings(Name, ContextMapper)
+ * @see LdapTemplate#lookup(Name, ContextMapper)
+ * @see AttributesMapper
+ * @see DefaultDirObjectFactory
+ * @see DirContextAdapter
+ * @see AbstractContextMapper
+ *
+ * @author Mattias Hellborg Arthursson
+ */
+public interface ContextMapper
- * While uncommon, options can be used to specify additional descriptors for
- * the attribute. Options are backed by a {@link java.util.HashSet} of
- * {@link java.lang.String}.
- *
- * @author Keith Barlow
- *
- */
-public class LdapAttribute extends BasicAttribute {
-
- private static final long serialVersionUID = -5263905906016179429L;
-
- /**
- * Holds the attributes options.
- */
- protected Set
+ * While uncommon, options can be used to specify additional descriptors for
+ * the attribute. Options are backed by a {@link java.util.HashSet} of
+ * {@link java.lang.String}.
+ *
+ * @author Keith Barlow
+ *
+ */
+public class LdapAttribute extends BasicAttribute {
+
+ private static final long serialVersionUID = -5263905906016179429L;
+
+ /**
+ * Holds the attributes options.
+ */
+ protected Set
- * Typical use of this method would be as follows:
- *
- *
- * Example:
- * Example:
- * Example:
- * Example:
- * Note: This method differs from the older authenticate methods in that encountered
- * exceptions are thrown rather than supplied to a callback for handling.
- *
- * Note: This method differs from the older authenticate methods in that encountered
- * exceptions are thrown rather than supplied to a callback for handling.
- *
- * Only those entries that both match the query search filter and
- * are represented by the given Java class are returned.
- *
- * @param NamingExceptions will
+ * be caught and handled correctly by the {@link LdapTemplate} class.
+ * AttributeMapper objects are normally stateless and thus
+ * reusable; they are ideal for implementing attribute-mapping logic in one
+ * place.
+ * AuthenticationSource is responsible for providing the
- * principal (user DN) and credentials to be used when creating a new context.
- *
- * @author Mattias Hellborg Arthursson
- *
- */
-public interface AuthenticationSource {
- /**
- * Get the principal to use when creating an authenticated context.
- *
- * @return the principal (userDn).
- */
- String getPrincipal();
-
- /**
- * Get the credentials to use when creating an authenticated context.
- *
- * @return the credentials (password).
- */
- String getCredentials();
-}
+/*
+ * Copyright 2005-2010 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
+ *
+ * https://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.core;
+
+/**
+ * An AuthenticationSource is responsible for providing the
+ * principal (user DN) and credentials to be used when creating a new context.
+ *
+ * @author Mattias Hellborg Arthursson
+ *
+ */
+public interface AuthenticationSource {
+ /**
+ * Get the principal to use when creating an authenticated context.
+ *
+ * @return the principal (userDn).
+ */
+ String getPrincipal();
+
+ /**
+ * Get the credentials to use when creating an authenticated context.
+ *
+ * @return the credentials (password).
+ */
+ String getCredentials();
+}
diff --git a/core/src/main/java/org/springframework/ldap/core/CollectingNameClassPairCallbackHandler.java b/core/src/main/java/org/springframework/ldap/core/CollectingNameClassPairCallbackHandler.java
index bae7b6a9..7f785157 100644
--- a/core/src/main/java/org/springframework/ldap/core/CollectingNameClassPairCallbackHandler.java
+++ b/core/src/main/java/org/springframework/ldap/core/CollectingNameClassPairCallbackHandler.java
@@ -1,64 +1,64 @@
-/*
- * 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
- *
- * https://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.core;
-
-import javax.naming.NameClassPair;
-import javax.naming.NamingException;
-import java.util.LinkedList;
-import java.util.List;
-
-/**
- * A NameClassPairCallbackHandler to collect all results in an internal List.
- *
- * @see LdapTemplate
- *
- * @author Mattias Hellborg Arthursson
- */
-public abstract class CollectingNameClassPairCallbackHandlerDirContext. For searches, use {@link SearchExecutor} in
- * stead. A typical usage of this interface could be e.g.:
- *
- *
- * ContextExecutor executor = new ContextExecutor() {
- * public Object executeWithContext(DirContext ctx) throws NamingException {
- * return ctx.lookup(dn);
- * }
- * };
- *
- *
- * @see LdapTemplate#executeReadOnly(ContextExecutor)
- * @see LdapTemplate#executeReadWrite(ContextExecutor)
- *
- * @author Mattias Hellborg Arthursson
- */
-public interface ContextExecutorDirContext. For searches, use {@link SearchExecutor} in
+ * stead. A typical usage of this interface could be e.g.:
+ *
+ *
+ * ContextExecutor executor = new ContextExecutor() {
+ * public Object executeWithContext(DirContext ctx) throws NamingException {
+ * return ctx.lookup(dn);
+ * }
+ * };
+ *
+ *
+ * @see LdapTemplate#executeReadOnly(ContextExecutor)
+ * @see LdapTemplate#executeReadWrite(ContextExecutor)
+ *
+ * @author Mattias Hellborg Arthursson
+ */
+public interface ContextExecutorsearch and listBindings operations are
- * automatically transformed to DirContext objects (when using the
- * {@link DefaultDirObjectFactory} - which is typically the case, unless
- * something else has been explicitly specified - you get a
- * {@link DirContextAdapter} object). This object will then be passed to the
- * ContextMapper implementation for transformation to the desired bean.
- * ctx is the object from a single {@link SearchResult},
- * {@link Binding}, or a lookup operation.
- *
- * @param ctx
- * the context to map to an object. Typically this will be a
- * {@link DirContextAdapter} instance, unless a project specific
- * DirObjectFactory has been specified on the
- * ContextSource.
- * @return an object built from the data in the context.
- * @throws NamingException if an error occurs.
- */
- T mapFromContext(Object ctx) throws NamingException;
-}
+/*
+ * 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
+ *
+ * https://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.core;
+
+import org.springframework.ldap.core.support.AbstractContextMapper;
+import org.springframework.ldap.core.support.DefaultDirObjectFactory;
+
+import javax.naming.Binding;
+import javax.naming.Name;
+import javax.naming.NamingException;
+import javax.naming.directory.SearchResult;
+
+/**
+ * An interface used by LdapTemplate to map LDAP Contexts to beans. When a
+ * DirObjectFactory is set on the ContextSource, the objects returned from
+ * search and listBindings operations are
+ * automatically transformed to DirContext objects (when using the
+ * {@link DefaultDirObjectFactory} - which is typically the case, unless
+ * something else has been explicitly specified - you get a
+ * {@link DirContextAdapter} object). This object will then be passed to the
+ * ContextMapper implementation for transformation to the desired bean.
+ * ctx is the object from a single {@link SearchResult},
+ * {@link Binding}, or a lookup operation.
+ *
+ * @param ctx
+ * the context to map to an object. Typically this will be a
+ * {@link DirContextAdapter} instance, unless a project specific
+ * DirObjectFactory has been specified on the
+ * ContextSource.
+ * @return an object built from the data in the context.
+ * @throws NamingException if an error occurs.
+ */
+ T mapFromContext(Object ctx) throws NamingException;
+}
diff --git a/core/src/main/java/org/springframework/ldap/core/ContextSource.java b/core/src/main/java/org/springframework/ldap/core/ContextSource.java
index 81d7b452..ae8a6915 100644
--- a/core/src/main/java/org/springframework/ldap/core/ContextSource.java
+++ b/core/src/main/java/org/springframework/ldap/core/ContextSource.java
@@ -1,71 +1,71 @@
-/*
- * 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
- *
- * https://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.core;
-
-import org.springframework.ldap.NamingException;
-
-import javax.naming.directory.DirContext;
-
-/**
- * A ContextSource is responsible for configuring and creating
- * DirContext instances. It is typically used from
- * {@link LdapTemplate} to acquiring contexts for LDAP operations, but may be
- * used standalone to perform LDAP authentication.
- *
- * @see org.springframework.ldap.core.LdapTemplate
- *
- * @author Adam Skogman
- * @author Mattias Hellborg Arthursson
- */
-public interface ContextSource {
-
- /**
- * Gets a read-only DirContext. The returned
- * DirContext must be possible to perform read-only operations
- * on.
- *
- * @return A DirContext instance, never null.
- * @throws NamingException if some error occurs creating an DirContext.
- */
- DirContext getReadOnlyContext() throws NamingException;
-
- /**
- * Gets a read-write DirContext instance.
- *
- * @return A DirContext instance, never null.
- * @throws NamingException if some error occurs creating an
- * DirContext.
- */
- DirContext getReadWriteContext() throws NamingException;
-
- /**
- * Gets a DirContext instance authenticated using the supplied
- * principal and credentials. Typically to be used for plain authentication
- * purposes. Note that this method will never make use
- * of native Java LDAP pooling, even though this instance is configured to do so.
- * This is to force password changes in the target directory to take effect
- * as soon as possible.
- *
- * @param principal The principal (typically a distinguished name of a user
- * in the LDAP tree) to use for authentication.
- * @param credentials The credentials to use for authentication.
- * @return an authenticated DirContext instance, never
- * null.
- * @since 1.3
- */
- DirContext getContext(String principal, String credentials) throws NamingException;
+/*
+ * 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
+ *
+ * https://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.core;
+
+import org.springframework.ldap.NamingException;
+
+import javax.naming.directory.DirContext;
+
+/**
+ * A ContextSource is responsible for configuring and creating
+ * DirContext instances. It is typically used from
+ * {@link LdapTemplate} to acquiring contexts for LDAP operations, but may be
+ * used standalone to perform LDAP authentication.
+ *
+ * @see org.springframework.ldap.core.LdapTemplate
+ *
+ * @author Adam Skogman
+ * @author Mattias Hellborg Arthursson
+ */
+public interface ContextSource {
+
+ /**
+ * Gets a read-only DirContext. The returned
+ * DirContext must be possible to perform read-only operations
+ * on.
+ *
+ * @return A DirContext instance, never null.
+ * @throws NamingException if some error occurs creating an DirContext.
+ */
+ DirContext getReadOnlyContext() throws NamingException;
+
+ /**
+ * Gets a read-write DirContext instance.
+ *
+ * @return A DirContext instance, never null.
+ * @throws NamingException if some error occurs creating an
+ * DirContext.
+ */
+ DirContext getReadWriteContext() throws NamingException;
+
+ /**
+ * Gets a DirContext instance authenticated using the supplied
+ * principal and credentials. Typically to be used for plain authentication
+ * purposes. Note that this method will never make use
+ * of native Java LDAP pooling, even though this instance is configured to do so.
+ * This is to force password changes in the target directory to take effect
+ * as soon as possible.
+ *
+ * @param principal The principal (typically a distinguished name of a user
+ * in the LDAP tree) to use for authentication.
+ * @param credentials The credentials to use for authentication.
+ * @return an authenticated DirContext instance, never
+ * null.
+ * @since 1.3
+ */
+ DirContext getContext(String principal, String credentials) throws NamingException;
}
\ No newline at end of file
diff --git a/core/src/main/java/org/springframework/ldap/core/DefaultDnParserFactory.java b/core/src/main/java/org/springframework/ldap/core/DefaultDnParserFactory.java
index 7b8938a0..9299833f 100644
--- a/core/src/main/java/org/springframework/ldap/core/DefaultDnParserFactory.java
+++ b/core/src/main/java/org/springframework/ldap/core/DefaultDnParserFactory.java
@@ -1,45 +1,45 @@
-/*
- * 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
- *
- * https://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.core;
-
-import java.io.StringReader;
-
-/**
- * A factory for creating DnParser instances. The actual implementation of
- * DnParser is generated using javacc and should not be constructed directly.
- *
- * @author Mattias Hellborg Arthursson
- * @deprecated {@link DistinguishedName} and associated classes are deprecated as of 2.0.
- */
-public final class DefaultDnParserFactory {
- /**
- * Not to be instantiated.
- */
- private DefaultDnParserFactory() {
-
- }
-
- /**
- * Create a new DnParser instance.
- *
- * @param string
- * the DN String to be parsed.
- * @return a new DnParser instance for parsing the supplied DN string.
- */
- public static DnParser createDnParser(String string) {
- return new DnParserImpl(new StringReader(string));
- }
-}
+/*
+ * 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
+ *
+ * https://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.core;
+
+import java.io.StringReader;
+
+/**
+ * A factory for creating DnParser instances. The actual implementation of
+ * DnParser is generated using javacc and should not be constructed directly.
+ *
+ * @author Mattias Hellborg Arthursson
+ * @deprecated {@link DistinguishedName} and associated classes are deprecated as of 2.0.
+ */
+public final class DefaultDnParserFactory {
+ /**
+ * Not to be instantiated.
+ */
+ private DefaultDnParserFactory() {
+
+ }
+
+ /**
+ * Create a new DnParser instance.
+ *
+ * @param string
+ * the DN String to be parsed.
+ * @return a new DnParser instance for parsing the supplied DN string.
+ */
+ public static DnParser createDnParser(String string) {
+ return new DnParserImpl(new StringReader(string));
+ }
+}
diff --git a/core/src/main/java/org/springframework/ldap/core/DefaultNameClassPairMapper.java b/core/src/main/java/org/springframework/ldap/core/DefaultNameClassPairMapper.java
index 8db126d5..71edb54c 100644
--- a/core/src/main/java/org/springframework/ldap/core/DefaultNameClassPairMapper.java
+++ b/core/src/main/java/org/springframework/ldap/core/DefaultNameClassPairMapper.java
@@ -1,47 +1,47 @@
-/*
- * 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
- *
- * https://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.core;
-
-import javax.naming.NameClassPair;
-import javax.naming.NamingException;
-
-/**
- * The default NameClassPairMapper implementation. This implementation simply
- * takes the Name string from the supplied NameClassPair and returns it as
- * result.
- *
- * @author Mattias Hellborg Arthursson
- *
- */
-public class DefaultNameClassPairMapper implements NameClassPairMapperContext and retrieve the results of
- * such controls afterwards.
- *
- * @author Mattias Hellborg Arthursson
- * @author Ulrik Sandberg
- */
-public interface DirContextProcessor {
- /**
- * Perform pre-processing on the supplied DirContext.
- *
- * @param ctx
- * the DirContext instance.
- * @throws NamingException
- * if thrown by the underlying operation.
- */
- void preProcess(DirContext ctx) throws NamingException;
-
- /**
- * Perform post-processing on the supplied DirContext.
- *
- * @param ctx
- * the DirContext instance.
- * @throws NamingException
- * if thrown by the underlying operation.
- */
- void postProcess(DirContext ctx) throws NamingException;
-}
+/*
+ * Copyright 2005-2010 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
+ *
+ * https://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.core;
+
+import javax.naming.NamingException;
+import javax.naming.directory.DirContext;
+
+/**
+ * Interface to be called in search by {@link LdapTemplate} before and after the
+ * actual search and enumeration traversal. Implementations may be used to apply
+ * search controls on the Context and retrieve the results of
+ * such controls afterwards.
+ *
+ * @author Mattias Hellborg Arthursson
+ * @author Ulrik Sandberg
+ */
+public interface DirContextProcessor {
+ /**
+ * Perform pre-processing on the supplied DirContext.
+ *
+ * @param ctx
+ * the DirContext instance.
+ * @throws NamingException
+ * if thrown by the underlying operation.
+ */
+ void preProcess(DirContext ctx) throws NamingException;
+
+ /**
+ * Perform post-processing on the supplied DirContext.
+ *
+ * @param ctx
+ * the DirContext instance.
+ * @throws NamingException
+ * if thrown by the underlying operation.
+ */
+ void postProcess(DirContext ctx) throws NamingException;
+}
diff --git a/core/src/main/java/org/springframework/ldap/core/DirContextProxy.java b/core/src/main/java/org/springframework/ldap/core/DirContextProxy.java
index 1d14f17e..f7f25aaf 100644
--- a/core/src/main/java/org/springframework/ldap/core/DirContextProxy.java
+++ b/core/src/main/java/org/springframework/ldap/core/DirContextProxy.java
@@ -1,34 +1,34 @@
-/*
- * Copyright 2005-2010 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
- *
- * https://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.core;
-
-import javax.naming.directory.DirContext;
-
-/**
- * Helper interface to be able to get hold of the target DirContext
- * from proxies created by ContextSource proxies.
- *
- * @author Mattias Hellborg Arthursson
- * @since 1.2
- */
-public interface DirContextProxy {
- /**
- * Get the target DirContext of the proxy.
- *
- * @return the target DirContext.
- */
- DirContext getTargetContext();
-}
+/*
+ * Copyright 2005-2010 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
+ *
+ * https://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.core;
+
+import javax.naming.directory.DirContext;
+
+/**
+ * Helper interface to be able to get hold of the target DirContext
+ * from proxies created by ContextSource proxies.
+ *
+ * @author Mattias Hellborg Arthursson
+ * @since 1.2
+ */
+public interface DirContextProxy {
+ /**
+ * Get the target DirContext of the proxy.
+ *
+ * @return the target DirContext.
+ */
+ DirContext getTargetContext();
+}
diff --git a/core/src/main/java/org/springframework/ldap/core/DistinguishedNameEditor.java b/core/src/main/java/org/springframework/ldap/core/DistinguishedNameEditor.java
index 61b99354..0188408f 100644
--- a/core/src/main/java/org/springframework/ldap/core/DistinguishedNameEditor.java
+++ b/core/src/main/java/org/springframework/ldap/core/DistinguishedNameEditor.java
@@ -1,58 +1,58 @@
-/*
- * Copyright 2005-2010 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
- *
- * https://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.core;
-
-import java.beans.PropertyEditorSupport;
-
-/**
- * Property editor for use with {@link DistinguishedName} instances. The
- * {@link #setAsText(String)} method sets the value as an immutable
- * instance of a DistinguishedName.
- *
- * @author Mattias Hellborg Arthursson
- * @since 1.2
- * @deprecated {@link DistinguishedName} and associated classes are deprecated as of 2.0.
- */
-public class DistinguishedNameEditor extends PropertyEditorSupport {
-
- /*
- * (non-Javadoc)
- * @see java.beans.PropertyEditorSupport#setAsText(java.lang.String)
- */
- public void setAsText(String text) throws IllegalArgumentException {
- if (text == null) {
- setValue(null);
- }
- else {
- setValue(new DistinguishedName(text).immutableDistinguishedName());
- }
- }
-
- /*
- * (non-Javadoc)
- * @see java.beans.PropertyEditorSupport#getAsText()
- */
- public String getAsText() {
- Object theValue = getValue();
- if (theValue == null) {
- return null;
- }
- else {
- return ((DistinguishedName) theValue).toString();
- }
- }
-
-}
+/*
+ * Copyright 2005-2010 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
+ *
+ * https://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.core;
+
+import java.beans.PropertyEditorSupport;
+
+/**
+ * Property editor for use with {@link DistinguishedName} instances. The
+ * {@link #setAsText(String)} method sets the value as an immutable
+ * instance of a DistinguishedName.
+ *
+ * @author Mattias Hellborg Arthursson
+ * @since 1.2
+ * @deprecated {@link DistinguishedName} and associated classes are deprecated as of 2.0.
+ */
+public class DistinguishedNameEditor extends PropertyEditorSupport {
+
+ /*
+ * (non-Javadoc)
+ * @see java.beans.PropertyEditorSupport#setAsText(java.lang.String)
+ */
+ public void setAsText(String text) throws IllegalArgumentException {
+ if (text == null) {
+ setValue(null);
+ }
+ else {
+ setValue(new DistinguishedName(text).immutableDistinguishedName());
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see java.beans.PropertyEditorSupport#getAsText()
+ */
+ public String getAsText() {
+ Object theValue = getValue();
+ if (theValue == null) {
+ return null;
+ }
+ else {
+ return ((DistinguishedName) theValue).toString();
+ }
+ }
+
+}
diff --git a/core/src/main/java/org/springframework/ldap/core/DnParser.java b/core/src/main/java/org/springframework/ldap/core/DnParser.java
index 13416dde..3b20fa99 100644
--- a/core/src/main/java/org/springframework/ldap/core/DnParser.java
+++ b/core/src/main/java/org/springframework/ldap/core/DnParser.java
@@ -1,39 +1,39 @@
-/*
- * Copyright 2005-2010 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
- *
- * https://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.core;
-
-/**
- * A parser for RFC2253-compliant Distinguished Names.
- *
- * @author Mattias Hellborg Arthursson
- * @deprecated {@link DistinguishedName} and associated classes are deprecated as of 2.0.
- */
-public interface DnParser {
- /**
- * Parse a full Distinguished Name.
- *
- * @return the DistinguishedName corresponding to the parsed
- * stream.
- */
- public DistinguishedName dn() throws ParseException;
-
- /**
- * Parse a Relative Distinguished Name.
- *
- * @return the next rdn on the stream.
- */
- public LdapRdn rdn() throws ParseException;
-}
+/*
+ * Copyright 2005-2010 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
+ *
+ * https://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.core;
+
+/**
+ * A parser for RFC2253-compliant Distinguished Names.
+ *
+ * @author Mattias Hellborg Arthursson
+ * @deprecated {@link DistinguishedName} and associated classes are deprecated as of 2.0.
+ */
+public interface DnParser {
+ /**
+ * Parse a full Distinguished Name.
+ *
+ * @return the DistinguishedName corresponding to the parsed
+ * stream.
+ */
+ public DistinguishedName dn() throws ParseException;
+
+ /**
+ * Parse a Relative Distinguished Name.
+ *
+ * @return the next rdn on the stream.
+ */
+ public LdapRdn rdn() throws ParseException;
+}
diff --git a/core/src/main/java/org/springframework/ldap/core/LdapAttribute.java b/core/src/main/java/org/springframework/ldap/core/LdapAttribute.java
index cfe8f052..037f5272 100644
--- a/core/src/main/java/org/springframework/ldap/core/LdapAttribute.java
+++ b/core/src/main/java/org/springframework/ldap/core/LdapAttribute.java
@@ -1,224 +1,224 @@
-/*
- * Copyright 2005-2010 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
- *
- * https://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.core;
-
-import javax.naming.directory.BasicAttribute;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
-
-/**
- * Extends {@link javax.naming.directory.BasicAttribute} to add support for
- * options as defined in RFC2849.
- * NamingEnumeration and
- * closing the context and enumeration. The actual search is delegated to
- * the SearchExecutor and each found NameClassPair is passed to
- * the CallbackHandler. Any encountered
- * NamingException will be translated using
- * {@link LdapUtils#convertLdapException(javax.naming.NamingException)}.
- *
- * @param se The SearchExecutor to use for performing the
- * actual search.
- * @param handler The NameClassPairCallbackHandler to which
- * each found entry will be passed.
- * @param processor DirContextProcessor for custom pre- and
- * post-processing.
- * @throws NamingException if any error occurs. Note that a
- * NameNotFoundException will be ignored. Instead this is
- * interpreted as no entries being found.
- */
- void search(SearchExecutor se, NameClassPairCallbackHandler handler, DirContextProcessor processor)
- throws NamingException;
-
- /**
- * Perform a search using a particular {@link SearchExecutor}. Use this
- * method only if especially needed - for the most cases there is an
- * overloaded convenience method which calls this one with suitable
- * argments. This method handles all the plumbing; getting a readonly
- * context; looping through the NamingEnumeration and closing
- * the context and enumeration. The actual search is delegated to the
- * SearchExecutor and each found NameClassPair is
- * passed to the CallbackHandler. Any encountered
- * NamingException will be translated using the
- * {@link LdapUtils#convertLdapException(javax.naming.NamingException)}.
- *
- * @param se The SearchExecutor to use for performing the
- * actual search.
- * @param handler The NameClassPairCallbackHandler to which
- * each found entry will be passed.
- * @throws NamingException if any error occurs. Note that a
- * NameNotFoundException will be ignored. Instead this is
- * interpreted as no entries being found.
- * @see #search(Name, String, AttributesMapper)
- * @see #search(Name, String, ContextMapper)
- */
- void search(SearchExecutor se, NameClassPairCallbackHandler handler) throws NamingException;
-
- /**
- * Perform an operation (or series of operations) on a read-only context.
- * This method handles the plumbing - getting a DirContext,
- * translating any Exceptions and closing the context afterwards. This
- * method is not intended for searches; use
- * {@link #search(SearchExecutor, NameClassPairCallbackHandler)} or any of
- * the overloaded search methods for this.
- *
- * @param ce The ContextExecutor to which the actual operation
- * on the DirContext will be delegated.
- * @return the result from the ContextExecutor's operation.
- * @throws NamingException if the operation resulted in a
- * NamingException.
- *
- * @see #search(SearchExecutor, NameClassPairCallbackHandler)
- * @see #search(Name, String, AttributesMapper)
- * @see #search(Name, String, ContextMapper)
- */
- DirContext,
- * translating any exceptions and closing the context afterwards. This
- * method is intended only for very particular cases, where there is no
- * suitable method in this interface to use.
- *
- * @param ce The ContextExecutor to which the actual operation
- * on the DirContext will be delegated.
- * @return the result from the ContextExecutor's operation.
- * @throws NamingException if the operation resulted in a
- * NamingException.
- * @see #bind(Name, Object, Attributes)
- * @see #unbind(Name)
- * @see #rebind(Name, Object, Attributes)
- * @see #rename(Name, Name)
- * @see #modifyAttributes(Name, ModificationItem[])
- */
- SearchResult is supplied to the specified
- * NameClassPairCallbackHandler. The SearchScope
- * specified in the supplied SearchControls will be used in the
- * search. Note that if you are using a ContextMapper, the
- * returningObjFlag needs to be set to true in the
- * SearchControls.
- *
- * @param base The base DN where the search should begin.
- * @param filter The filter to use in the search.
- * @param controls The SearchControls to use in the search.
- * @param handler The NameClassPairCallbackHandler to supply
- * the SearchResult to.
- * @throws NamingException if any error occurs. Note that a
- * NameNotFoundException will be ignored. Instead this is
- * interpreted that no entries were found.
- */
- void search(Name base, String filter, SearchControls controls, NameClassPairCallbackHandler handler)
- throws NamingException;
-
- /**
- * Search for all objects matching the supplied filter. See
- * {@link #search(Name, String, SearchControls, NameClassPairCallbackHandler)}
- * for details.
- *
- * @param base The base DN where the search should begin.
- * @param filter The filter to use in the search.
- * @param controls The SearchControls to use in the search.
- * @param handler The NameClassPairCallbackHandler to supply
- * the SearchResult to.
- * @throws NamingException if any error occurs. Note that a
- * NameNotFoundException will be ignored. Instead this is
- * interpreted that no entries were found.
- */
- void search(String base, String filter, SearchControls controls, NameClassPairCallbackHandler handler)
- throws NamingException;
-
- /**
- * Search for all objects matching the supplied filter. Each
- * SearchResult is supplied to the specified
- * NameClassPairCallbackHandler. The SearchScope
- * specified in the supplied SearchControls will be used in the
- * search. Note that if you are using a ContextMapper, the
- * returningObjFlag needs to be set to true in the
- * SearchControls. The given DirContextProcessor
- * will be called before and after the search.
- *
- * @param base The base DN where the search should begin.
- * @param filter The filter to use in the search.
- * @param controls The SearchControls to use in the search.
- * @param handler The NameClassPairCallbackHandler to supply
- * the SearchResult to.
- * @param processor The DirContextProcessor to use before and
- * after the search.
- * @throws NamingException if any error occurs. Note that a
- * NameNotFoundException will be ignored. Instead this is
- * interpreted that no entries were found.
- */
- void search(Name base, String filter, SearchControls controls, NameClassPairCallbackHandler handler,
- DirContextProcessor processor) throws NamingException;
-
- /**
- * Search for all objects matching the supplied filter. The Attributes in
- * each SearchResult is supplied to the specified
- * AttributesMapper. The SearchScope specified in
- * the supplied SearchControls will be used in the search. The
- * given DirContextProcessor will be called before and after
- * the search.
- *
- * @param base The base DN where the search should begin.
- * @param filter The filter to use in the search.
- * @param controls The SearchControls to use in the search.
- * @param mapper The AttributesMapper to use for translating
- * each entry.
- * @param processor The DirContextProcessor to use before and
- * after the search.
- * @return a List containing all entries received from the
- * AttributesMapper.
- * @throws NamingException if any error occurs. Note that a
- * NameNotFoundException will be ignored. Instead this is
- * interpreted that no entries were found.
- */
- SearchResult is supplied to the specified
- * AttributesMapper. The SearchScope specified in
- * the supplied SearchControls will be used in the search. The
- * given DirContextProcessor will be called before and after
- * the search.
- *
- * @param base The base DN where the search should begin.
- * @param filter The filter to use in the search.
- * @param controls The SearchControls to use in the search.
- * @param mapper The AttributesMapper to use for translating
- * each entry.
- * @param processor The DirContextProcessor to use before and
- * after the search.
- * @return a List containing all entries received from the
- * AttributesMapper.
- * @throws NamingException if any error occurs. Note that a
- * NameNotFoundException will be ignored. Instead this is
- * interpreted that no entries were found.
- */
- SearchResult is supplied to the specified
- * ContextMapper. The SearchScope specified in the
- * supplied SearchControls will be used in the search. The
- * given DirContextProcessor will be called before and after
- * the search.
- *
- * @param base The base DN where the search should begin.
- * @param filter The filter to use in the search.
- * @param controls The SearchControls to use in the search. If
- * the returnObjFlag is not set in the SearchControls, this
- * method will set it automatically, as this is required for the
- * ContextMapper to work.
- * @param mapper The ContextMapper to use for translating each
- * entry.
- * @param processor The DirContextProcessor to use before and
- * after the search.
- * @return a List containing all entries received from the
- * ContextMapper.
- * @throws NamingException if any error occurs. Note that a
- * NameNotFoundException will be ignored. Instead this is
- * interpreted that no entries were found.
- */
- SearchResult is supplied to the specified
- * ContextMapper. The SearchScope specified in the
- * supplied SearchControls will be used in the search. The
- * given DirContextProcessor will be called before and after
- * the search.
- *
- * @param base The base DN where the search should begin.
- * @param filter The filter to use in the search.
- * @param controls The SearchControls to use in the search. If
- * the returnObjFlag is not set in the SearchControls, this
- * method will set it automatically, as this is required for the
- * ContextMapper to work.
- * @param mapper The ContextMapper to use for translating each
- * entry.
- * @param processor The DirContextProcessor to use before and
- * after the search.
- * @return a List containing all entries received from the
- * ContextMapper.
- * @throws NamingException if any error occurs. Note that a
- * NameNotFoundException will be ignored. Instead this is
- * interpreted that no entries were found.
- */
- SearchControls to use in the search.
- * @param handler The NameClassPairCallbackHandler to supply
- * the SearchResults to.
- * @param processor The DirContextProcessor to use before and
- * after the search.
- * @throws NamingException if any error occurs. Note that a
- * NameNotFoundException will be ignored. Instead this is
- * interpreted that no entries were found.
- */
- void search(String base, String filter, SearchControls controls, NameClassPairCallbackHandler handler,
- DirContextProcessor processor) throws NamingException;
-
- /**
- * Search for all objects matching the supplied filter. Each
- * SearchResult is supplied to the specified
- * NameClassPairCallbackHandler. Use the specified values for
- * search scope and return objects flag.
- *
- * @param base The base DN where the search should begin.
- * @param filter The filter to use in the search.
- * @param searchScope The search scope to set in SearchControls
- * .
- * @param returningObjFlag Whether the bound object should be returned in
- * search results. Must be set to true if a
- * ContextMapper is used.
- * @param handler The NameClassPairCallbackHandler to supply
- * the SearchResults to.
- * @throws NamingException if any error occurs. Note that a
- * NameNotFoundException will be ignored. Instead this is
- * interpreted that no entries were found.
- */
- void search(Name base, String filter, int searchScope, boolean returningObjFlag,
- NameClassPairCallbackHandler handler) throws NamingException;
-
- /**
- * Search for all objects matching the supplied filter. Each
- * SearchResult is supplied to the specified
- * NameClassPairCallbackHandler. Use the specified values for
- * search scope and return objects flag.
- *
- * @param base The base DN where the search should begin.
- * @param filter The filter to use in the search.
- * @param searchScope The search scope to set in SearchControls
- * .
- * @param returningObjFlag Whether the bound object should be returned in
- * search results. Must be set to true if a
- * ContextMapper is used.
- * @param handler The NameClassPairCallbackHandler to supply
- * the SearchResults to.
- * @throws NamingException if any error occurs. Note that a
- * NameNotFoundException will be ignored. Instead this is
- * interpreted that no entries were found.
- */
- void search(String base, String filter, int searchScope, boolean returningObjFlag,
- NameClassPairCallbackHandler handler) throws NamingException;
-
- /**
- * Search for all objects matching the supplied filter. Each
- * SearchResult is supplied to the specified
- * NameClassPairCallbackHandler. The default Search scope (
- * SearchControls.SUBTREE_SCOPE) will be used and the
- * returnObjects flag will be set to false.
- *
- * @param base The base DN where the search should begin.
- * @param filter The filter to use in the search.
- * @param handler The NameClassPairCallbackHandler to supply
- * the SearchResults to.
- * @throws NamingException if any error occurs. Note that a
- * NameNotFoundException will be ignored. Instead this is
- * interpreted that no entries were found.
- */
- void search(Name base, String filter, NameClassPairCallbackHandler handler) throws NamingException;
-
- /**
- * Search for all objects matching the supplied filter. Each
- * SearchResult is supplied to the specified
- * NameClassPairCallbackHandler. The default Search scope (
- * SearchControls.SUBTREE_SCOPE) will be used and the
- * returnObjects flag will be set to false.
- *
- * @param base The base DN where the search should begin.
- * @param filter The filter to use in the search.
- * @param handler The NameClassPairCallbackHandler to supply
- * the SearchResults to.
- * @throws NamingException if any error occurs. Note that a
- * NameNotFoundException will be ignored. Instead this is
- * interpreted that no entries were found.
- */
- void search(String base, String filter, NameClassPairCallbackHandler handler) throws NamingException;
-
- /**
- * Search for all objects matching the supplied filter. Only return any
- * attributes mathing the specified attribute names. The Attributes in each
- * SearchResult is supplied to the specified
- * AttributesMapper.
- *
- * @param base The base DN where the search should begin.
- * @param filter The filter to use in the search.
- * @param searchScope The search scope to set in SearchControls
- * .
- * @param attrs The attributes to return, null means returning
- * all attributes.
- * @param mapper The AttributesMapper to use for translating
- * each entry.
- * @return a List containing all entries received from the
- * AttributesMapper.
- * @throws NamingException if any error occurs. Note that a
- * NameNotFoundException will be ignored. Instead this is
- * interpreted that no entries were found.
- */
- SearchResult is supplied to the specified
- * AttributesMapper.
- *
- * @param base The base DN where the search should begin.
- * @param filter The filter to use in the search.
- * @param searchScope The search scope to set in SearchControls
- * .
- * @param attrs The attributes to return, null means returning
- * all attributes.
- * @param mapper The AttributesMapper to use for translating
- * each entry.
- * @return a List containing all entries received from the
- * AttributesMapper.
- * @throws NamingException if any error occurs. Note that a
- * NameNotFoundException will be ignored. Instead this is
- * interpreted that no entries were found.
- */
- SearchResult is supplied to the specified
- * AttributesMapper.
- *
- * @param base The base DN where the search should begin.
- * @param filter The filter to use in the search.
- * @param searchScope The search scope to set in SearchControls
- * .
- * @param mapper The AttributesMapper to use for translating
- * each entry.
- * @return a List containing all entries received from the
- * AttributesMapper.
- * @throws NamingException if any error occurs. Note that a
- * NameNotFoundException will be ignored. Instead this is
- * interpreted that no entries were found.
- */
- SearchResult is supplied to the specified
- * AttributesMapper.
- *
- * @param base The base DN where the search should begin.
- * @param filter The filter to use in the search.
- * @param searchScope The search scope to set in SearchControls
- * .
- * @param mapper The AttributesMapper to use for translating
- * each entry.
- * @return a List containing all entries received from the
- * AttributesMapper.
- * @throws NamingException if any error occurs. Note that a
- * NameNotFoundException will be ignored. Instead this is
- * interpreted that no entries were found.
- */
- SearchResult is supplied to the specified
- * AttributesMapper. The default search scope will be used.
- *
- * @param base The base DN where the search should begin.
- * @param filter The filter to use in the search.
- * @param mapper The AttributesMapper to use for translating
- * each entry.
- * @return a List containing all entries received from the
- * AttributesMapper.
- * @throws NamingException if any error occurs. Note that a
- * NameNotFoundException will be ignored. Instead this is
- * interpreted that no entries were found.
- */
- SearchResult is supplied to the specified
- * AttributesMapper. The default search scope will be used.
- *
- * @param base The base DN where the search should begin.
- * @param filter The filter to use in the search.
- * @param mapper The AttributesMapper to use for translating
- * each entry.
- * @return a List containing all entries received from the
- * AttributesMapper.
- * @throws NamingException if any error occurs. Note that a
- * NameNotFoundException will be ignored. Instead this is
- * interpreted that no entries were found.
- */
- Object returned in each SearchResult is
- * supplied to the specified ContextMapper. Only return the
- * supplied attributes.
- *
- * @param base The base DN where the search should begin.
- * @param filter The filter to use in the search.
- * @param searchScope The search scope to set in SearchControls
- * .
- * @param attrs The attributes to return, null means all
- * attributes.
- * @param mapper The ContextMapper to use for translating each
- * entry.
- * @return a List containing all entries received from the
- * ContextMapper.
- * @throws NamingException if any error occurs. Note that a
- * NameNotFoundException will be ignored. Instead this is
- * interpreted that no entries were found.
- */
- Object returned in each SearchResult is
- * supplied to the specified ContextMapper. Only return the
- * supplied attributes.
- *
- * @param base The base DN where the search should begin.
- * @param filter The filter to use in the search.
- * @param searchScope The search scope to set in SearchControls
- * .
- * @param attrs The attributes to return, null means all
- * attributes.
- * @param mapper The ContextMapper to use for translating each
- * entry.
- * @return a List containing all entries received from the
- * ContextMapper.
- * @throws NamingException if any error occurs. Note that a
- * NameNotFoundException will be ignored. Instead this is
- * interpreted that no entries were found.
- */
- Object returned in each SearchResult is
- * supplied to the specified ContextMapper.
- *
- * @param base The base DN where the search should begin.
- * @param filter The filter to use in the search.
- * @param searchScope The search scope to set in SearchControls
- * .
- * @param mapper The ContextMapper to use for translating each
- * entry.
- * @return a List containing all entries received from the
- * ContextMapper.
- * @throws NamingException if any error occurs. Note that a
- * NameNotFoundException will be ignored. Instead this is
- * interpreted that no entries were found.
- */
- Object returned in each SearchResult is
- * supplied to the specified ContextMapper.
- *
- * @param base The base DN where the search should begin.
- * @param filter The filter to use in the search.
- * @param searchScope The search scope to set in SearchControls
- * .
- * @param mapper The ContextMapper to use for translating each
- * entry.
- * @return a List containing all entries received from the
- * ContextMapper.
- * @throws NamingException if any error occurs. Note that a
- * NameNotFoundException will be ignored. Instead this is
- * interpreted that no entries were found.
- */
- Object returned in each SearchResult is
- * supplied to the specified ContextMapper. The default search
- * scope (SearchControls.SUBTREE_SCOPE) will be used.
- *
- * @param base The base DN where the search should begin.
- * @param filter The filter to use in the search.
- * @param mapper The ContextMapper to use for translating each
- * entry.
- * @return a List containing all entries received from the
- * ContextMapper.
- * @throws NamingException if any error occurs. Note that a
- * NameNotFoundException will be ignored. Instead this is
- * interpreted that no entries were found.
- */
- Object returned in each SearchResult is
- * supplied to the specified ContextMapper. The default search
- * scope (SearchControls.SUBTREE_SCOPE) will be used.
- *
- * @param base The base DN where the search should begin.
- * @param filter The filter to use in the search.
- * @param mapper The ContextMapper to use for translating each
- * entry.
- * @return a List containing all entries received from the
- * ContextMapper.
- * @throws NamingException if any error occurs. Note that a
- * NameNotFoundException will be ignored. Instead this is
- * interpreted that no entries were found.
- */
- Object returned in each SearchResult is
- * supplied to the specified ContextMapper. The default search
- * scope (SearchControls.SUBTREE_SCOPE) will be used.
- *
- * @param base The base DN where the search should begin.
- * @param filter The filter to use in the search.
- * @param mapper The ContextMapper to use for translating each
- * entry.
- * @return a List containing all entries received from the
- * ContextMapper.
- * @throws NamingException if any error occurs. Note that a
- * NameNotFoundException will be ignored. Instead this is
- * interpreted that no entries were found.
- */
- SearchResult is supplied to the specified
- * ContextMapper.
- *
- * @param base The base DN where the search should begin.
- * @param filter The filter to use in the search.
- * @param controls The SearchControls to use in the search. If
- * the returnObjFlag is not set in the SearchControls, this
- * method will set it automatically, as this is required for the
- * ContextMapper to work.
- * @param mapper The ContextMapper to use for translating each
- * entry.
- * @return a List containing all entries received from the
- * ContextMapper.
- * @throws NamingException if any error occurs. Note that a
- * NameNotFoundException will be ignored. Instead this is
- * interpreted that no entries were found.
- */
- SearchResult is supplied to the specified
- * AttributesMapper.
- *
- * @param base The base DN where the search should begin.
- * @param filter The filter to use in the search.
- * @param controls The SearchControls to use in the search.
- * @param mapper The AttributesMapper to use for translating
- * each entry.
- * @return a List containing all entries received from the
- * ContextMapper.
- * @throws NamingException if any error occurs. Note that a
- * NameNotFoundException will be ignored. Instead this is
- * interpreted that no entries were found.
- */
- SearchResult is supplied to the specified
- * AttributesMapper.
- *
- * @param base The base DN where the search should begin.
- * @param filter The filter to use in the search.
- * @param controls The SearchControls to use in the search.
- * @param mapper The AttributesMapper to use for translating
- * each entry.
- * @return a List containing all entries received from the
- * ContextMapper.
- * @throws NamingException if any error occurs. Note that a
- * NameNotFoundException will be ignored. Instead this is
- * interpreted that no entries were found.
- */
- base. Each resulting NameClassPair is supplied
- * to the specified NameClassPairCallbackHandler.
- *
- * @param base The base DN where the list should be performed.
- * @param handler The NameClassPairCallbackHandler to supply
- * each {@link NameClassPair} to.
- * @throws NamingException if any error occurs. Note that a
- * NameNotFoundException will be ignored. Instead this is
- * interpreted that no entries were found.
- */
- void list(String base, NameClassPairCallbackHandler handler) throws NamingException;
-
- /**
- * Perform a non-recursive listing of the children of the given
- * base. Each resulting NameClassPair is supplied
- * to the specified NameClassPairCallbackHandler.
- *
- * @param base The base DN where the list should be performed.
- * @param handler The NameClassPairCallbackHandler to supply
- * each {@link NameClassPair} to.
- * @throws NamingException if any error occurs. Note that a
- * NameNotFoundException will be ignored. Instead this is
- * interpreted that no entries were found.
- */
- void list(Name base, NameClassPairCallbackHandler handler) throws NamingException;
-
- /**
- * Perform a non-recursive listing of the children of the given
- * base. Pass all the found NameClassPair objects
- * to the supplied NameClassPairMapper and return all the
- * returned values as a List.
- *
- * @param base The base DN where the list should be performed.
- * @param mapper The NameClassPairMapper to supply each
- * {@link NameClassPair} to.
- * @return a List containing the Objects returned from the
- * Mapper.
- * @throws NamingException if any error occurs. Note that a
- * NameNotFoundException will be ignored. Instead this is
- * interpreted that no entries were found.
- */
- base. Pass all the found NameClassPair objects
- * to the supplied NameClassPairMapper and return all the
- * returned values as a List.
- *
- * @param base The base DN where the list should be performed.
- * @param mapper The NameClassPairMapper to supply each
- * {@link NameClassPair} to.
- * @return a List containing the Objects returned from the
- * Mapper.
- * @throws NamingException if any error occurs. Note that a
- * NameNotFoundException will be ignored. Instead this is
- * interpreted that no entries were found.
- */
- base.
- *
- * @param base The base DN where the list should be performed.
- * @return a List containing the names of all the contexts bound to
- * base.
- * @throws NamingException if any error occurs. Note that a
- * NameNotFoundException will be ignored. Instead this is
- * interpreted that no entries were found.
- */
- Listbase.
- *
- * @param base The base DN where the list should be performed.
- * @return a List containing the names of all the contexts bound to
- * base.
- * @throws NamingException if any error occurs. Note that a
- * NameNotFoundException will be ignored. Instead this is
- * interpreted that no entries were found.
- */
- Listbase. Each resulting Binding is supplied to the
- * specified NameClassPairCallbackHandler.
- *
- * @param base The base DN where the list should be performed.
- * @param handler The NameClassPairCallbackHandler to supply
- * each {@link Binding} to.
- * @throws NamingException if any error occurs. Note that a
- * NameNotFoundException will be ignored. Instead this is
- * interpreted that no entries were found.
- */
- void listBindings(final String base, NameClassPairCallbackHandler handler) throws NamingException;
-
- /**
- * Perform a non-recursive listing of the children of the given
- * base. Each resulting Binding is supplied to the
- * specified NameClassPairCallbackHandler.
- *
- * @param base The base DN where the list should be performed.
- * @param handler The NameClassPairCallbackHandler to supply
- * each {@link Binding} to.
- * @throws NamingException if any error occurs. Note that a
- * NameNotFoundException will be ignored. Instead this is
- * interpreted that no entries were found.
- */
- void listBindings(final Name base, NameClassPairCallbackHandler handler) throws NamingException;
-
- /**
- * Perform a non-recursive listing of the children of the given
- * base. Pass all the found Binding objects to the
- * supplied NameClassPairMapper and return all the returned
- * values as a List.
- *
- * @param base The base DN where the list should be performed.
- * @param mapper The NameClassPairMapper to supply each
- * {@link Binding} to.
- * @return a List containing the Objects returned from the
- * Mapper.
- * @throws NamingException if any error occurs. Note that a
- * NameNotFoundException will be ignored. Instead this is
- * interpreted that no entries were found.
- */
- base. Pass all the found Binding objects to the
- * supplied NameClassPairMapper and return all the returned
- * values as a List.
- *
- * @param base The base DN where the list should be performed.
- * @param mapper The NameClassPairMapper to supply each
- * {@link Binding} to.
- * @return a List containing the Objects returned from the
- * Mapper.
- * @throws NamingException if any error occurs. Note that a
- * NameNotFoundException will be ignored. Instead this is
- * interpreted that no entries were found.
- */
- base.
- *
- * @param base The base DN where the list should be performed.
- * @return a List containing the names of all the contexts
- * bound to base.
- * @throws NamingException if any error occurs. Note that a
- * NameNotFoundException will be ignored. Instead this is
- * interpreted that no entries were found.
- */
- Listbase.
- *
- * @param base The base DN where the list should be performed.
- * @return a List containing the names of all the contexts
- * bound to base.
- * @throws NamingException if any error occurs. Note that a
- * NameNotFoundException will be ignored. Instead this is
- * interpreted that no entries were found.
- */
- Listbase. The Object returned in each {@link Binding} is
- * supplied to the specified ContextMapper.
- *
- * @param base The base DN where the list should be performed.
- * @param mapper The ContextMapper to use for mapping the found
- * object.
- * @return a List containing all entries received from the
- * ContextMapper.
- * @throws NamingException if any error occurs. Note that a
- * NameNotFoundException will be ignored. Instead this is
- * interpreted that no entries were found.
- */
- base. The Object returned in each {@link Binding} is
- * supplied to the specified ContextMapper.
- *
- * @param base The base DN where the list should be performed.
- * @param mapper The ContextMapper to use for mapping the found
- * object.
- * @return a List containing all entries received from the
- * ContextMapper.
- * @throws NamingException if any error occurs. Note that a
- * NameNotFoundException will be ignored. Instead this is
- * interpreted that no entries were found.
- */
- DirObjectFactory
- * has been modified in the ContextSource.
- *
- * @param dn The distinguished name of the object to find.
- * @return the found object, typically a {@link DirContextAdapter} instance.
- * @throws NamingException if any error occurs.
- * @see #lookupContext(Name)
- * @see AbstractContextSource#setDirObjectFactory(Class)
- */
- Object lookup(Name dn) throws NamingException;
-
- /**
- * Lookup the supplied DN and return the found object. This will typically
- * be a {@link DirContextAdapter}, unless the DirObjectFactory
- * has been modified in the ContextSource.
- *
- * @param dn The distinguished name of the object to find.
- * @return the found object, typically a {@link DirContextAdapter} instance.
- * @throws NamingException if any error occurs.
- * @see #lookupContext(String)
- * @see AbstractContextSource#setDirObjectFactory(Class)
- */
- Object lookup(String dn) throws NamingException;
-
- /**
- * Convenience method to get the attributes of a specified DN and
- * automatically pass them to an AttributesMapper.
- *
- * @param dn The distinguished name to find.
- * @param mapper The AttributesMapper to use for mapping the
- * found object.
- * @return the object returned from the mapper.
- * @throws NamingException if any error occurs.
- */
- AttributesMapper.
- *
- * @param dn The distinguished name to find.
- * @param mapper The AttributesMapper to use for mapping the
- * found object.
- * @return the object returned from the mapper.
- * @throws NamingException if any error occurs.
- */
- ContextMapper.
- *
- * @param dn The distinguished name to find.
- * @param mapper The ContextMapper to use for mapping the found
- * object.
- * @return the object returned from the mapper.
- * @throws NamingException if any error occurs.
- */
- ContextMapper.
- *
- * @param dn The distinguished name to find.
- * @param mapper The ContextMapper to use for mapping the found
- * object.
- * @return the object returned from the mapper.
- * @throws NamingException if any error occurs.
- */
- AttributesMapper.
- *
- * @param dn The distinguished name to find.
- * @param attributes The names of the attributes to pass to the mapper.
- * @param mapper The AttributesMapper to use for mapping the
- * found object.
- * @return the object returned from the mapper.
- * @throws NamingException if any error occurs.
- */
- AttributesMapper.
- *
- * @param dn The distinguished name to find.
- * @param attributes The names of the attributes to pass to the mapper.
- * @param mapper The AttributesMapper to use for mapping the
- * found object.
- * @return the object returned from the mapper.
- * @throws NamingException if any error occurs.
- */
- ContextMapper.
- *
- * @param dn The distinguished name to find.
- * @param attributes The names of the attributes to pass to the mapper.
- * @param mapper The ContextMapper to use for mapping the found
- * object.
- * @return the object returned from the mapper.
- * @throws NamingException if any error occurs.
- */
- ContextMapper.
- *
- * @param dn The distinguished name to find.
- * @param attributes The names of the attributes to pass to the mapper.
- * @param mapper The ContextMapper to use for mapping the found
- * object.
- * @return the object returned from the mapper.
- * @throws NamingException if any error occurs.
- */
- ModificationItems.
- *
- * @param dn The distinguished name of the node to modify.
- * @param mods The modifications to perform.
- * @throws NamingException if any error occurs.
- * @see #modifyAttributes(DirContextOperations)
- */
- void modifyAttributes(Name dn, ModificationItem[] mods) throws NamingException;
-
- /**
- * Modify an entry in the LDAP tree using the supplied
- * ModificationItems.
- *
- * @param dn The distinguished name of the node to modify.
- * @param mods The modifications to perform.
- * @throws NamingException if any error occurs.
- * @see #modifyAttributes(DirContextOperations)
- */
- void modifyAttributes(String dn, ModificationItem[] mods) throws NamingException;
-
- /**
- * Create an entry in the LDAP tree. The attributes used to create the entry
- * are either retrieved from the obj parameter or the
- * attributes parameter (or both). One of these parameters may
- * be null but not both.
- *
- * @param dn The distinguished name to bind the object and attributes to.
- * @param obj The object to bind, may be null. Typically a
- * DirContext implementation.
- * @param attributes The attributes to bind, may be null.
- * @throws NamingException if any error occurs.
- * @see DirContextAdapter
- */
- void bind(Name dn, Object obj, Attributes attributes) throws NamingException;
-
- /**
- * Create an entry in the LDAP tree. The attributes used to create the entry
- * are either retrieved from the obj parameter or the
- * attributes parameter (or both). One of these parameters may
- * be null but not both.
- *
- * @param dn The distinguished name to bind the object and attributes to.
- * @param obj The object to bind, may be null. Typically a
- * DirContext implementation.
- * @param attributes The attributes to bind, may be null.
- * @throws NamingException if any error occurs.
- * @see DirContextAdapter
- */
- void bind(String dn, Object obj, Attributes attributes) throws NamingException;
-
- /**
- * Remove an entry from the LDAP tree. The entry must not have any children
- * - if you suspect that the entry might have descendants, use
- * {@link #unbind(Name, boolean)} in stead.
- *
- * @param dn The distinguished name of the entry to remove.
- * @throws NamingException if any error occurs.
- */
- void unbind(Name dn) throws NamingException;
-
- /**
- * Remove an entry from the LDAP tree. The entry must not have any children
- * - if you suspect that the entry might have descendants, use
- * {@link #unbind(Name, boolean)} in stead.
- *
- * @param dn The distinguished name to unbind.
- * @throws NamingException if any error occurs.
- */
- void unbind(String dn) throws NamingException;
-
- /**
- * Remove an entry from the LDAP tree, optionally removing all descendants
- * in the process.
- *
- * @param dn The distinguished name to unbind.
- * @param recursive Whether to unbind all subcontexts as well. If this
- * parameter is false and the entry has children, the operation
- * will fail.
- * @throws NamingException if any error occurs.
- */
- void unbind(Name dn, boolean recursive) throws NamingException;
-
- /**
- * Remove an entry from the LDAP tree, optionally removing all descendants
- * in the process.
- *
- * @param dn The distinguished name to unbind.
- * @param recursive Whether to unbind all subcontexts as well. If this
- * parameter is false and the entry has children, the operation
- * will fail.
- * @throws NamingException if any error occurs.
- */
- void unbind(String dn, boolean recursive) throws NamingException;
-
- /**
- * Remove an entry and replace it with a new one. The attributes used to
- * create the entry are either retrieved from the obj parameter
- * or the attributes parameter (or both). One of these
- * parameters may be null but not both. This method assumes
- * that the specified context already exists - if not it will fail.
- *
- * @param dn The distinguished name to rebind.
- * @param obj The object to bind to the DN, may be null.
- * Typically a DirContext implementation.
- * @param attributes The attributes to bind, may be null.
- * @throws NamingException if any error occurs.
- * @see DirContextAdapter
- */
- void rebind(Name dn, Object obj, Attributes attributes) throws NamingException;
-
- /**
- * Remove an entry and replace it with a new one. The attributes used to
- * create the entry are either retrieved from the obj parameter
- * or the attributes parameter (or both). One of these
- * parameters may be null but not both. This method assumes
- * that the specified context already exists - if not it will fail.
- *
- * @param dn The distinguished name to rebind.
- * @param obj The object to bind to the DN, may be null.
- * Typically a DirContext implementation.
- * @param attributes The attributes to bind, may be null.
- * @throws NamingException if any error occurs.
- * @see DirContextAdapter
- */
- void rebind(String dn, Object obj, Attributes attributes) throws NamingException;
-
- /**
- * Move an entry in the LDAP tree to a new location.
- *
- * @param oldDn The distinguished name of the entry to move; may not be
- * null or empty.
- * @param newDn The distinguished name where the entry should be moved; may
- * not be null or empty.
- * @throws ContextNotEmptyException if newDn is already bound
- * @throws NamingException if any other error occurs.
- */
- void rename(final Name oldDn, final Name newDn) throws NamingException;
-
- /**
- * Move an entry in the LDAP tree to a new location.
- *
- * @param oldDn The distinguished name of the entry to move; may not be
- * null or empty.
- * @param newDn The distinguished name where the entry should be moved; may
- * not be null or empty.
- * @throws ContextNotEmptyException if newDn is already bound
- * @throws NamingException if any other error occurs.
- */
- void rename(final String oldDn, final String newDn) throws NamingException;
-
- /**
- * Convenience method to lookup the supplied DN and automatically cast it to
- * {@link DirContextOperations}.
- *
- * @param dn The distinguished name of the object to find.
- * @return The found object, cast to {@link DirContextOperations}.
- * @throws ClassCastException if an alternative
- * DirObjectFactory has been registered with the
- * ContextSource, causing the actual class of the returned
- * object to be something else than {@link DirContextOperations}.
- * @throws NamingException if any other error occurs.
- * @see #lookup(Name)
- * @see #modifyAttributes(DirContextOperations)
- * @since 1.2
- */
- DirContextOperations lookupContext(Name dn) throws NamingException, ClassCastException;
-
- /**
- * Convenience method to lookup the supplied DN and automatically cast it to
- * {@link DirContextOperations}.
- *
- * @param dn The distinguished name of the object to find.
- * @return The found object, cast to {@link DirContextOperations}.
- * @throws ClassCastException if an alternative
- * DirObjectFactory has been registered with the
- * ContextSource, causing the actual class of the returned
- * object to be something else than {@link DirContextOperations}.
- * @throws NamingException if any other error occurs.
- * @see #lookup(String)
- * @see #modifyAttributes(DirContextOperations)
- * @since 1.2
- */
- DirContextOperations lookupContext(String dn) throws NamingException, ClassCastException;
-
- /**
- * Modify the attributes of the entry referenced by the supplied
- * {@link DirContextOperations} instance. The DN to update will be the DN of
- * the DirContextOperationsinstance, and the
- * ModificationItem array is retrieved from the
- * DirContextOperations instance using a call to
- * {@link AttributeModificationsAware#getModificationItems()}. NB:
- * The supplied instance needs to have been properly initialized; this means
- * that if it hasn't been received from a lookup operation, its
- * DN needs to be initialized and it must have been put in update mode (
- * {@link DirContextAdapter#setUpdateMode(boolean)}).
- *
- * public void update(Person person) {
- * DirContextOperations ctx = ldapOperations.lookupContext(person.getDn());
- *
- * ctx.setAttributeValue("description", person.getDescription());
- * ctx.setAttributeValue("telephoneNumber", person.getPhone());
- * // More modifications here
- *
- * ldapOperations.modifyAttributes(ctx);
- * }
- *
- *
- * @param ctx the DirContextOperations instance to use in the update.
- * @throws IllegalStateException if the supplied instance is not in update
- * mode or has not been properly initialized.
- * @throws NamingException if any other error occurs.
- * @since 1.2
- * @see #lookupContext(Name)
- * @see DirContextAdapter
- */
- void modifyAttributes(DirContextOperations ctx) throws IllegalStateException, NamingException;
-
- /**
- * Bind the data in the supplied context in the tree. All specified
- * attributes ctxin will be bound to the DN set on ctx.
- *
- *
- *
- * DirContextOperations ctx = new DirContextAdapter(dn);
- * ctx.setAttributeValue("cn", "john doe");
- * ctx.setAttributeValue("description", "some description");
- * //More initialization here.
- *
- * ldapTemplate.bind(ctx);
- *
- * @param ctx the context to bind
- * @throws IllegalStateException if no DN is set or if the instance is in
- * update mode.
- * @since 1.3
- */
- void bind(DirContextOperations ctx);
-
- /**
- * Remove an entry and replace it with a new one. The attributes used to
- * create the entry are retrieved from the ctx parameter. This
- * method assumes that the specified context already exists - if not it will
- * fail. The entry will be bound to the DN set on ctx.
- *
- *
- *
- * DirContextOperations ctx = new DirContextAdapter(dn);
- * ctx.setAttributeValue("cn", "john doe");
- * ctx.setAttributeValue("description", "some description");
- * //More initialization here.
- *
- * ldapTemplate.rebind(ctx);
- *
- * @param ctx the context to rebind
- * @throws IllegalStateException if no DN is set or if the instance is in
- * update mode.
- * @since 1.3
- */
- void rebind(DirContextOperations ctx);
-
- /**
- * Utility method to perform a simple LDAP 'bind' authentication. Search for
- * the LDAP entry to authenticate using the supplied base DN and filter; use
- * the DN of the found entry together with the password as input to
- * {@link ContextSource#getContext(String, String)}, thus authenticating the
- * entry.
- *
- *
- *
- * AndFilter filter = new AndFilter();
- * filter.and("objectclass", "person").and("uid", userId);
- * boolean authenticated = ldapTemplate.authenticate(LdapUtils.emptyLdapName(), filter.toString(), password);
- *
- *
- * @param base the DN to use as the base of the search.
- * @param filter the search filter - must result in a unique result.
- * @param password the password to use for authentication.
- * @return true if the authentication was successful,
- * false otherwise.
- * @since 1.3
- * @deprecated use {@link #authenticate(org.springframework.ldap.query.LdapQuery, String)}
- * or {@link #authenticate(org.springframework.ldap.query.LdapQuery, String, AuthenticatedLdapEntryContextMapper)}
- */
- boolean authenticate(Name base, String filter, String password);
-
- /**
- * Utility method to perform a simple LDAP 'bind' authentication. Search for
- * the LDAP entry to authenticate using the supplied base DN and filter; use
- * the DN of the found entry together with the password as input to
- * {@link ContextSource#getContext(String, String)}, thus authenticating the
- * entry.
- *
- *
- *
- * AndFilter filter = new AndFilter();
- * filter.and("objectclass", "person").and("uid", userId);
- * boolean authenticated = ldapTemplate.authenticate(LdapUtils.emptyLdapName(), filter.toString(), password);
- *
- *
- * @param base the DN to use as the base of the search.
- * @param filter the search filter - must result in a unique result.
- * @param password the password to use for authentication.
- * @return true if the authentication was successful,
- * false otherwise.
- * @since 1.3
- * @deprecated use {@link #authenticate(org.springframework.ldap.query.LdapQuery, String)}
- * or {@link #authenticate(org.springframework.ldap.query.LdapQuery, String, AuthenticatedLdapEntryContextMapper)}
- */
- boolean authenticate(String base, String filter, String password);
-
- /**
- * Utility method to perform a simple LDAP 'bind' authentication. Search for
- * the LDAP entry to authenticate using the supplied base DN and filter; use
- * the DN of the found entry together with the password as input to
- * {@link ContextSource#getContext(String, String)}, thus authenticating the
- * entry. The resulting DirContext instance is then used as input to the
- * supplied {@link AuthenticatedLdapEntryContextCallback} to perform any
- * additional LDAP operations against the authenticated DirContext.
- *
- * @param base the DN to use as the base of the search.
- * @param filter the search filter - must result in a unique result.
- * @param password the password to use for authentication.
- * @param callback the callback to that will be called to perform operations
- * on the DirContext authenticated with the found user.
- * @return true if the authentication was successful,
- * false otherwise.
- * @see #authenticate(Name, String, String)
- * @since 1.3
- * @deprecated use {@link #authenticate(org.springframework.ldap.query.LdapQuery, String)}
- * or {@link #authenticate(org.springframework.ldap.query.LdapQuery, String, AuthenticatedLdapEntryContextMapper)}
- */
- boolean authenticate(Name base, String filter, String password, AuthenticatedLdapEntryContextCallback callback);
-
- /**
- * Utility method to perform a simple LDAP 'bind' authentication. Search for
- * the LDAP entry to authenticate using the supplied base DN and filter; use
- * the DN of the found entry together with the password as input to
- * {@link ContextSource#getContext(String, String)}, thus authenticating the
- * entry. The resulting DirContext instance is then used as input to the
- * supplied {@link AuthenticatedLdapEntryContextCallback} to perform any
- * additional LDAP operations against the authenticated DirContext.
- *
- * @param base the DN to use as the base of the search.
- * @param filter the search filter - must result in a unique result.
- * @param password the password to use for authentication.
- * @param callback the callback to that will be called to perform operations
- * on the DirContext authenticated with the found user.
- * @return true if the authentication was successful,
- * false otherwise.
- * @see #authenticate(String, String, String)
- * @since 1.3
- * @deprecated use {@link #authenticate(org.springframework.ldap.query.LdapQuery, String)}
- * or {@link #authenticate(org.springframework.ldap.query.LdapQuery, String, AuthenticatedLdapEntryContextMapper)}
- */
- boolean authenticate(String base, String filter, String password, AuthenticatedLdapEntryContextCallback callback);
-
- /**
- * Utility method to perform a simple LDAP 'bind' authentication. Search for
- * the LDAP entry to authenticate using the supplied base DN and filter; use
- * the DN of the found entry together with the password as input to
- * {@link ContextSource#getContext(String, String)}, thus authenticating the
- * entry. The resulting DirContext instance is then used as input to the
- * supplied {@link AuthenticatedLdapEntryContextCallback} to perform any
- * additional LDAP operations against the authenticated DirContext. If an
- * exception is caught, the same exception is passed on to the given
- * {@link AuthenticationErrorCallback}. This enables the caller to provide a
- * callback that, for example, collects the exception for later processing.
- *
- * @param base the DN to use as the base of the search.
- * @param filter the search filter - must result in a unique result.
- * @param password the password to use for authentication.
- * @param callback the callback that will be called to perform operations
- * on the DirContext authenticated with the found user.
- * @param errorCallback the callback that will be called if an exception is caught.
- * @return true if the authentication was successful,
- * false otherwise.
- * @see #authenticate(Name, String, String, AuthenticatedLdapEntryContextCallback)
- * @since 1.3.1
- * @deprecated use {@link #authenticate(org.springframework.ldap.query.LdapQuery, String)}
- * or {@link #authenticate(org.springframework.ldap.query.LdapQuery, String, AuthenticatedLdapEntryContextMapper)}
- */
- boolean authenticate(Name base, String filter, String password,
- AuthenticatedLdapEntryContextCallback callback,
- AuthenticationErrorCallback errorCallback);
-
- /**
- * Utility method to perform a simple LDAP 'bind' authentication. Search for
- * the LDAP entry to authenticate using the supplied base DN and filter; use
- * the DN of the found entry together with the password as input to
- * {@link ContextSource#getContext(String, String)}, thus authenticating the
- * entry. The resulting DirContext instance is then used as input to the
- * supplied {@link AuthenticatedLdapEntryContextCallback} to perform any
- * additional LDAP operations against the authenticated DirContext. If an
- * exception is caught, the same exception is passed on to the given
- * {@link AuthenticationErrorCallback}. This enables the caller to provide a
- * callback that, for example, collects the exception for later processing.
- *
- * @param base the DN to use as the base of the search.
- * @param filter the search filter - must result in a unique result.
- * @param password the password to use for authentication.
- * @param callback the callback that will be called to perform operations
- * on the DirContext authenticated with the found user.
- * @param errorCallback the callback that will be called if an exception is caught.
- * @return true if the authentication was successful,
- * false otherwise.
- * @see #authenticate(String, String, String, AuthenticatedLdapEntryContextCallback)
- * @since 1.3.1
- * @deprecated use {@link #authenticate(org.springframework.ldap.query.LdapQuery, String)}
- * or {@link #authenticate(org.springframework.ldap.query.LdapQuery, String, AuthenticatedLdapEntryContextMapper)}
- */
- boolean authenticate(String base, String filter, String password,
- AuthenticatedLdapEntryContextCallback callback,
- AuthenticationErrorCallback errorCallback);
-
- /**
- * Utility method to perform a simple LDAP 'bind' authentication. Search for
- * the LDAP entry to authenticate using the supplied base DN and filter; use
- * the DN of the found entry together with the password as input to
- * {@link ContextSource#getContext(String, String)}, thus authenticating the
- * entry. If an exception is caught, the same exception is passed on to the given
- * {@link AuthenticationErrorCallback}. This enables the caller to provide a
- * callback that, for example, collects the exception for later processing.
- *
- * @param base the DN to use as the base of the search.
- * @param filter the search filter - must result in a unique result.
- * @param password the password to use for authentication.
- * @param errorCallback the callback that will be called if an exception is caught.
- * @return true if the authentication was successful,
- * false otherwise.
- * @see #authenticate(Name, String, String, AuthenticatedLdapEntryContextCallback, AuthenticationErrorCallback)
- * @since 1.3.1
- * @deprecated use {@link #authenticate(org.springframework.ldap.query.LdapQuery, String)}
- * or {@link #authenticate(org.springframework.ldap.query.LdapQuery, String, AuthenticatedLdapEntryContextMapper)}
- */
- boolean authenticate(Name base, String filter, String password,
- AuthenticationErrorCallback errorCallback);
-
- /**
- * Utility method to perform a simple LDAP 'bind' authentication. Search for
- * the LDAP entry to authenticate using the supplied base DN and filter; use
- * the DN of the found entry together with the password as input to
- * {@link ContextSource#getContext(String, String)}, thus authenticating the
- * entry. If an exception is caught, the same exception is passed on to the given
- * {@link AuthenticationErrorCallback}. This enables the caller to provide a
- * callback that, for example, collects the exception for later processing.
- *
- * @param base the DN to use as the base of the search.
- * @param filter the search filter - must result in a unique result.
- * @param password the password to use for authentication.
- * @param errorCallback the callback that will be called if an exception is caught.
- * @return true if the authentication was successful,
- * false otherwise.
- * @throws IncorrectResultSizeDataAccessException if more than one users were found
- * @since 1.3.1
- * @deprecated use {@link #authenticate(org.springframework.ldap.query.LdapQuery, String)}
- * or {@link #authenticate(org.springframework.ldap.query.LdapQuery, String, AuthenticatedLdapEntryContextMapper)}
- */
- boolean authenticate(String base, String filter, String password,
- AuthenticationErrorCallback errorCallback);
-
-
- /**
- * Utility method to perform a simple LDAP 'bind' authentication. Search for
- * the LDAP entry to authenticate using the supplied LdapQuery; use
- * the DN of the found entry together with the password as input to
- * {@link ContextSource#getContext(String, String)}, thus authenticating the
- * entry.
- * false otherwise.
- * @return the result from the callback.
- * @throws IncorrectResultSizeDataAccessException if more than one users were found
- * @throws org.springframework.dao.EmptyResultDataAccessException if only one user was found
- * @throws NamingException if something went wrong in authentication.
- *
- * @since 2.0
- * @see org.springframework.ldap.query.LdapQueryBuilder
- */
- false otherwise.
- * @throws IncorrectResultSizeDataAccessException if more than one users were found
- * @throws org.springframework.dao.EmptyResultDataAccessException if only one user was found
- * @throws NamingException if something went wrong in authentication.
- *
- * @since 2.0
- * @see org.springframework.ldap.query.LdapQueryBuilder
- */
- void authenticate(LdapQuery query, String password);
-
-
- /**
- * Perform a search for a unique entry matching the specified search
- * criteria and return the found object. If no entry is found or if there
- * are more than one matching entry, an
- * {@link IncorrectResultSizeDataAccessException} is thrown.
- * @param base the DN to use as the base of the search.
- * @param filter the search filter.
- * @param mapper the mapper to use for the search.
- * @return the single object returned by the mapper that matches the search
- * criteria.
- * @throws IncorrectResultSizeDataAccessException if the result is not one unique entry
- * @since 1.3
- */
- NameClassPairCallbackHandler for processing.
- *
- * @param query the LDAP query specification.
- * @param callbackHandler the NameClassPairCallbackHandler to supply all found entries to.
- *
- * @throws NamingException if any error occurs.
- * @since 2.0
- * @see org.springframework.ldap.query.LdapQueryBuilder
- * @see org.springframework.ldap.core.support.CountNameClassPairCallbackHandler
- */
- void search(LdapQuery query, NameClassPairCallbackHandler callbackHandler);
-
- /**
- * Perform a search with parameters from the specified LdapQuery. All found objects will be supplied to the
- * ContextMapper for processing, and all returned objects will be collected in a list to be returned.
- *
- * @param query the LDAP query specification.
- * @param mapper the ContextMapper to supply all found entries to.
- * @return a List containing all entries received from the
- * ContextMapper.
- *
- * @throws NamingException if any error occurs.
- * @since 2.0
- * @see org.springframework.ldap.query.LdapQueryBuilder
- */
- AttributesMapper for processing, and all
- * returned objects will be collected in a list to be returned.
- *
- * @param query the LDAP query specification.
- * @param mapper the Attributes to supply all found Attributes to.
- * @return a List containing all entries received from the
- * Attributes.
- *
- * @throws NamingException if any error occurs.
- * @since 2.0
- * @see org.springframework.ldap.query.LdapQueryBuilder
- */
- null),
- * an attempt will be made to calculate the name from fields annotated with
- * {@link org.springframework.ldap.odm.annotations.DnAttribute}. If the {@link org.springframework.ldap.odm.annotations.Id}
- * field and the calculated DN is different, the entry will be moved (i.e., an {@link #unbind(javax.naming.Name)}
- * followed by a {@link #bind(DirContextOperations)}. Otherwise
- * the current data of the entry will be read from the directory and a {@link #modifyAttributes(DirContextOperations)}
- * operation will be performed using the ModificationItems resulting from the changes of the
- * entry compared to its current state in the directory.
- * If the id of the entry has changed, i.e. if it wasn't specified from the beginning, or if it is calculated to
- * have changed, the new value will be populated in the supplied object.
- *
- * @param entry The entry to update, it must already exist in the directory.
- *
- * @throws org.springframework.ldap.NamingException on error.
- * @throws IllegalArgumentException if the entry is null or on failure to determine the distinguished name.
- * @since 2.0
- */
- void update(Object entry);
-
- /**
- * Delete an entry from the LDAP directory. The referenced class must have object-directory mapping metadata
- * specified using {@link org.springframework.ldap.odm.annotations.Entry} and associated annotations.
- * If the field annotated with {@link org.springframework.ldap.odm.annotations.Id}
- * is set in the object, this will be used as the distinguished name of the new entry. If no explicit DN is specified,
- * an attempt will be made to calculate the name from fields annotated with {@link org.springframework.ldap.odm.annotations.DnAttribute}.
- *
- * @param entry The entry to delete, it must already exist in the directory.
- *
- * @throws org.springframework.ldap.NamingException on error.
- * @throws IllegalArgumentException if the entry is null or on failure to determine the distinguished name.
- * @since 2.0
- */
- void delete(Object entry);
-
- /**
- * Find all entries in the LDAP directory of a given type. The referenced class must have object-directory mapping metadata
- * specified using {@link org.springframework.ldap.odm.annotations.Entry} and associated annotations.
- *
- * @param NamingEnumeration and
+ * closing the context and enumeration. The actual search is delegated to
+ * the SearchExecutor and each found NameClassPair is passed to
+ * the CallbackHandler. Any encountered
+ * NamingException will be translated using
+ * {@link LdapUtils#convertLdapException(javax.naming.NamingException)}.
+ *
+ * @param se The SearchExecutor to use for performing the
+ * actual search.
+ * @param handler The NameClassPairCallbackHandler to which
+ * each found entry will be passed.
+ * @param processor DirContextProcessor for custom pre- and
+ * post-processing.
+ * @throws NamingException if any error occurs. Note that a
+ * NameNotFoundException will be ignored. Instead this is
+ * interpreted as no entries being found.
+ */
+ void search(SearchExecutor se, NameClassPairCallbackHandler handler, DirContextProcessor processor)
+ throws NamingException;
+
+ /**
+ * Perform a search using a particular {@link SearchExecutor}. Use this
+ * method only if especially needed - for the most cases there is an
+ * overloaded convenience method which calls this one with suitable
+ * argments. This method handles all the plumbing; getting a readonly
+ * context; looping through the NamingEnumeration and closing
+ * the context and enumeration. The actual search is delegated to the
+ * SearchExecutor and each found NameClassPair is
+ * passed to the CallbackHandler. Any encountered
+ * NamingException will be translated using the
+ * {@link LdapUtils#convertLdapException(javax.naming.NamingException)}.
+ *
+ * @param se The SearchExecutor to use for performing the
+ * actual search.
+ * @param handler The NameClassPairCallbackHandler to which
+ * each found entry will be passed.
+ * @throws NamingException if any error occurs. Note that a
+ * NameNotFoundException will be ignored. Instead this is
+ * interpreted as no entries being found.
+ * @see #search(Name, String, AttributesMapper)
+ * @see #search(Name, String, ContextMapper)
+ */
+ void search(SearchExecutor se, NameClassPairCallbackHandler handler) throws NamingException;
+
+ /**
+ * Perform an operation (or series of operations) on a read-only context.
+ * This method handles the plumbing - getting a DirContext,
+ * translating any Exceptions and closing the context afterwards. This
+ * method is not intended for searches; use
+ * {@link #search(SearchExecutor, NameClassPairCallbackHandler)} or any of
+ * the overloaded search methods for this.
+ *
+ * @param ce The ContextExecutor to which the actual operation
+ * on the DirContext will be delegated.
+ * @return the result from the ContextExecutor's operation.
+ * @throws NamingException if the operation resulted in a
+ * NamingException.
+ *
+ * @see #search(SearchExecutor, NameClassPairCallbackHandler)
+ * @see #search(Name, String, AttributesMapper)
+ * @see #search(Name, String, ContextMapper)
+ */
+ DirContext,
+ * translating any exceptions and closing the context afterwards. This
+ * method is intended only for very particular cases, where there is no
+ * suitable method in this interface to use.
+ *
+ * @param ce The ContextExecutor to which the actual operation
+ * on the DirContext will be delegated.
+ * @return the result from the ContextExecutor's operation.
+ * @throws NamingException if the operation resulted in a
+ * NamingException.
+ * @see #bind(Name, Object, Attributes)
+ * @see #unbind(Name)
+ * @see #rebind(Name, Object, Attributes)
+ * @see #rename(Name, Name)
+ * @see #modifyAttributes(Name, ModificationItem[])
+ */
+ SearchResult is supplied to the specified
+ * NameClassPairCallbackHandler. The SearchScope
+ * specified in the supplied SearchControls will be used in the
+ * search. Note that if you are using a ContextMapper, the
+ * returningObjFlag needs to be set to true in the
+ * SearchControls.
+ *
+ * @param base The base DN where the search should begin.
+ * @param filter The filter to use in the search.
+ * @param controls The SearchControls to use in the search.
+ * @param handler The NameClassPairCallbackHandler to supply
+ * the SearchResult to.
+ * @throws NamingException if any error occurs. Note that a
+ * NameNotFoundException will be ignored. Instead this is
+ * interpreted that no entries were found.
+ */
+ void search(Name base, String filter, SearchControls controls, NameClassPairCallbackHandler handler)
+ throws NamingException;
+
+ /**
+ * Search for all objects matching the supplied filter. See
+ * {@link #search(Name, String, SearchControls, NameClassPairCallbackHandler)}
+ * for details.
+ *
+ * @param base The base DN where the search should begin.
+ * @param filter The filter to use in the search.
+ * @param controls The SearchControls to use in the search.
+ * @param handler The NameClassPairCallbackHandler to supply
+ * the SearchResult to.
+ * @throws NamingException if any error occurs. Note that a
+ * NameNotFoundException will be ignored. Instead this is
+ * interpreted that no entries were found.
+ */
+ void search(String base, String filter, SearchControls controls, NameClassPairCallbackHandler handler)
+ throws NamingException;
+
+ /**
+ * Search for all objects matching the supplied filter. Each
+ * SearchResult is supplied to the specified
+ * NameClassPairCallbackHandler. The SearchScope
+ * specified in the supplied SearchControls will be used in the
+ * search. Note that if you are using a ContextMapper, the
+ * returningObjFlag needs to be set to true in the
+ * SearchControls. The given DirContextProcessor
+ * will be called before and after the search.
+ *
+ * @param base The base DN where the search should begin.
+ * @param filter The filter to use in the search.
+ * @param controls The SearchControls to use in the search.
+ * @param handler The NameClassPairCallbackHandler to supply
+ * the SearchResult to.
+ * @param processor The DirContextProcessor to use before and
+ * after the search.
+ * @throws NamingException if any error occurs. Note that a
+ * NameNotFoundException will be ignored. Instead this is
+ * interpreted that no entries were found.
+ */
+ void search(Name base, String filter, SearchControls controls, NameClassPairCallbackHandler handler,
+ DirContextProcessor processor) throws NamingException;
+
+ /**
+ * Search for all objects matching the supplied filter. The Attributes in
+ * each SearchResult is supplied to the specified
+ * AttributesMapper. The SearchScope specified in
+ * the supplied SearchControls will be used in the search. The
+ * given DirContextProcessor will be called before and after
+ * the search.
+ *
+ * @param base The base DN where the search should begin.
+ * @param filter The filter to use in the search.
+ * @param controls The SearchControls to use in the search.
+ * @param mapper The AttributesMapper to use for translating
+ * each entry.
+ * @param processor The DirContextProcessor to use before and
+ * after the search.
+ * @return a List containing all entries received from the
+ * AttributesMapper.
+ * @throws NamingException if any error occurs. Note that a
+ * NameNotFoundException will be ignored. Instead this is
+ * interpreted that no entries were found.
+ */
+ SearchResult is supplied to the specified
+ * AttributesMapper. The SearchScope specified in
+ * the supplied SearchControls will be used in the search. The
+ * given DirContextProcessor will be called before and after
+ * the search.
+ *
+ * @param base The base DN where the search should begin.
+ * @param filter The filter to use in the search.
+ * @param controls The SearchControls to use in the search.
+ * @param mapper The AttributesMapper to use for translating
+ * each entry.
+ * @param processor The DirContextProcessor to use before and
+ * after the search.
+ * @return a List containing all entries received from the
+ * AttributesMapper.
+ * @throws NamingException if any error occurs. Note that a
+ * NameNotFoundException will be ignored. Instead this is
+ * interpreted that no entries were found.
+ */
+ SearchResult is supplied to the specified
+ * ContextMapper. The SearchScope specified in the
+ * supplied SearchControls will be used in the search. The
+ * given DirContextProcessor will be called before and after
+ * the search.
+ *
+ * @param base The base DN where the search should begin.
+ * @param filter The filter to use in the search.
+ * @param controls The SearchControls to use in the search. If
+ * the returnObjFlag is not set in the SearchControls, this
+ * method will set it automatically, as this is required for the
+ * ContextMapper to work.
+ * @param mapper The ContextMapper to use for translating each
+ * entry.
+ * @param processor The DirContextProcessor to use before and
+ * after the search.
+ * @return a List containing all entries received from the
+ * ContextMapper.
+ * @throws NamingException if any error occurs. Note that a
+ * NameNotFoundException will be ignored. Instead this is
+ * interpreted that no entries were found.
+ */
+ SearchResult is supplied to the specified
+ * ContextMapper. The SearchScope specified in the
+ * supplied SearchControls will be used in the search. The
+ * given DirContextProcessor will be called before and after
+ * the search.
+ *
+ * @param base The base DN where the search should begin.
+ * @param filter The filter to use in the search.
+ * @param controls The SearchControls to use in the search. If
+ * the returnObjFlag is not set in the SearchControls, this
+ * method will set it automatically, as this is required for the
+ * ContextMapper to work.
+ * @param mapper The ContextMapper to use for translating each
+ * entry.
+ * @param processor The DirContextProcessor to use before and
+ * after the search.
+ * @return a List containing all entries received from the
+ * ContextMapper.
+ * @throws NamingException if any error occurs. Note that a
+ * NameNotFoundException will be ignored. Instead this is
+ * interpreted that no entries were found.
+ */
+ SearchControls to use in the search.
+ * @param handler The NameClassPairCallbackHandler to supply
+ * the SearchResults to.
+ * @param processor The DirContextProcessor to use before and
+ * after the search.
+ * @throws NamingException if any error occurs. Note that a
+ * NameNotFoundException will be ignored. Instead this is
+ * interpreted that no entries were found.
+ */
+ void search(String base, String filter, SearchControls controls, NameClassPairCallbackHandler handler,
+ DirContextProcessor processor) throws NamingException;
+
+ /**
+ * Search for all objects matching the supplied filter. Each
+ * SearchResult is supplied to the specified
+ * NameClassPairCallbackHandler. Use the specified values for
+ * search scope and return objects flag.
+ *
+ * @param base The base DN where the search should begin.
+ * @param filter The filter to use in the search.
+ * @param searchScope The search scope to set in SearchControls
+ * .
+ * @param returningObjFlag Whether the bound object should be returned in
+ * search results. Must be set to true if a
+ * ContextMapper is used.
+ * @param handler The NameClassPairCallbackHandler to supply
+ * the SearchResults to.
+ * @throws NamingException if any error occurs. Note that a
+ * NameNotFoundException will be ignored. Instead this is
+ * interpreted that no entries were found.
+ */
+ void search(Name base, String filter, int searchScope, boolean returningObjFlag,
+ NameClassPairCallbackHandler handler) throws NamingException;
+
+ /**
+ * Search for all objects matching the supplied filter. Each
+ * SearchResult is supplied to the specified
+ * NameClassPairCallbackHandler. Use the specified values for
+ * search scope and return objects flag.
+ *
+ * @param base The base DN where the search should begin.
+ * @param filter The filter to use in the search.
+ * @param searchScope The search scope to set in SearchControls
+ * .
+ * @param returningObjFlag Whether the bound object should be returned in
+ * search results. Must be set to true if a
+ * ContextMapper is used.
+ * @param handler The NameClassPairCallbackHandler to supply
+ * the SearchResults to.
+ * @throws NamingException if any error occurs. Note that a
+ * NameNotFoundException will be ignored. Instead this is
+ * interpreted that no entries were found.
+ */
+ void search(String base, String filter, int searchScope, boolean returningObjFlag,
+ NameClassPairCallbackHandler handler) throws NamingException;
+
+ /**
+ * Search for all objects matching the supplied filter. Each
+ * SearchResult is supplied to the specified
+ * NameClassPairCallbackHandler. The default Search scope (
+ * SearchControls.SUBTREE_SCOPE) will be used and the
+ * returnObjects flag will be set to false.
+ *
+ * @param base The base DN where the search should begin.
+ * @param filter The filter to use in the search.
+ * @param handler The NameClassPairCallbackHandler to supply
+ * the SearchResults to.
+ * @throws NamingException if any error occurs. Note that a
+ * NameNotFoundException will be ignored. Instead this is
+ * interpreted that no entries were found.
+ */
+ void search(Name base, String filter, NameClassPairCallbackHandler handler) throws NamingException;
+
+ /**
+ * Search for all objects matching the supplied filter. Each
+ * SearchResult is supplied to the specified
+ * NameClassPairCallbackHandler. The default Search scope (
+ * SearchControls.SUBTREE_SCOPE) will be used and the
+ * returnObjects flag will be set to false.
+ *
+ * @param base The base DN where the search should begin.
+ * @param filter The filter to use in the search.
+ * @param handler The NameClassPairCallbackHandler to supply
+ * the SearchResults to.
+ * @throws NamingException if any error occurs. Note that a
+ * NameNotFoundException will be ignored. Instead this is
+ * interpreted that no entries were found.
+ */
+ void search(String base, String filter, NameClassPairCallbackHandler handler) throws NamingException;
+
+ /**
+ * Search for all objects matching the supplied filter. Only return any
+ * attributes mathing the specified attribute names. The Attributes in each
+ * SearchResult is supplied to the specified
+ * AttributesMapper.
+ *
+ * @param base The base DN where the search should begin.
+ * @param filter The filter to use in the search.
+ * @param searchScope The search scope to set in SearchControls
+ * .
+ * @param attrs The attributes to return, null means returning
+ * all attributes.
+ * @param mapper The AttributesMapper to use for translating
+ * each entry.
+ * @return a List containing all entries received from the
+ * AttributesMapper.
+ * @throws NamingException if any error occurs. Note that a
+ * NameNotFoundException will be ignored. Instead this is
+ * interpreted that no entries were found.
+ */
+ SearchResult is supplied to the specified
+ * AttributesMapper.
+ *
+ * @param base The base DN where the search should begin.
+ * @param filter The filter to use in the search.
+ * @param searchScope The search scope to set in SearchControls
+ * .
+ * @param attrs The attributes to return, null means returning
+ * all attributes.
+ * @param mapper The AttributesMapper to use for translating
+ * each entry.
+ * @return a List containing all entries received from the
+ * AttributesMapper.
+ * @throws NamingException if any error occurs. Note that a
+ * NameNotFoundException will be ignored. Instead this is
+ * interpreted that no entries were found.
+ */
+ SearchResult is supplied to the specified
+ * AttributesMapper.
+ *
+ * @param base The base DN where the search should begin.
+ * @param filter The filter to use in the search.
+ * @param searchScope The search scope to set in SearchControls
+ * .
+ * @param mapper The AttributesMapper to use for translating
+ * each entry.
+ * @return a List containing all entries received from the
+ * AttributesMapper.
+ * @throws NamingException if any error occurs. Note that a
+ * NameNotFoundException will be ignored. Instead this is
+ * interpreted that no entries were found.
+ */
+ SearchResult is supplied to the specified
+ * AttributesMapper.
+ *
+ * @param base The base DN where the search should begin.
+ * @param filter The filter to use in the search.
+ * @param searchScope The search scope to set in SearchControls
+ * .
+ * @param mapper The AttributesMapper to use for translating
+ * each entry.
+ * @return a List containing all entries received from the
+ * AttributesMapper.
+ * @throws NamingException if any error occurs. Note that a
+ * NameNotFoundException will be ignored. Instead this is
+ * interpreted that no entries were found.
+ */
+ SearchResult is supplied to the specified
+ * AttributesMapper. The default search scope will be used.
+ *
+ * @param base The base DN where the search should begin.
+ * @param filter The filter to use in the search.
+ * @param mapper The AttributesMapper to use for translating
+ * each entry.
+ * @return a List containing all entries received from the
+ * AttributesMapper.
+ * @throws NamingException if any error occurs. Note that a
+ * NameNotFoundException will be ignored. Instead this is
+ * interpreted that no entries were found.
+ */
+ SearchResult is supplied to the specified
+ * AttributesMapper. The default search scope will be used.
+ *
+ * @param base The base DN where the search should begin.
+ * @param filter The filter to use in the search.
+ * @param mapper The AttributesMapper to use for translating
+ * each entry.
+ * @return a List containing all entries received from the
+ * AttributesMapper.
+ * @throws NamingException if any error occurs. Note that a
+ * NameNotFoundException will be ignored. Instead this is
+ * interpreted that no entries were found.
+ */
+ Object returned in each SearchResult is
+ * supplied to the specified ContextMapper. Only return the
+ * supplied attributes.
+ *
+ * @param base The base DN where the search should begin.
+ * @param filter The filter to use in the search.
+ * @param searchScope The search scope to set in SearchControls
+ * .
+ * @param attrs The attributes to return, null means all
+ * attributes.
+ * @param mapper The ContextMapper to use for translating each
+ * entry.
+ * @return a List containing all entries received from the
+ * ContextMapper.
+ * @throws NamingException if any error occurs. Note that a
+ * NameNotFoundException will be ignored. Instead this is
+ * interpreted that no entries were found.
+ */
+ Object returned in each SearchResult is
+ * supplied to the specified ContextMapper. Only return the
+ * supplied attributes.
+ *
+ * @param base The base DN where the search should begin.
+ * @param filter The filter to use in the search.
+ * @param searchScope The search scope to set in SearchControls
+ * .
+ * @param attrs The attributes to return, null means all
+ * attributes.
+ * @param mapper The ContextMapper to use for translating each
+ * entry.
+ * @return a List containing all entries received from the
+ * ContextMapper.
+ * @throws NamingException if any error occurs. Note that a
+ * NameNotFoundException will be ignored. Instead this is
+ * interpreted that no entries were found.
+ */
+ Object returned in each SearchResult is
+ * supplied to the specified ContextMapper.
+ *
+ * @param base The base DN where the search should begin.
+ * @param filter The filter to use in the search.
+ * @param searchScope The search scope to set in SearchControls
+ * .
+ * @param mapper The ContextMapper to use for translating each
+ * entry.
+ * @return a List containing all entries received from the
+ * ContextMapper.
+ * @throws NamingException if any error occurs. Note that a
+ * NameNotFoundException will be ignored. Instead this is
+ * interpreted that no entries were found.
+ */
+ Object returned in each SearchResult is
+ * supplied to the specified ContextMapper.
+ *
+ * @param base The base DN where the search should begin.
+ * @param filter The filter to use in the search.
+ * @param searchScope The search scope to set in SearchControls
+ * .
+ * @param mapper The ContextMapper to use for translating each
+ * entry.
+ * @return a List containing all entries received from the
+ * ContextMapper.
+ * @throws NamingException if any error occurs. Note that a
+ * NameNotFoundException will be ignored. Instead this is
+ * interpreted that no entries were found.
+ */
+ Object returned in each SearchResult is
+ * supplied to the specified ContextMapper. The default search
+ * scope (SearchControls.SUBTREE_SCOPE) will be used.
+ *
+ * @param base The base DN where the search should begin.
+ * @param filter The filter to use in the search.
+ * @param mapper The ContextMapper to use for translating each
+ * entry.
+ * @return a List containing all entries received from the
+ * ContextMapper.
+ * @throws NamingException if any error occurs. Note that a
+ * NameNotFoundException will be ignored. Instead this is
+ * interpreted that no entries were found.
+ */
+ Object returned in each SearchResult is
+ * supplied to the specified ContextMapper. The default search
+ * scope (SearchControls.SUBTREE_SCOPE) will be used.
+ *
+ * @param base The base DN where the search should begin.
+ * @param filter The filter to use in the search.
+ * @param mapper The ContextMapper to use for translating each
+ * entry.
+ * @return a List containing all entries received from the
+ * ContextMapper.
+ * @throws NamingException if any error occurs. Note that a
+ * NameNotFoundException will be ignored. Instead this is
+ * interpreted that no entries were found.
+ */
+ Object returned in each SearchResult is
+ * supplied to the specified ContextMapper. The default search
+ * scope (SearchControls.SUBTREE_SCOPE) will be used.
+ *
+ * @param base The base DN where the search should begin.
+ * @param filter The filter to use in the search.
+ * @param mapper The ContextMapper to use for translating each
+ * entry.
+ * @return a List containing all entries received from the
+ * ContextMapper.
+ * @throws NamingException if any error occurs. Note that a
+ * NameNotFoundException will be ignored. Instead this is
+ * interpreted that no entries were found.
+ */
+ SearchResult is supplied to the specified
+ * ContextMapper.
+ *
+ * @param base The base DN where the search should begin.
+ * @param filter The filter to use in the search.
+ * @param controls The SearchControls to use in the search. If
+ * the returnObjFlag is not set in the SearchControls, this
+ * method will set it automatically, as this is required for the
+ * ContextMapper to work.
+ * @param mapper The ContextMapper to use for translating each
+ * entry.
+ * @return a List containing all entries received from the
+ * ContextMapper.
+ * @throws NamingException if any error occurs. Note that a
+ * NameNotFoundException will be ignored. Instead this is
+ * interpreted that no entries were found.
+ */
+ SearchResult is supplied to the specified
+ * AttributesMapper.
+ *
+ * @param base The base DN where the search should begin.
+ * @param filter The filter to use in the search.
+ * @param controls The SearchControls to use in the search.
+ * @param mapper The AttributesMapper to use for translating
+ * each entry.
+ * @return a List containing all entries received from the
+ * ContextMapper.
+ * @throws NamingException if any error occurs. Note that a
+ * NameNotFoundException will be ignored. Instead this is
+ * interpreted that no entries were found.
+ */
+ SearchResult is supplied to the specified
+ * AttributesMapper.
+ *
+ * @param base The base DN where the search should begin.
+ * @param filter The filter to use in the search.
+ * @param controls The SearchControls to use in the search.
+ * @param mapper The AttributesMapper to use for translating
+ * each entry.
+ * @return a List containing all entries received from the
+ * ContextMapper.
+ * @throws NamingException if any error occurs. Note that a
+ * NameNotFoundException will be ignored. Instead this is
+ * interpreted that no entries were found.
+ */
+ base. Each resulting NameClassPair is supplied
+ * to the specified NameClassPairCallbackHandler.
+ *
+ * @param base The base DN where the list should be performed.
+ * @param handler The NameClassPairCallbackHandler to supply
+ * each {@link NameClassPair} to.
+ * @throws NamingException if any error occurs. Note that a
+ * NameNotFoundException will be ignored. Instead this is
+ * interpreted that no entries were found.
+ */
+ void list(String base, NameClassPairCallbackHandler handler) throws NamingException;
+
+ /**
+ * Perform a non-recursive listing of the children of the given
+ * base. Each resulting NameClassPair is supplied
+ * to the specified NameClassPairCallbackHandler.
+ *
+ * @param base The base DN where the list should be performed.
+ * @param handler The NameClassPairCallbackHandler to supply
+ * each {@link NameClassPair} to.
+ * @throws NamingException if any error occurs. Note that a
+ * NameNotFoundException will be ignored. Instead this is
+ * interpreted that no entries were found.
+ */
+ void list(Name base, NameClassPairCallbackHandler handler) throws NamingException;
+
+ /**
+ * Perform a non-recursive listing of the children of the given
+ * base. Pass all the found NameClassPair objects
+ * to the supplied NameClassPairMapper and return all the
+ * returned values as a List.
+ *
+ * @param base The base DN where the list should be performed.
+ * @param mapper The NameClassPairMapper to supply each
+ * {@link NameClassPair} to.
+ * @return a List containing the Objects returned from the
+ * Mapper.
+ * @throws NamingException if any error occurs. Note that a
+ * NameNotFoundException will be ignored. Instead this is
+ * interpreted that no entries were found.
+ */
+ base. Pass all the found NameClassPair objects
+ * to the supplied NameClassPairMapper and return all the
+ * returned values as a List.
+ *
+ * @param base The base DN where the list should be performed.
+ * @param mapper The NameClassPairMapper to supply each
+ * {@link NameClassPair} to.
+ * @return a List containing the Objects returned from the
+ * Mapper.
+ * @throws NamingException if any error occurs. Note that a
+ * NameNotFoundException will be ignored. Instead this is
+ * interpreted that no entries were found.
+ */
+