Class ScriptedSearchBuilder
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.idp.attribute.resolver.dc.scripted.impl.ScriptedSearchBuilder
- All Implemented Interfaces:
ExecutableSearchBuilder<ScriptedSearch>,Component,DestructableComponent,InitializableComponent
public class ScriptedSearchBuilder
extends AbstractInitializableComponent
implements ExecutableSearchBuilder<ScriptedSearch>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild(AttributeResolutionContext resolutionContext, Map<String, List<IdPAttributeValue>> dependencyAttributes) Creates an executable search that can be executed against a data source in order to produce results.protected voidGet the cache key template text to be evaluated.private StringgetResultCacheKey(AttributeResolutionContext resolutionContext, Map<String, List<IdPAttributeValue>> dependencyAttributes) Allow a user-provided cache key for this resolution.org.apache.velocity.app.VelocityEngineGet theVelocityEngineto be used.voidSet the cache key template to be evaluated.voidsetVelocityEngine(org.apache.velocity.app.VelocityEngine velocityEngine) Set theVelocityEngineto be used.Methods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitialized
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
engine
VelocityEngine. -
cacheKeyTemplate
Cache key template to be evaluated. -
cacheKeyTemplateText
Text of cache key template to be evaluated.
-
-
Constructor Details
-
ScriptedSearchBuilder
public ScriptedSearchBuilder()
-
-
Method Details
-
doInitialize
- Overrides:
doInitializein classAbstractInitializableComponent- Throws:
ComponentInitializationException
-
getVelocityEngine
Get theVelocityEngineto be used.- Returns:
- template engine
-
setVelocityEngine
public void setVelocityEngine(@Nonnull org.apache.velocity.app.VelocityEngine velocityEngine) Set theVelocityEngineto be used.- Parameters:
velocityEngine- engine to be used
-
getCacheKeyTemplateText
Get the cache key template text to be evaluated.- Returns:
- template text
-
setCacheKeyTemplateText
Set the cache key template to be evaluated.- Parameters:
text- template to be evaluated
-
build
@Nonnull public ScriptedSearch build(@Nonnull AttributeResolutionContext resolutionContext, @Nonnull Map<String, List<IdPAttributeValue>> dependencyAttributes) throws ResolutionExceptionCreates an executable search that can be executed against a data source in order to produce results.- Specified by:
buildin interfaceExecutableSearchBuilder<ScriptedSearch>- Parameters:
resolutionContext- current request contextdependencyAttributes- made available to the executable search- Returns:
- executable search
- Throws:
ResolutionException- throw if their is a problem creating the executable search
-
getResultCacheKey
@Nullable @NotEmpty private String getResultCacheKey(@Nonnull AttributeResolutionContext resolutionContext, @Nonnull Map<String, List<IdPAttributeValue>> dependencyAttributes) Allow a user-provided cache key for this resolution.- Parameters:
resolutionContext- theAttributeResolutionContextdependencyAttributes- the attributes,- Returns:
- They key or null if the user didn't specify one.
-