Class ScriptedDataConnector
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.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 classEvaluator bound to the DataConnector semantic. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Collection<ResolverScriptContextExtender>Extenders for script context.private ObjectThe custom object we inject into all scripts.private final org.slf4j.LoggerClass logger.static final StringThe id of the object where the results go.private EvaluableScriptScript 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 voidReturn the custom (externally provided) object.Gets the script to be evaluated.voidsetCustomObject(Object object) Set the custom (externally provided) object.voidsetScript(EvaluableScript definitionScript) Sets the script to be evaluated.voidSet any script context extenders to apply.Methods inherited from class net.shibboleth.idp.attribute.resolver.AbstractDataConnector
doResolve, getExportAttributes, getFailoverDataConnectorId, getLastFail, getLastSuccess, getLogPrefix, getNoRetryDelay, setExportAttributes, setFailoverDataConnectorId, setLastFail, setLastSuccess, setNoRetryDelayMethods inherited from class net.shibboleth.idp.attribute.resolver.AbstractResolverPlugin
doDestroy, equals, getActivationCondition, getAttributeDependencies, getDataConnectorDependencies, hashCode, isPropagateResolutionExceptions, resolve, setActivationCondition, setAttributeDependencies, setDataConnectorDependencies, setPropagateResolutionExceptionsMethods inherited from class net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
setIdMethods inherited from class net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
ensureId, getId, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentExceptionMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, initialize, isDestroyed, isInitializedMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.shibboleth.shared.component.DestructableComponent
destroy, isDestroyedMethods inherited from interface org.springframework.beans.factory.DisposableBean
destroyMethods inherited from interface net.shibboleth.shared.component.IdentifiedComponent
getIdMethods inherited from interface net.shibboleth.shared.component.InitializableComponent
initialize, isInitializedMethods 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. -
contextExtenders
Extenders for script context. -
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
-
setScriptContextExtenders
public void setScriptContextExtenders(@Nullable Collection<ResolverScriptContextExtender> extenders) Set any script context extenders to apply.- Parameters:
extenders- script extenders- Since:
- 5.0.0
-
doInitialize
- Overrides:
doInitializein 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:
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
-