public abstract class AbstractHandlerAndFilterDecorator extends AbstractDecorator
Filter
and
Handler
.
Implementors just have to implement the dedicated decorateFilter(Filter, JsonValue, Context)
and decorateHandler(Handler, JsonValue, Context)
for decorating Filter and Handler respectively.
Modifier | Constructor and Description |
---|---|
protected |
AbstractHandlerAndFilterDecorator(String name)
Forces to give the name of the decorator.
|
Modifier and Type | Method and Description |
---|---|
boolean |
accepts(Class<?> type)
Returns
true if this decorator is compatible with the provided component type. |
Object |
decorate(Object delegate,
org.forgerock.json.JsonValue decoratorConfig,
Context context)
Decorates the provided
delegate instance with the provided decoratorConfig configuration. |
protected abstract org.forgerock.http.Filter |
decorateFilter(org.forgerock.http.Filter delegate,
org.forgerock.json.JsonValue decoratorConfig,
Context context)
Decorates the provided
delegate Filter instance with the provided decoratorConfig
configuration. |
protected abstract org.forgerock.http.Handler |
decorateHandler(org.forgerock.http.Handler delegate,
org.forgerock.json.JsonValue decoratorConfig,
Context context)
Decorates the provided
delegate Handler instance with the provided decoratorConfig
configuration. |
getLogger
protected AbstractHandlerAndFilterDecorator(String name)
name
- The name of the decorator.public boolean accepts(Class<?> type)
Decorator
true
if this decorator is compatible with the provided component type. Note that a return value
of true
does not necessarily indicate that decoration will be performed since it may also depend on other
factorstype
- type under testtrue
if the decorator can decorate instance of the given type, false
otherwise.public Object decorate(Object delegate, org.forgerock.json.JsonValue decoratorConfig, Context context) throws HeapException
Decorator
delegate
instance with the provided decoratorConfig
configuration.
The implementation should take care of not changing the base type of the delegate.delegate
- instance to be decorateddecoratorConfig
- the decorator configuration to applycontext
- contextual information of the decorated instanceHeapException
- when decoration failsprotected abstract org.forgerock.http.Filter decorateFilter(org.forgerock.http.Filter delegate, org.forgerock.json.JsonValue decoratorConfig, Context context) throws HeapException
delegate
Filter
instance with the provided decoratorConfig
configuration.delegate
- Filter instance to be decorateddecoratorConfig
- the decorator configuration to applycontext
- contextual information of the decorated instanceHeapException
- when decoration failsprotected abstract org.forgerock.http.Handler decorateHandler(org.forgerock.http.Handler delegate, org.forgerock.json.JsonValue decoratorConfig, Context context) throws HeapException
delegate
Handler
instance with the provided decoratorConfig
configuration.delegate
- Handler instance to be decorateddecoratorConfig
- the decorator configuration to applycontext
- contextual information of the decorated instanceHeapException
- when decoration failsCopyright © 2025 Open Identity Platform Community. All rights reserved.