Package net.shibboleth.idp.attribute.resolver

# Class ResolvedDataConnector

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.ResolvedDataConnector

All Implemented Interfaces:
  `DataConnector`, `ResolverPlugin<Map<String,IdPAttribute>>`, `Component`, `DestructableComponent`, `IdentifiableComponent`, `IdentifiedComponent`, `InitializableComponent`, `UnmodifiableComponent`, `DisposableBean`

@ThreadSafe public final class ResolvedDataConnector extends AbstractDataConnector
A proxy which wraps a resolved data connector and always returns the same attributes. The goal being that once a data connector is resolved this can be used in its place and calls to `ResolverPlugin.resolve(AttributeResolutionContext)` are "free". This proxy is immutable so all setter methods simply return.

## Field Summary

Fields
Modifier and Type
Field
Description
`private final Map<String,IdPAttribute>`
`resolvedAttributes`
The attributes produced by the resolved data connector.
`private final DataConnector`
`resolvedConnector`
The data connector that was resolved to produce the attributes.

## Constructor Summary

Constructors
Constructor
Description
`ResolvedDataConnector(DataConnector connector, Map<String,IdPAttribute> attributes)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`protected Map<String,IdPAttribute>`
`doDataConnectorResolve(AttributeResolutionContext resolutionContext, AttributeResolverWorkContext workContext)`
Retrieves a collection of attributes from some data source.
`boolean`
`equals(Object obj)`
`Predicate<ProfileRequestContext>`
`getActivationCondition()`
Get the predicate which defines whether this plugin is active for a given request.
`Set<ResolverAttributeDefinitionDependency>`
`getAttributeDependencies()`
Gets the unmodifiable list of attributeDependencies for this plugin.
`Set<ResolverDataConnectorDependency>`
`getDataConnectorDependencies()`
Gets the unmodifiable list of dependencies for this plugin.
`Collection<String>`
`getExportAttributes()`
Gets the list of attribute names to export during resolution.
`String`
`getFailoverDataConnectorId()`
Gets the ID of the `AbstractDataConnector` whose values will be used in the event that this data connector experiences an error.
`String`
`getId()`
`Map<String,IdPAttribute>`
`getResolvedAttributes()`
Gets the resolved attributes.
`DataConnector`
`getResolvedConnector()`
Gets the wrapped data connector that was resolved.
`int`
`hashCode()`
`boolean`
`isInitialized()`
`boolean`
`isPropagateResolutionExceptions()`
Get whether a `ResolutionException` that occurred resolving attributes will be re-thrown.
`void`
`setExportAttributes(Collection<String> what)`
Sets the list of attribute names to export during resolution.
`void`
`setFailoverDataConnectorId(String id)`
Set the ID of the `AbstractDataConnector` whose values will be used in the event that this data connector experiences an error.
`void`
`setPropagateResolutionExceptions(boolean propagate)`
Set whether an `AttributeResolutionContext` that occurred resolving attributes will be re-thrown.
`String`
`toString()`

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

`doInitialize, doResolve, getLastFail, getLastSuccess, getLogPrefix, getNoRetryDelay, setLastFail, setLastSuccess, setNoRetryDelay`

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

`doDestroy, resolve, setActivationCondition, setAttributeDependencies, setDataConnectorDependencies`

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

`setId`

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

`ensureId, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException`

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

`checkComponentActive, checkSetterPreconditions, destroy, initialize, isDestroyed`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, 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.InitializableComponent

`initialize`

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

`resolve`

## Field Details

### resolvedConnector

@Nonnull private final DataConnector resolvedConnector
The data connector that was resolved to produce the attributes.

### resolvedAttributes

@Nullable private final Map<String,IdPAttribute> resolvedAttributes
The attributes produced by the resolved data connector.

## Constructor Details

### ResolvedDataConnector

public ResolvedDataConnector(@Nonnull DataConnector connector, @Nullable Map<String,IdPAttribute> attributes)
Constructor.

Parameters:
  `connector` - data connector that was resolved to produce the attributes
  `attributes` - attributes produced by the resolved data connector

## Method Details

### doDataConnectorResolve

@Nullable protected Map<String,IdPAttribute> doDataConnectorResolve(@Nonnull AttributeResolutionContext resolutionContext, @Nonnull AttributeResolverWorkContext workContext) throws ResolutionException
Retrieves a collection of attributes from some data source.

Specified by:
  `doDataConnectorResolve` in class `AbstractDataConnector`
Parameters:
  `resolutionContext` - current resolution context
  `workContext` - current resolver work context
Returns:
  collected attributes indexed by attribute ID
Throws:
  `ResolutionException` - thrown if there is a problem resolving the attributes

### equals

public boolean equals(Object obj)

Overrides:
  `equals` in class `AbstractResolverPlugin<Map<String,IdPAttribute>>`

### getAttributeDependencies

@Nonnull public Set<ResolverAttributeDefinitionDependency> getAttributeDependencies()
Gets the unmodifiable list of attributeDependencies for this plugin.

Specified by:
  `getAttributeDependencies` in interface `ResolverPlugin<Map<String,IdPAttribute>>`
Overrides:
  `getAttributeDependencies` in class `AbstractResolverPlugin<Map<String,IdPAttribute>>`
Returns:
  unmodifiable list of dependencies for this plugin, never null.

### getDataConnectorDependencies

@Nonnull public Set<ResolverDataConnectorDependency> getDataConnectorDependencies()
Gets the unmodifiable list of dependencies for this plugin.

Specified by:
  `getDataConnectorDependencies` in interface `ResolverPlugin<Map<String,IdPAttribute>>`
Overrides:
  `getDataConnectorDependencies` in class `AbstractResolverPlugin<Map<String,IdPAttribute>>`
Returns:
  unmodifiable list of dependencies for this plugin, never null.

### getActivationCondition

@Nullable public Predicate<ProfileRequestContext> getActivationCondition()
Get the predicate which defines whether this plugin is active for a given request.

Specified by:
  `getActivationCondition` in interface `ResolverPlugin<Map<String,IdPAttribute>>`
Overrides:
  `getActivationCondition` in class `AbstractResolverPlugin<Map<String,IdPAttribute>>`
Returns:
  the predicate.

### getFailoverDataConnectorId

@Nullable public String getFailoverDataConnectorId()
Gets the ID of the `AbstractDataConnector` whose values will be used in the event that this data connector experiences an error.

Specified by:
  `getFailoverDataConnectorId` in interface `DataConnector`
Overrides:
  `getFailoverDataConnectorId` in class `AbstractDataConnector`
Returns:
  ID of the `AbstractDataConnector` whose values will be used in the event that this data connector experiences an error

### getId

@Nonnull public String getId()

Specified by:
  `getId` in interface `IdentifiedComponent`
Overrides:
  `getId` in class `AbstractIdentifiedInitializableComponent`

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `AbstractResolverPlugin<Map<String,IdPAttribute>>`

### isPropagateResolutionExceptions

public boolean isPropagateResolutionExceptions()
Get whether a `ResolutionException` that occurred resolving attributes will be re-thrown. Doing so will cause the entire attribute resolution request to fail.

Specified by:
  `isPropagateResolutionExceptions` in interface `ResolverPlugin<Map<String,IdPAttribute>>`
Overrides:
  `isPropagateResolutionExceptions` in class `AbstractResolverPlugin<Map<String,IdPAttribute>>`
Returns:
  true if `ResolutionException`s are propagated, false if not

### setFailoverDataConnectorId

public void setFailoverDataConnectorId(@Nullable String id)
Set the ID of the `AbstractDataConnector` whose values will be used in the event that this data connector experiences an error.

Overrides:
  `setFailoverDataConnectorId` in class `AbstractDataConnector`
Parameters:
  `id` - ID of the `AbstractDataConnector` whose values will be used in the event that this data connector experiences an error

### setPropagateResolutionExceptions

public void setPropagateResolutionExceptions(boolean propagate)
Set whether an `AttributeResolutionContext` that occurred resolving attributes will be re-thrown. Doing so will cause the entire attribute resolution request to fail.

Overrides:
  `setPropagateResolutionExceptions` in class `AbstractResolverPlugin<Map<String,IdPAttribute>>`
Parameters:
  `propagate` - true if `ResolutionException`s are propagated, false if not

### toString

@Nonnull public String toString()

Overrides:
  `toString` in class `Object`

### setExportAttributes

public void setExportAttributes(@Nonnull Collection<String> what)
Sets the list of attribute names to export during resolution.

Overrides:
  `setExportAttributes` in class `AbstractDataConnector`
Parameters:
  `what` - the list

### getExportAttributes

@Nonnull @Unmodifiable @NotLive public Collection<String> getExportAttributes()
Gets the list of attribute names to export during resolution.

Specified by:
  `getExportAttributes` in interface `DataConnector`
Overrides:
  `getExportAttributes` in class `AbstractDataConnector`
Returns:
  the list of attribute names to export during resolution

### getResolvedAttributes

@Nullable public Map<String,IdPAttribute> getResolvedAttributes()
Gets the resolved attributes.

Returns:
  the resolved attributes

### getResolvedConnector

@Nonnull public DataConnector getResolvedConnector()
Gets the wrapped data connector that was resolved.

Returns:
  the resolved data connector

### isInitialized

public boolean isInitialized()

Specified by:
  `isInitialized` in interface `InitializableComponent`
Overrides:
  `isInitialized` in class `AbstractInitializableComponent`