ResolvedType - object type this plug-in resolves to@ThreadSafe public abstract class AbstractResolverPlugin<ResolvedType> extends AbstractIdentifiableInitializableComponent implements ResolverPlugin<ResolvedType>, org.springframework.beans.factory.DisposableBean
ResolverPlugins.| Modifier and Type | Field and Description |
|---|---|
private com.google.common.base.Predicate<ProfileRequestContext> |
activationCondition
Criterion that must be met for this plugin to be active for the given request.
|
private Set<ResolverPluginDependency> |
dependencies
IDs of the
ResolverPlugins this plug-in depends on. |
private org.slf4j.Logger |
log
Class logger.
|
private com.google.common.base.Function<AttributeResolutionContext,ProfileRequestContext> |
profileContextStrategy
Strategy to get the
ProfileRequestContext. |
private boolean |
propagateResolutionExceptions
Whether an
AttributeResolutionContext that occurred resolving attributes will be re-thrown. |
| Constructor and Description |
|---|
AbstractResolverPlugin() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doDestroy() |
protected void |
doInitialize() |
protected abstract ResolvedType |
doResolve(AttributeResolutionContext resolutionContext,
AttributeResolverWorkContext workContext)
Perform the actual resolution.
|
boolean |
equals(Object obj) |
com.google.common.base.Predicate<ProfileRequestContext> |
getActivationCondition()
Get the predicate which defines whether this plugin is active for a given request.
|
Set<ResolverPluginDependency> |
getDependencies()
Gets the unmodifiable list of dependencies for this plugin.
|
com.google.common.base.Function<AttributeResolutionContext,ProfileRequestContext> |
getProfileContextStrategy()
Gets the mechanism to find out the
ProfileRequestContext. |
int |
hashCode() |
boolean |
isPropagateResolutionExceptions()
Get whether a
ResolutionException that occurred resolving attributes will be re-thrown. |
ResolvedType |
resolve(AttributeResolutionContext resolutionContext)
Performs the attribute resolution for this plugin.
|
void |
setActivationCondition(com.google.common.base.Predicate<ProfileRequestContext> pred)
Sets the predicate which defines whether this plugin is active for a given request.
|
void |
setDependencies(Set<ResolverPluginDependency> pluginDependencies)
Sets the list of dependencies for this plugin.
|
void |
setProfileContextStrategy(com.google.common.base.Function<AttributeResolutionContext,ProfileRequestContext> strategy)
Sets the mechanism to find out the
ProfileRequestContext. |
void |
setPropagateResolutionExceptions(boolean propagate)
Set whether an
AttributeResolutionContext that occurred resolving attributes will be re-thrown. |
private boolean |
startTimer(AttributeResolutionContext resolutionContext)
Conditionally start a timer at the beginning of the resolution process.
|
private void |
stopTimer(AttributeResolutionContext resolutionContext)
Conditionally stop a timer at the end of the resolution process.
|
setIdgetIddestroy, initialize, isDestroyed, isInitializedclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitinitialize, isInitializeddestroy, isDestroyedgetId@Nonnull private final org.slf4j.Logger log
private boolean propagateResolutionExceptions
AttributeResolutionContext that occurred resolving attributes will be re-thrown.@Nonnull private com.google.common.base.Function<AttributeResolutionContext,ProfileRequestContext> profileContextStrategy
ProfileRequestContext.@Nullable private com.google.common.base.Predicate<ProfileRequestContext> activationCondition
@Nonnull @NonnullElements private Set<ResolverPluginDependency> dependencies
ResolverPlugins this plug-in depends on.public boolean isPropagateResolutionExceptions()
ResolutionException that occurred resolving attributes will be re-thrown. Doing so
will cause the entire attribute resolution request to fail.isPropagateResolutionExceptions in interface ResolverPlugin<ResolvedType>ResolutionExceptions are propagated, false if notpublic void setPropagateResolutionExceptions(boolean propagate)
AttributeResolutionContext that occurred resolving attributes will be re-thrown. Doing so
will cause the entire attribute resolution request to fail.propagate - true if ResolutionExceptions are propagated, false if notpublic void setProfileContextStrategy(com.google.common.base.Function<AttributeResolutionContext,ProfileRequestContext> strategy)
ProfileRequestContext.strategy - the mechanismpublic com.google.common.base.Function<AttributeResolutionContext,ProfileRequestContext> getProfileContextStrategy()
ProfileRequestContext.@Nullable public com.google.common.base.Predicate<ProfileRequestContext> getActivationCondition()
getActivationCondition in interface ResolverPlugin<ResolvedType>public void setActivationCondition(@Nonnull com.google.common.base.Predicate<ProfileRequestContext> pred)
pred - what to set@Nonnull @NonnullElements @Unmodifiable public Set<ResolverPluginDependency> getDependencies()
getDependencies in interface ResolverPlugin<ResolvedType>public void setDependencies(@Nullable@NullableElements Set<ResolverPluginDependency> pluginDependencies)
pluginDependencies - unmodifiable list of dependencies for this plugin@Nullable public final ResolvedType resolve(@Nonnull AttributeResolutionContext resolutionContext) throws ResolutionException
This method first checks to see if this plugin has been initialized and has not be destroyed. Then it checks if
the plugins activation criterion has been met. Finally it delegates to
doResolve(AttributeResolutionContext, AttributeResolverWorkContext). If an exception is thrown and
isPropagateResolutionExceptions() is false the exception is logged but not re-thrown, otherwise it is
re-thrown.
resolve in interface ResolverPlugin<ResolvedType>resolutionContext - current attribute resolution contextResolutionException - thrown if there was a problem resolving the attributesprotected void doDestroy()
doDestroy in class AbstractInitializableComponentprotected void doInitialize()
throws ComponentInitializationException
doInitialize in class AbstractIdentifiedInitializableComponentComponentInitializationException@Nullable protected abstract ResolvedType doResolve(@Nonnull AttributeResolutionContext resolutionContext, @Nonnull AttributeResolverWorkContext workContext) throws ResolutionException
resolutionContext - current resolution contextworkContext - child context where intermediate results are trackedResolutionException - thrown if there is a problem resolving the attributesresolve(AttributeResolutionContext)private boolean startTimer(@Nonnull AttributeResolutionContext resolutionContext)
resolutionContext - attribute resolution contextstopTimer(AttributeResolutionContext) method needs to be calledprivate void stopTimer(@Nonnull AttributeResolutionContext resolutionContext)
resolutionContext - attribute resolution contextCopyright © 1999–2018 Shibboleth Consortium. All rights reserved.