|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.internet2.middleware.shibboleth.common.attribute.resolver.provider.AbstractResolutionPlugIn<Map<String,BaseAttribute>>
edu.internet2.middleware.shibboleth.common.attribute.resolver.provider.dataConnector.BaseDataConnector
edu.internet2.middleware.shibboleth.common.attribute.resolver.provider.dataConnector.RDBMSDataConnector
public class RDBMSDataConnector
A data connector that can retrieve information from a relational database through JDBC, version 3.
Nested Class Summary | |
---|---|
static class |
RDBMSDataConnector.DATA_TYPES
Data types understood by this connector. |
Constructor Summary | |
---|---|
RDBMSDataConnector(DataSource source,
boolean resultCaching)
Constructor. |
Method Summary | |
---|---|
protected void |
addValueByType(Collection values,
RDBMSDataConnector.DATA_TYPES type,
ResultSet resultSet,
int columnIndex)
Adds a value extracted from the result set as a specific type into the value set. |
void |
clearCache()
Clears the result cache. |
boolean |
getCacheResults()
Gets whether to cache query results. |
Map<String,RDBMSColumnDescriptor> |
getColumnDescriptor()
Gets the set of column descriptors used to deal with result set data. |
String |
getQueryTemplate()
Gets the template used to create queries. |
TemplateEngine |
getTemplateEngine()
Gets the engine used to evaluate the query template. |
boolean |
getUsesStoredProcedure()
Gets whether queries made use stored procedures. |
void |
initialize()
Initializes the connector and prepares it for use. |
boolean |
isConnectionReadOnly()
Gets whether this data connector uses read-only connections. |
boolean |
isNoResultIsError()
This returns whether this connector will throw an exception if no search results are found. |
void |
onApplicationEvent(org.springframework.context.ApplicationEvent event)
|
protected Map<String,BaseAttribute> |
processResultSet(ResultSet resultSet)
Converts a SQL query results set into a set of BaseAttribute s. |
protected void |
registerTemplate()
Registers the query template with template engine. |
Map<String,BaseAttribute> |
resolve(ShibbolethResolutionContext resolutionContext)
Performs the attribute resolution for this plugin. |
protected Map<String,BaseAttribute> |
retrieveAttributesFromCache(String princpal,
String query)
Attempts to retrieve the attributes from the cache. |
protected Map<String,BaseAttribute> |
retrieveAttributesFromDatabase(String query)
Attempts to retrieve the attribute from the database. |
void |
setConnectionReadOnly(boolean isReadOnly)
Sets whether this data connector uses read-only connections. |
void |
setNoResultIsError(boolean b)
This sets whether this connector will throw an exception if no search results are found. |
void |
setQueryTemplate(String template)
Sets the template used to create queries. |
void |
setTemplateEngine(TemplateEngine engine)
Sets the engine used to evaluate the query template. |
void |
setUsesStoredProcedure(boolean storedProcedure)
Sets whether queries made use stored procedures. |
void |
validate()
Validate the internal state of this plug-in. |
Methods inherited from class edu.internet2.middleware.shibboleth.common.attribute.resolver.provider.dataConnector.BaseDataConnector |
---|
getFailoverDependencyId, setFailoverDependencyIds |
Methods inherited from class edu.internet2.middleware.shibboleth.common.attribute.resolver.provider.AbstractResolutionPlugIn |
---|
getDependencyIds, getId, getValuesFromAllDependencies, getValuesFromAttributeDependency, getValuesFromConnectorDependency, setId |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface edu.internet2.middleware.shibboleth.common.attribute.resolver.provider.ResolutionPlugIn |
---|
getDependencyIds, getId |
Constructor Detail |
---|
public RDBMSDataConnector(DataSource source, boolean resultCaching)
source
- data source used to retrieve connectionsresultCaching
- whether query results should be cachedMethod Detail |
---|
public void initialize()
public boolean isConnectionReadOnly()
public void setConnectionReadOnly(boolean isReadOnly)
isReadOnly
- whether this data connector uses read-only connectionspublic boolean getUsesStoredProcedure()
public void setUsesStoredProcedure(boolean storedProcedure)
storedProcedure
- whether queries made use stored procedurespublic boolean isNoResultIsError()
boolean
public void setNoResultIsError(boolean b)
b
- boolean
public boolean getCacheResults()
public TemplateEngine getTemplateEngine()
public void setTemplateEngine(TemplateEngine engine)
engine
- engine used to evaluate the query templatepublic String getQueryTemplate()
public void setQueryTemplate(String template)
template
- template used to create queriespublic Map<String,RDBMSColumnDescriptor> getColumnDescriptor()
public void onApplicationEvent(org.springframework.context.ApplicationEvent event)
onApplicationEvent
in interface org.springframework.context.ApplicationListener
public Map<String,BaseAttribute> resolve(ShibbolethResolutionContext resolutionContext) throws AttributeResolutionException
resolve
in interface ResolutionPlugIn<Map<String,BaseAttribute>>
resolutionContext
- the context for the resolution
AttributeResolutionException
- the problem that occured during the resolutionpublic void validate() throws AttributeResolutionException
validate
in interface ResolutionPlugIn<Map<String,BaseAttribute>>
AttributeResolutionException
- if the plug-in has an invalid internal statepublic void clearCache()
protected void registerTemplate()
protected Map<String,BaseAttribute> retrieveAttributesFromCache(String princpal, String query) throws AttributeResolutionException
princpal
- the principal name of the user the attributes are forquery
- query used to generate the attributes
AttributeResolutionException
- thrown if there is a problem retrieving data from the cacheprotected Map<String,BaseAttribute> retrieveAttributesFromDatabase(String query) throws AttributeResolutionException
query
- query used to get the attributes
AttributeResolutionException
- thrown if there is a problem retrieving data from the database or
transforming that data into BaseAttribute
sprotected Map<String,BaseAttribute> processResultSet(ResultSet resultSet) throws AttributeResolutionException
BaseAttribute
s.
resultSet
- the result set to convert
AttributeResolutionException
- thrown if there is a problem converting the result set into attributesprotected void addValueByType(Collection values, RDBMSDataConnector.DATA_TYPES type, ResultSet resultSet, int columnIndex) throws SQLException
values
- set to add values intotype
- type the value should be extracted asresultSet
- result set, on the current row, to extract the value fromcolumnIndex
- index of the column from which to extract the attribute
SQLException
- thrown if value can not retrieved from the result set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |