edu.internet2.middleware.subject
Interface Source

All Known Implementing Classes:
BaseSourceAdapter, ExternalSubjectAutoSourceAdapter, GrouperJdbcSourceAdapter, GrouperJdbcSourceAdapter2, GrouperJndiSourceAdapter, GrouperSourceAdapter, HelperGrouperJdbcSourceAdapter, HelperGrouperJdbcSourceAdapter2, HelperGrouperJndiSourceAdapter, InternalSourceAdapter, JDBCSourceAdapter, JDBCSourceAdapter2, JNDISourceAdapter, LazySource, 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
 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)
          Deprecated. use the overload instead
 Subject getSubject(String id, boolean exceptionIfNull)
          Gets a Subject by its ID.
 Subject getSubjectByIdentifier(String id)
          Deprecated. use the overload instead
 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.
 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.
 

Method Detail

getId

String getId()
Returns the ID of this source.

Returns:
id

setId

void setId(String id)
Sets the ID of this source.

Parameters:
id -

getName

String getName()
Returns the name of this source.

Returns:
name

setName

void setName(String name)
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 instead

Gets 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 instead

Gets 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

Map<String,Subject> getSubjectsByIds(Collection<String> ids)
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

Map<String,Subject> getSubjectsByIdentifiers(Collection<String> identifiers)
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

Map<String,Subject> getSubjectsByIdsOrIdentifiers(Collection<String> idsOrIdentifiers)
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

Set<Subject> search(String searchValue)
Unstructured search for Subjects. Each implementation utilizes its own search algorithm tailored to the Subject repository and schema.

Parameters:
searchValue -
Returns:
set

init

void init()
          throws SourceUnavailableException
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

String getInitParam(String name1)
get the init param e.g. from the sources.xml

Parameters:
name1 -
Returns:
param

getInitParams

Properties getInitParams()
get the init params e.g. from the sources.xml

Returns:
params