edu.internet2.middleware.grouper.subj
Class InternalSourceAdapter

java.lang.Object
  extended by edu.internet2.middleware.subject.provider.BaseSourceAdapter
      extended by edu.internet2.middleware.grouper.subj.InternalSourceAdapter
All Implemented Interfaces:
Source

public class InternalSourceAdapter
extends BaseSourceAdapter

Internal SourceAdapter for retrieving InternalSubjects.

This subject adapter resolves two subjects:

Version:
$Id: InternalSourceAdapter.java,v 1.6 2009-09-02 05:57:26 mchyzer Exp $
Author:
blair christensen.

Field Summary
static String ID
           
static String NAME
           
 
Method Summary
 void checkConfig()
          make sure the config is ok, and log descriptive errors if not
 Subject getSubject(String id)
          Deprecated. 
 Subject getSubject(String id, boolean exceptionIfNull)
          Gets a Subject by its ID.
 Subject getSubjectByIdentifier(String id)
          Deprecated. 
 Subject getSubjectByIdentifier(String id, boolean exceptionIfNull)
          Gets a Subject by other well-known identifiers, aside from the subject ID.
 Set getSubjectTypes()
          Gets the SubjectTypes supported by this source.
 void init()
          Called by SourceManager when it loads this source.
static InternalSourceAdapter instance()
          singleton
 String printConfig()
          in the startup on this i2mi app, print helpful and brief info about this source
 Set search(String searchValue)
          Unstructured search for Subjects.
 
Methods inherited from class edu.internet2.middleware.subject.provider.BaseSourceAdapter
addAttribute, addInitParam, addSubjectType, equals, getId, getInitParam, getInitParams, getName, getSubjectByIdOrIdentifier, getSubjectsByIdentifiers, getSubjectsByIds, getSubjectsByIdsOrIdentifiers, getSubjectType, hashCode, loadSearch, setId, setName
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ID

public static final String ID
See Also:
Constant Field Values

NAME

public static final String NAME
See Also:
Constant Field Values
Method Detail

instance

public static InternalSourceAdapter instance()
singleton

Returns:
the singleton

getSubject

@Deprecated
public Subject getSubject(String id)
                   throws SubjectNotFoundException
Deprecated. 

Gets a Subject by its ID.
 // Return a subject with the id john.
 SourceAdapter  sa    = new InternalSourceAdapter();
 Subject        subj  = sa.getSubject("john");
 

Specified by:
getSubject in interface Source
Specified by:
getSubject in class BaseSourceAdapter
Parameters:
id - Subject id to return.
Returns:
An internal subject.
Throws:
SubjectNotFoundException
See Also:
Source.getSubject(java.lang.String)

getSubject

public Subject getSubject(String id,
                          boolean exceptionIfNull)
                   throws SubjectNotFoundException
Gets a Subject by its ID.
 // Return a subject with the id john.
 SourceAdapter  sa    = new InternalSourceAdapter();
 Subject        subj  = sa.getSubject("john");
 

Specified by:
getSubject in interface Source
Overrides:
getSubject in class BaseSourceAdapter
Parameters:
id - Subject id to return.
exceptionIfNull -
Returns:
An internal subject.
Throws:
SubjectNotFoundException
See Also:
Source.getSubject(java.lang.String, boolean)

getSubjectByIdentifier

@Deprecated
public Subject getSubjectByIdentifier(String id)
                               throws SubjectNotFoundException
Deprecated. 

Gets a Subject by other well-known identifiers, aside from the subject ID.
 // Return a subject with the identity john.
 SourceAdapter  sa    = new InternalSourceAdapter();
 Subject        subj  = sa.getSubjectByIdentifier("john");
 

Specified by:
getSubjectByIdentifier in interface Source
Specified by:
getSubjectByIdentifier in class BaseSourceAdapter
Parameters:
id - Identity of subject to return.
Returns:
An internal subject.
Throws:
SubjectNotFoundException
See Also:
Source.getSubjectByIdentifier(java.lang.String)

getSubjectByIdentifier

public Subject getSubjectByIdentifier(String id,
                                      boolean exceptionIfNull)
                               throws SubjectNotFoundException
Gets a Subject by other well-known identifiers, aside from the subject ID.
 // Return a subject with the identity john.
 SourceAdapter  sa    = new InternalSourceAdapter();
 Subject        subj  = sa.getSubjectByIdentifier("john");
 

Specified by:
getSubjectByIdentifier in interface Source
Overrides:
getSubjectByIdentifier in class BaseSourceAdapter
Parameters:
id - Identity of subject to return.
exceptionIfNull - SubjectNotFoundException exception if null result
Returns:
An internal subject.
Throws:
SubjectNotFoundException
See Also:
Source.getSubjectByIdentifier(java.lang.String, boolean)

getSubjectTypes

public Set getSubjectTypes()
Gets the SubjectTypes supported by this source.
 SourceAdapter  sa    = new InternalSourceAdapter();
 Set            types = sa.getSubjectTypes();
 

Specified by:
getSubjectTypes in interface Source
Overrides:
getSubjectTypes in class BaseSourceAdapter
Returns:
Subject type supported by this source.

init

public void init()
Called by SourceManager when it loads this source.

No initialization is performed by this source adapter.

 // Initialize this source adapter.
 SourceAdapter sa = new InternalSourceAdapter();
 sa.init();
 

Specified by:
init in interface Source
Specified by:
init in class BaseSourceAdapter

search

public Set search(String searchValue)
Unstructured search for Subjects.
 // Search for subjects with the query string test.
 SourceAdapter  sa        = new InternalSourceAdapter();
 Set            subjects  = sa.searchValue("test");
 

Specified by:
search in interface Source
Specified by:
search in class BaseSourceAdapter
Parameters:
searchValue - Query string for finding subjects.
Returns:
Subjects matching search value.

checkConfig

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

See Also:
Source.checkConfig()

printConfig

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

Returns:
the info
See Also:
Source.printConfig()