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
public class ScriptedDataConnector extends AbstractDataConnector
A Data Connector which populates a series of attributes from a providedProfileRequestContext.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classScriptedDataConnector.DataConnectorScriptEvaluatorEvaluator bound to the DataConnector semantic.
-
Field Summary
Fields Modifier and Type Field Description private ObjectcustomObjectThe custom object we inject into all scripts.private org.slf4j.LoggerlogClass logger.private Function<AttributeResolutionContext,ProfileRequestContext>prcLookupStrategyStrategy used to locate theProfileRequestContextto use.static StringRESULTS_STRINGThe id of the object where the results go.private Function<ProfileRequestContext,SubjectContext>scLookupStrategyStrategy used to locate theSubjectContextto use.private EvaluableScriptscriptScript to be evaluated.private ScriptedDataConnector.DataConnectorScriptEvaluatorscriptEvaluatorEvaluator.
-
Constructor Summary
Constructors Constructor Description ScriptedDataConnector()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Map<String,IdPAttribute>doDataConnectorResolve(AttributeResolutionContext resolutionContext, AttributeResolverWorkContext workContext)protected voiddoInitialize()ObjectgetCustomObject()Return the custom (externally provided) object.EvaluableScriptgetScript()Gets the script to be evaluated.voidsetCustomObject(Object object)Set the custom (externally provided) object.voidsetProfileRequestContextLookupStrategy(Function<AttributeResolutionContext,ProfileRequestContext> strategy)Set the strategy used to locate theProfileRequestContextassociated with a givenAttributeResolutionContext.voidsetScript(EvaluableScript definitionScript)Sets the script to be evaluated.voidsetSubjectContextLookupStrategy(Function<ProfileRequestContext,SubjectContext> strategy)Set the strategy used to locate theSubjectContextassociated 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 Detail
-
RESULTS_STRING
@Nonnull public static final String RESULTS_STRING
The id of the object where the results go.- See Also:
- Constant Field Values
-
log
@Nonnull private final org.slf4j.Logger log
Class logger.
-
script
@NonnullAfterInit private EvaluableScript script
Script to be evaluated.
-
scriptEvaluator
@NonnullAfterInit private ScriptedDataConnector.DataConnectorScriptEvaluator scriptEvaluator
Evaluator.
-
prcLookupStrategy
@Nonnull private Function<AttributeResolutionContext,ProfileRequestContext> prcLookupStrategy
Strategy used to locate theProfileRequestContextto use.
-
scLookupStrategy
@Nonnull private Function<ProfileRequestContext,SubjectContext> scLookupStrategy
Strategy used to locate theSubjectContextto use.
-
customObject
@Nullable private Object customObject
The custom object we inject into all scripts.
-
-
Method Detail
-
getCustomObject
@Nullable public Object getCustomObject()
Return the custom (externally provided) object.- Returns:
- the custom object
-
setCustomObject
@Nullable public void setCustomObject(Object object)
Set the custom (externally provided) object.- Parameters:
object- the custom object
-
getScript
@NonnullAfterInit public EvaluableScript getScript()
Gets the script to be evaluated.- Returns:
- the script to be evaluated
-
setScript
public void setScript(@Nonnull EvaluableScript definitionScript)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 theProfileRequestContextassociated with a givenAttributeResolutionContext.- Parameters:
strategy- strategy used to locate theProfileRequestContextassociated with a givenAttributeResolutionContext
-
setSubjectContextLookupStrategy
public void setSubjectContextLookupStrategy(@Nonnull Function<ProfileRequestContext,SubjectContext> strategy)Set the strategy used to locate theSubjectContextassociated with a givenAttributeResolutionContext.- Parameters:
strategy- strategy used to locate theSubjectContextassociated with a givenAttributeResolutionContext
-
doInitialize
protected void doInitialize() throws ComponentInitializationException- Overrides:
doInitializein classAbstractDataConnector- Throws:
ComponentInitializationException
-
doDataConnectorResolve
@Nullable protected Map<String,IdPAttribute> doDataConnectorResolve(@Nonnull AttributeResolutionContext resolutionContext, @Nonnull AttributeResolverWorkContext workContext) throws ResolutionException
- Specified by:
doDataConnectorResolvein classAbstractDataConnector- Throws:
ResolutionException
-
-