edu.internet2.middleware.grouper.subj
Class CachingResolver
java.lang.Object
edu.internet2.middleware.grouper.subj.SubjectResolverDecorator
edu.internet2.middleware.grouper.subj.CachingResolver
- All Implemented Interfaces:
- SubjectResolver
public class CachingResolver
- extends SubjectResolverDecorator
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 $
- Author:
- blair christensen.
Method Summary |
edu.internet2.middleware.subject.Subject |
find(String id)
|
edu.internet2.middleware.subject.Subject |
find(String id,
String source)
|
Set<edu.internet2.middleware.subject.Subject> |
findAll(String query)
|
Set<edu.internet2.middleware.subject.Subject> |
findAll(String query,
Set<edu.internet2.middleware.subject.Source> sources)
find subjects in a set of sources |
Set<edu.internet2.middleware.subject.Subject> |
findAll(String query,
String source)
|
Set<edu.internet2.middleware.subject.Subject> |
findAllInStem(String stemName,
String query)
|
edu.internet2.middleware.subject.Subject |
findByIdentifier(String id)
|
edu.internet2.middleware.subject.Subject |
findByIdentifier(String id,
String source)
|
Map<String,edu.internet2.middleware.subject.Subject> |
findByIdentifiers(Collection<String> identifiers)
|
Map<String,edu.internet2.middleware.subject.Subject> |
findByIdentifiers(Collection<String> identifiers,
String source)
|
edu.internet2.middleware.subject.Subject |
findByIdOrIdentifier(String id)
|
edu.internet2.middleware.subject.Subject |
findByIdOrIdentifier(String id,
String source)
|
Map<String,edu.internet2.middleware.subject.Subject> |
findByIds(Collection<String> ids)
|
Map<String,edu.internet2.middleware.subject.Subject> |
findByIds(Collection<String> ids,
String source)
|
Map<String,edu.internet2.middleware.subject.Subject> |
findByIdsOrIdentifiers(Collection<String> idsOrIdentifiers)
|
Map<String,edu.internet2.middleware.subject.Subject> |
findByIdsOrIdentifiers(Collection<String> idsOrIdentifiers,
String source)
|
edu.internet2.middleware.subject.SearchPageResult |
findPage(String query)
|
edu.internet2.middleware.subject.SearchPageResult |
findPage(String query,
Set<edu.internet2.middleware.subject.Source> sources)
find a page of subjects in a set of sources |
edu.internet2.middleware.subject.SearchPageResult |
findPage(String query,
String source)
|
edu.internet2.middleware.subject.SearchPageResult |
findPageInStem(String stemName,
String query)
|
edu.internet2.middleware.subject.SearchPageResult |
findPageInStem(String stemName,
String query,
Set<edu.internet2.middleware.subject.Source> sources)
|
void |
flushCache()
flush the cache (e.g. |
edu.internet2.middleware.subject.Source |
getSource(String id)
|
Set<edu.internet2.middleware.subject.Source> |
getSources()
|
CachingResolver
public CachingResolver(SubjectResolver resolver)
- Since:
- 1.2.1
flushCache
public void flushCache()
- flush the cache (e.g. for testing)
find
public edu.internet2.middleware.subject.Subject find(String id)
throws IllegalArgumentException,
edu.internet2.middleware.subject.SubjectNotFoundException,
edu.internet2.middleware.subject.SubjectNotUniqueException
- Parameters:
id
- Subject id to search on.
- Returns:
- Subject matching search parameters.
- Throws:
IllegalArgumentException
- if any parameter is null.
edu.internet2.middleware.subject.SubjectNotFoundException
- if no matching subject is found.
edu.internet2.middleware.subject.SubjectNotUniqueException
- if more than one matching subject is found.- Since:
- 1.2.1
- See Also:
SubjectResolver.find(String)
find
public edu.internet2.middleware.subject.Subject find(String id,
String source)
throws IllegalArgumentException,
edu.internet2.middleware.subject.SourceUnavailableException,
edu.internet2.middleware.subject.SubjectNotFoundException,
edu.internet2.middleware.subject.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.
edu.internet2.middleware.subject.SourceUnavailableException
- if source is unavailable.
edu.internet2.middleware.subject.SubjectNotFoundException
- if no matching subject is found.
edu.internet2.middleware.subject.SubjectNotUniqueException
- if more than one matching subject is found.- Since:
- 1.2.1
- See Also:
SubjectResolver.find(String, String)
findAll
public Set<edu.internet2.middleware.subject.Subject> findAll(String query)
throws IllegalArgumentException
- 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:
SubjectResolver.findAll(String)
findAll
public Set<edu.internet2.middleware.subject.Subject> findAll(String query,
String source)
throws IllegalArgumentException,
edu.internet2.middleware.subject.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.
edu.internet2.middleware.subject.SourceUnavailableException
- if source is unavailable.- Since:
- 1.2.1
- See Also:
SubjectResolver.findAll(String, String)
findByIdentifier
public edu.internet2.middleware.subject.Subject findByIdentifier(String id)
throws IllegalArgumentException,
edu.internet2.middleware.subject.SubjectNotFoundException,
edu.internet2.middleware.subject.SubjectNotUniqueException
- Parameters:
id
- Subject identifier to search on.
- Returns:
- Subject matching search parameters.
- Throws:
IllegalArgumentException
- if any parameter is null.
edu.internet2.middleware.subject.SubjectNotFoundException
- if no matching subject is found.
edu.internet2.middleware.subject.SubjectNotUniqueException
- if more than one matching subject is found.- Since:
- 1.2.1
- See Also:
SubjectResolver.findByIdentifier(String)
findByIdentifier
public edu.internet2.middleware.subject.Subject findByIdentifier(String id,
String source)
throws IllegalArgumentException,
edu.internet2.middleware.subject.SourceUnavailableException,
edu.internet2.middleware.subject.SubjectNotFoundException,
edu.internet2.middleware.subject.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.
edu.internet2.middleware.subject.SourceUnavailableException
- if source is unavailable.
edu.internet2.middleware.subject.SubjectNotFoundException
- if no matching subject is found.
edu.internet2.middleware.subject.SubjectNotUniqueException
- if more than one matching subject is found.- Since:
- 1.2.1
- See Also:
SubjectResolver.findByIdentifier(String, String)
getSource
public edu.internet2.middleware.subject.Source getSource(String id)
throws IllegalArgumentException,
edu.internet2.middleware.subject.SourceUnavailableException
- Returns:
- Subject source identified by id.
- Throws:
IllegalArgumentException
- if id is null.
edu.internet2.middleware.subject.SourceUnavailableException
- if source cannot be returned.- Since:
- 1.2.1
- See Also:
SubjectResolver.getSource(String)
getSources
public Set<edu.internet2.middleware.subject.Source> getSources()
- Returns:
- All Subject sources.
- Since:
- 1.2.1
- See Also:
SubjectResolver.getSources()
findByIdOrIdentifier
public edu.internet2.middleware.subject.Subject findByIdOrIdentifier(String id)
throws IllegalArgumentException,
edu.internet2.middleware.subject.SubjectNotFoundException,
edu.internet2.middleware.subject.SubjectNotUniqueException
- Parameters:
id
- Subject identifier to search on.
- Returns:
- Subject matching search parameters.
- Throws:
IllegalArgumentException
- if any parameter is null.
edu.internet2.middleware.subject.SubjectNotFoundException
- if no matching subject is found.
edu.internet2.middleware.subject.SubjectNotUniqueException
- if more than one matching subject is found.
findByIdOrIdentifier
public edu.internet2.middleware.subject.Subject findByIdOrIdentifier(String id,
String source)
throws IllegalArgumentException,
edu.internet2.middleware.subject.SourceUnavailableException,
edu.internet2.middleware.subject.SubjectNotFoundException,
edu.internet2.middleware.subject.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.
edu.internet2.middleware.subject.SourceUnavailableException
- if source is unavailable.
edu.internet2.middleware.subject.SubjectNotFoundException
- if no matching subject is found.
edu.internet2.middleware.subject.SubjectNotUniqueException
- if more than one matching subject is found.- See Also:
SubjectResolver.findByIdOrIdentifier(String, String)
findAllInStem
public Set<edu.internet2.middleware.subject.Subject> findAllInStem(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:
SubjectResolver.findAllInStem(java.lang.String, java.lang.String)
findPage
public edu.internet2.middleware.subject.SearchPageResult findPage(String query)
throws IllegalArgumentException
- 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:
SubjectResolver.findPage(String)
findAll
public Set<edu.internet2.middleware.subject.Subject> findAll(String query,
Set<edu.internet2.middleware.subject.Source> sources)
throws IllegalArgumentException
- Description copied from interface:
SubjectResolver
- find subjects in a set of sources
- Returns:
- the subjects
- Throws:
IllegalArgumentException
- See Also:
SubjectResolver.findAll(String, Set)
findPage
public edu.internet2.middleware.subject.SearchPageResult findPage(String query,
Set<edu.internet2.middleware.subject.Source> sources)
throws edu.internet2.middleware.subject.SourceUnavailableException
- Description copied from interface:
SubjectResolver
- find a page of subjects in a set of sources
- Returns:
- the page of subjects
- Throws:
edu.internet2.middleware.subject.SourceUnavailableException
- See Also:
SubjectResolver.findPage(String)
findPage
public edu.internet2.middleware.subject.SearchPageResult findPage(String query,
String source)
throws IllegalArgumentException,
edu.internet2.middleware.subject.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.
edu.internet2.middleware.subject.SourceUnavailableException
- if source is unavailable.- Since:
- 2.0.2
- See Also:
SubjectResolver.findPage(String, String)
findPageInStem
public edu.internet2.middleware.subject.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:
SubjectResolver.findAllInStem(java.lang.String, java.lang.String)
findPageInStem
public edu.internet2.middleware.subject.SearchPageResult findPageInStem(String stemName,
String query,
Set<edu.internet2.middleware.subject.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:
SubjectResolver.findPageInStem(java.lang.String, java.lang.String, Set)
findByIdentifiers
public Map<String,edu.internet2.middleware.subject.Subject> findByIdentifiers(Collection<String> identifiers)
throws IllegalArgumentException
- Returns:
- map of search param to subject
- Throws:
IllegalArgumentException
- if any parameter is null.- See Also:
SubjectResolver.findByIdentifiers(Collection)
findByIdentifiers
public Map<String,edu.internet2.middleware.subject.Subject> findByIdentifiers(Collection<String> identifiers,
String source)
throws IllegalArgumentException,
edu.internet2.middleware.subject.SourceUnavailableException
source
- Source adapter to search within.
- Returns:
- map of search param to subject
- Throws:
IllegalArgumentException
- if any parameter is null.
edu.internet2.middleware.subject.SourceUnavailableException
- if source is unavailable.- See Also:
SubjectResolver.findByIdentifiers(Collection, String)
findByIds
public Map<String,edu.internet2.middleware.subject.Subject> findByIds(Collection<String> ids)
throws IllegalArgumentException
- Parameters:
ids
- Subject id to search on.
- Returns:
- map of search param to subject
- Throws:
IllegalArgumentException
- if any parameter is null.- See Also:
SubjectResolver.findByIds(Collection)
findByIds
public Map<String,edu.internet2.middleware.subject.Subject> findByIds(Collection<String> ids,
String source)
throws IllegalArgumentException,
edu.internet2.middleware.subject.SourceUnavailableException
source
- Source adapter to search within.
- Returns:
- map of search param to subject
- Throws:
IllegalArgumentException
- if any parameter is null.
edu.internet2.middleware.subject.SourceUnavailableException
- if source is unavailable.- See Also:
SubjectResolver.findByIds(Collection, String)
findByIdsOrIdentifiers
public Map<String,edu.internet2.middleware.subject.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:
SubjectResolver.findByIdsOrIdentifiers(Collection)
findByIdsOrIdentifiers
public Map<String,edu.internet2.middleware.subject.Subject> findByIdsOrIdentifiers(Collection<String> idsOrIdentifiers,
String source)
throws IllegalArgumentException,
edu.internet2.middleware.subject.SourceUnavailableException
source
- Source adapter to search within.
- Returns:
- map of search param to subject
- Throws:
IllegalArgumentException
- if any parameter is null.
edu.internet2.middleware.subject.SourceUnavailableException
- if source is unavailable.- See Also:
SubjectResolver.findByIdsOrIdentifiers(Collection, String)