Class TemplatedExecutableSearchFilterBuilder
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.idp.attribute.resolver.dc.ldap.AbstractExecutableSearchFilterBuilder
net.shibboleth.idp.attribute.resolver.dc.ldap.TemplatedExecutableSearchFilterBuilder
- All Implemented Interfaces:
ExecutableSearchBuilder<ExecutableSearchFilter>,Component,DestructableComponent,InitializableComponent
An
ExecutableSearchBuilder that generates the search filter to
be executed by evaluating a Template against the currently resolved attributes within a
AttributeResolutionContext.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classEscapes LDAP attribute values added to the template context. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate org.apache.velocity.app.VelocityEngineVelocityEngine.private org.apache.velocity.app.event.ReferenceInsertionEventHandlerEvent handler used for escaping.private final org.slf4j.LoggerClass logger.private TemplateTemplate evaluated to generate a search filter.private StringTemplate (as Text) to be evaluated.private booleanDo we need to make ourself V2 Compatible? -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddExtraVelocityContext(org.apache.velocity.VelocityContext velocityContext, AttributeResolutionContext resolutionContext) Method to allow private additions to the velocity context.build(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 voidorg.apache.velocity.app.event.ReferenceInsertionEventHandlerGets theReferenceInsertionEventHandlerto be used.Gets the template to be evaluated.Gets the template text to be evaluated.org.apache.velocity.app.VelocityEngineGets theVelocityEngineto be used.booleanAre we in V2 Compatibility mode?protected Stringmerge(org.apache.velocity.VelocityContext context) InvokesTemplate.merge(org.apache.velocity.context.Context)on the supplied context.voidsetReferenceInsertionEventHandler(org.apache.velocity.app.event.ReferenceInsertionEventHandler handler) Sets theReferenceInsertionEventHandlerto be used.voidsetTemplateText(String velocityTemplate) Sets the template to be evaluated.voidsetV2Compatibility(boolean compat) What is out V2 Compatibility mode.voidsetVelocityEngine(org.apache.velocity.app.VelocityEngine velocityEngine) Sets theVelocityEngineto be used.Methods inherited from class net.shibboleth.idp.attribute.resolver.dc.ldap.AbstractExecutableSearchFilterBuilder
buildMethods 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. -
template
Template evaluated to generate a search filter. -
templateText
Template (as Text) to be evaluated. -
engine
VelocityEngine. -
eventHandler
private org.apache.velocity.app.event.ReferenceInsertionEventHandler eventHandlerEvent handler used for escaping. -
v2Compatibility
private boolean v2CompatibilityDo we need to make ourself V2 Compatible?
-
-
Constructor Details
-
TemplatedExecutableSearchFilterBuilder
public TemplatedExecutableSearchFilterBuilder()
-
-
Method Details
-
getTemplate
Gets the template to be evaluated.- Returns:
- the template
-
getTemplateText
Gets the template text to be evaluated.- Returns:
- the template text
-
setTemplateText
Sets the template to be evaluated.- Parameters:
velocityTemplate- template to be evaluated
-
getVelocityEngine
Gets theVelocityEngineto be used.- Returns:
- the velocity engine
-
setVelocityEngine
public void setVelocityEngine(org.apache.velocity.app.VelocityEngine velocityEngine) Sets theVelocityEngineto be used.- Parameters:
velocityEngine- engine to be used
-
getReferenceInsertionEventHandler
@Nullable public org.apache.velocity.app.event.ReferenceInsertionEventHandler getReferenceInsertionEventHandler()Gets theReferenceInsertionEventHandlerto be used.- Returns:
- the reference insertion event handler
-
setReferenceInsertionEventHandler
public void setReferenceInsertionEventHandler(@Nullable org.apache.velocity.app.event.ReferenceInsertionEventHandler handler) Sets theReferenceInsertionEventHandlerto be used.- Parameters:
handler- reference insertion event handler to be used
-
isV2Compatibility
public boolean isV2Compatibility()Are we in V2 Compatibility mode?- Returns:
- Returns the v2Compat.
-
setV2Compatibility
public void setV2Compatibility(boolean compat) What is out V2 Compatibility mode.- Parameters:
compat- The mode to set.
-
addExtraVelocityContext
protected void addExtraVelocityContext(@Nonnull org.apache.velocity.VelocityContext velocityContext, @Nonnull AttributeResolutionContext resolutionContext) Method to allow private additions to the velocity context.- Parameters:
velocityContext- where to add the informationresolutionContext- current resolution context
-
doInitialize
- Overrides:
doInitializein classAbstractInitializableComponent- Throws:
ComponentInitializationException
-
build
@Nonnull public ExecutableSearchFilter 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.- 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
-
merge
InvokesTemplate.merge(org.apache.velocity.context.Context)on the supplied context.- Parameters:
context- to merge- Returns:
- result of the merge operation
-