|
|
@@ -6,18 +6,30 @@
|
|
|
package scot.carricksoftware.grants.cache;
|
|
|
|
|
|
import scot.carricksoftware.grants.domains.people.Person;
|
|
|
+import scot.carricksoftware.grants.services.people.PersonService;
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
public class BMDCacheImpl implements BMDCache {
|
|
|
|
|
|
+ private final PersonService personService;
|
|
|
+
|
|
|
+ private List<Person> people = null;
|
|
|
+
|
|
|
+ public BMDCacheImpl(PersonService personService) {
|
|
|
+ this.personService = personService;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public List<Person> getPeople() {
|
|
|
- return List.of();
|
|
|
+ if (people == null) {
|
|
|
+ people = personService.findAll();
|
|
|
+ }
|
|
|
+ return people;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void invalidatePeople() {
|
|
|
- throw new UnsupportedOperationException("BMDCache::invalidatePeople Not supported yet.");
|
|
|
+ people = null;
|
|
|
}
|
|
|
}
|