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:
edu.internet2.middleware.subject.Source

public class InternalSourceAdapter
extends edu.internet2.middleware.subject.provider.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()
           
 edu.internet2.middleware.subject.Subject getSubject(String id)
          Deprecated. 
 edu.internet2.middleware.subject.Subject getSubject(String id, boolean exceptionIfNull)
          Gets a Subject by its ID.
 edu.internet2.middleware.subject.Subject getSubjectByIdentifier(String id)
          Deprecated. 
 edu.internet2.middleware.subject.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()
           
 Set search(String searchValue)
          Unstructured search for Subjects.
 
Methods inherited from class edu.internet2.middleware.subject.provider.BaseSourceAdapter
addAttribute, addInitParam, addInternalAttribute, addSubjectType, equals, getId, getInitParam, getInternalAttributes, getName, getSearchAttributes, getSortAttributes, getSubject, getSubjectByIdentifier, getSubjectByIdOrIdentifier, getSubjectByIdOrIdentifier, getSubjectIdentifierAttributes, getSubjectsByIdentifiers, getSubjectsByIdentifiers, getSubjectsByIds, getSubjectsByIds, getSubjectsByIdsOrIdentifiers, getSubjectsByIdsOrIdentifiers, getSubjectStatusConfig, getSubjectType, hashCode, initParams, loadSearch, removeInitParam, resultSetLimit, search, searchPage, searchPage, setId, setName, setSearchAttributes, setSortAttributes, setSubjectIdentifierAttributes
 
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 edu.internet2.middleware.subject.Subject getSubject(String id)
                                                    throws edu.internet2.middleware.subject.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 edu.internet2.middleware.subject.Source
Specified by:
getSubject in class edu.internet2.middleware.subject.provider.BaseSourceAdapter
Parameters:
id - Subject id to return.
Returns:
An internal subject.
Throws:
edu.internet2.middleware.subject.SubjectNotFoundException

getSubject

public edu.internet2.middleware.subject.Subject getSubject(String id,
                                                           boolean exceptionIfNull)
                                                    throws edu.internet2.middleware.subject.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 edu.internet2.middleware.subject.Source
Overrides:
getSubject in class edu.internet2.middleware.subject.provider.BaseSourceAdapter
Parameters:
id - Subject id to return.
exceptionIfNull -
Returns:
An internal subject.
Throws:
edu.internet2.middleware.subject.SubjectNotFoundException

getSubjectByIdentifier

@Deprecated
public edu.internet2.middleware.subject.Subject getSubjectByIdentifier(String id)
                                                                throws edu.internet2.middleware.subject.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 edu.internet2.middleware.subject.Source
Specified by:
getSubjectByIdentifier in class edu.internet2.middleware.subject.provider.BaseSourceAdapter
Parameters:
id - Identity of subject to return.
Returns:
An internal subject.
Throws:
edu.internet2.middleware.subject.SubjectNotFoundException

getSubjectByIdentifier

public edu.internet2.middleware.subject.Subject getSubjectByIdentifier(String id,
                                                                       boolean exceptionIfNull)
                                                                throws edu.internet2.middleware.subject.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 edu.internet2.middleware.subject.Source
Overrides:
getSubjectByIdentifier in class edu.internet2.middleware.subject.provider.BaseSourceAdapter
Parameters:
id - Identity of subject to return.
exceptionIfNull - SubjectNotFoundException exception if null result
Returns:
An internal subject.
Throws:
edu.internet2.middleware.subject.SubjectNotFoundException

getSubjectTypes

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

Specified by:
getSubjectTypes in interface edu.internet2.middleware.subject.Source
Overrides:
getSubjectTypes in class edu.internet2.middleware.subject.provider.BaseSourceAdapter
Returns:
Subject type supported by this source.

init

public void init()
Called by SourceManager when it loads this source.
 // Initialize this source adapter.
 SourceAdapter sa = new InternalSourceAdapter();
 sa.init();
 

Specified by:
init in interface edu.internet2.middleware.subject.Source
Specified by:
init in class edu.internet2.middleware.subject.provider.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 edu.internet2.middleware.subject.Source
Specified by:
search in class edu.internet2.middleware.subject.provider.BaseSourceAdapter
Parameters:
searchValue - Query string for finding subjects.
Returns:
Subjects matching search value.

checkConfig

public void checkConfig()
See Also:
Source.checkConfig()

printConfig

public String printConfig()
See Also:
Source.printConfig()