Class ResolvedDataConnector
- 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.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 toResolverPlugin.resolve(AttributeResolutionContext)are "free". This proxy is immutable so all setter methods simply return.
-
-
Field Summary
Fields Modifier and Type Field Description private Map<String,IdPAttribute>resolvedAttributesThe attributes produced by the resolved data connector.private DataConnectorresolvedConnectorThe data connector that was resolved to produce the attributes.
-
Constructor Summary
Constructors Constructor Description ResolvedDataConnector(DataConnector connector, Map<String,IdPAttribute> attributes)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Map<String,IdPAttribute>doDataConnectorResolve(AttributeResolutionContext resolutionContext, AttributeResolverWorkContext workContext)Retrieves a collection of attributes from some data source.booleanequals(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.StringgetFailoverDataConnectorId()Gets the ID of theAbstractDataConnectorwhose values will be used in the event that this data connector experiences an error.StringgetId()Map<String,IdPAttribute>getResolvedAttributes()Gets the resolved attributes.DataConnectorgetResolvedConnector()Gets the wrapped data connector that was resolved.inthashCode()booleanisExportAllAttributes()Gets whether we export all attributes during resolution.booleanisInitialized()booleanisPropagateResolutionExceptions()Get whether aResolutionExceptionthat occurred resolving attributes will be re-thrown.voidsetExportAllAttributes(boolean what)Set whether we export all attributes.voidsetExportAttributes(Collection<String> what)Sets the list of attribute names to export during resolution.voidsetFailoverDataConnectorId(String id)Set the ID of theAbstractDataConnectorwhose values will be used in the event that this data connector experiences an error.voidsetPropagateResolutionExceptions(boolean propagate)Set whether anAttributeResolutionContextthat occurred resolving attributes will be re-thrown.StringtoString()-
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
addDisplayInformation, doDestroy, getProfileContextStrategy, isSuppressDisplayInformation, resolve, setActivationCondition, setAttributeDependencies, setDataConnectorDependencies, setProfileContextStrategy, setSuppressDisplayInformation
-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractIdentifiableInitializableComponent
setId
-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, initialize, isDestroyed
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, 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.InitializableComponent
initialize
-
Methods inherited from interface net.shibboleth.idp.attribute.resolver.ResolverPlugin
resolve
-
-
-
-
Field Detail
-
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 Detail
-
ResolvedDataConnector
public ResolvedDataConnector(@Nonnull DataConnector connector, @Nullable Map<String,IdPAttribute> attributes)Constructor.- Parameters:
connector- data connector that was resolved to produce the attributesattributes- attributes produced by the resolved data connector
-
-
Method Detail
-
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:
doDataConnectorResolvein classAbstractDataConnector- Parameters:
resolutionContext- current resolution contextworkContext- 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:
equalsin classAbstractResolverPlugin<Map<String,IdPAttribute>>
-
getAttributeDependencies
@Nonnull @NonnullElements public Set<ResolverAttributeDefinitionDependency> getAttributeDependencies()
Gets the unmodifiable list of attributeDependencies for this plugin.- Specified by:
getAttributeDependenciesin interfaceResolverPlugin<Map<String,IdPAttribute>>- Overrides:
getAttributeDependenciesin classAbstractResolverPlugin<Map<String,IdPAttribute>>- Returns:
- unmodifiable list of dependencies for this plugin, never null
-
getDataConnectorDependencies
@Nonnull @NonnullElements public Set<ResolverDataConnectorDependency> getDataConnectorDependencies()
Gets the unmodifiable list of dependencies for this plugin.- Specified by:
getDataConnectorDependenciesin interfaceResolverPlugin<Map<String,IdPAttribute>>- Overrides:
getDataConnectorDependenciesin classAbstractResolverPlugin<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:
getActivationConditionin interfaceResolverPlugin<Map<String,IdPAttribute>>- Overrides:
getActivationConditionin classAbstractResolverPlugin<Map<String,IdPAttribute>>- Returns:
- the predicate.
-
getFailoverDataConnectorId
@Nullable public String getFailoverDataConnectorId()
Gets the ID of theAbstractDataConnectorwhose values will be used in the event that this data connector experiences an error.- Specified by:
getFailoverDataConnectorIdin interfaceDataConnector- Overrides:
getFailoverDataConnectorIdin classAbstractDataConnector- Returns:
- ID of the
AbstractDataConnectorwhose values will be used in the event that this data connector experiences an error
-
getId
@Nonnull public String getId()
- Specified by:
getIdin interfaceIdentifiedComponent- Overrides:
getIdin classAbstractIdentifiedInitializableComponent
-
hashCode
public int hashCode()
- Overrides:
hashCodein classAbstractResolverPlugin<Map<String,IdPAttribute>>
-
isPropagateResolutionExceptions
public boolean isPropagateResolutionExceptions()
Get whether aResolutionExceptionthat occurred resolving attributes will be re-thrown. Doing so will cause the entire attribute resolution request to fail.- Specified by:
isPropagateResolutionExceptionsin interfaceResolverPlugin<Map<String,IdPAttribute>>- Overrides:
isPropagateResolutionExceptionsin classAbstractResolverPlugin<Map<String,IdPAttribute>>- Returns:
- true if
ResolutionExceptions are propagated, false if not
-
setFailoverDataConnectorId
public void setFailoverDataConnectorId(String id)
Set the ID of theAbstractDataConnectorwhose values will be used in the event that this data connector experiences an error.- Overrides:
setFailoverDataConnectorIdin classAbstractDataConnector- Parameters:
id- ID of theAbstractDataConnectorwhose values will be used in the event that this data connector experiences an error
-
setPropagateResolutionExceptions
public void setPropagateResolutionExceptions(boolean propagate)
Set whether anAttributeResolutionContextthat occurred resolving attributes will be re-thrown. Doing so will cause the entire attribute resolution request to fail.- Overrides:
setPropagateResolutionExceptionsin classAbstractResolverPlugin<Map<String,IdPAttribute>>- Parameters:
propagate- true ifResolutionExceptions are propagated, false if not
-
setExportAllAttributes
public void setExportAllAttributes(@Nullable boolean what)Set whether we export all attributes.- Overrides:
setExportAllAttributesin classAbstractDataConnector- Parameters:
what- whether we export all attributes
-
isExportAllAttributes
public boolean isExportAllAttributes()
Gets whether we export all attributes during resolution.If this returns false then
DataConnector.getExportAttributes()returns the list of attributes to return.- Specified by:
isExportAllAttributesin interfaceDataConnector- Overrides:
isExportAllAttributesin classAbstractDataConnector- Returns:
- whether we export all attributes
-
setExportAttributes
public void setExportAttributes(@Nonnull Collection<String> what)Sets the list of attribute names to export during resolution.- Overrides:
setExportAttributesin classAbstractDataConnector- Parameters:
what- the list
-
getExportAttributes
@Nonnull @NonnullElements @Unmodifiable public Collection<String> getExportAttributes()
Gets the list of attribute names to export during resolution.- Specified by:
getExportAttributesin interfaceDataConnector- Overrides:
getExportAttributesin classAbstractDataConnector- 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:
isInitializedin interfaceInitializableComponent- Overrides:
isInitializedin classAbstractInitializableComponent
-
-