|
|||||||||
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.
Nested Class Summary | |
---|---|
static class |
SubjectFinder.RestrictSourceForGroup
result to see if source if restricted by group |
Constructor Summary | |
---|---|
SubjectFinder()
|
Method Summary | |
---|---|
static Set<Subject> |
findAll(String query)
Find all subjects matching the query. |
static Set<Subject> |
findAll(String query,
Set<Source> sources)
Find all subjects matching the query within the specified Source s. |
static Set<Subject> |
findAll(String query,
String source)
Find all subjects matching the query within the specified Source . |
static Set<Subject> |
findAllInStem(String stemName,
String query)
Find all subjects matching the query, in a certain folder. |
static Subject |
findAllSubject()
Get GrouperAll subject. |
static Subject |
findById(String id)
Deprecated. |
static Subject |
findById(String id,
boolean exceptionIfNull)
Search within all configured sources for subject with identified by id. |
static Subject |
findById(String id,
String type)
Deprecated. |
static Subject |
findById(String id,
String type,
boolean exceptionIfNull)
Deprecated. since type is no longer an identifier... just use id or id/source |
static Subject |
findById(String id,
String type,
String source)
Deprecated. |
static Subject |
findById(String id,
String type,
String source,
boolean exceptionIfNull)
Deprecated. |
static Subject |
findByIdAndSource(String id,
String source,
boolean exceptionIfNull)
Search within all configured sources for subject with identified by id. |
static Subject |
findByIdentifier(String id)
Deprecated. |
static Subject |
findByIdentifier(String id,
boolean exceptionIfNotFound)
Get a subject by a well-known identifier. |
static Subject |
findByIdentifier(String id,
String type)
Deprecated. |
static Subject |
findByIdentifier(String id,
String type,
boolean exceptionIfNull)
Deprecated. use id or id/source |
static Subject |
findByIdentifier(String id,
String type,
String source)
Deprecated. |
static Subject |
findByIdentifier(String id,
String type,
String source,
boolean exceptionIfNull)
Deprecated. |
static Subject |
findByIdentifierAndSource(String identifier,
String source,
boolean exceptionIfNull)
Get a subject by a well-known identifier, and source. |
static Subject |
findByIdOrIdentifier(String idOrIdentifier,
boolean exceptionIfNull)
find by id or identifier |
static Subject |
findByIdOrIdentifierAndSource(String idOrIdentifier,
String source,
boolean exceptionIfNull)
find by id or identifier |
static Subject |
findByOptionalArgs(String sourceId,
String subjectId,
String subjectIdentifier,
boolean exceptionIfNotFound)
pass in the source (optional), and the id or identifier |
static Subject |
findByPackedSubjectString(String subjectString,
boolean exceptionIfNotFound)
Find a subject by packed subject string. |
static Set<Subject> |
findBySubjectsInGroup(GrouperSession grouperSession,
Set<Subject> subjects,
Group group,
Field field,
MembershipType membershipType)
convert a set of subjects to a set of subject that are in a group |
static Subject |
findRootSubject()
Get GrouperSystem subject. |
static void |
flushCache()
flush the cache (e.g. |
static Source |
getSource(String id)
try { Source sa = SubjectFinder.getSource(id); } catch (SourceUnavailableException eSU) { // unable to retrieve source } |
static Set<Source> |
getSources()
Set sources = SubjectFinder.getSources(); |
static Source |
internal_getGSA()
TODO 20070803 what is the point of this method? |
static void |
reset()
Reset SubjectResolver . |
static SubjectFinder.RestrictSourceForGroup |
restrictSourceForGroup(String stemName,
String sourceId)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SubjectFinder()
Method Detail |
---|
public static Subject findByIdOrIdentifier(String idOrIdentifier, boolean exceptionIfNull) throws SubjectNotFoundException, SubjectNotUniqueException
idOrIdentifier
- exceptionIfNull
- if SubjectNotFoundException or null
SubjectNotFoundException
SubjectNotUniqueException
public static Subject findByOptionalArgs(String sourceId, String subjectId, String subjectIdentifier, boolean exceptionIfNotFound)
sourceId
- subjectId
- subjectIdentifier
- exceptionIfNotFound
-
public static Subject findByIdOrIdentifierAndSource(String idOrIdentifier, String source, boolean exceptionIfNull) throws SubjectNotFoundException, SubjectNotUniqueException
idOrIdentifier
- source
- exceptionIfNull
- if SubjectNotFoundException or null
SubjectNotFoundException
SubjectNotUniqueException
@Deprecated public static Subject findById(String id) throws SubjectNotFoundException, SubjectNotUniqueException
try { Subject subj = SubjectFinder.findById(subjectID); } catch (SubjectNotFoundException eSNF) { // Subject not found } catch (SubjectNotUniqueException eSNU) { // Subject not unique }
id
- Subject ID
Subject
object
SubjectNotFoundException
SubjectNotUniqueException
public static Subject findById(String id, boolean exceptionIfNull) throws SubjectNotFoundException, SubjectNotUniqueException
try { Subject subj = SubjectFinder.findById(subjectID); } catch (SubjectNotFoundException eSNF) { // Subject not found } catch (SubjectNotUniqueException eSNU) { // Subject not unique }
id
- Subject IDexceptionIfNull
-
Subject
object
SubjectNotFoundException
SubjectNotUniqueException
public static Subject findByIdAndSource(String id, String source, boolean exceptionIfNull) throws SubjectNotFoundException, 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
SubjectNotFoundException
SubjectNotUniqueException
public static void flushCache()
@Deprecated public static Subject findById(String id, String type) throws SubjectNotFoundException, 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
SubjectNotFoundException
SubjectNotUniqueException
@Deprecated public static Subject findById(String id, String type, String source) throws SourceUnavailableException, SubjectNotFoundException, 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.
SourceUnavailableException
SubjectNotFoundException
SubjectNotUniqueException
@Deprecated public static Subject findByIdentifier(String id) throws SubjectNotFoundException, SubjectNotUniqueException
try { Subject subj = SubjectFinder.findByIdentifier(identifier); } catch (SubjectNotFoundException eSNF) { // Subject not found } catch (SubjectNotUniqueException eSNU) { // Subject not unique }
id
- Subject identifier.
Subject
object
SubjectNotFoundException
SubjectNotUniqueException
@Deprecated public static Subject findByIdentifier(String id, String type) throws SubjectNotFoundException, 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
SubjectNotFoundException
SubjectNotUniqueException
@Deprecated public static Subject findByIdentifier(String id, String type, String source) throws SourceUnavailableException, SubjectNotFoundException, 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
SourceUnavailableException
SubjectNotFoundException
SubjectNotUniqueException
public static Set<Subject> findAll(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.
SubjectTooManyResults
- if more results than configuredpublic static Set<Subject> findAllInStem(String stemName, 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);
stemName
- stem name to search inquery
- Subject query string.
Set
of Subject
objects.
SubjectTooManyResults
- if more results than configuredpublic static Set<Subject> findAll(String query, String source) throws 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.
SourceUnavailableException
public static Set<Subject> findAll(String query, Set<Source> sources) throws 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.
SourceUnavailableException
public static Subject findAllSubject() throws GrouperException
Subject all = SubjectFinder.findAllSubject();
Subject
Get GrouperAll subject.
Subject all = SubjectFinder.findAllSubject();
GrouperException
- if unable to retrieve GrouperAll.public static Subject findRootSubject() throws GrouperException
Subject root = SubjectFinder.findRootSubject();
GrouperException
- if unable to retrieve GrouperSystem.public static Source getSource(String id) throws IllegalArgumentException, SourceUnavailableException
try { Source sa = SubjectFinder.getSource(id); } catch (SourceUnavailableException eSU) { // unable to retrieve source }
id
-
IllegalArgumentException
- if id is null.
SourceUnavailableException
- if unable to retrieve source.public static Set<Source> getSources()
Set sources = SubjectFinder.getSources();
Source
adapters.public static Source internal_getGSA()
public static void reset()
SubjectResolver
.
@Deprecated public static Subject findById(String id, String type, boolean exceptionIfNull) throws SubjectNotFoundException, 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
SubjectNotFoundException
SubjectNotUniqueException
@Deprecated public static Subject findById(String id, String type, String source, boolean exceptionIfNull) throws SourceUnavailableException, SubjectNotFoundException, 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
-
SourceUnavailableException
SubjectNotFoundException
SubjectNotUniqueException
public static Subject findByIdentifier(String id, boolean exceptionIfNotFound) throws SubjectNotFoundException, 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
SubjectNotFoundException
SubjectNotUniqueException
@Deprecated public static Subject findByIdentifier(String id, String type, boolean exceptionIfNull) throws SubjectNotFoundException, 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
SubjectNotFoundException
SubjectNotUniqueException
@Deprecated public static Subject findByIdentifier(String id, String type, String source, boolean exceptionIfNull) throws SourceUnavailableException, SubjectNotFoundException, 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
SourceUnavailableException
SubjectNotFoundException
SubjectNotUniqueException
public static Set<Subject> findBySubjectsInGroup(GrouperSession grouperSession, Set<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 Subject findByIdentifierAndSource(String identifier, String source, boolean exceptionIfNull) throws SourceUnavailableException, SubjectNotFoundException, 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
SourceUnavailableException
SubjectNotFoundException
SubjectNotUniqueException
public static Subject findByPackedSubjectString(String subjectString, boolean exceptionIfNotFound)
Find a subject by packed subject string. This could be a four colons then subjectId or six colons then a subjectIdentifier, or a source then four colons, then subjectId, or a source then six colons then a subjectIdentifier. or a subjectIdOrIdentifier, or a source, then eight colons, then a subjectIdentifier e.g. subjectIdOrIdentifier sourceId::::subjectId ::::subjectId sourceId::::::subjectIdentifier ::::::subjectIdentifier sourceId::::::::subjectIdOrIdentifier ::::::::subjectIdOrIdentifier
subjectString
- exceptionIfNotFound
-
public static SubjectFinder.RestrictSourceForGroup restrictSourceForGroup(String stemName, String sourceId)
sourceId
- stemName
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |