Package edu.internet2.middleware.subject
Class LazySource
java.lang.Object
edu.internet2.middleware.subject.LazySource
- All Implemented Interfaces:
Source,Serializable
if the id or sources might not be known, dont resolve until you need it
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidmake 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. from the subject.propertiesGet 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) Gets a Subject by its ID.getSubject(String id, boolean exceptionIfNull) Gets a Subject by its ID.getSubject(String id, boolean exceptionIfNull, String realm) Gets a Subject by its ID.Gets a Subject by other well-known identifiers, aside from the subject ID, for example, login ID.getSubjectByIdentifier(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.id of underlying sourcevoidinit()Called by SourceManager when it loads this source.get the init params e.g. from the subject.propertiesbooleanbooleanvoidstart 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.voidsetConfigId(String configId) set config id for this sourcevoidSets the ID of this source.voidSets the name of this source.voidsetUnderlyingSourceId(String sourceId1) id of underlying source
-
Constructor Details
-
LazySource
public LazySource()default constructor -
LazySource
construct with source id- Parameters:
theSourceId-
-
-
Method Details
-
loggingStart
public void loggingStart()Description copied from interface:Sourcestart logging the source low level actions- Specified by:
loggingStartin interfaceSource
-
loggingStop
Description copied from interface:Sourcestop logging and get the output- Specified by:
loggingStopin interfaceSource
-
retrieveAllSubjectIds
Description copied from interface:Sourceget all subject ids- Specified by:
retrieveAllSubjectIdsin interfaceSource- Returns:
- all subjectIds
- See Also:
-
getSubjectStatusConfig
Description copied from interface:Sourceget the config bean for this source- Specified by:
getSubjectStatusConfigin interfaceSource- Returns:
- the config bean for this source
- See Also:
-
getUnderlyingSourceId
id of underlying source- Returns:
- the sourceId
-
setUnderlyingSourceId
id of underlying source- Parameters:
sourceId1- the sourceId to set
-
getSource
- Returns:
- source
-
checkConfig
public void checkConfig()Description copied from interface:Sourcemake sure the config is ok, and log descriptive errors if not- Specified by:
checkConfigin interfaceSource- See Also:
-
getId
Description copied from interface:SourceReturns the ID of this source. -
getName
Description copied from interface:SourceReturns the name of this source. -
getSubject
Description copied from interface:SourceGets a Subject by its ID.- Specified by:
getSubjectin interfaceSource- Parameters:
id-- Returns:
- subject
- Throws:
SubjectNotFoundExceptionSubjectNotUniqueException
-
getSubject
public Subject getSubject(String id, boolean exceptionIfNull) throws SubjectNotFoundException, SubjectNotUniqueException Description copied from interface:SourceGets a Subject by its ID.- Specified by:
getSubjectin interfaceSourceexceptionIfNull- if SubjectNotFoundException should be throws if the subject is null, or if null should be returned- Returns:
- subject
- Throws:
SubjectNotFoundExceptionSubjectNotUniqueException- See Also:
-
getSubjectByIdOrIdentifier
public Subject getSubjectByIdOrIdentifier(String idOrIdentifier, boolean exceptionIfNull) throws SubjectNotFoundException, SubjectNotUniqueException Description copied from interface:Sourcefind by id or identifier. pass in either an id or an identifier- Specified by:
getSubjectByIdOrIdentifierin interfaceSourceexceptionIfNull- if SubjectNotFoundException or null- Returns:
- the subject
- Throws:
SubjectNotFoundExceptionSubjectNotUniqueException- See Also:
-
getSubjectByIdentifier
public Subject getSubjectByIdentifier(String id) throws SubjectNotFoundException, SubjectNotUniqueException Description copied from interface:SourceGets a Subject by other well-known identifiers, aside from the subject ID, for example, login ID.- Specified by:
getSubjectByIdentifierin interfaceSource- Parameters:
id-- Returns:
- subject
- Throws:
SubjectNotFoundExceptionSubjectNotUniqueException
-
getSubjectByIdentifier
public Subject getSubjectByIdentifier(String id, boolean exceptionIfNull) throws SubjectNotFoundException, SubjectNotUniqueException Description copied from interface:SourceGets a Subject by other well-known identifiers, aside from the subject ID, for example, login ID.- Specified by:
getSubjectByIdentifierin interfaceSource- Returns:
- subject
- Throws:
SubjectNotFoundExceptionSubjectNotUniqueException- See Also:
-
getSubjectTypes
Description copied from interface:SourceGets the SubjectTypes supported by this source.- Specified by:
getSubjectTypesin interfaceSource- Returns:
- set
- See Also:
-
getSubjectsByIdentifiers
Description copied from interface:SourceGet 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.- Specified by:
getSubjectsByIdentifiersin interfaceSource- Returns:
- a map of results never null indexed by the identifiers
- See Also:
-
getSubjectsByIds
Description copied from interface:SourceGet 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.- Specified by:
getSubjectsByIdsin interfaceSource- Returns:
- a map of results never null indexed by the id
- See Also:
-
getSubjectsByIdsOrIdentifiers
Description copied from interface:SourceGet 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.- Specified by:
getSubjectsByIdsOrIdentifiersin interfaceSource- 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)
- See Also:
-
init
Description copied from interface:SourceCalled by SourceManager when it loads this source.- Specified by:
initin interfaceSource- Throws:
SourceUnavailableException- See Also:
-
printConfig
Description copied from interface:Sourcein the startup on this i2mi app, print helpful and brief info about this source- Specified by:
printConfigin interfaceSource- Returns:
- the info
- See Also:
-
searchPage
Description copied from interface:SourceUnstructured 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- Specified by:
searchPagein interfaceSource- Returns:
- results and if there are too many, never return null!!!
- See Also:
-
search
Description copied from interface:SourceUnstructured 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 -
setId
Description copied from interface:SourceSets the ID of this source. -
setName
Description copied from interface:SourceSets the name of this source. -
getInitParam
Description copied from interface:Sourceget the init param e.g. from the subject.properties- Specified by:
getInitParamin interfaceSource- Returns:
- param
- See Also:
-
initParams
Description copied from interface:Sourceget the init params e.g. from the subject.properties- Specified by:
initParamsin interfaceSource- Returns:
- params
- See Also:
-
edu.internet2.middleware.subject.Source#getInitParams()
-
getSearchAttributes
Description copied from interface:SourceGet the names of attributes used for searching.- Specified by:
getSearchAttributesin interfaceSource- Returns:
- search attributes in lower case
- See Also:
-
getSubjectIdentifierAttributes
Description copied from interface:SourceGet the names of attributes that are subject identifiers. This only returns the first- Specified by:
getSubjectIdentifierAttributesin interfaceSource- Returns:
- subject identifiers
- See Also:
-
getSubjectIdentifierAttributesAll
Description copied from interface:SourceGet all the names of attributes that are subject identifiers.- Specified by:
getSubjectIdentifierAttributesAllin interfaceSource- Returns:
- subject identifiers
- See Also:
-
getSortAttributes
Description copied from interface:SourceGet the names of attributes used for sorting.- Specified by:
getSortAttributesin interfaceSource- Returns:
- sort attributes in lower case
- See Also:
-
getInternalAttributes
Description copied from interface:SourceGet a set of attributes that are marked as being internal attributes. Note, these will be in lower case- Specified by:
getInternalAttributesin interfaceSource- Returns:
- set to lower case
- See Also:
-
getSubject
public Subject getSubject(String id, boolean exceptionIfNull, String realm) throws SubjectNotFoundException, SubjectNotUniqueException Description copied from interface:SourceGets a Subject by its ID.- Specified by:
getSubjectin interfaceSourceexceptionIfNull- if SubjectNotFoundException should be throws if the subject is null, or if null should be returnedrealm- 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:
SubjectNotFoundExceptionSubjectNotUniqueException- See Also:
-
getSubjectByIdOrIdentifier
public Subject getSubjectByIdOrIdentifier(String idOrIdentifier, boolean exceptionIfNull, String realm) throws SubjectNotFoundException, SubjectNotUniqueException Description copied from interface:Sourcefind by id or identifier. pass in either an id or an identifier- Specified by:
getSubjectByIdOrIdentifierin interfaceSourceexceptionIfNull- 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:
SubjectNotFoundExceptionSubjectNotUniqueException- See Also:
-
getSubjectByIdentifier
public Subject getSubjectByIdentifier(String id, boolean exceptionIfNull, String realm) throws SubjectNotFoundException, SubjectNotUniqueException Description copied from interface:SourceGets a Subject by other well-known identifiers, aside from the subject ID, for example, login ID.- Specified by:
getSubjectByIdentifierin interfaceSourcerealm- 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:
SubjectNotFoundExceptionSubjectNotUniqueException- See Also:
-
getSubjectsByIdentifiers
Description copied from interface:SourceGet 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.- Specified by:
getSubjectsByIdentifiersin interfaceSourcerealm- 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
- See Also:
-
getSubjectsByIds
Description copied from interface:SourceGet 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.- Specified by:
getSubjectsByIdsin interfaceSourcerealm- 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
- See Also:
-
getSubjectsByIdsOrIdentifiers
public Map<String,Subject> getSubjectsByIdsOrIdentifiers(Collection<String> idsOrIdentifiers, String realm) Description copied from interface:SourceGet 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.- Specified by:
getSubjectsByIdsOrIdentifiersin interfaceSource- 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)
- See Also:
-
search
Description copied from interface:SourceUnstructured 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 -
searchPage
Description copied from interface:SourceUnstructured 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- Specified by:
searchPagein interfaceSourcerealm- string value that sets the realm for the search. The source can implement various realms to account for permissions of the calling user- Returns:
- results and if there are too many, never return null!!!
- See Also:
-
isEditable
public boolean isEditable()- Specified by:
isEditablein interfaceSource- Returns:
- true if the source is editable otherwise false
-
isEnabled
public boolean isEnabled() -
getConfigId
- Specified by:
getConfigIdin interfaceSource- Returns:
- configId for this source
-
setConfigId
Description copied from interface:Sourceset config id for this source- Specified by:
setConfigIdin interfaceSource
-
convertSubjectAttributeToSourceAttribute
- Specified by:
convertSubjectAttributeToSourceAttributein interfaceSource
-
convertSourceAttributeToSubjectAttribute
- Specified by:
convertSourceAttributeToSubjectAttributein interfaceSource
-