Interface SubjectResolver
- All Known Implementing Classes:
CachingResolver,SourcesXmlResolver,SubjectResolverDecorator,ValidatingResolver
public interface SubjectResolver
Subject resolution interface.
- Since:
- 1.2.1
- Version:
- $Id: SubjectResolver.java,v 1.5 2008-08-26 21:11:51 mchyzer Exp $
-
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. for testing)getSources(boolean enabledOnly)
-
Method Details
-
flushCache
void flushCache()flush the cache (e.g. for testing) -
find
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
-
find
Subject find(String id, boolean ignoreCachedSubjects) throws IllegalArgumentException, SubjectNotFoundException, SubjectNotUniqueException - Parameters:
id- Subject id to search on.ignoreCachedSubjects-- 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.
-
find
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
-
find
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.ignoreCachedSubjects-- 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.
-
findAll
- Parameters:
query- A source-appropraite query string.- Returns:
- All subjects matching query.
- Throws:
IllegalArgumentException- if any parameter is null.- Since:
- 1.2.1
-
findAll
find subjects in a set of sources- Parameters:
query-sources-- Returns:
- the subjects
- Throws:
IllegalArgumentException
-
findPage
find a page of subjects in a set of sources- Parameters:
query-sources-- Returns:
- the page of subjects
- Throws:
SourceUnavailableException
-
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.- Since:
- 1.2.1
-
findAll
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
-
findByIdentifier
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
-
findByIdentifier
Subject findByIdentifier(String id, boolean ignoreCachedSubjects) throws IllegalArgumentException, SubjectNotFoundException, SubjectNotUniqueException - Parameters:
id- Subject identifier to search on.ignoreCachedSubjects-- 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.
-
findByIdentifier
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
-
findByIdentifier
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.ignoreCachedSubjects-- 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.
-
getSource
- Parameters:
id-- Returns:
- Subject source identified by id.
- Throws:
IllegalArgumentException- if id is null.SourceUnavailableException- if source cannot be returned.- Since:
- 1.2.1
-
getSources
- Returns:
- All Subject sources.
- Since:
- 1.2.1
-
getSources
- Parameters:
enabledOnly-- Returns:
- All Subject sources.
-
findByIdOrIdentifier
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.- Since:
- 1.2.1
-
findByIdOrIdentifier
Subject findByIdOrIdentifier(String id, boolean ignoreCachedSubjects) throws IllegalArgumentException, SubjectNotFoundException, SubjectNotUniqueException - Parameters:
id- Subject identifier to search on.ignoreCachedSubjects-- 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
Subject findByIdOrIdentifier(String id, 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
-
findByIdOrIdentifier
Subject findByIdOrIdentifier(String id, String source, boolean ignoreCachedSubjects) throws IllegalArgumentException, SourceUnavailableException, SubjectNotFoundException, SubjectNotUniqueException - Parameters:
id- Subject identifier to search on.type- Subject type to search on.source- Source adapter to search within.ignoreCachedSubjects-- 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.
-
findPage
- Parameters:
query- A source-appropraite query string.- Returns:
- Paged subjects matching query.
- Throws:
IllegalArgumentException- if any parameter is null.- Since:
- 2.0.2
-
findPage
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
-
findPageInStem
- 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.- Since:
- 2.0.2
-
findPageInStem
SearchPageResult findPageInStem(String stemName, String query, Set<Source> sources) throws IllegalArgumentException - Parameters:
stemName- name of stem we are queryingquery- A source-appropriate query string.source-- Returns:
- All subjects matching query.
- Throws:
IllegalArgumentException- if any parameter is null.- Since:
- 2.0.2
-
findByIdsOrIdentifiers
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.SubjectNotFoundException- if no matching subject is found.SubjectNotUniqueException- if more than one matching subject is found.- Since:
- 2.0.2
-
findByIdsOrIdentifiers
Map<String,Subject> findByIdsOrIdentifiers(Collection<String> idsOrIdentifiers, String source) throws IllegalArgumentException, SourceUnavailableException - Parameters:
id- Subject identifier to search on.type- Subject type to search on.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.SubjectNotFoundException- if no matching subject is found.SubjectNotUniqueException- if more than one matching subject is found.- Since:
- 2.0.2
-
findByIdsOrIdentifiers
Map<String,Subject> findByIdsOrIdentifiers(Collection<String> idsOrIdentifiers, Set<Source> sources) throws IllegalArgumentException, SourceUnavailableException - Parameters:
id- Subject identifier to search on.type- Subject type to search on.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.SubjectNotFoundException- if no matching subject is found.SubjectNotUniqueException- if more than one matching subject is found.- Since:
- 2.0.2
-
findByIds
- Parameters:
ids- Subject id to search on.- Returns:
- map of search param to subject
- Throws:
IllegalArgumentException- if any parameter is null.SubjectNotFoundException- if no matching subject is found.SubjectNotUniqueException- if more than one matching subject is found.- Since:
- 2.0.2
-
findByIds
Map<String,Subject> findByIds(Collection<String> ids, String source) throws IllegalArgumentException, SourceUnavailableException - Parameters:
id- Subject id to search on.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.SubjectNotFoundException- if no matching subject is found.SubjectNotUniqueException- if more than one matching subject is found.- Since:
- 2.0.2
-
findByIds
Map<String,Subject> findByIds(Collection<String> ids, String source, boolean ignoreCachedSubjects) throws IllegalArgumentException, SourceUnavailableException - Parameters:
id- Subject id to search on.source- Source adapter to search within.ignoreCachedSubjects-- Returns:
- map of search param to subject
- 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:
- 2.0.2
-
findByIdentifiers
Map<String,Subject> findByIdentifiers(Collection<String> identifiers) throws IllegalArgumentException - Parameters:
id- Subject identifier to search on.- Returns:
- map of search param to subject
- Throws:
IllegalArgumentException- if any parameter is null.SubjectNotFoundException- if no matching subject is found.SubjectNotUniqueException- if more than one matching subject is found.- Since:
- 2.0.2
-
findByIdentifiers
Map<String,Subject> findByIdentifiers(Collection<String> identifiers, String source) throws IllegalArgumentException, SourceUnavailableException - Parameters:
id- Subject identifier to search on.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.SubjectNotFoundException- if no matching subject is found.SubjectNotUniqueException- if more than one matching subject is found.- Since:
- 2.0.2
-