Package edu.internet2.middleware.subject
Interface Source
- All Known Implementing Classes:
BaseSourceAdapter
,EntitySourceAdapter
,ExternalSubjectAutoSourceAdapter
,GrouperJdbcSourceAdapter
,GrouperJdbcSourceAdapter2
,GrouperJdbcSourceAdapter2_5
,GrouperJndiSourceAdapter
,GrouperLdapSourceAdapter2_5
,GrouperSourceAdapter
,HelperGrouperJdbcSourceAdapter
,HelperGrouperJdbcSourceAdapter2
,HelperGrouperJndiSourceAdapter
,InternalSourceAdapter
,JDBCSourceAdapter
,JDBCSourceAdapter2
,JNDISourceAdapter
,JNDISourceAdapterLegacy
,LazySource
,LdapSourceAdapter
,NullSourceAdapter
public interface Source
Source to find and get Subjects and their attributes.
You should probably extend BaseSourceAdapter instead of implement this interface
-
Method Summary
Modifier and TypeMethodDescriptionvoid
make sure the config is ok, and log descriptive errors if notconvertSourceAttributeToSubjectAttribute
(String nameOfSourceAttribute) convertSubjectAttributeToSourceAttribute
(String nameOfSubjectAttribute) getId()
Returns the ID of this source.getInitParam
(String name1) get the init param e.g.Get a set of attributes that are marked as being internal attributes.getName()
Returns the name of this source.Get the names of attributes used for searching.Get the names of attributes used for sorting.getSubject
(String id) Deprecated.use the overload insteadgetSubject
(String id, boolean exceptionIfNull) Gets a Subject by its ID.getSubject
(String id, boolean exceptionIfNull, String realm) Gets a Subject by its ID.Deprecated.use the overload insteadgetSubjectByIdentifier
(String id, boolean exceptionIfNull) Gets a Subject by other well-known identifiers, aside from the subject ID, for example, login ID.getSubjectByIdentifier
(String id, boolean exceptionIfNull, String realm) Gets a Subject by other well-known identifiers, aside from the subject ID, for example, login ID.getSubjectByIdOrIdentifier
(String idOrIdentifier, boolean exceptionIfNull) find by id or identifier.getSubjectByIdOrIdentifier
(String idOrIdentifier, boolean exceptionIfNull, String realm) find by id or identifier.Get the names of attributes that are subject identifiers.Get all the names of attributes that are subject identifiers.getSubjectsByIdentifiers
(Collection<String> identifiers) Get subjects by identifiers.getSubjectsByIdentifiers
(Collection<String> identifiers, String realm) Get subjects by identifiers.getSubjectsByIds
(Collection<String> ids) Get subjects by ids.getSubjectsByIds
(Collection<String> ids, String realm) Get subjects by ids.getSubjectsByIdsOrIdentifiers
(Collection<String> idsOrIdentifiers) Get subjects by ids or identifiers.getSubjectsByIdsOrIdentifiers
(Collection<String> idsOrIdentifiers, String realm) Get subjects by ids or identifiers.get the config bean for this sourceGets the SubjectTypes supported by this source.void
init()
Called by SourceManager when it loads this source.get the init params e.g.boolean
boolean
void
start logging the source low level actionsstop logging and get the outputin the startup on this i2mi app, print helpful and brief info about this sourceget all subject idsUnstructured search for Subjects.Unstructured search for Subjects.searchPage
(String searchValue) Unstructured search for Subjects.searchPage
(String searchValue, String realm) Unstructured search for Subjects.void
setConfigId
(String configId) set config id for this sourcevoid
Sets the ID of this source.void
Sets the name of this source.
-
Method Details
-
loggingStart
void loggingStart()start logging the source low level actions -
loggingStop
String loggingStop()stop logging and get the output -
retrieveAllSubjectIds
get all subject ids- Returns:
- all subjectIds
- Throws:
UnsupportedOperationException
- if not implemented
-
getSubjectStatusConfig
SubjectStatusConfig getSubjectStatusConfig()get the config bean for this source- Returns:
- the config bean for this source
-
getId
String getId()Returns the ID of this source.- Returns:
- id
-
setId
Sets the ID of this source.- Parameters:
id
-
-
getName
String getName()Returns the name of this source.- Returns:
- name
-
setName
Sets the name of this source.- Parameters:
name
-
-
getSubjectTypes
Set<SubjectType> getSubjectTypes()Gets the SubjectTypes supported by this source.- Returns:
- set
-
getSubject
@Deprecated Subject getSubject(String id) throws SubjectNotFoundException, SubjectNotUniqueException Deprecated.use the overload insteadGets a Subject by its ID.- Parameters:
id
-- Returns:
- subject
- Throws:
SubjectNotFoundException
SubjectNotUniqueException
-
getSubjectByIdentifier
@Deprecated Subject getSubjectByIdentifier(String id) throws SubjectNotFoundException, SubjectNotUniqueException Deprecated.use the overload insteadGets a Subject by other well-known identifiers, aside from the subject ID, for example, login ID.- Parameters:
id
-- Returns:
- subject
- Throws:
SubjectNotFoundException
SubjectNotUniqueException
-
getSubject
Subject getSubject(String id, boolean exceptionIfNull) throws SubjectNotFoundException, SubjectNotUniqueException Gets a Subject by its ID.- Parameters:
id
-exceptionIfNull
- if SubjectNotFoundException should be throws if the subject is null, or if null should be returned- Returns:
- subject
- Throws:
SubjectNotFoundException
SubjectNotUniqueException
-
getSubjectsByIds
Get subjects by ids. Note, if the subjects arent found or arent unique, they wont be returned. Duplicates are ok on the input, but will return one output.- Parameters:
ids
-- Returns:
- a map of results never null indexed by the id
-
getSubjectsByIdentifiers
Get subjects by identifiers. Note, if the subjects arent found or arent unique, they wont be returned. Identifiers are unique ways to refer to a subject that isnt its id (e.g. netid). Duplicates are ok on the input, but will return one output.- Parameters:
identifiers
-- Returns:
- a map of results never null indexed by the identifiers
-
getSubjectsByIdsOrIdentifiers
Get subjects by ids or identifiers. Note, if the subjects arent found or arent unique, they wont be returned. Identifiers are unique ways to refer to a subject that isnt its id (e.g. netid). Duplicates are ok on the input, but will return one output.- Parameters:
idsOrIdentifiers
- each string could be a subject id or identifier- Returns:
- a map of results never null indexed by the id or identifier that was passed in. Note, the same subject could be returned twice if looked up by id and identifier (two inputs)
-
getSubjectByIdOrIdentifier
Subject getSubjectByIdOrIdentifier(String idOrIdentifier, boolean exceptionIfNull) throws SubjectNotFoundException, SubjectNotUniqueException find by id or identifier. pass in either an id or an identifier- Parameters:
idOrIdentifier
-exceptionIfNull
- if SubjectNotFoundException or null- Returns:
- the subject
- Throws:
SubjectNotFoundException
SubjectNotUniqueException
-
getSubjectByIdentifier
Subject getSubjectByIdentifier(String id, boolean exceptionIfNull) throws SubjectNotFoundException, SubjectNotUniqueException Gets a Subject by other well-known identifiers, aside from the subject ID, for example, login ID.- Parameters:
id
-exceptionIfNull
-- Returns:
- subject
- Throws:
SubjectNotFoundException
SubjectNotUniqueException
-
search
Unstructured search for Subjects. Each implementation utilizes its own search algorithm tailored to the Subject repository and schema. Note if config param: throwErrorOnFindAllFailure is false, then swallow and log exceptions- Parameters:
searchValue
-- Returns:
- set
-
init
Called by SourceManager when it loads this source.- Throws:
SourceUnavailableException
-
checkConfig
void checkConfig()make sure the config is ok, and log descriptive errors if not -
printConfig
String printConfig()in the startup on this i2mi app, print helpful and brief info about this source- Returns:
- the info
-
getInitParam
get the init param e.g. from the subject.properties- Parameters:
name1
-- Returns:
- param
-
initParams
Properties initParams()get the init params e.g. from the subject.properties- Returns:
- params
-
getInternalAttributes
Get a set of attributes that are marked as being internal attributes. Note, these will be in lower case- Returns:
- set to lower case
-
getSubjectIdentifierAttributes
Get the names of attributes that are subject identifiers. This only returns the first- Returns:
- subject identifiers
-
getSubjectIdentifierAttributesAll
Get all the names of attributes that are subject identifiers.- Returns:
- subject identifiers
-
getSortAttributes
Get the names of attributes used for sorting.- Returns:
- sort attributes in lower case
-
getSearchAttributes
Get the names of attributes used for searching.- Returns:
- search attributes in lower case
-
searchPage
Unstructured search for Subjects. Each implementation utilizes its own search algorithm tailored to the Subject repository and schema. Note if config param: throwErrorOnFindAllFailure is false, then swallow and log exceptions if maxPageSize is set in subject.properties, then only return max that many, and if there are more, set the tooManyResults flag- Parameters:
searchValue
-- Returns:
- results and if there are too many, never return null!!!
-
searchPage
Unstructured search for Subjects. Each implementation utilizes its own search algorithm tailored to the Subject repository and schema. Note if config param: throwErrorOnFindAllFailure is false, then swallow and log exceptions if maxPageSize is set in subject.properties, then only return max that many, and if there are more, set the tooManyResults flag- Parameters:
realm
- string value that sets the realm for the search. The source can implement various realms to account for permissions of the calling usersearchValue
-- Returns:
- results and if there are too many, never return null!!!
-
getSubject
Subject getSubject(String id, boolean exceptionIfNull, String realm) throws SubjectNotFoundException, SubjectNotUniqueException Gets a Subject by its ID.- Parameters:
id
-realm
- string value that sets the realm for the search. The source can implement various realms to account for permissions of the calling userexceptionIfNull
- if SubjectNotFoundException should be throws if the subject is null, or if null should be returned- Returns:
- subject
- Throws:
SubjectNotFoundException
SubjectNotUniqueException
-
getSubjectByIdentifier
Subject getSubjectByIdentifier(String id, boolean exceptionIfNull, String realm) throws SubjectNotFoundException, SubjectNotUniqueException Gets a Subject by other well-known identifiers, aside from the subject ID, for example, login ID.- Parameters:
id
-exceptionIfNull
-realm
- string value that sets the realm for the search. The source can implement various realms to account for permissions of the calling user- Returns:
- subject
- Throws:
SubjectNotFoundException
SubjectNotUniqueException
-
getSubjectByIdOrIdentifier
Subject getSubjectByIdOrIdentifier(String idOrIdentifier, boolean exceptionIfNull, String realm) throws SubjectNotFoundException, SubjectNotUniqueException find by id or identifier. pass in either an id or an identifier- Parameters:
idOrIdentifier
-exceptionIfNull
- if SubjectNotFoundException or nullrealm
- string value that sets the realm for the search. The source can implement various realms to account for permissions of the calling user- Returns:
- the subject
- Throws:
SubjectNotFoundException
SubjectNotUniqueException
-
getSubjectsByIdentifiers
Get subjects by identifiers. Note, if the subjects arent found or arent unique, they wont be returned. Identifiers are unique ways to refer to a subject that isnt its id (e.g. netid). Duplicates are ok on the input, but will return one output.- Parameters:
identifiers
-realm
- string value that sets the realm for the search. The source can implement various realms to account for permissions of the calling user- Returns:
- a map of results never null indexed by the identifiers
-
getSubjectsByIds
Get subjects by ids. Note, if the subjects arent found or arent unique, they wont be returned. Duplicates are ok on the input, but will return one output.- Parameters:
ids
-realm
- string value that sets the realm for the search. The source can implement various realms to account for permissions of the calling user- Returns:
- a map of results never null indexed by the id
-
getSubjectsByIdsOrIdentifiers
Map<String,Subject> getSubjectsByIdsOrIdentifiers(Collection<String> idsOrIdentifiers, String realm) Get subjects by ids or identifiers. Note, if the subjects arent found or arent unique, they wont be returned. Identifiers are unique ways to refer to a subject that isnt its id (e.g. netid). Duplicates are ok on the input, but will return one output.- Parameters:
idsOrIdentifiers
- each string could be a subject id or identifierrealm
- string value that sets the realm for the search. The source can implement various realms to account for permissions of the calling user- Returns:
- a map of results never null indexed by the id or identifier that was passed in. Note, the same subject could be returned twice if looked up by id and identifier (two inputs)
-
search
Unstructured search for Subjects. Each implementation utilizes its own search algorithm tailored to the Subject repository and schema. Note if config param: throwErrorOnFindAllFailure is false, then swallow and log exceptions- Parameters:
searchValue
-realm
- string value that sets the realm for the search. The source can implement various realms to account for permissions of the calling user- Returns:
- set
-
isEditable
boolean isEditable()- Returns:
- true if the source is editable otherwise false
-
isEnabled
boolean isEnabled()- Returns:
- true if the source is active otherwise false
-
getConfigId
String getConfigId()- Returns:
- configId for this source
-
setConfigId
set config id for this source -
convertSubjectAttributeToSourceAttribute
-
convertSourceAttributeToSubjectAttribute
-