public class AuditDecorator extends AbstractHandlerAndFilterDecorator
Handler
and Filter
instances.
It triggers notifications (AuditEvent
) to an AuditSystem
sink.
Each AuditEvent
includes a source marker that will indicate that the event comes
from the decorated component.
Each notification includes a set of tags that helps the notification receiver to filter the events with simple matching rules. Here is the list of built-in tags:
Tag.request
: The event happens before the delegate Filter
/Handler
is calledTag.response
: The event happens after the delegate Filter
/Handler
was calledTag.completed
: The event happens when the exchange has been completely handled successfully
by the processing unit (always complements a Tag.response
tag)Tag.exception
: The event happens when the exchange has been handled with errors
by the processing unit (always complements a Tag.response
tag). Notice that this does not indicate that
the source heap object is the origin of the failure (it may or may not have thrown the exception itself).The user can add extra tags to the list of tags that decorates the notification, in order to help notification qualification:
"audit": "route-#1" // add a single tag to the decorated component
"audit": [ "super-tag", "route-#2" ] // add all of theses tags
"audit": boolean, object, ... // any other format will be ignored
Notice that the attribute name in the decorated object has to be the same as the decorator
heap object name (audit
in our example).
A default audit decorator is automatically created when OpenIG starts.
Tag
Modifier and Type | Field and Description |
---|---|
static String |
AUDIT_HEAP_KEY
Key to retrieve a
AuditDecorator instance from the Heap . |
Constructor and Description |
---|
AuditDecorator(AuditSystem auditSystem)
Builds a new AuditDecorator that will send events to the provided AuditSystem.
|
Modifier and Type | Method and Description |
---|---|
protected Filter |
decorateFilter(Filter delegate,
org.forgerock.json.fluent.JsonValue decoratorConfig,
Context context)
|
protected Handler |
decorateHandler(Handler delegate,
org.forgerock.json.fluent.JsonValue decoratorConfig,
Context context)
|
accepts, decorate
public static final String AUDIT_HEAP_KEY
AuditDecorator
instance from the Heap
.public AuditDecorator(AuditSystem auditSystem)
auditSystem
- AuditSystem reference (cannot be null
)protected Filter decorateFilter(Filter delegate, org.forgerock.json.fluent.JsonValue decoratorConfig, Context context) throws HeapException
AbstractHandlerAndFilterDecorator
decorateFilter
in class AbstractHandlerAndFilterDecorator
delegate
- Filter instance to be decorateddecoratorConfig
- the decorator configuration to applycontext
- contextual information of the decorated instanceHeapException
- when decoration failsprotected Handler decorateHandler(Handler delegate, org.forgerock.json.fluent.JsonValue decoratorConfig, Context context) throws HeapException
AbstractHandlerAndFilterDecorator
decorateHandler
in class AbstractHandlerAndFilterDecorator
delegate
- Handler instance to be decorateddecoratorConfig
- the decorator configuration to applycontext
- contextual information of the decorated instanceHeapException
- when decoration failsCopyright © 2014 ForgeRock AS. All rights reserved.