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
.
- Since:
- 1.2.1
- Version:
- $Id: CachingResolver.java,v 1.8 2008-08-26 21:11:51 mchyzer Exp $
- Author:
- blair christensen.
CACHE_FIND
public static final String CACHE_FIND
CACHE_FINDALL
public static final String CACHE_FINDALL
CACHE_FINDBYIDENTIFIER
public static final String CACHE_FINDBYIDENTIFIER
CachingResolver
public CachingResolver(SubjectResolver resolver)
- Since:
- 1.2.1
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:
SubjectResolver.find(String)
find
public Subject find(String id,
String type)
throws IllegalArgumentException,
SubjectNotFoundException,
SubjectNotUniqueException
- Parameters:
id
- Subject id to search on.type
- Subject type 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:
SubjectResolver.find(String, String)
find
public Subject find(String id,
String type,
String source)
throws IllegalArgumentException,
SourceUnavailableException,
SubjectNotFoundException,
SubjectNotUniqueException
- Parameters:
id
- Subject id to search on.type
- Subject type 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:
SubjectResolver.find(String, String, String)
findAll
public Set<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<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:
SubjectResolver.findAll(String, String)
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:
SubjectResolver.findByIdentifier(String)
findByIdentifier
public Subject findByIdentifier(String id,
String type)
throws IllegalArgumentException,
SubjectNotFoundException,
SubjectNotUniqueException
- Parameters:
id
- Subject identifier to search on.type
- Subject type 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:
SubjectResolver.findByIdentifier(String, String)
findByIdentifier
public Subject findByIdentifier(String id,
String type,
String source)
throws IllegalArgumentException,
SourceUnavailableException,
SubjectNotFoundException,
SubjectNotUniqueException
- Parameters:
id
- Subject identifier to search on.type
- Subject type 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:
SubjectResolver.findByIdentifier(String, String, String)
getSource
public Source getSource(String id)
throws IllegalArgumentException,
SourceUnavailableException
- Returns:
- Subject source identified by id.
- Throws:
IllegalArgumentException
- if id is null.
SourceUnavailableException
- if source cannot be returned.- Since:
- 1.2.1
- See Also:
SubjectResolver.getSource(String)
getSources
public Set<Source> getSources()
- Returns:
- All Subject sources.
- Since:
- 1.2.1
- See Also:
SubjectResolver.getSources()
getSources
public Set<Source> getSources(String subjectType)
throws IllegalArgumentException
- Parameters:
subjectType
- Only return sources that provide this type.
- Returns:
- All Subject sources that provide subjectType.
- Throws:
IllegalArgumentException
- if subjectType is null or invalid.- Since:
- 1.2.1
- See Also:
SubjectResolver.getSources(String)
getStats
public CacheStats getStats(String cache)
- Returns:
- ehcache statistics for cache.
- Since:
- 1.2.1