public class CachingResolver extends SubjectResolverDecorator
SubjectResolver
.
TODO the caching of findAll should work based on group restricted to, not stem name
Constructor and Description |
---|
CachingResolver(SubjectResolver resolver) |
getDecoratedResolver
public CachingResolver(SubjectResolver resolver)
public void flushCache()
public Subject find(String id) throws IllegalArgumentException, SubjectNotFoundException, SubjectNotUniqueException
id
- Subject id to search on.IllegalArgumentException
- if any parameter is null.SubjectNotFoundException
- if no matching subject is found.SubjectNotUniqueException
- if more than one matching subject is found.SubjectResolver.find(String)
public Subject find(String id, String source) throws IllegalArgumentException, SourceUnavailableException, SubjectNotFoundException, SubjectNotUniqueException
id
- Subject id to search on.source
- Source adapter to search within.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.SubjectResolver.find(String, String)
public Set<Subject> findAll(String query) throws IllegalArgumentException
query
- A source-appropraite query string.IllegalArgumentException
- if any parameter is null.SubjectResolver.findAll(String)
public Set<Subject> findAll(String query, String source) throws IllegalArgumentException, SourceUnavailableException
query
- A source-appropriate query string.source
- Restrict query to within this source.IllegalArgumentException
- if any parameter is null.SourceUnavailableException
- if source is unavailable.SubjectResolver.findAll(String, String)
public Subject findByIdentifier(String id) throws IllegalArgumentException, SubjectNotFoundException, SubjectNotUniqueException
id
- Subject identifier to search on.IllegalArgumentException
- if any parameter is null.SubjectNotFoundException
- if no matching subject is found.SubjectNotUniqueException
- if more than one matching subject is found.SubjectResolver.findByIdentifier(String)
public Subject findByIdentifier(String id, String source) throws IllegalArgumentException, SourceUnavailableException, SubjectNotFoundException, SubjectNotUniqueException
id
- Subject identifier to search on.source
- Source adapter to search within.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.SubjectResolver.findByIdentifier(String, String)
public Source getSource(String id) throws IllegalArgumentException, SourceUnavailableException
IllegalArgumentException
- if id is null.SourceUnavailableException
- if source cannot be returned.SubjectResolver.getSource(String)
public Set<Source> getSources()
SubjectResolver.getSources()
public Subject findByIdOrIdentifier(String id) throws IllegalArgumentException, SubjectNotFoundException, SubjectNotUniqueException
id
- Subject identifier to search on.IllegalArgumentException
- if any parameter is null.SubjectNotFoundException
- if no matching subject is found.SubjectNotUniqueException
- if more than one matching subject is found.public Subject findByIdOrIdentifier(String id, String source) throws IllegalArgumentException, SourceUnavailableException, SubjectNotFoundException, SubjectNotUniqueException
id
- Subject identifier to search on.source
- Source adapter to search within.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.SubjectResolver.findByIdOrIdentifier(String, String)
public Set<Subject> findAllInStem(String stemName, String query) throws IllegalArgumentException
stemName
- name of stem we are queryingquery
- A source-appropriate query string.IllegalArgumentException
- if any parameter is null.SubjectResolver.findAllInStem(java.lang.String, java.lang.String)
public SearchPageResult findPage(String query) throws IllegalArgumentException
query
- A source-appropraite query string.IllegalArgumentException
- if any parameter is null.SubjectResolver.findPage(String)
public Set<Subject> findAll(String query, Set<Source> sources) throws IllegalArgumentException
SubjectResolver
IllegalArgumentException
SubjectResolver.findAll(String, Set)
public SearchPageResult findPage(String query, Set<Source> sources) throws SourceUnavailableException
SubjectResolver
SourceUnavailableException
SubjectResolver.findPage(String)
public SearchPageResult findPage(String query, String source) throws IllegalArgumentException, SourceUnavailableException
query
- A source-appropriate query string.source
- Restrict query to within this source.IllegalArgumentException
- if any parameter is null.SourceUnavailableException
- if source is unavailable.SubjectResolver.findPage(String, String)
public SearchPageResult findPageInStem(String stemName, String query) throws IllegalArgumentException
stemName
- name of stem we are queryingquery
- A source-appropriate query string.IllegalArgumentException
- if any parameter is null.SubjectResolver.findAllInStem(java.lang.String, java.lang.String)
public SearchPageResult findPageInStem(String stemName, String query, Set<Source> sources) throws IllegalArgumentException
stemName
- name of stem we are queryingquery
- A source-appropriate query string.IllegalArgumentException
- if any parameter is null.SubjectResolver.findPageInStem(java.lang.String, java.lang.String, Set)
public Map<String,Subject> findByIdentifiers(Collection<String> identifiers) throws IllegalArgumentException
IllegalArgumentException
- if any parameter is null.SubjectResolver.findByIdentifiers(Collection)
public Map<String,Subject> findByIdentifiers(Collection<String> identifiers, String source) throws IllegalArgumentException, SourceUnavailableException
source
- Source adapter to search within.IllegalArgumentException
- if any parameter is null.SourceUnavailableException
- if source is unavailable.SubjectResolver.findByIdentifiers(Collection, String)
public Map<String,Subject> findByIds(Collection<String> ids) throws IllegalArgumentException
ids
- Subject id to search on.IllegalArgumentException
- if any parameter is null.SubjectResolver.findByIds(Collection)
public Map<String,Subject> findByIds(Collection<String> ids, String source) throws IllegalArgumentException, SourceUnavailableException
source
- Source adapter to search within.IllegalArgumentException
- if any parameter is null.SourceUnavailableException
- if source is unavailable.SubjectResolver.findByIds(Collection, String)
public Map<String,Subject> findByIdsOrIdentifiers(Collection<String> idsOrIdentifiers) throws IllegalArgumentException
idsOrIdentifiers
- Subject identifiers to search on.IllegalArgumentException
- if any parameter is null.SubjectResolver.findByIdsOrIdentifiers(Collection)
public Map<String,Subject> findByIdsOrIdentifiers(Collection<String> idsOrIdentifiers, String source) throws IllegalArgumentException, SourceUnavailableException
source
- Source adapter to search within.IllegalArgumentException
- if any parameter is null.SourceUnavailableException
- if source is unavailable.SubjectResolver.findByIdsOrIdentifiers(Collection, String)
public Map<String,Subject> findByIdsOrIdentifiers(Collection<String> idsOrIdentifiers, Set<Source> sources) throws IllegalArgumentException, SourceUnavailableException
sources
- Source adapters to search within.IllegalArgumentException
- if any parameter is null.SourceUnavailableException
- if source is unavailable.SubjectResolver.findByIdsOrIdentifiers(Collection, Set)
Copyright © 2016 Internet2. All rights reserved.