Class CachingResolver
java.lang.Object
edu.internet2.middleware.grouper.subj.SubjectResolverDecorator
edu.internet2.middleware.grouper.subj.CachingResolver
- All Implemented Interfaces:
SubjectResolver
Decorator that provides caching for
SubjectResolver.
TODO the caching of findAll should work based on group restricted to, not stem name
- Since:
- 1.2.1
- Version:
- $Id: CachingResolver.java,v 1.8 2008-08-26 21:11:51 mchyzer Exp $
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfind subjects in a set of sourcesfindAllInStem(String stemName, String query) findByIdentifier(String id, boolean ignoreCachedSubjects) findByIdentifier(String id, String source) findByIdentifier(String id, String source, boolean ignoreCachedSubjects) findByIdentifiers(Collection<String> identifiers) findByIdentifiers(Collection<String> identifiers, String source) findByIdOrIdentifier(String id, boolean ignoreCachedSubjects) findByIdOrIdentifier(String id, String source) findByIdOrIdentifier(String id, String source, boolean ignoreCachedSubjects) findByIds(Collection<String> ids) findByIds(Collection<String> ids, String source) findByIds(Collection<String> ids, String source, boolean ignoreCachedSubjects) findByIdsOrIdentifiers(Collection<String> idsOrIdentifiers) findByIdsOrIdentifiers(Collection<String> idsOrIdentifiers, String source) findByIdsOrIdentifiers(Collection<String> idsOrIdentifiers, Set<Source> sources) find a page of subjects in a set of sourcesfindPageInStem(String stemName, String query) findPageInStem(String stemName, String query, Set<Source> sources) voidflush the cache (e.g.Methods inherited from class edu.internet2.middleware.grouper.subj.SubjectResolverDecorator
getDecoratedResolver
-
Constructor Details
-
CachingResolver
- Since:
- 1.2.1
-
-
Method Details
-
flushCache
public void flushCache()flush the cache (e.g. for testing) -
find
public Subject find(String id) throws IllegalArgumentException, SubjectNotFoundException, SubjectNotUniqueException - Parameters:
id- Subject id to search on.- Returns:
- Subject matching search parameters.
- Throws:
IllegalArgumentException- if any parameter is null.SubjectNotFoundException- if no matching subject is found.SubjectNotUniqueException- if more than one matching subject is found.- Since:
- 1.2.1
- See Also:
-
find
public Subject find(String id, boolean ignoreCachedSubjects) throws IllegalArgumentException, SubjectNotFoundException, SubjectNotUniqueException - Parameters:
id- Subject id to search on.- Returns:
- Subject matching search parameters.
- Throws:
IllegalArgumentException- if any parameter is null.SubjectNotFoundException- if no matching subject is found.SubjectNotUniqueException- if more than one matching subject is found.- See Also:
-
find
public Subject find(String id, String source) throws IllegalArgumentException, SourceUnavailableException, SubjectNotFoundException, SubjectNotUniqueException - Parameters:
id- Subject id to search on.source- Source adapter to search within.- Returns:
- Subject matching search parameters.
- Throws:
IllegalArgumentException- if any parameter is null.SourceUnavailableException- if source is unavailable.SubjectNotFoundException- if no matching subject is found.SubjectNotUniqueException- if more than one matching subject is found.- Since:
- 1.2.1
- See Also:
-
find
public Subject find(String id, String source, boolean ignoreCachedSubjects) throws IllegalArgumentException, SourceUnavailableException, SubjectNotFoundException, SubjectNotUniqueException - Parameters:
id- Subject id to search on.source- Source adapter to search within.- Returns:
- Subject matching search parameters.
- Throws:
IllegalArgumentException- if any parameter is null.SourceUnavailableException- if source is unavailable.SubjectNotFoundException- if no matching subject is found.SubjectNotUniqueException- if more than one matching subject is found.- Since:
- 1.2.1
- See Also:
-
findAll
- Parameters:
query- A source-appropraite query string.- Returns:
- All subjects matching query.
- Throws:
IllegalArgumentException- if any parameter is null.- Since:
- 1.2.1
- See Also:
-
findAll
public Set<Subject> findAll(String query, String source) throws IllegalArgumentException, SourceUnavailableException - Parameters:
query- A source-appropriate query string.source- Restrict query to within this source.- Returns:
- All subjects matching query.
- Throws:
IllegalArgumentException- if any parameter is null.SourceUnavailableException- if source is unavailable.- Since:
- 1.2.1
- See Also:
-
findByIdentifier
public Subject findByIdentifier(String id) throws IllegalArgumentException, SubjectNotFoundException, SubjectNotUniqueException - Parameters:
id- Subject identifier to search on.- Returns:
- Subject matching search parameters.
- Throws:
IllegalArgumentException- if any parameter is null.SubjectNotFoundException- if no matching subject is found.SubjectNotUniqueException- if more than one matching subject is found.- Since:
- 1.2.1
- See Also:
-
findByIdentifier
public Subject findByIdentifier(String id, boolean ignoreCachedSubjects) throws IllegalArgumentException, SubjectNotFoundException, SubjectNotUniqueException - Parameters:
id- Subject identifier to search on.- Returns:
- Subject matching search parameters.
- Throws:
IllegalArgumentException- if any parameter is null.SubjectNotFoundException- if no matching subject is found.SubjectNotUniqueException- if more than one matching subject is found.- See Also:
-
findByIdentifier
public Subject findByIdentifier(String id, String source) throws IllegalArgumentException, SourceUnavailableException, SubjectNotFoundException, SubjectNotUniqueException - Parameters:
id- Subject identifier to search on.source- Source adapter to search within.- Returns:
- Subject matching search parameters.
- Throws:
IllegalArgumentException- if any parameter is null.SourceUnavailableException- if source is unavailable.SubjectNotFoundException- if no matching subject is found.SubjectNotUniqueException- if more than one matching subject is found.- Since:
- 1.2.1
- See Also:
-
findByIdentifier
public Subject findByIdentifier(String id, String source, boolean ignoreCachedSubjects) throws IllegalArgumentException, SourceUnavailableException, SubjectNotFoundException, SubjectNotUniqueException - Parameters:
id- Subject identifier to search on.source- Source adapter to search within.- Returns:
- Subject matching search parameters.
- Throws:
IllegalArgumentException- if any parameter is null.SourceUnavailableException- if source is unavailable.SubjectNotFoundException- if no matching subject is found.SubjectNotUniqueException- if more than one matching subject is found.- See Also:
-
getSource
- Returns:
- Subject source identified by id.
- Throws:
IllegalArgumentException- if id is null.SourceUnavailableException- if source cannot be returned.- Since:
- 1.2.1
- See Also:
-
getSources
- Returns:
- All Subject sources.
- Since:
- 1.2.1
- See Also:
-
findByIdOrIdentifier
public Subject findByIdOrIdentifier(String id) throws IllegalArgumentException, SubjectNotFoundException, SubjectNotUniqueException - Parameters:
id- Subject identifier to search on.- Returns:
- Subject matching search parameters.
- Throws:
IllegalArgumentException- if any parameter is null.SubjectNotFoundException- if no matching subject is found.SubjectNotUniqueException- if more than one matching subject is found.
-
findByIdOrIdentifier
public Subject findByIdOrIdentifier(String id, boolean ignoreCachedSubjects) throws IllegalArgumentException, SubjectNotFoundException, SubjectNotUniqueException - Parameters:
id- Subject identifier to search on.- Returns:
- Subject matching search parameters.
- Throws:
IllegalArgumentException- if any parameter is null.SubjectNotFoundException- if no matching subject is found.SubjectNotUniqueException- if more than one matching subject is found.
-
findByIdOrIdentifier
public Subject findByIdOrIdentifier(String id, String source) throws IllegalArgumentException, SourceUnavailableException, SubjectNotFoundException, SubjectNotUniqueException - Parameters:
id- Subject identifier to search on.source- Source adapter to search within.- Returns:
- Subject matching search parameters.
- Throws:
IllegalArgumentException- if any parameter is null.SourceUnavailableException- if source is unavailable.SubjectNotFoundException- if no matching subject is found.SubjectNotUniqueException- if more than one matching subject is found.- See Also:
-
findByIdOrIdentifier
public Subject findByIdOrIdentifier(String id, String source, boolean ignoreCachedSubjects) throws IllegalArgumentException, SourceUnavailableException, SubjectNotFoundException, SubjectNotUniqueException - Parameters:
id- Subject identifier to search on.source- Source adapter to search within.- Returns:
- Subject matching search parameters.
- Throws:
IllegalArgumentException- if any parameter is null.SourceUnavailableException- if source is unavailable.SubjectNotFoundException- if no matching subject is found.SubjectNotUniqueException- if more than one matching subject is found.- See Also:
-
findAllInStem
- Parameters:
stemName- name of stem we are queryingquery- A source-appropriate query string.- Returns:
- All subjects matching query.
- Throws:
IllegalArgumentException- if any parameter is null.- See Also:
-
findPage
- Parameters:
query- A source-appropraite query string.- Returns:
- Paged subjects matching query.
- Throws:
IllegalArgumentException- if any parameter is null.- Since:
- 1.2.1
- See Also:
-
findAll
Description copied from interface:SubjectResolverfind subjects in a set of sources- Returns:
- the subjects
- Throws:
IllegalArgumentException- See Also:
-
findPage
public SearchPageResult findPage(String query, Set<Source> sources) throws SourceUnavailableException Description copied from interface:SubjectResolverfind a page of subjects in a set of sources- Returns:
- the page of subjects
- Throws:
SourceUnavailableException- See Also:
-
findPage
public SearchPageResult findPage(String query, String source) throws IllegalArgumentException, SourceUnavailableException - Parameters:
query- A source-appropriate query string.source- Restrict query to within this source.- Returns:
- Page of subjects matching query.
- Throws:
IllegalArgumentException- if any parameter is null.SourceUnavailableException- if source is unavailable.- Since:
- 2.0.2
- See Also:
-
findPageInStem
public SearchPageResult findPageInStem(String stemName, String query) throws IllegalArgumentException - Parameters:
stemName- name of stem we are queryingquery- A source-appropriate query string.- Returns:
- All subjects matching query.
- Throws:
IllegalArgumentException- if any parameter is null.- See Also:
-
findPageInStem
public SearchPageResult findPageInStem(String stemName, String query, Set<Source> sources) throws IllegalArgumentException - Parameters:
stemName- name of stem we are queryingquery- A source-appropriate query string.- Returns:
- All subjects matching query.
- Throws:
IllegalArgumentException- if any parameter is null.- See Also:
-
findByIdentifiers
public Map<String,Subject> findByIdentifiers(Collection<String> identifiers) throws IllegalArgumentException - Returns:
- map of search param to subject
- Throws:
IllegalArgumentException- if any parameter is null.- See Also:
-
findByIdentifiers
public Map<String,Subject> findByIdentifiers(Collection<String> identifiers, String source) throws IllegalArgumentException, SourceUnavailableException source- Source adapter to search within.- Returns:
- map of search param to subject
- Throws:
IllegalArgumentException- if any parameter is null.SourceUnavailableException- if source is unavailable.- See Also:
-
findByIds
- Parameters:
ids- Subject id to search on.- Returns:
- map of search param to subject
- Throws:
IllegalArgumentException- if any parameter is null.- See Also:
-
findByIds
public Map<String,Subject> findByIds(Collection<String> ids, String source) throws IllegalArgumentException, SourceUnavailableException source- Source adapter to search within.- Returns:
- map of search param to subject
- Throws:
IllegalArgumentException- if any parameter is null.SourceUnavailableException- if source is unavailable.- See Also:
-
findByIds
public Map<String,Subject> findByIds(Collection<String> ids, String source, boolean ignoreCachedSubjects) throws IllegalArgumentException, SourceUnavailableException source- Source adapter to search within.- Returns:
- map of search param to subject
- Throws:
IllegalArgumentException- if any parameter is null.SourceUnavailableException- if source is unavailable.- See Also:
-
findByIdsOrIdentifiers
public Map<String,Subject> findByIdsOrIdentifiers(Collection<String> idsOrIdentifiers) throws IllegalArgumentException - Parameters:
idsOrIdentifiers- Subject identifiers to search on.- Returns:
- map of search param to subject
- Throws:
IllegalArgumentException- if any parameter is null.- See Also:
-
findByIdsOrIdentifiers
public Map<String,Subject> findByIdsOrIdentifiers(Collection<String> idsOrIdentifiers, String source) throws IllegalArgumentException, SourceUnavailableException source- Source adapter to search within.- Returns:
- map of search param to subject
- Throws:
IllegalArgumentException- if any parameter is null.SourceUnavailableException- if source is unavailable.- See Also:
-
findByIdsOrIdentifiers
public Map<String,Subject> findByIdsOrIdentifiers(Collection<String> idsOrIdentifiers, Set<Source> sources) throws IllegalArgumentException, SourceUnavailableException sources- Source adapters to search within.- Returns:
- map of search param to subject
- Throws:
IllegalArgumentException- if any parameter is null.SourceUnavailableException- if source is unavailable.- See Also:
-