FileDocCategorySizeDatePackage
PeopleFinderImpl.javaAPI DocExample2634Thu Dec 15 21:39:26 GMT 2005com.oreilly.jent.people.soap

PeopleFinderImpl

public class PeopleFinderImpl extends Object implements PeopleFinder
PeopleFinderImpl: Implementation of our remote PeopleFinder interface.

Fields Summary
Constructors Summary
public PeopleFinderImpl()

Methods Summary
public com.oreilly.jent.people.Person[]findPeople(com.oreilly.jent.people.SearchArg[] args)
Implementation of findPeople. Here we simply invoke our PersonDAO to perform the search using whatever information source it's configured to use.

        PersonDAO dao = PersonDAO.getInstance();
        Map searchParamsMap = new HashMap();
        for (int i = 0; i < args.length; i++) {
            searchParamsMap.put(args[i].getName(), args[i].getValue());
        }
        Collection people = dao.findPeople(searchParamsMap);
        Person[] peopleArray = new Person[people.size()];
        Iterator pIter = people.iterator();
        int i = 0;
        while (pIter.hasNext()) {
            peopleArray[i++] = (Person)pIter.next();
        }
        return peopleArray;