edu.internet2.middleware.subject
Class LazySource

java.lang.Object
  extended by edu.internet2.middleware.subject.LazySource
All Implemented Interfaces:
Source

public class LazySource
extends Object
implements Source

if the id or sources might not be known, dont resolve until you need it


Constructor Summary
LazySource()
          default constructor
LazySource(String theSourceId)
          construct with source id
 
Method Summary
 void checkConfig()
          make sure the config is ok, and log descriptive errors if not
 String getId()
          Returns the ID of this source.
 String getInitParam(String name1)
          get the init param e.g.
 Properties getInitParams()
          get the init params e.g.
 String getName()
          Returns the name of this source.
 Subject getSubject(String id)
          Gets a Subject by its ID.
 Subject getSubject(String id, boolean exceptionIfNull)
          Gets a Subject by its ID.
 Subject getSubjectByIdentifier(String id)
          Gets a Subject by other well-known identifiers, aside from the subject ID, for example, login ID.
 Subject getSubjectByIdentifier(String id, boolean exceptionIfNull)
          Gets a Subject by other well-known identifiers, aside from the subject ID, for example, login ID.
 Subject getSubjectByIdOrIdentifier(String idOrIdentifier, boolean exceptionIfNull)
          find by id or identifier.
 Map<String,Subject> getSubjectsByIdentifiers(Collection<String> identifiers)
          Get subjects by identifiers.
 Map<String,Subject> getSubjectsByIds(Collection<String> ids)
          Get subjects by ids.
 Map<String,Subject> getSubjectsByIdsOrIdentifiers(Collection<String> idsOrIdentifiers)
          Get subjects by ids or identifiers.
 Set<SubjectType> getSubjectTypes()
          Gets the SubjectTypes supported by this source.
 String getUnderlyingSourceId()
          id of underlying source
 void init()
          Called by SourceManager when it loads this source.
 String printConfig()
          in the startup on this i2mi app, print helpful and brief info about this source
 Set<Subject> search(String searchValue)
          Unstructured search for Subjects.
 void setId(String id)
          Sets the ID of this source.
 void setName(String name)
          Sets the name of this source.
 void setUnderlyingSourceId(String sourceId1)
          id of underlying source
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LazySource

public LazySource()
default constructor


LazySource

public LazySource(String theSourceId)
construct with source id

Parameters:
theSourceId -
Method Detail

getUnderlyingSourceId

public String getUnderlyingSourceId()
id of underlying source

Returns:
the sourceId

setUnderlyingSourceId

public void setUnderlyingSourceId(String sourceId1)
id of underlying source

Parameters:
sourceId1 - the sourceId to set

checkConfig

public void checkConfig()
Description copied from interface: Source
make sure the config is ok, and log descriptive errors if not

Specified by:
checkConfig in interface Source
See Also:
Source.checkConfig()

getId

public String getId()
Description copied from interface: Source
Returns the ID of this source.

Specified by:
getId in interface Source
Returns:
id
See Also:
Source.getId()

getName

public String getName()
Description copied from interface: Source
Returns the name of this source.

Specified by:
getName in interface Source
Returns:
name
See Also:
Source.getName()

getSubject

public Subject getSubject(String id)
                   throws SubjectNotFoundException,
                          SubjectNotUniqueException
Description copied from interface: Source
Gets a Subject by its ID.

Specified by:
getSubject in interface Source
Parameters:
id -
Returns:
subject
Throws:
SubjectNotFoundException
SubjectNotUniqueException

getSubject

public Subject getSubject(String id,
                          boolean exceptionIfNull)
                   throws SubjectNotFoundException,
                          SubjectNotUniqueException
Description copied from interface: Source
Gets a Subject by its ID.

Specified by:
getSubject in interface Source
exceptionIfNull - if SubjectNotFoundException should be throws if the subject is null, or if null should be returned
Returns:
subject
Throws:
SubjectNotFoundException
SubjectNotUniqueException
See Also:
Source.getSubject(java.lang.String, boolean)

getSubjectByIdOrIdentifier

public Subject getSubjectByIdOrIdentifier(String idOrIdentifier,
                                          boolean exceptionIfNull)
                                   throws SubjectNotFoundException,
                                          SubjectNotUniqueException
