public class ScriptedDataConnector extends AbstractDataConnector
ProfileRequestContext.| Modifier and Type | Field and Description |
|---|---|
private Object |
customObject
The custom object we inject into all scripts.
|
private org.slf4j.Logger |
log
Class logger.
|
private Function<AttributeResolutionContext,org.opensaml.profile.context.ProfileRequestContext> |
prcLookupStrategy
Strategy used to locate the
ProfileRequestContext to use. |
static String |
RESULTS_STRING
The id of the object where the results go.
|
private Function<org.opensaml.profile.context.ProfileRequestContext,SubjectContext> |
scLookupStrategy
Strategy used to locate the
SubjectContext to use. |
private EvaluableScript |
script
Script to be evaluated.
|
| Constructor and Description |
|---|
ScriptedDataConnector()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
private Map<String,IdPAttribute> |
buildResult(ScriptContext context)
Given the Script context we extract the attribute list and then (very carefully) construct the results map.
|
private void |
checkValues(IdPAttribute attribute)
Ensure that all the values in the attribute are of the correct type.
|
protected Map<String,IdPAttribute> |
doDataConnectorResolve(AttributeResolutionContext resolutionContext,
AttributeResolverWorkContext workContext) |
protected void |
doInitialize() |
Object |
getCustomObject()
Return the custom (externally provided) object.
|
EvaluableScript |
getScript()
Gets the script to be evaluated.
|
private ScriptContext |
getScriptContext(AttributeResolutionContext resolutionContext,
AttributeResolverWorkContext workContext)
Constructs the
ScriptContext used when evaluating the script. |
void |
setCustomObject(Object object)
Set the custom (externally provided) object.
|
void |
setProfileRequestContextLookupStrategy(Function<AttributeResolutionContext,org.opensaml.profile.context.ProfileRequestContext> strategy)
Set the strategy used to locate the
ProfileRequestContext associated with a given
AttributeResolutionContext. |
void |
setScript(EvaluableScript definitionScript)
Sets the script to be evaluated.
|
void |
setSubjectContextLookupStrategy(Function<org.opensaml.profile.context.ProfileRequestContext,SubjectContext> strategy)
Set the strategy used to locate the
SubjectContext associated with a given
AttributeResolutionContext. |
doResolve, getFailoverDataConnectorId, getLastFail, getLogPrefix, getNoRetryDelay, setFailoverDataConnectorId, setLastFail, setNoRetryDelaydoDestroy, equals, getActivationCondition, getDependencies, getProfileContextStrategy, hashCode, isPropagateResolutionExceptions, resolve, setActivationCondition, setDependencies, setProfileContextStrategy, setPropagateResolutionExceptionssetIdgetIddestroy, initialize, isDestroyed, isInitializedclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitgetActivationCondition, getDependencies, isPropagateResolutionExceptions, resolveinitialize, isInitializeddestroy, isDestroyedgetId@Nonnull public static final String RESULTS_STRING
@Nonnull private final org.slf4j.Logger log
@NonnullAfterInit private EvaluableScript script
@Nonnull private Function<AttributeResolutionContext,org.opensaml.profile.context.ProfileRequestContext> prcLookupStrategy
ProfileRequestContext to use.@Nonnull private Function<org.opensaml.profile.context.ProfileRequestContext,SubjectContext> scLookupStrategy
SubjectContext to use.@Nullable public Object getCustomObject()
@Nullable public void setCustomObject(Object object)
object - the custom object@NonnullAfterInit public EvaluableScript getScript()
public void setScript(@Nonnull EvaluableScript definitionScript)
definitionScript - the script to be evaluatedpublic void setProfileRequestContextLookupStrategy(@Nonnull Function<AttributeResolutionContext,org.opensaml.profile.context.ProfileRequestContext> strategy)
ProfileRequestContext associated with a given
AttributeResolutionContext.strategy - strategy used to locate the ProfileRequestContext associated with a given
AttributeResolutionContextpublic void setSubjectContextLookupStrategy(@Nonnull Function<org.opensaml.profile.context.ProfileRequestContext,SubjectContext> strategy)
SubjectContext associated with a given
AttributeResolutionContext.strategy - strategy used to locate the SubjectContext associated with a given
AttributeResolutionContextprotected void doInitialize()
throws ComponentInitializationException
doInitialize in class AbstractDataConnectorComponentInitializationException@Nonnull private ScriptContext getScriptContext(@Nonnull AttributeResolutionContext resolutionContext, @Nonnull AttributeResolverWorkContext workContext) throws ResolutionException
ScriptContext used when evaluating the script.resolutionContext - current resolution contextworkContext - current work contextResolutionException - thrown if dependent data connectors or attribute definitions can not be resolvedprivate void checkValues(IdPAttribute attribute)
attribute - the attribute to look atprivate Map<String,IdPAttribute> buildResult(ScriptContext context) throws ResolutionException
context - the Scripting context. We know that there is a variable inside called RESULTS_STRING.ResolutionException - if the output was "wrong".@Nullable protected Map<String,IdPAttribute> doDataConnectorResolve(@Nonnull AttributeResolutionContext resolutionContext, @Nonnull AttributeResolverWorkContext workContext) throws ResolutionException
doDataConnectorResolve in class AbstractDataConnectorResolutionExceptionCopyright © 1999–2017 Shibboleth Consortium. All rights reserved.