public class JDBCSourceAdapter2 extends JDBCSourceAdapter
descriptionAttributeName, failOnSearchForTesting, jdbcConnectionProvider, maxResults, nameAttributeName, queryCountforTesting, subjectIDAttributeName, subjectTypeString
attributes, 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, tryToChangeQuery
addAttribute, 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, setSortAttributes
public void checkConfig()
Source
checkConfig
in interface Source
checkConfig
in class JDBCSourceAdapter
Source.checkConfig()
public Subject getSubject(String id1, boolean exceptionIfNull, String realm) throws SubjectNotFoundException, SubjectNotUniqueException
Source
getSubject
in interface Source
getSubject
in class BaseSourceAdapter
exceptionIfNull
- 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 userSubjectNotFoundException
SubjectNotUniqueException
BaseSourceAdapter.getSubject(java.lang.String, boolean, java.lang.String)
public Subject getSubjectByIdentifier(String identifier, boolean exceptionIfNull, String realm) throws SubjectNotFoundException, SubjectNotUniqueException
Source
getSubjectByIdentifier
in interface Source
getSubjectByIdentifier
in class BaseSourceAdapter
realm
- string value that sets the realm for the search. The source can
implement various realms to account for permissions of the calling userSubjectNotFoundException
SubjectNotUniqueException
BaseSourceAdapter.getSubjectByIdentifier(java.lang.String, boolean, java.lang.String)
public Subject getSubjectByIdOrIdentifier(String idOrIdentifier, boolean exceptionIfNull, String realm) throws SubjectNotFoundException, SubjectNotUniqueException
Source
getSubjectByIdOrIdentifier
in interface Source
getSubjectByIdOrIdentifier
in class BaseSourceAdapter
exceptionIfNull
- 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 userSubjectNotFoundException
SubjectNotUniqueException
BaseSourceAdapter.getSubjectByIdOrIdentifier(java.lang.String, boolean, java.lang.String)
public Subject getSubjectByIdOrIdentifier(String idOrIdentifier, boolean exceptionIfNull) throws SubjectNotFoundException, SubjectNotUniqueException
BaseSourceAdapter
getSubjectByIdOrIdentifier
in interface Source
getSubjectByIdOrIdentifier
in class BaseSourceAdapter
exceptionIfNull
- if SubjectNotFoundException or nullSubjectNotFoundException
SubjectNotUniqueException
BaseSourceAdapter.getSubjectByIdOrIdentifier(java.lang.String, boolean)
public Map<String,Subject> getSubjectsByIdentifiers(Collection<String> identifiers, String realm)
Source
getSubjectsByIdentifiers
in interface Source
getSubjectsByIdentifiers
in class BaseSourceAdapter
realm
- 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)
Source
getSubjectsByIds
in interface Source
getSubjectsByIds
in class BaseSourceAdapter
realm
- 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)
Source
getSubjectsByIdsOrIdentifiers
in interface Source
getSubjectsByIdsOrIdentifiers
in class BaseSourceAdapter
idsOrIdentifiers
- 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)
Source
getSubjectsByIdsOrIdentifiers
in interface Source
getSubjectsByIdsOrIdentifiers
in class BaseSourceAdapter
idsOrIdentifiers
- each string could be a subject id or identifierBaseSourceAdapter.getSubjectsByIdsOrIdentifiers(java.util.Collection)
public Set<Subject> search(String searchValue, String realm)
Source
search
in interface Source
search
in class BaseSourceAdapter
realm
- 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)
Source
searchPage
in interface Source
searchPage
in class BaseSourceAdapter
realm
- 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 JDBCSourceAdapter
props
- SourceUnavailableException
public String getDbTableOrView()
public Map<String,Subject> getSubjectsByIdentifiers(Collection<String> identifiers)
Source
getSubjectsByIdentifiers
in interface Source
getSubjectsByIdentifiers
in class JDBCSourceAdapter
JDBCSourceAdapter.getSubjectsByIdentifiers(java.util.Collection)
public Map<String,Subject> getSubjectsByIds(Collection<String> ids)
Source
getSubjectsByIds
in interface Source
getSubjectsByIds
in class JDBCSourceAdapter
JDBCSourceAdapter.getSubjectsByIds(java.util.Collection)
public Subject getSubject(String id1, boolean exceptionIfNull) throws SubjectNotFoundException, SubjectNotUniqueException
JDBCSourceAdapter
getSubject
in interface Source
getSubject
in class JDBCSourceAdapter
exceptionIfNull
- if SubjectNotFoundException should be
throws if the subject is null, or if null should be returnedSubjectNotFoundException
SubjectNotUniqueException
JDBCSourceAdapter.getSubject(java.lang.String, boolean)
public SearchPageResult searchPage(String searchValue)
Source
searchPage
in interface Source
searchPage
in class JDBCSourceAdapter
BaseSourceAdapter.searchPage(java.lang.String)
public Set<Subject> search(String searchValue)
JDBCSourceAdapter
search
in interface Source
search
in class JDBCSourceAdapter
JDBCSourceAdapter.search(java.lang.String)
protected String dbTableOrView()
public Subject getSubjectByIdentifier(String identifier, boolean exceptionIfNull) throws SubjectNotFoundException, SubjectNotUniqueException
BaseSourceAdapter
getSubjectByIdentifier
in interface Source
getSubjectByIdentifier
in class JDBCSourceAdapter
SubjectNotFoundException
SubjectNotUniqueException
JDBCSourceAdapter.getSubjectByIdentifier(java.lang.String, boolean)
protected Map<String,Set<String>> loadAttributes(ResultSet resultSet, String query, ResultSetMetaData resultSetMetaData) throws SQLException
resultSet
- query
- for loggingresultSetMetaData
- SQLException
public 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.