public class CaptureDecorator extends AbstractHandlerAndFilterDecorator
Filter
and Handler
instances. It enables
the user to see the messages coming in and out of the decorated object.
Multiple input/output can be intercepted:
CapturePoint.ALL
: Prints all of the messagesCapturePoint.FILTERED_REQUEST
: Prints the outgoing request (Filter only)CapturePoint.FILTERED_RESPONSE
: Prints the outgoing responseCapturePoint.REQUEST
: Prints incoming + outgoing requestCapturePoint.RESPONSE
: Prints incoming + outgoing response
{
"name": "capture",
"type": "CaptureDecorator",
"config": {
"captureEntity": false,
"captureContext": false
}
}
The capture decorator can be configured to globally enable entity capture using the captureEntity
boolean attribute (default to false
).
To capture the context at the capture point as well, use the captureContext boolean attribute
(default to false
).
To decorate a component, just add the decorator declaration next to the config
element:
{
"type": "...",
"capture": [ "FILTERED_REQUEST", "RESPONSE" ],
"config": { ... }
}
Notice that the attribute name in the decorated object has to be the same as the decorator
heap object name (capture
in our example).
A default capture decorator is automatically created when OpenIG starts. It can be overridden
in the configuration files if default values are not satisfying.Modifier and Type | Class and Description |
---|---|
static class |
CaptureDecorator.Heaplet
Creates and initializes a CaptureDecorator in a heap environment.
|
Constructor and Description |
---|
CaptureDecorator(String name,
boolean captureEntity,
boolean captureContext)
Builds a new
capture decorator. |
Modifier and Type | Method and Description |
---|---|
protected 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 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. |
accepts, decorate
getLogger
public CaptureDecorator(String name, boolean captureEntity, boolean captureContext)
capture
decorator.name
- The name of this decoratorcaptureEntity
- true
if the decorator needs to capture the entity,
false
otherwisecaptureContext
- true
if the decorator needs to capture the context,
false
otherwiseprotected org.forgerock.http.Filter decorateFilter(org.forgerock.http.Filter delegate, org.forgerock.json.JsonValue decoratorConfig, Context context) throws HeapException
AbstractHandlerAndFilterDecorator
delegate
Filter
instance with the provided decoratorConfig
configuration.decorateFilter
in class AbstractHandlerAndFilterDecorator
delegate
- Filter instance to be decorateddecoratorConfig
- the decorator configuration to applycontext
- contextual information of the decorated instanceHeapException
- when decoration failsprotected org.forgerock.http.Handler decorateHandler(org.forgerock.http.Handler delegate, org.forgerock.json.JsonValue decoratorConfig, Context context) throws HeapException
AbstractHandlerAndFilterDecorator
delegate
Handler
instance with the provided decoratorConfig
configuration.decorateHandler
in class AbstractHandlerAndFilterDecorator
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.