Changed to the new exceptions.
This commit is contained in:
@@ -8,9 +8,9 @@ import java.util.Map;
|
|||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
import org.springframework.ldap.NameNotFoundException;
|
||||||
import org.springframework.ldap.samples.person.domain.Group;
|
import org.springframework.ldap.samples.person.domain.Group;
|
||||||
import org.springframework.ldap.samples.person.domain.SearchCriteria;
|
import org.springframework.ldap.samples.person.domain.SearchCriteria;
|
||||||
import org.springframework.ldap.support.EntryNotFoundException;
|
|
||||||
|
|
||||||
public class DummyGroupDao implements GroupDao {
|
public class DummyGroupDao implements GroupDao {
|
||||||
private static Map GROUPS;
|
private static Map GROUPS;
|
||||||
@@ -54,7 +54,7 @@ public class DummyGroupDao implements GroupDao {
|
|||||||
if (GROUPS.get(name) != null) {
|
if (GROUPS.get(name) != null) {
|
||||||
return (Group) GROUPS.get(name);
|
return (Group) GROUPS.get(name);
|
||||||
} else {
|
} else {
|
||||||
throw new EntryNotFoundException("Could not find group with name '"
|
throw new NameNotFoundException("Could not find group with name '"
|
||||||
+ name + "'");
|
+ name + "'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,9 +8,9 @@ import java.util.Map;
|
|||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
import org.springframework.ldap.NameNotFoundException;
|
||||||
import org.springframework.ldap.samples.person.domain.Person;
|
import org.springframework.ldap.samples.person.domain.Person;
|
||||||
import org.springframework.ldap.samples.person.domain.SearchCriteria;
|
import org.springframework.ldap.samples.person.domain.SearchCriteria;
|
||||||
import org.springframework.ldap.support.EntryNotFoundException;
|
|
||||||
|
|
||||||
public class DummyPersonDao implements PersonDao {
|
public class DummyPersonDao implements PersonDao {
|
||||||
private static Map PERSONS;
|
private static Map PERSONS;
|
||||||
@@ -67,7 +67,7 @@ public class DummyPersonDao implements PersonDao {
|
|||||||
if (PERSONS.get(fullname) != null) {
|
if (PERSONS.get(fullname) != null) {
|
||||||
return (Person) PERSONS.get(fullname);
|
return (Person) PERSONS.get(fullname);
|
||||||
} else {
|
} else {
|
||||||
throw new EntryNotFoundException(
|
throw new NameNotFoundException(
|
||||||
"Could not find person with name '" + fullname + "'");
|
"Could not find person with name '" + fullname + "'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user