edu.internet2.middleware.subject.provider
Class JDBCSourceAdapter

java.lang.Object
  extended by edu.internet2.middleware.subject.provider.BaseSourceAdapter
      extended by edu.internet2.middleware.subject.provider.JDBCSourceAdapter
All Implemented Interfaces:
Source
Direct Known Subclasses:
HelperGrouperJdbcSourceAdapter, JDBCSourceAdapter2

public class JDBCSourceAdapter
extends BaseSourceAdapter

JDBC Source


Constructor Summary
JDBCSourceAdapter()
          Allocates new JDBCSourceAdapter;
JDBCSourceAdapter(String id1, String name1)
          Allocates new JDBCSourceAdapter;
 
Method Summary
 void checkConfig()
          make sure the config is ok, and log descriptive errors if not
 String getDescriptionAttributeName()
           
 String getNameAttributeName()
           
 Subject getSubject(String id1)
          Deprecated.  
 Subject getSubject(String id1, boolean exceptionIfNull)
          Gets a Subject by its ID.
 Subject getSubjectByIdentifier(String id1)
          Deprecated.  
 Subject getSubjectByIdentifier(String id1, boolean exceptionIfNull)
          note, you should implement this method since this implementation will become abstract at some point
 String getSubjectIDAttributeName()
           
 String getSubjectTypeString()
           
 void init()
          Called by SourceManager when it loads this source.
static void loadDriver(String sourceId, String driver)
          Loads the the JDBC driver.
 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.
 
Methods inherited from class edu.internet2.middleware.subject.provider.BaseSourceAdapter
addAttribute, addInitParam, addSubjectType, equals, getId, getInitParam, getInitParams, getName, getSubjectByIdOrIdentifier, getSubjectsByIdentifiers, getSubjectsByIds, getSubjectsByIdsOrIdentifiers, getSubjectType, getSubjectTypes, hashCode, loadSearch, setId, setName
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDBCSourceAdapter

public JDBCSourceAdapter()
Allocates new JDBCSourceAdapter;


JDBCSourceAdapter

public JDBCSourceAdapter(String id1,
                         String name1)
Allocates new JDBCSourceAdapter;

Parameters:
id1 -
name1 -
Method Detail

getSubject

public Subject getSubject(String id1,
                          boolean exceptionIfNull)
                   throws SubjectNotFoundException,
                          SubjectNotUniqueException
Gets a Subject by its ID.

Specified by:
getSubject in interface Source
Overrides:
getSubject in class BaseSourceAdapter
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)

getSubjectByIdentifier

public Subject getSubjectByIdentifier(String id1,
                                      boolean exceptionIfNull)
                               throws SubjectNotFoundException,
                                      SubjectNotUniqueException
Description copied from class: BaseSourceAdapter
note, you should implement this method since this implementation will become abstract at some point

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

search

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

Specified by:
search in interface Source
Specified by:
search in class BaseSourceAdapter
Returns:
set

init

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

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

loadDriver

public static void loadDriver(String sourceId,
                              String driver)
                       throws SourceUnavailableException
Loads the the JDBC driver.

Parameters:
sourceId -
driver -
Throws:
SourceUnavailableException

getDescriptionAttributeName

public String getDescriptionAttributeName()
Returns:
the descriptionAttributeName

getNameAttributeName

public String getNameAttributeName()
Returns:
the nameAttributeName

getSubjectIDAttributeName

public String getSubjectIDAttributeName()
Returns:
the subjectIDAttributeName

getSubjectTypeString

public String getSubjectTypeString()
Returns:
the subjectTypeString

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()

getSubject

@Deprecated
public Subject getSubject(String id1)
                   throws SubjectNotFoundException,
                          SubjectNotUniqueException
Deprecated. 

Description copied from interface: Source
Gets a Subject by its ID.

Specified by:
getSubject in interface Source
Specified by:
getSubject in class BaseSourceAdapter
Returns:
subject
Throws:
SubjectNotFoundException
SubjectNotUniqueException
See Also:
BaseSourceAdapter.getSubject(java.lang.String)

getSubjectByIdentifier

@Deprecated
public Subject getSubjectByIdentifier(String id1)
                               throws SubjectNotFoundException,
                                      SubjectNotUniqueException
Deprecated. 

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
Specified by:
getSubjectByIdentifier in class BaseSourceAdapter
Returns:
subject
Throws:
SubjectNotFoundException
SubjectNotUniqueException
See Also:
BaseSourceAdapter.getSubjectByIdentifier(java.lang.String)