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
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
FieldsModifier and TypeFieldDescriptionprivate final Map<String,
IdPAttribute> The attributes produced by the resolved data connector.private final DataConnector
The data connector that was resolved to produce the attributes. -
Constructor Summary
ConstructorsConstructorDescriptionResolvedDataConnector
(DataConnector connector, Map<String, IdPAttribute> attributes) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected Map<String,
IdPAttribute> doDataConnectorResolve
(AttributeResolutionContext resolutionContext, AttributeResolverWorkContext workContext) Retrieves a collection of attributes from some data source.boolean
Get the predicate which defines whether this plugin is active for a given request.Gets the unmodifiable list of attributeDependencies for this plugin.Gets the unmodifiable list of dependencies for this plugin.Gets the list of attribute names to export during resolution.Gets the ID of theAbstractDataConnector
whose values will be used in the event that this data connector experiences an error.getId()
Gets the resolved attributes.Gets the wrapped data connector that was resolved.int
hashCode()
boolean
Gets whether we export all attributes during resolution.boolean
boolean
Get whether aResolutionException
that occurred resolving attributes will be re-thrown.void
setExportAllAttributes
(boolean what) Set whether we export all attributes.void
setExportAttributes
(Collection<String> what) Sets the list of attribute names to export during resolution.void
Set the ID of theAbstractDataConnector
whose values will be used in the event that this data connector experiences an error.void
setPropagateResolutionExceptions
(boolean propagate) Set whether anAttributeResolutionContext
that occurred resolving attributes will be re-thrown.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
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 Details
-
resolvedConnector
The data connector that was resolved to produce the attributes. -
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 attributesattributes
- 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 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
- Overrides:
equals
in classAbstractResolverPlugin<Map<String,
IdPAttribute>>
-
getAttributeDependencies
@Nonnull @NonnullElements public Set<ResolverAttributeDefinitionDependency> getAttributeDependencies()Gets the unmodifiable list of attributeDependencies for this plugin.- Specified by:
getAttributeDependencies
in interfaceResolverPlugin<Map<String,
IdPAttribute>> - Overrides:
getAttributeDependencies
in 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:
getDataConnectorDependencies
in interfaceResolverPlugin<Map<String,
IdPAttribute>> - Overrides:
getDataConnectorDependencies
in classAbstractResolverPlugin<Map<String,
IdPAttribute>> - Returns:
- unmodifiable list of dependencies for this plugin, never null
-
getActivationCondition
Get the predicate which defines whether this plugin is active for a given request.- Specified by:
getActivationCondition
in interfaceResolverPlugin<Map<String,
IdPAttribute>> - Overrides:
getActivationCondition
in classAbstractResolverPlugin<Map<String,
IdPAttribute>> - Returns:
- the predicate.
-
getFailoverDataConnectorId
Gets the ID of theAbstractDataConnector
whose values will be used in the event that this data connector experiences an error.- Specified by:
getFailoverDataConnectorId
in interfaceDataConnector
- Overrides:
getFailoverDataConnectorId
in classAbstractDataConnector
- Returns:
- ID of the
AbstractDataConnector
whose values will be used in the event that this data connector experiences an error
-
getId
- Specified by:
getId
in interfaceIdentifiedComponent
- Overrides:
getId
in classAbstractIdentifiedInitializableComponent
-
hashCode
public int hashCode()- Overrides:
hashCode
in classAbstractResolverPlugin<Map<String,
IdPAttribute>>
-
isPropagateResolutionExceptions
public boolean isPropagateResolutionExceptions()Get whether aResolutionException
that occurred resolving attributes will be re-thrown. Doing so will cause the entire attribute resolution request to fail.- Specified by:
isPropagateResolutionExceptions
in interfaceResolverPlugin<Map<String,
IdPAttribute>> - Overrides:
isPropagateResolutionExceptions
in classAbstractResolverPlugin<Map<String,
IdPAttribute>> - Returns:
- true if
ResolutionException
s are propagated, false if not
-
setFailoverDataConnectorId
Set the ID of theAbstractDataConnector
whose values will be used in the event that this data connector experiences an error.- Overrides:
setFailoverDataConnectorId
in classAbstractDataConnector
- Parameters:
id
- ID of theAbstractDataConnector
whose values will be used in the event that this data connector experiences an error
-
setPropagateResolutionExceptions
public void setPropagateResolutionExceptions(boolean propagate) Set whether anAttributeResolutionContext
that occurred resolving attributes will be re-thrown. Doing so will cause the entire attribute resolution request to fail.- Overrides:
setPropagateResolutionExceptions
in classAbstractResolverPlugin<Map<String,
IdPAttribute>> - Parameters:
propagate
- true ifResolutionException
s are propagated, false if not
-
toString
-
setExportAllAttributes
public void setExportAllAttributes(@Nullable boolean what) Set whether we export all attributes.- Overrides:
setExportAllAttributes
in 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:
isExportAllAttributes
in interfaceDataConnector
- Overrides:
isExportAllAttributes
in classAbstractDataConnector
- Returns:
- whether we export all attributes
-
setExportAttributes
Sets the list of attribute names to export during resolution.- Overrides:
setExportAttributes
in classAbstractDataConnector
- Parameters:
what
- the list
-
getExportAttributes
Gets the list of attribute names to export during resolution.- Specified by:
getExportAttributes
in interfaceDataConnector
- Overrides:
getExportAttributes
in classAbstractDataConnector
- Returns:
- the list of attribute names to export during resolution
-
getResolvedAttributes
Gets the resolved attributes.- Returns:
- the resolved attributes
-
getResolvedConnector
Gets the wrapped data connector that was resolved.- Returns:
- the resolved data connector
-
isInitialized
public boolean isInitialized()- Specified by:
isInitialized
in interfaceInitializableComponent
- Overrides:
isInitialized
in classAbstractInitializableComponent
-