public class JDBCSourceAdapter2 extends JDBCSourceAdapter
descriptionAttributeName, failOnSearchForTesting, jdbcConnectionProvider, maxResults, nameAttributeName, queryCountforTesting, subjectIDAttributeName, subjectTypeStringattributes, id, internalAttributes, name, params, searchAttributes, searches, sortAttributes, type, types| Constructor and Description |
|---|
JDBCSourceAdapter2() |
JDBCSourceAdapter2(String id,
String name) |
| Modifier and Type | Method and Description |
|---|---|
void |
checkConfig()
make sure the config is ok, and log descriptive errors if not
|
protected String |
dbTableOrView()
get the db table or view, considering realm
|
String |
getDbTableOrView()
table or view where each row is a subject
|
String |
getDefaultSortCol()
search queries will sort by this.
|
String |
getDescriptionCol() |
String |
getLowerSearchCol()
for searches (not by id or identifier), this is the col which holds the search terms, in lower case
|
String |
getNameCol()
column which holds the subject name
|
Subject |
getSubject(String id1,
boolean exceptionIfNull)
Gets a Subject by its ID.
|
Subject |
getSubject(String id1,
boolean exceptionIfNull,
String realm)
Gets a Subject by its ID.
|
Map<String,String> |
getSubjectAttributeColToName()
map of col to attribute name
//
|
Subject |
getSubjectByIdentifier(String identifier,
boolean exceptionIfNull)
note, you should implement this method since this implementation will become abstract at some point
|
Subject |
getSubjectByIdentifier(String identifier,
boolean exceptionIfNull,
String realm)
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
|
Subject |
getSubjectByIdOrIdentifier(String idOrIdentifier,
boolean exceptionIfNull,
String realm)
find by id or identifier.
|
String |
getSubjectIdCol()
column which holds the subject id
|
Set<String> |
getSubjectIdentifierCols()
cols which are used in a findByIdentifier query
|
Map<String,Subject> |
getSubjectsByIdentifiers(Collection<String> identifiers)
Get subjects by identifiers.
|
Map<String,Subject> |
getSubjectsByIdentifiers(Collection<String> identifiers,
String realm)
Get subjects by identifiers.
|
Map<String,Subject> |
getSubjectsByIds(Collection<String> ids)
Get subjects by ids.
|
Map<String,Subject> |
getSubjectsByIds(Collection<String> ids,
String realm)
Get subjects by ids.
|
Map<String,Subject> |
getSubjectsByIdsOrIdentifiers(Collection<String> idsOrIdentifiers)
Get subjects by ids or identifiers.
|
Map<String,Subject> |
getSubjectsByIdsOrIdentifiers(Collection<String> idsOrIdentifiers,
String realm)
Get subjects by ids or identifiers.
|
protected Map<String,Set<String>> |
loadAttributes(ResultSet resultSet,
String query,
ResultSetMetaData resultSetMetaData)
Loads attributes for the argument subject.
|
Set<Subject> |
search(String searchValue)
Unstructured search for Subjects.
|
Set<Subject> |
search(String searchValue,
String realm)
Unstructured search for Subjects.
|
SearchPageResult |
searchPage(String searchValue)
Unstructured search for Subjects.
|
SearchPageResult |
searchPage(String searchValue,
String realm)
Unstructured search for Subjects.
|
void |
setDbTableOrView(String dbTableOrView1)
table or view where each row is a subject
|
void |
setDefaultSortCol(String defaultSortCol1)
search queries will sort by this.
|
void |
setDescriptionCol(String descriptionCol1) |
void |
setLowerSearchCol(String lowerSearchCol1)
for searches (not by id or identifier), this is the col which holds the search terms, in lower case
|
void |
setNameCol(String nameCol1)
column which holds the subject name
|
void |
setSubjectAttributeColToName(Map<String,String> subjectAttributeColToName1)
map of col to attribute name
//
|
void |
setSubjectIdCol(String subjectIdCol1)
column which holds the subject id
|
void |
setSubjectIdentifierCols(Set<String> subjectIdentifierCols1)
cols which are used in a findByIdentifier query
|
protected void |
setupDataSource(Properties props)
DataSource connection pool setup.
|
closeStatement, getDatabaseType, getDescriptionAttributeName, getMaxPage, getNameAttributeName, getSqlResults, getSqlResults, getSubject, getSubjectByIdentifier, getSubjectIDAttributeName, getSubjectTypeString, init, isChangeSearchQueryForMaxResults, isUseInClauseForIdAndIdentifier, loadAttributes, loadDriver, prepareStatement, printConfig, tryToChangeQueryaddAttribute, addInitParam, addInternalAttribute, addSubjectType, equals, getAttributes, getId, getInitParam, getInternalAttributes, getName, getSearch, getSearchAttributes, getSearches, getSortAttributes, getSubjectStatusConfig, getSubjectType, getSubjectTypes, hashCode, initParams, loadSearch, removeInitParam, resultSetLimit, setId, setName, setSearchAttributes, setSearches, setSortAttributespublic void checkConfig()
SourcecheckConfig in interface SourcecheckConfig in class JDBCSourceAdapterSource.checkConfig()public Subject getSubject(String id1, boolean exceptionIfNull, String realm) throws SubjectNotFoundException, SubjectNotUniqueException
SourcegetSubject in interface SourcegetSubject in class BaseSourceAdapterexceptionIfNull - if SubjectNotFoundException should be
throws if the subject is null, or if null should be returnedrealm - string value that sets the realm for the search. The source can
implement various realms to account for permissions of the calling userSubjectNotFoundExceptionSubjectNotUniqueExceptionBaseSourceAdapter.getSubject(java.lang.String, boolean, java.lang.String)public Subject getSubjectByIdentifier(String identifier, boolean exceptionIfNull, String realm) throws SubjectNotFoundException, SubjectNotUniqueException
SourcegetSubjectByIdentifier in interface SourcegetSubjectByIdentifier in class BaseSourceAdapterrealm - string value that sets the realm for the search. The source can
implement various realms to account for permissions of the calling userSubjectNotFoundExceptionSubjectNotUniqueExceptionBaseSourceAdapter.getSubjectByIdentifier(java.lang.String, boolean, java.lang.String)public Subject getSubjectByIdOrIdentifier(String idOrIdentifier, boolean exceptionIfNull, String realm) throws SubjectNotFoundException, SubjectNotUniqueException
SourcegetSubjectByIdOrIdentifier in interface SourcegetSubjectByIdOrIdentifier in class BaseSourceAdapterexceptionIfNull - if SubjectNotFoundException or nullrealm - string value that sets the realm for the search. The source can
implement various realms to account for permissions of the calling userSubjectNotFoundExceptionSubjectNotUniqueExceptionBaseSourceAdapter.getSubjectByIdOrIdentifier(java.lang.String, boolean, java.lang.String)public Subject getSubjectByIdOrIdentifier(String idOrIdentifier, boolean exceptionIfNull) throws SubjectNotFoundException, SubjectNotUniqueException
BaseSourceAdaptergetSubjectByIdOrIdentifier in interface SourcegetSubjectByIdOrIdentifier in class BaseSourceAdapterexceptionIfNull - if SubjectNotFoundException or nullSubjectNotFoundExceptionSubjectNotUniqueExceptionBaseSourceAdapter.getSubjectByIdOrIdentifier(java.lang.String, boolean)public Map<String,Subject> getSubjectsByIdentifiers(Collection<String> identifiers, String realm)
SourcegetSubjectsByIdentifiers in interface SourcegetSubjectsByIdentifiers in class BaseSourceAdapterrealm - string value that sets the realm for the search. The source can
implement various realms to account for permissions of the calling userBaseSourceAdapter.getSubjectsByIdentifiers(java.util.Collection, java.lang.String)public Map<String,Subject> getSubjectsByIds(Collection<String> ids, String realm)
SourcegetSubjectsByIds in interface SourcegetSubjectsByIds in class BaseSourceAdapterrealm - string value that sets the realm for the search. The source can
implement various realms to account for permissions of the calling userBaseSourceAdapter.getSubjectsByIds(java.util.Collection, java.lang.String)public Map<String,Subject> getSubjectsByIdsOrIdentifiers(Collection<String> idsOrIdentifiers, String realm)
SourcegetSubjectsByIdsOrIdentifiers in interface SourcegetSubjectsByIdsOrIdentifiers in class BaseSourceAdapteridsOrIdentifiers - each string could be a subject id or identifierrealm - string value that sets the realm for the search. The source can
implement various realms to account for permissions of the calling userBaseSourceAdapter.getSubjectsByIdsOrIdentifiers(java.util.Collection, java.lang.String)public Map<String,Subject> getSubjectsByIdsOrIdentifiers(Collection<String> idsOrIdentifiers)
SourcegetSubjectsByIdsOrIdentifiers in interface SourcegetSubjectsByIdsOrIdentifiers in class BaseSourceAdapteridsOrIdentifiers - each string could be a subject id or identifierBaseSourceAdapter.getSubjectsByIdsOrIdentifiers(java.util.Collection)public Set<Subject> search(String searchValue, String realm)
Sourcesearch in interface Sourcesearch in class BaseSourceAdapterrealm - string value that sets the realm for the search. The source can
implement various realms to account for permissions of the calling userBaseSourceAdapter.search(java.lang.String, java.lang.String)public SearchPageResult searchPage(String searchValue, String realm)
SourcesearchPage in interface SourcesearchPage in class BaseSourceAdapterrealm - string value that sets the realm for the search. The source can
implement various realms to account for permissions of the calling userBaseSourceAdapter.searchPage(java.lang.String, java.lang.String)protected void setupDataSource(Properties props) throws SourceUnavailableException
setupDataSource in class JDBCSourceAdapterprops - SourceUnavailableExceptionpublic String getDbTableOrView()
public Map<String,Subject> getSubjectsByIdentifiers(Collection<String> identifiers)
SourcegetSubjectsByIdentifiers in interface SourcegetSubjectsByIdentifiers in class JDBCSourceAdapterJDBCSourceAdapter.getSubjectsByIdentifiers(java.util.Collection)public Map<String,Subject> getSubjectsByIds(Collection<String> ids)
SourcegetSubjectsByIds in interface SourcegetSubjectsByIds in class JDBCSourceAdapterJDBCSourceAdapter.getSubjectsByIds(java.util.Collection)public Subject getSubject(String id1, boolean exceptionIfNull) throws SubjectNotFoundException, SubjectNotUniqueException
JDBCSourceAdaptergetSubject in interface SourcegetSubject in class JDBCSourceAdapterexceptionIfNull - if SubjectNotFoundException should be
throws if the subject is null, or if null should be returnedSubjectNotFoundExceptionSubjectNotUniqueExceptionJDBCSourceAdapter.getSubject(java.lang.String, boolean)public SearchPageResult searchPage(String searchValue)
SourcesearchPage in interface SourcesearchPage in class JDBCSourceAdapterBaseSourceAdapter.searchPage(java.lang.String)public Set<Subject> search(String searchValue)
JDBCSourceAdaptersearch in interface Sourcesearch in class JDBCSourceAdapterJDBCSourceAdapter.search(java.lang.String)protected String dbTableOrView()
public Subject getSubjectByIdentifier(String identifier, boolean exceptionIfNull) throws SubjectNotFoundException, SubjectNotUniqueException
BaseSourceAdaptergetSubjectByIdentifier in interface SourcegetSubjectByIdentifier in class JDBCSourceAdapterSubjectNotFoundExceptionSubjectNotUniqueExceptionJDBCSourceAdapter.getSubjectByIdentifier(java.lang.String, boolean)protected Map<String,Set<String>> loadAttributes(ResultSet resultSet, String query, ResultSetMetaData resultSetMetaData) throws SQLException
resultSet - query - for loggingresultSetMetaData - SQLExceptionpublic void setDbTableOrView(String dbTableOrView1)
dbTableOrView1 - public String getSubjectIdCol()
public void setSubjectIdCol(String subjectIdCol1)
subjectIdCol1 - public String getNameCol()
public void setNameCol(String nameCol1)
nameCol1 - public String getDescriptionCol()
public void setDescriptionCol(String descriptionCol1)
descriptionCol1 - public String getLowerSearchCol()
public void setLowerSearchCol(String lowerSearchCol1)
lowerSearchCol1 - public String getDefaultSortCol()
public void setDefaultSortCol(String defaultSortCol1)
defaultSortCol1 - public Set<String> getSubjectIdentifierCols()
public void setSubjectIdentifierCols(Set<String> subjectIdentifierCols1)
subjectIdentifierCols1 - public Map<String,String> getSubjectAttributeColToName()
Copyright © 2016 Internet2. All rights reserved.