Class TemplatedExecutableSearchFilterBuilder
java.lang.Object
net.shibboleth.utilities.java.support.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
- Direct Known Subclasses:
V2CompatibleTemplatedExecutableSearchFilterBuilder
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 class
Escapes LDAP attribute values added to the template context. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate org.apache.velocity.app.VelocityEngine
VelocityEngine.private org.apache.velocity.app.event.ReferenceInsertionEventHandler
Event handler used for escaping.private final org.slf4j.Logger
Class logger.private Template
Template evaluated to generate a search filter.private String
Template (as Text) to be evaluated.private boolean
Do we need to make ourself V2 Compatible? -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addExtraVelocityContext
(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 void
org.apache.velocity.app.event.ReferenceInsertionEventHandler
Gets theReferenceInsertionEventHandler
to be used.Gets the template to be evaluated.Gets the template text to be evaluated.org.apache.velocity.app.VelocityEngine
Gets theVelocityEngine
to be used.boolean
Are we in V2 Compatibility mode?protected String
merge
(org.apache.velocity.VelocityContext context) InvokesTemplate.merge(org.apache.velocity.context.Context)
on the supplied context.void
setReferenceInsertionEventHandler
(org.apache.velocity.app.event.ReferenceInsertionEventHandler handler) Sets theReferenceInsertionEventHandler
to be used.void
setTemplateText
(String velocityTemplate) Sets the template to be evaluated.void
setV2Compatibility
(boolean compat) What is out V2 Compatibility mode.void
setVelocityEngine
(org.apache.velocity.app.VelocityEngine velocityEngine) Sets theVelocityEngine
to be used.Methods inherited from class net.shibboleth.idp.attribute.resolver.dc.ldap.AbstractExecutableSearchFilterBuilder
build
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, doDestroy, initialize, isDestroyed, isInitialized
-
Field Details
-
log
private final org.slf4j.Logger logClass logger. -
template
Template evaluated to generate a search filter. -
templateText
Template (as Text) to be evaluated. -
engine
private org.apache.velocity.app.VelocityEngine engineVelocityEngine. -
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 theVelocityEngine
to be used.- Returns:
- the velocity engine
-
setVelocityEngine
public void setVelocityEngine(org.apache.velocity.app.VelocityEngine velocityEngine) Sets theVelocityEngine
to be used.- Parameters:
velocityEngine
- engine to be used
-
getReferenceInsertionEventHandler
@Nullable public org.apache.velocity.app.event.ReferenceInsertionEventHandler getReferenceInsertionEventHandler()Gets theReferenceInsertionEventHandler
to be used.- Returns:
- the reference insertion event handler
-
setReferenceInsertionEventHandler
public void setReferenceInsertionEventHandler(@Nullable org.apache.velocity.app.event.ReferenceInsertionEventHandler handler) Sets theReferenceInsertionEventHandler
to 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
-
build
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
-
doInitialize
- Overrides:
doInitialize
in classAbstractInitializableComponent
- Throws:
ComponentInitializationException
-