Description copied from interface: Source
find by id or identifier. pass in either an id or an identifier

Specified by:
getSubjectByIdOrIdentifier in interface Source
exceptionIfNull - if SubjectNotFoundException or null
Returns:
the subject
Throws:
SubjectNotFoundException
SubjectNotUniqueException
See Also:
Source.getSubjectByIdOrIdentifier(java.lang.String, boolean)

getSubjectByIdentifier

public Subject getSubjectByIdentifier(String id)
                               throws SubjectNotFoundException,
                                      SubjectNotUniqueException
Description copied from interface: Source
Gets a Subject by other well-known identifiers, aside from the subject ID, for example, login ID.

Specified by:
getSubjectByIdentifier in interface Source
Parameters:
id -
Returns:
subject
Throws:
SubjectNotFoundException
SubjectNotUniqueException

getSubjectByIdentifier

public Subject getSubjectByIdentifier(String id,
                                      boolean exceptionIfNull)
                               throws SubjectNotFoundException,
                                      SubjectNotUniqueException
Description copied from interface: Source
Gets a Subject by other well-known identifiers, aside from the subject ID, for example, login ID.

Specified by:
getSubjectByIdentifier in interface Source
Returns:
subject
Throws:
SubjectNotFoundException
SubjectNotUniqueException
See Also:
Source.getSubjectByIdentifier(java.lang.String, boolean)

getSubjectTypes

public Set<SubjectType> getSubjectTypes()
Description copied from interface: Source
Gets the SubjectTypes supported by this source.

Specified by:
getSubjectTypes in interface Source
Returns:
set
See Also:
Source.getSubjectTypes()

getSubjectsByIdentifiers

public Map<String,Subject> getSubjectsByIdentifiers(Collection<String> identifiers)
Description copied from interface: Source
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.

Specified by:
getSubjectsByIdentifiers in interface Source
Returns:
a map of results never null indexed by the identifiers
See Also:
Source.getSubjectsByIdentifiers(java.util.Collection)

getSubjectsByIds

public Map<String,Subject> getSubjectsByIds(Collection<String> ids)
Description copied from interface: Source
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.

Specified by:
getSubjectsByIds in interface Source
Returns:
a map of results never null indexed by the id
See Also:
Source.getSubjectsByIds(java.util.Collection)

getSubjectsByIdsOrIdentifiers

public Map<String,Subject> getSubjectsByIdsOrIdentifiers(Collection<String> idsOrIdentifiers)
Description copied from interface: Source
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.

Specified by:
getSubjectsByIdsOrIdentifiers in interface Source
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:
Source.getSubjectsByIdsOrIdentifiers(java.util.Collection)

init

public void init()
          throws SourceUnavailableException
Description copied from interface: Source
Called by SourceManager when it loads this source.

Specified by:
init in interface Source
Throws:
SourceUnavailableException
See Also:
Source.init()

printConfig

public String printConfig()
Description copied from interface: Source
in the startup on this i2mi app, print helpful and brief info about this source

Specified by:
printConfig in interface Source
Returns:
the info
See Also:
Source.printConfig()

search

public Set<Subject> search(String searchValue)
Description copied from interface: Source
Unstructured search for Subjects. Each implementation utilizes its own search algorithm tailored to the Subject repository and schema.

Specified by:
search in interface Source
Returns:
set
See Also:
Source.search(java.lang.String)

setId

public void setId(String id)
Description copied from interface: Source
Sets the ID of this source.

Specified by:
setId in interface Source
See Also:
Source.setId(java.lang.String)

setName

public void setName(String name)
Description copied from interface: Source
Sets the name of this source.

Specified by:
setName in interface Source
See Also:
Source.setName(java.lang.String)

getInitParam

public String getInitParam(String name1)
Description copied from interface: Source
get the init param e.g. from the sources.xml

Specified by:
getInitParam in interface Source
Returns:
param
See Also:
Source.getInitParam(java.lang.String)

getInitParams

public Properties getInitParams()
Description copied from interface: Source
get the init params e.g. from the sources.xml

Specified by:
getInitParams in interface Source
Returns:
params
See Also:
Source.getInitParams()