edu.internet2.middleware.grouper.subj
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 $
Author:
blair christensen.

Method Summary
 Subject find(String id)
           
 Subject find(String id, String type)
           
 Subject find(String id, String type, String source)
           
 Set<Subject> findAll(String query)
           
 Set<Subject> findAll(String query, String source)
           
 Subject findByIdentifier(String id)
           
 Subject findByIdentifier(String id, String type)
           
 Subject findByIdentifier(String id, String type, String source)
           
 void flushCache()
          flush the cache (e.g.
 Source getSource(String id)
           
 Set<Source> getSources()
           
 Set<Source> getSources(String subjectType)
           
 

Method Detail

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,
             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

find

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

findAll

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

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,
                         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

findByIdentifier

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

getSource

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

getSources

Set<Source> getSources()
Returns:
All Subject sources.
Since:
1.2.1

getSources

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