Class RDBMSDataConnector
- java.lang.Object
-
- net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
-
- net.shibboleth.utilities.java.support.component.AbstractIdentifiedInitializableComponent
-
- net.shibboleth.utilities.java.support.component.AbstractIdentifiableInitializableComponent
-
- net.shibboleth.idp.attribute.resolver.AbstractResolverPlugin<Map<String,IdPAttribute>>
-
- net.shibboleth.idp.attribute.resolver.AbstractDataConnector
-
- net.shibboleth.idp.attribute.resolver.dc.impl.AbstractSearchDataConnector<ExecutableStatement,ResultMappingStrategy>
-
- net.shibboleth.idp.attribute.resolver.dc.rdbms.impl.RDBMSDataConnector
-
- All Implemented Interfaces:
DataConnector,ResolverPlugin<Map<String,IdPAttribute>>,Component,DestructableComponent,IdentifiableComponent,IdentifiedComponent,InitializableComponent,UnmodifiableComponent,DisposableBean
public class RDBMSDataConnector extends AbstractSearchDataConnector<ExecutableStatement,ResultMappingStrategy>
ADataConnectorthat queries a relation database in order to retrieve attribute data.
-
-
Field Summary
Fields Modifier and Type Field Description private DataSourcedataSourceJDBC data source for retrievingConnections.private booleandefaultMappingStrategyWhether the default mapping strategy is being used.private booleandefaultValidatorWhether the default validator is being used.private org.slf4j.LoggerlogClass logger.
-
Constructor Summary
Constructors Constructor Description RDBMSDataConnector()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoInitialize()DataSourcegetDataSource()Gets the JDBC data source for retrievingConnections.protected Map<String,IdPAttribute>retrieveAttributes(ExecutableStatement statement)Attempts to retrieve the attribute from the database.voidsetDataSource(DataSource source)Sets the JDBC data source for retrievingConnections.voidsetMappingStrategy(ResultMappingStrategy strategy)Sets the strategy for mapping from search results to a collection ofIdPAttributes.voidsetValidator(Validator validator)Sets the validator used to validate this connector.-
Methods inherited from class net.shibboleth.idp.attribute.resolver.dc.impl.AbstractSearchDataConnector
doDataConnectorResolve, getExecutableSearchBuilder, getMappingStrategy, getResultsCache, getValidator, isFailFastInitialize, setExecutableSearchBuilder, setFailFastInitialize, setResultsCache
-
Methods inherited from class net.shibboleth.idp.attribute.resolver.AbstractDataConnector
doResolve, getExportAttributes, getFailoverDataConnectorId, getLastFail, getLastSuccess, getLogPrefix, getNoRetryDelay, isExportAllAttributes, setExportAllAttributes, setExportAttributes, setFailoverDataConnectorId, setLastFail, setLastSuccess, setNoRetryDelay
-
Methods inherited from class net.shibboleth.idp.attribute.resolver.AbstractResolverPlugin
addDisplayInformation, doDestroy, equals, getActivationCondition, getAttributeDependencies, getDataConnectorDependencies, getProfileContextStrategy, hashCode, isPropagateResolutionExceptions, isSuppressDisplayInformation, resolve, setActivationCondition, setAttributeDependencies, setDataConnectorDependencies, setProfileContextStrategy, setPropagateResolutionExceptions, setSuppressDisplayInformation
-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractIdentifiableInitializableComponent
setId
-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractIdentifiedInitializableComponent
getId
-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, initialize, isDestroyed, isInitialized
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.shibboleth.utilities.java.support.component.DestructableComponent
destroy, isDestroyed
-
Methods inherited from interface org.springframework.beans.factory.DisposableBean
destroy
-
Methods inherited from interface net.shibboleth.utilities.java.support.component.IdentifiedComponent
getId
-
Methods inherited from interface net.shibboleth.utilities.java.support.component.InitializableComponent
initialize, isInitialized
-
Methods inherited from interface net.shibboleth.idp.attribute.resolver.ResolverPlugin
getActivationCondition, getAttributeDependencies, getDataConnectorDependencies, isPropagateResolutionExceptions, resolve
-
-
-
-
Field Detail
-
log
private final org.slf4j.Logger log
Class logger.
-
dataSource
private DataSource dataSource
JDBC data source for retrievingConnections.
-
defaultValidator
private boolean defaultValidator
Whether the default validator is being used.
-
defaultMappingStrategy
private boolean defaultMappingStrategy
Whether the default mapping strategy is being used.
-
-
Method Detail
-
getDataSource
public DataSource getDataSource()
Gets the JDBC data source for retrievingConnections.- Returns:
- JDBC data source for retrieving
Connections
-
setDataSource
public void setDataSource(@Nonnull DataSource source)Sets the JDBC data source for retrievingConnections.- Parameters:
source- JDBC data source for retrievingConnections
-
setValidator
public void setValidator(@Nonnull Validator validator)Sets the validator used to validate this connector.- Overrides:
setValidatorin classAbstractSearchDataConnector<ExecutableStatement,ResultMappingStrategy>- Parameters:
validator- used to validate this connector
-
setMappingStrategy
public void setMappingStrategy(@Nonnull ResultMappingStrategy strategy)Sets the strategy for mapping from search results to a collection ofIdPAttributes.- Overrides:
setMappingStrategyin classAbstractSearchDataConnector<ExecutableStatement,ResultMappingStrategy>- Parameters:
strategy- strategy for mapping from search results to a collection ofIdPAttributes
-
doInitialize
protected void doInitialize() throws ComponentInitializationException- Overrides:
doInitializein classAbstractSearchDataConnector<ExecutableStatement,ResultMappingStrategy>- Throws:
ComponentInitializationException
-
retrieveAttributes
@Nullable protected Map<String,IdPAttribute> retrieveAttributes(ExecutableStatement statement) throws ResolutionException
Attempts to retrieve the attribute from the database.- Specified by:
retrieveAttributesin classAbstractSearchDataConnector<ExecutableStatement,ResultMappingStrategy>- Parameters:
statement- statement used to retrieve data from the database- Returns:
- attributes gotten from the database
- Throws:
ResolutionException- thrown if there is a problem retrieving data from the database or transforming that data intoIdPAttributes
-
-