01: /* Copyright 2001, 2002 The JA-SIG Collaborative. All rights reserved.
02: * See license distributed with this file and
03: * available online at http://www.uportal.org/license.html
04: */
05:
06: package org.jasig.portal.groups.local;
07:
08: import org.jasig.portal.EntityIdentifier;
09: import org.jasig.portal.groups.GroupsException;
10: import org.jasig.portal.groups.IEntitySearcher;
11:
12: /**
13: * An IEntitySearcher implementation for the local portal group service.
14: * Uses implementations of ITypedEntitySearcher to do the dirty work.
15: *
16: * @author Alex Vigdor
17: * @version $Revision: 34757 $
18: */
19:
20: public class EntitySearcherImpl implements IEntitySearcher {
21: protected ITypedEntitySearcher[] searchers;
22:
23: public EntitySearcherImpl(ITypedEntitySearcher[] searchers) {
24: this .searchers = searchers;
25: }
26:
27: public EntityIdentifier[] searchForEntities(String query,
28: int method, Class type) throws GroupsException {
29: EntityIdentifier[] r = new EntityIdentifier[0];
30: for (int i = 0; i < searchers.length; i++) {
31: if (searchers[i].getType().equals(type)) {
32: r = searchers[i].searchForEntities(query, method);
33: break;
34: }
35: }
36: return r;
37: }
38:
39: }
|