Package net.shibboleth.idp.attribute.resolver.dc.rdbms.impl

# Class RDBMSDataConnector

java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
net.shibboleth.shared.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>
A `DataConnector` that queries a relation database in order to retrieve attribute data.

## Field Summary

Fields
Modifier and Type
Field
Description
`private DataSource`
`dataSource`
JDBC data source for retrieving `Connection`s.
`private boolean`
`defaultMappingStrategy`
Whether the default mapping strategy is being used.
`private boolean`
`defaultValidator`
Whether the default validator is being used.
`private final org.slf4j.Logger`
`log`
Class logger.

## Constructor Summary

Constructors
Constructor
Description
`RDBMSDataConnector()`

## Method Summary

Modifier and Type
Method
Description
`protected void`
`doInitialize()`
`DataSource`
`getDataSource()`
Gets the JDBC data source for retrieving `Connection`s.
`protected Map<String,IdPAttribute>`
`retrieveAttributes(ExecutableStatement statement)`
Attempts to retrieve the attribute from the database.
`void`
`setDataSource(DataSource source)`
Sets the JDBC data source for retrieving `Connection`s.
`void`
`setMappingStrategy(ResultMappingStrategy strategy)`
Sets the strategy for mapping from search results to a collection of `IdPAttribute`s.
`void`
`setValidator(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, retrieveAttributes, setExecutableSearchBuilder, setFailFastInitialize, setResultsCache`

### Methods inherited from class net.shibboleth.idp.attribute.resolver.AbstractDataConnector

`doResolve, getExportAttributes, getFailoverDataConnectorId, getLastFail, getLastSuccess, getLogPrefix, getNoRetryDelay, setExportAttributes, setFailoverDataConnectorId, setLastFail, setLastSuccess, setNoRetryDelay`

### Methods inherited from class net.shibboleth.idp.attribute.resolver.AbstractResolverPlugin

`doDestroy, equals, getActivationCondition, getAttributeDependencies, getDataConnectorDependencies, hashCode, isPropagateResolutionExceptions, resolve, setActivationCondition, setAttributeDependencies, setDataConnectorDependencies, setPropagateResolutionExceptions`

### Methods inherited from class net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent

`setId`

### Methods inherited from class net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent

`ensureId, getId, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException`

### Methods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent

`checkComponentActive, checkSetterPreconditions, 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.shared.component.DestructableComponent

`destroy, isDestroyed`

### Methods inherited from interface org.springframework.beans.factory.DisposableBean

`destroy`

### Methods inherited from interface net.shibboleth.shared.component.IdentifiedComponent

`getId`

### Methods inherited from interface net.shibboleth.shared.component.InitializableComponent

`initialize, isInitialized`

### Methods inherited from interface net.shibboleth.idp.attribute.resolver.ResolverPlugin

`getActivationCondition, getAttributeDependencies, getDataConnectorDependencies, isPropagateResolutionExceptions, resolve`

## Field Details

### log

@Nonnull private final org.slf4j.Logger log
Class logger.

### dataSource

@NonnullAfterInit private DataSource dataSource
JDBC data source for retrieving `Connection`s.

### defaultValidator

private boolean defaultValidator
Whether the default validator is being used.

### defaultMappingStrategy

private boolean defaultMappingStrategy
Whether the default mapping strategy is being used.

## Constructor Details

### RDBMSDataConnector

public RDBMSDataConnector()

## Method Details

### getDataSource

@NonnullAfterInit public DataSource getDataSource()
Gets the JDBC data source for retrieving `Connection`s.

Returns:
  JDBC data source for retrieving `Connection`s

### setDataSource

public void setDataSource(@Nonnull DataSource source)
Sets the JDBC data source for retrieving `Connection`s.

Parameters:
  `source` - JDBC data source for retrieving `Connection`s

### setValidator

public void setValidator(@Nonnull Validator validator)
Sets the validator used to validate this connector.

Overrides:
  `setValidator` in class `AbstractSearchDataConnector<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 of `IdPAttribute`s.

Overrides:
  `setMappingStrategy` in class `AbstractSearchDataConnector<ExecutableStatement,ResultMappingStrategy>`
Parameters:
  `strategy` - strategy for mapping from search results to a collection of `IdPAttribute`s

### doInitialize

protected void doInitialize() throws ComponentInitializationException

Overrides:
  `doInitialize` in class `AbstractSearchDataConnector<ExecutableStatement,ResultMappingStrategy>`
Throws:
  `ComponentInitializationException`

### retrieveAttributes

@Nullable @Unmodifiable @NotLive protected Map<String,IdPAttribute> retrieveAttributes(@Nullable ExecutableStatement statement) throws ResolutionException
Attempts to retrieve the attribute from the database.

Specified by:
  `retrieveAttributes` in class `AbstractSearchDataConnector<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 into `IdPAttribute`s