|
||||||||||
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 | |
---|---|
SubjectFinder |
assignExceptionIfNotFound(boolean theExceptionIfNotFound)
if there should be an exception if not found on one subject to query |
SubjectFinder |
assignMemberId(java.lang.String theMemberId)
assign a member id to search for |
SubjectFinder |
assignSourceId(java.lang.String theSourceId)
assign the source id to search in |
SubjectFinder |
assignSubjectId(java.lang.String theSubjectId)
assign a subjectId to search for |
SubjectFinder |
assignSubjectIdentifier(java.lang.String theSubjectIdentifier1)
assign a subject identifier to search for |
SubjectFinder |
assignSubjectIdOrIdentifier(java.lang.String theSubjectIdOrIdentifier)
assign subject id or identifier to search for |
static void |
decorateSubjects(GrouperSession grouperSession,
java.util.Set<edu.internet2.middleware.subject.Subject> subjects,
java.util.Collection<java.lang.String> attributeNamesRequested)
decorate subjects based on subject customizer in grouper.properties |
static edu.internet2.middleware.subject.Subject |
filterSubject(GrouperSession grouperSession,
edu.internet2.middleware.subject.Subject subject,
java.lang.String filterSubjectsInStemName)
filter subjects based on subject customizer in grouper.properties |
static java.util.Map<java.lang.String,edu.internet2.middleware.subject.Subject> |
filterSubjects(GrouperSession grouperSession,
java.util.Map<java.lang.String,edu.internet2.middleware.subject.Subject> subjectMap,
java.lang.String filterSubjectsInStemName)
filter subjects based on subject customizer in grouper.properties |
static java.util.Set<edu.internet2.middleware.subject.Subject> |
filterSubjects(GrouperSession grouperSession,
java.util.Set<edu.internet2.middleware.subject.Subject> subjects,
java.lang.String filterSubjectsInStemName)
filter subjects based on subject customizer in grouper.properties |
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 java.util.Set<edu.internet2.middleware.subject.Subject> |
findAllInStem(java.lang.String stemName,
java.lang.String query)
Find all subjects matching the query, in a certain folder. |
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)
Deprecated. since type is no longer an identifier... just use id or id/source |
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)
Deprecated. |
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)
Deprecated. use id or id/source |
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)
Deprecated. |
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 java.util.Map<java.lang.String,edu.internet2.middleware.subject.Subject> |
findByIdentifiers(java.util.Collection<java.lang.String> identifiers)
find subjects by identifiers |
static java.util.Map<java.lang.String,edu.internet2.middleware.subject.Subject> |
findByIdentifiers(java.util.Collection<java.lang.String> identifiers,
java.lang.String source)
find subjects by identifiers |
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.Map<java.lang.String,edu.internet2.middleware.subject.Subject> |
findByIds(java.util.Collection<java.lang.String> ids)
find subjects by ids |
static java.util.Map<java.lang.String,edu.internet2.middleware.subject.Subject> |
findByIds(java.util.Collection<java.lang.String> ids,
java.lang.String source)
find subjects by ids |
static java.util.Map<java.lang.String,edu.internet2.middleware.subject.Subject> |
findByIdsOrIdentifiers(java.util.Collection<java.lang.String> idsOrIdentifiers)
find subjects by idsOrIdentifiers |
static java.util.Map<java.lang.String,edu.internet2.middleware.subject.Subject> |
findByIdsOrIdentifiers(java.util.Collection<java.lang.String> idsOrIdentifiers,
java.lang.String source)
find subjects by idsOrIdentifiers |
static edu.internet2.middleware.subject.Subject |
findByOptionalArgs(java.lang.String sourceId,
java.lang.String subjectId,
java.lang.String subjectIdentifier,
boolean exceptionIfNotFound)
pass in the source (optional), and the id or identifier |
static edu.internet2.middleware.subject.Subject |
findByPackedSubjectString(java.lang.String subjectString,
boolean exceptionIfNotFound)
Find a subject by packed subject string. |
static java.util.Map<SubjectBean,edu.internet2.middleware.subject.Subject> |
findBySubjectBeans(java.util.Collection<SubjectBean> subjectBeans)
find by subject beans |
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.SearchPageResult |
findPage(java.lang.String query)
Find a page of subjects matching the query. |
static edu.internet2.middleware.subject.SearchPageResult |
findPage(java.lang.String query,
java.util.Set<edu.internet2.middleware.subject.Source> sources)
Find a page of subjects matching the query within the specified Source s. |
static edu.internet2.middleware.subject.SearchPageResult |
findPage(java.lang.String query,
java.lang.String source)
Find a page of subjects matching the query within the specified Source . |
static edu.internet2.middleware.subject.SearchPageResult |
findPageInStem(java.lang.String stemName,
java.lang.String query)
Find a page of subjects matching the query, in a certain folder. |
static edu.internet2.middleware.subject.SearchPageResult |
findPageInStem(java.lang.String stemName,
java.lang.String query,
java.util.Set<edu.internet2.middleware.subject.Source> sources)
Find a page of subjects matching the query, in a certain folder. |
static edu.internet2.middleware.subject.Subject |
findRootSubject()
Get GrouperSystem subject. |
edu.internet2.middleware.subject.Subject |
findSubject()
|
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 GrouperSession |
grouperSessionOrRootForSubjectFinder()
|
static edu.internet2.middleware.subject.Source |
internal_getEntitySourceAdapter(boolean failIfError)
|
static edu.internet2.middleware.subject.Source |
internal_getGSA()
|
static void |
internalClearSubjectCustomizerCache()
clea the subject customizer cache |
static boolean |
isUseThreadsBasedOnThreadLocal()
if we should use threads when doing searches (if grouper.properties allows) |
static void |
reset()
Reset SubjectResolver . |
static SubjectFinder.RestrictSourceForGroup |
restrictSourceForGroup(java.lang.String stemName,
java.lang.String sourceId)
|
static SubjectCustomizer |
subjectCustomizer()
get the subject customizer |
static void |
useThreads(boolean ifUseThreads)
if we should use threads when doing searches (if grouper.properties allows), this must be used in a try/finally |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SubjectFinder()
Method Detail |
---|
public SubjectFinder assignSubjectId(java.lang.String theSubjectId)
theSubjectId
-
public SubjectFinder assignSourceId(java.lang.String theSourceId)
theSourceId
-
public SubjectFinder assignSubjectIdentifier(java.lang.String theSubjectIdentifier1)
theSubjectIdentifier1
-
public SubjectFinder assignSubjectIdOrIdentifier(java.lang.String theSubjectIdOrIdentifier)
theSubjectIdOrIdentifier
-
public SubjectFinder assignMemberId(java.lang.String theMemberId)
theMemberId
-
public SubjectFinder assignExceptionIfNotFound(boolean theExceptionIfNotFound)
theExceptionIfNotFound
-
public edu.internet2.middleware.subject.Subject findSubject()
public static GrouperSession grouperSessionOrRootForSubjectFinder()
public static void useThreads(boolean ifUseThreads)
ifUseThreads
- public static boolean isUseThreadsBasedOnThreadLocal()
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 findByOptionalArgs(java.lang.String sourceId, java.lang.String subjectId, java.lang.String subjectIdentifier, boolean exceptionIfNotFound)
sourceId
- subjectId
- subjectIdentifier
- exceptionIfNotFound
-
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 java.util.Map<SubjectBean,edu.internet2.middleware.subject.Subject> findBySubjectBeans(java.util.Collection<SubjectBean> subjectBeans)
subjectBeans
-
public static java.util.Map<java.lang.String,edu.internet2.middleware.subject.Subject> findByIds(java.util.Collection<java.lang.String> ids)
ids
-
public static java.util.Map<java.lang.String,edu.internet2.middleware.subject.Subject> findByIdsOrIdentifiers(java.util.Collection<java.lang.String> idsOrIdentifiers)
idsOrIdentifiers
-
public static java.util.Map<java.lang.String,edu.internet2.middleware.subject.Subject> findByIdsOrIdentifiers(java.util.Collection<java.lang.String> idsOrIdentifiers, java.lang.String source)
idsOrIdentifiers
- source
-
public static java.util.Map<java.lang.String,edu.internet2.middleware.subject.Subject> findByIdentifiers(java.util.Collection<java.lang.String> identifiers)
identifiers
-
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> findAllInStem(java.lang.String stemName, 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);
stemName
- stem name to search inquery
- 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 edu.internet2.middleware.subject.Source internal_getGSA()
public static edu.internet2.middleware.subject.Source internal_getEntitySourceAdapter(boolean failIfError)
failIfError
-
public static void reset()
SubjectResolver
.
@Deprecated 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
@Deprecated 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
@Deprecated 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
@Deprecated 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
public static edu.internet2.middleware.subject.Subject findByPackedSubjectString(java.lang.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(java.lang.String stemName, java.lang.String sourceId)
sourceId
- stemName
-
public static edu.internet2.middleware.subject.SearchPageResult findPage(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. SearchPageResult subjects = SubjectFinder.findPage(query);
query
- Subject query string.
Set
of Subject
objects and if there are too many.
edu.internet2.middleware.subject.SubjectTooManyResults
- if more results than configuredpublic static edu.internet2.middleware.subject.SearchPageResult findPage(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 { SearchPageResult subjects = SubjectFinder.findPage(query, sources); } catch (SourceUnavailableException eSU) { // unable to query source }
query
- Subject query string.sources
- Source
adapters to search.
Set
of Subject
s and if there are too many.
edu.internet2.middleware.subject.SourceUnavailableException
public static edu.internet2.middleware.subject.SearchPageResult findPage(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.findPage(query, source); } catch (SourceUnavailableException eSU) { // unable to query source }
query
- Subject query string.r.source
- Source
adapter to search.
Set
of Subject
s and if too many.
edu.internet2.middleware.subject.SourceUnavailableException
public static edu.internet2.middleware.subject.SearchPageResult findPageInStem(java.lang.String stemName, 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);
stemName
- stem name to search inquery
- Subject query string.
Set
of Subject
objects.
edu.internet2.middleware.subject.SubjectTooManyResults
- if more results than configuredpublic static edu.internet2.middleware.subject.SearchPageResult findPageInStem(java.lang.String stemName, java.lang.String query, java.util.Set<edu.internet2.middleware.subject.Source> sources)
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.
edu.internet2.middleware.subject.SubjectTooManyResults
- if more results than configuredpublic static java.util.Map<java.lang.String,edu.internet2.middleware.subject.Subject> findByIdentifiers(java.util.Collection<java.lang.String> identifiers, java.lang.String source)
identifiers
- source
-
public static java.util.Map<java.lang.String,edu.internet2.middleware.subject.Subject> findByIds(java.util.Collection<java.lang.String> ids, java.lang.String source)
ids
- source
-
public static void decorateSubjects(GrouperSession grouperSession, java.util.Set<edu.internet2.middleware.subject.Subject> subjects, java.util.Collection<java.lang.String> attributeNamesRequested)
grouperSession
- subjects
- attributeNamesRequested
- public static java.util.Map<java.lang.String,edu.internet2.middleware.subject.Subject> filterSubjects(GrouperSession grouperSession, java.util.Map<java.lang.String,edu.internet2.middleware.subject.Subject> subjectMap, java.lang.String filterSubjectsInStemName)
grouperSession
- subjectMap
- is map os subject id to subjectfilterSubjectsInStemName
- attributeNamesRequested
-
public static java.util.Set<edu.internet2.middleware.subject.Subject> filterSubjects(GrouperSession grouperSession, java.util.Set<edu.internet2.middleware.subject.Subject> subjects, java.lang.String filterSubjectsInStemName)
grouperSession
- subjects
- filterSubjectsInStemName
- attributeNamesRequested
-
public static edu.internet2.middleware.subject.Subject filterSubject(GrouperSession grouperSession, edu.internet2.middleware.subject.Subject subject, java.lang.String filterSubjectsInStemName)
grouperSession
- subject
- filterSubjectsInStemName
- attributeNamesRequested
-
public static void internalClearSubjectCustomizerCache()
public static SubjectCustomizer subjectCustomizer()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |