|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.internet2.middleware.grouper.SubjectFinder
public class SubjectFinder
Find I2MI subjects.
Constructor Summary | |
---|---|
SubjectFinder()
|
Method Summary | |
---|---|
static java.util.Set<edu.internet2.middleware.subject.Subject> |
findAll(java.lang.String query)
Find all subjects matching the query. |
static java.util.Set<edu.internet2.middleware.subject.Subject> |
findAll(java.lang.String query,
java.util.Set<edu.internet2.middleware.subject.Source> sources)
Find all subjects matching the query within the specified Source s. |
static java.util.Set<edu.internet2.middleware.subject.Subject> |
findAll(java.lang.String query,
java.lang.String source)
Find all subjects matching the query within the specified Source . |
static edu.internet2.middleware.subject.Subject |
findAllSubject()
Get GrouperAll subject. |
static edu.internet2.middleware.subject.Subject |
findById(java.lang.String id)
Deprecated. |
static edu.internet2.middleware.subject.Subject |
findById(java.lang.String id,
boolean exceptionIfNull)
Search within all configured sources for subject with identified by id. |
static edu.internet2.middleware.subject.Subject |
findById(java.lang.String id,
java.lang.String type)
Deprecated. |
static edu.internet2.middleware.subject.Subject |
findById(java.lang.String id,
java.lang.String type,
boolean exceptionIfNull)
Search within all configured sources providing type for subject with identified by id. |
static edu.internet2.middleware.subject.Subject |
findById(java.lang.String id,
java.lang.String type,
java.lang.String source)
Deprecated. |
static edu.internet2.middleware.subject.Subject |
findById(java.lang.String id,
java.lang.String type,
java.lang.String source,
boolean exceptionIfNull)
Search for subject by id, type and source. |
static edu.internet2.middleware.subject.Subject |
findByIdAndSource(java.lang.String id,
java.lang.String source,
boolean exceptionIfNull)
Search within all configured sources for subject with identified by id. |
static edu.internet2.middleware.subject.Subject |
findByIdentifier(java.lang.String id)
Deprecated. |
static edu.internet2.middleware.subject.Subject |
findByIdentifier(java.lang.String id,
boolean exceptionIfNotFound)
Get a subject by a well-known identifier. |
static edu.internet2.middleware.subject.Subject |
findByIdentifier(java.lang.String id,
java.lang.String type)
Deprecated. |
static edu.internet2.middleware.subject.Subject |
findByIdentifier(java.lang.String id,
java.lang.String type,
boolean exceptionIfNull)
Get a subject by a well-known identifier and the specified type. |
static edu.internet2.middleware.subject.Subject |
findByIdentifier(java.lang.String id,
java.lang.String type,
java.lang.String source)
Deprecated. |
static edu.internet2.middleware.subject.Subject |
findByIdentifier(java.lang.String id,
java.lang.String type,
java.lang.String source,
boolean exceptionIfNull)
Get a subject by a well-known identifier, type and source. |
static edu.internet2.middleware.subject.Subject |
findByIdentifierAndSource(java.lang.String identifier,
java.lang.String source,
boolean exceptionIfNull)
Get a subject by a well-known identifier, and source. |
static edu.internet2.middleware.subject.Subject |
findByIdOrIdentifier(java.lang.String idOrIdentifier,
boolean exceptionIfNull)
find by id or identifier |
static edu.internet2.middleware.subject.Subject |
findByIdOrIdentifierAndSource(java.lang.String idOrIdentifier,
java.lang.String source,
boolean exceptionIfNull)
find by id or identifier |
static java.util.Set<edu.internet2.middleware.subject.Subject> |
findBySubjectsInGroup(GrouperSession grouperSession,
java.util.Set<edu.internet2.middleware.subject.Subject> subjects,
Group group,
Field field,
MembershipType membershipType)
convert a set of subjects to a set of subject that are in a group |
static edu.internet2.middleware.subject.Subject |
findRootSubject()
Get GrouperSystem subject. |
static void |
flushCache()
flush the cache (e.g. for testing) |
static edu.internet2.middleware.subject.Source |
getSource(java.lang.String id)
try { Source sa = SubjectFinder.getSource(id); } catch (SourceUnavailableException eSU) { // unable to retrieve source } |
static java.util.Set<edu.internet2.middleware.subject.Source> |
getSources()
Set sources = SubjectFinder.getSources(); |
static java.util.Set<edu.internet2.middleware.subject.Source> |
getSources(java.lang.String subjectType)
Set personSources = SubjectFinder.getSources("person"); |
static edu.internet2.middleware.subject.Source |
internal_getGSA()
TODO 20070803 what is the point of this method? |
static void |
reset()
Reset SubjectResolver . |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SubjectFinder()
Method Detail |
---|
public static edu.internet2.middleware.subject.Subject findByIdOrIdentifier(java.lang.String idOrIdentifier, boolean exceptionIfNull) throws edu.internet2.middleware.subject.SubjectNotFoundException, edu.internet2.middleware.subject.SubjectNotUniqueException
idOrIdentifier
- exceptionIfNull
- if SubjectNotFoundException or null
edu.internet2.middleware.subject.SubjectNotFoundException
edu.internet2.middleware.subject.SubjectNotUniqueException
public static edu.internet2.middleware.subject.Subject findByIdOrIdentifierAndSource(java.lang.String idOrIdentifier, java.lang.String source, boolean exceptionIfNull) throws edu.internet2.middleware.subject.SubjectNotFoundException, edu.internet2.middleware.subject.SubjectNotUniqueException
idOrIdentifier
- source
- exceptionIfNull
- if SubjectNotFoundException or null
edu.internet2.middleware.subject.SubjectNotFoundException
edu.internet2.middleware.subject.SubjectNotUniqueException
@Deprecated public static edu.internet2.middleware.subject.Subject findById(java.lang.String id) throws edu.internet2.middleware.subject.SubjectNotFoundException, edu.internet2.middleware.subject.SubjectNotUniqueException
try { Subject subj = SubjectFinder.findById(subjectID); } catch (SubjectNotFoundException eSNF) { // Subject not found } catch (SubjectNotUniqueException eSNU) { // Subject not unique }
id
- Subject ID
Subject
object
edu.internet2.middleware.subject.SubjectNotFoundException
edu.internet2.middleware.subject.SubjectNotUniqueException
public static edu.internet2.middleware.subject.Subject findById(java.lang.String id, boolean exceptionIfNull) throws edu.internet2.middleware.subject.SubjectNotFoundException, edu.internet2.middleware.subject.SubjectNotUniqueException
try { Subject subj = SubjectFinder.findById(subjectID); } catch (SubjectNotFoundException eSNF) { // Subject not found } catch (SubjectNotUniqueException eSNU) { // Subject not unique }
id
- Subject IDexceptionIfNull
-
Subject
object
edu.internet2.middleware.subject.SubjectNotFoundException
edu.internet2.middleware.subject.SubjectNotUniqueException
public static edu.internet2.middleware.subject.Subject findByIdAndSource(java.lang.String id, java.lang.String source, boolean exceptionIfNull) throws edu.internet2.middleware.subject.SubjectNotFoundException, edu.internet2.middleware.subject.SubjectNotUniqueException
try { Subject subj = SubjectFinder.findByIdAndSource(subjectID, source, true); } catch (SubjectNotFoundException eSNF) { // Subject not found } catch (SubjectNotUniqueException eSNU) { // Subject not unique }
id
- Subject IDsource
- is the source to check inexceptionIfNull
-
Subject
object
edu.internet2.middleware.subject.SubjectNotFoundException
edu.internet2.middleware.subject.SubjectNotUniqueException
public static void flushCache()
@Deprecated public static edu.internet2.middleware.subject.Subject findById(java.lang.String id, java.lang.String type) throws edu.internet2.middleware.subject.SubjectNotFoundException, edu.internet2.middleware.subject.SubjectNotUniqueException
try { Subject subj = SubjectFinder.findById(subjectID, type); } catch (SubjectNotFoundException eSNF) { // Subject not found } catch (SubjectNotUniqueException eSNU) { // Subject not unique }
id
- Subject IDtype
- Subject type.
Subject
object
edu.internet2.middleware.subject.SubjectNotFoundException
edu.internet2.middleware.subject.SubjectNotUniqueException
@Deprecated public static edu.internet2.middleware.subject.Subject findById(java.lang.String id, java.lang.String type, java.lang.String source) throws edu.internet2.middleware.subject.SourceUnavailableException, edu.internet2.middleware.subject.SubjectNotFoundException, edu.internet2.middleware.subject.SubjectNotUniqueException
try { Subject subj = SubjectFinder.findById(id, type, source); } catch (SourceUnavailableException eSU) { // unable to query source } catch (SubjectNotFoundException eSNF) { // subject not found }
id
- Subject IDtype
- Subject type.source
- Subject source.
edu.internet2.middleware.subject.SourceUnavailableException
edu.internet2.middleware.subject.SubjectNotFoundException
edu.internet2.middleware.subject.SubjectNotUniqueException
@Deprecated public static edu.internet2.middleware.subject.Subject findByIdentifier(java.lang.String id) throws edu.internet2.middleware.subject.SubjectNotFoundException, edu.internet2.middleware.subject.SubjectNotUniqueException
try { Subject subj = SubjectFinder.findByIdentifier(identifier); } catch (SubjectNotFoundException eSNF) { // Subject not found } catch (SubjectNotUniqueException eSNU) { // Subject not unique }
id
- Subject identifier.
Subject
object
edu.internet2.middleware.subject.SubjectNotFoundException
edu.internet2.middleware.subject.SubjectNotUniqueException
@Deprecated public static edu.internet2.middleware.subject.Subject findByIdentifier(java.lang.String id, java.lang.String type) throws edu.internet2.middleware.subject.SubjectNotFoundException, edu.internet2.middleware.subject.SubjectNotUniqueException
try { Subject subj = SubjectFinder.findByIdentifier(identifier, type); } catch (SubjectNotFoundException eSNF) { // subject not found } catch (SubjectNotUniqueException eSNU) { // subject not found }
id
- Subject identifier.type
- Subject type.
Subject
object
edu.internet2.middleware.subject.SubjectNotFoundException
edu.internet2.middleware.subject.SubjectNotUniqueException
@Deprecated public static edu.internet2.middleware.subject.Subject findByIdentifier(java.lang.String id, java.lang.String type, java.lang.String source) throws edu.internet2.middleware.subject.SourceUnavailableException, edu.internet2.middleware.subject.SubjectNotFoundException, edu.internet2.middleware.subject.SubjectNotUniqueException
NOTE: This method does not perform any caching.
try { Subject subj = SubjectFinder.findByIdentifier(id, type, source); } catch (SubjectNotFoundException e) { // Subject not found }
id
- Well-known identifier.type
- Subject type.source
- Source
adapter to search.
Subject
object
edu.internet2.middleware.subject.SourceUnavailableException
edu.internet2.middleware.subject.SubjectNotFoundException
edu.internet2.middleware.subject.SubjectNotUniqueException
public static java.util.Set<edu.internet2.middleware.subject.Subject> findAll(java.lang.String query)
The query string specification is currently unique to each subject source adapter. Queries may not work or may lead to erratic results across different source adapters. Consult the documentation for each source adapter for more information on the query language supported by each adapter.
NOTE: This method does not perform any caching.
// Find all subjects matching the given query string. Set subjects = SubjectFinder.findAll(query);
query
- Subject query string.
Set
of Subject
objects.
edu.internet2.middleware.subject.SubjectTooManyResults
- if more results than configuredpublic static java.util.Set<edu.internet2.middleware.subject.Subject> findAll(java.lang.String query, java.lang.String source) throws edu.internet2.middleware.subject.SourceUnavailableException
Source
.
NOTE: This method does not perform any caching.
try { Set subjects = SubjectFinder.findAll(query, source); } catch (SourceUnavailableException eSU) { // unable to query source }
query
- Subject query string.r.source
- Source
adapter to search.
Set
of Subject
s.
edu.internet2.middleware.subject.SourceUnavailableException
public static java.util.Set<edu.internet2.middleware.subject.Subject> findAll(java.lang.String query, java.util.Set<edu.internet2.middleware.subject.Source> sources) throws edu.internet2.middleware.subject.SourceUnavailableException
Source
s.
NOTE: This method does not perform any caching.
try { Set subjects = SubjectFinder.findAll(query, sources); } catch (SourceUnavailableException eSU) { // unable to query source }
query
- Subject query string.sources
- Source
adapters to search.
Set
of Subject
s.
edu.internet2.middleware.subject.SourceUnavailableException
public static edu.internet2.middleware.subject.Subject findAllSubject() throws GrouperException
Subject all = SubjectFinder.findAllSubject();
Subject
Get GrouperAll subject.
Subject all = SubjectFinder.findAllSubject();
GrouperException
- if unable to retrieve GrouperAll.public static edu.internet2.middleware.subject.Subject findRootSubject() throws GrouperException
Subject root = SubjectFinder.findRootSubject();
GrouperException
- if unable to retrieve GrouperSystem.public static edu.internet2.middleware.subject.Source getSource(java.lang.String id) throws java.lang.IllegalArgumentException, edu.internet2.middleware.subject.SourceUnavailableException
try { Source sa = SubjectFinder.getSource(id); } catch (SourceUnavailableException eSU) { // unable to retrieve source }
id
-
java.lang.IllegalArgumentException
- if id is null.
edu.internet2.middleware.subject.SourceUnavailableException
- if unable to retrieve source.public static java.util.Set<edu.internet2.middleware.subject.Source> getSources()
Set sources = SubjectFinder.getSources();
Source
adapters.public static java.util.Set<edu.internet2.middleware.subject.Source> getSources(java.lang.String subjectType)
Set personSources = SubjectFinder.getSources("person");
subjectType
-
public static edu.internet2.middleware.subject.Source internal_getGSA()
public static void reset()
SubjectResolver
.
public static edu.internet2.middleware.subject.Subject findById(java.lang.String id, java.lang.String type, boolean exceptionIfNull) throws edu.internet2.middleware.subject.SubjectNotFoundException, edu.internet2.middleware.subject.SubjectNotUniqueException
try { Subject subj = SubjectFinder.findById(subjectID, type); } catch (SubjectNotFoundException eSNF) { // Subject not found } catch (SubjectNotUniqueException eSNU) { // Subject not unique }
id
- Subject IDtype
- Subject type.exceptionIfNull
-
Subject
object
edu.internet2.middleware.subject.SubjectNotFoundException
edu.internet2.middleware.subject.SubjectNotUniqueException
public static edu.internet2.middleware.subject.Subject findById(java.lang.String id, java.lang.String type, java.lang.String source, boolean exceptionIfNull) throws edu.internet2.middleware.subject.SourceUnavailableException, edu.internet2.middleware.subject.SubjectNotFoundException, edu.internet2.middleware.subject.SubjectNotUniqueException
try { Subject subj = SubjectFinder.findById(id, type, source); } catch (SourceUnavailableException eSU) { // unable to query source } catch (SubjectNotFoundException eSNF) { // subject not found }
id
- Subject IDtype
- Subject type. If blank dont consider typesource
- Subject source.exceptionIfNull
-
edu.internet2.middleware.subject.SourceUnavailableException
edu.internet2.middleware.subject.SubjectNotFoundException
edu.internet2.middleware.subject.SubjectNotUniqueException
public static edu.internet2.middleware.subject.Subject findByIdentifier(java.lang.String id, boolean exceptionIfNotFound) throws edu.internet2.middleware.subject.SubjectNotFoundException, edu.internet2.middleware.subject.SubjectNotUniqueException
try { Subject subj = SubjectFinder.findByIdentifier(identifier); } catch (SubjectNotFoundException eSNF) { // Subject not found } catch (SubjectNotUniqueException eSNU) { // Subject not unique }
id
- Subject identifier.exceptionIfNotFound
-
Subject
object
edu.internet2.middleware.subject.SubjectNotFoundException
edu.internet2.middleware.subject.SubjectNotUniqueException
public static edu.internet2.middleware.subject.Subject findByIdentifier(java.lang.String id, java.lang.String type, boolean exceptionIfNull) throws edu.internet2.middleware.subject.SubjectNotFoundException, edu.internet2.middleware.subject.SubjectNotUniqueException
try { Subject subj = SubjectFinder.findByIdentifier(identifier, type); } catch (SubjectNotFoundException eSNF) { // subject not found } catch (SubjectNotUniqueException eSNU) { // subject not found }
id
- Subject identifier.type
- Subject type.exceptionIfNull
-
Subject
object
edu.internet2.middleware.subject.SubjectNotFoundException
edu.internet2.middleware.subject.SubjectNotUniqueException
public static edu.internet2.middleware.subject.Subject findByIdentifier(java.lang.String id, java.lang.String type, java.lang.String source, boolean exceptionIfNull) throws edu.internet2.middleware.subject.SourceUnavailableException, edu.internet2.middleware.subject.SubjectNotFoundException, edu.internet2.middleware.subject.SubjectNotUniqueException
NOTE: This method does not perform any caching.
try { Subject subj = SubjectFinder.findByIdentifier(id, type, source); } catch (SubjectNotFoundException e) { // Subject not found }
id
- Well-known identifier.type
- Subject type.source
- Source
adapter to search.exceptionIfNull
-
Subject
object
edu.internet2.middleware.subject.SourceUnavailableException
edu.internet2.middleware.subject.SubjectNotFoundException
edu.internet2.middleware.subject.SubjectNotUniqueException
public static java.util.Set<edu.internet2.middleware.subject.Subject> findBySubjectsInGroup(GrouperSession grouperSession, java.util.Set<edu.internet2.middleware.subject.Subject> subjects, Group group, Field field, MembershipType membershipType)
grouperSession
- subjects
- to convert to membersgroup
- that subjects must be infield
- that they must be in in the group (null will default to eh members listmembershipType
- that they must be in in the group or null for any
public static edu.internet2.middleware.subject.Subject findByIdentifierAndSource(java.lang.String identifier, java.lang.String source, boolean exceptionIfNull) throws edu.internet2.middleware.subject.SourceUnavailableException, edu.internet2.middleware.subject.SubjectNotFoundException, edu.internet2.middleware.subject.SubjectNotUniqueException
NOTE: This method does not perform any caching.
try { Subject subj = SubjectFinder.findByIdentifierAndSource(id, source, true); } catch (SubjectNotFoundException e) { // Subject not found }
identifier
- Well-known identifier.source
- Source
adapter to search.exceptionIfNull
-
Subject
object
edu.internet2.middleware.subject.SourceUnavailableException
edu.internet2.middleware.subject.SubjectNotFoundException
edu.internet2.middleware.subject.SubjectNotUniqueException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |