Class ScriptedDataConnector
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.ScriptedDataConnector
- All Implemented Interfaces:
DataConnector
,ResolverPlugin<Map<String,
,IdPAttribute>> Component
,DestructableComponent
,IdentifiableComponent
,IdentifiedComponent
,InitializableComponent
,UnmodifiableComponent
,DisposableBean
A Data Connector which populates a series of attributes from a provided
ProfileRequestContext
.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate class
Evaluator bound to the DataConnector semantic. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Object
The custom object we inject into all scripts.private final org.slf4j.Logger
Class logger.Strategy used to locate theProfileRequestContext
to use.static final String
The id of the object where the results go.private Function<ProfileRequestContext,
SubjectContext> Strategy used to locate theSubjectContext
to use.private EvaluableScript
Script to be evaluated.Evaluator. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Map<String,
IdPAttribute> doDataConnectorResolve
(AttributeResolutionContext resolutionContext, AttributeResolverWorkContext workContext) Retrieves a collection of attributes from some data source.protected void
Return the custom (externally provided) object.Gets the script to be evaluated.void
setCustomObject
(Object object) Set the custom (externally provided) object.void
setProfileRequestContextLookupStrategy
(Function<AttributeResolutionContext, ProfileRequestContext> strategy) Set the strategy used to locate theProfileRequestContext
associated with a givenAttributeResolutionContext
.void
setScript
(EvaluableScript definitionScript) Sets the script to be evaluated.void
Set the strategy used to locate theSubjectContext
associated with a givenAttributeResolutionContext
.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 Details
-
RESULTS_STRING
The id of the object where the results go.- See Also:
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
script
Script to be evaluated. -
scriptEvaluator
Evaluator. -
prcLookupStrategy
Strategy used to locate theProfileRequestContext
to use. -
scLookupStrategy
Strategy used to locate theSubjectContext
to use. -
customObject
The custom object we inject into all scripts.
-
-
Constructor Details
-
ScriptedDataConnector
public ScriptedDataConnector()Constructor.
-
-
Method Details
-
getCustomObject
Return the custom (externally provided) object.- Returns:
- the custom object
-
setCustomObject
Set the custom (externally provided) object.- Parameters:
object
- the custom object
-
getScript
Gets the script to be evaluated.- Returns:
- the script to be evaluated
-
setScript
Sets the script to be evaluated.- Parameters:
definitionScript
- the script to be evaluated
-
setProfileRequestContextLookupStrategy
public void setProfileRequestContextLookupStrategy(@Nonnull Function<AttributeResolutionContext, ProfileRequestContext> strategy) Set the strategy used to locate theProfileRequestContext
associated with a givenAttributeResolutionContext
.- Parameters:
strategy
- strategy used to locate theProfileRequestContext
associated with a givenAttributeResolutionContext
-
setSubjectContextLookupStrategy
public void setSubjectContextLookupStrategy(@Nonnull Function<ProfileRequestContext, SubjectContext> strategy) Set the strategy used to locate theSubjectContext
associated with a givenAttributeResolutionContext
.- Parameters:
strategy
- strategy used to locate theSubjectContext
associated with a givenAttributeResolutionContext
-
doInitialize
- Overrides:
doInitialize
in classAbstractDataConnector
- Throws:
ComponentInitializationException
-
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
-