The AuditHandler component is responsible for recording security-relevant events and data changes within a Strolch application.
An audit record contains:
READ, CREATE, UPDATE, DELETE).Auditing is usually handled automatically by the StrolchTransaction.
try (StrolchTransaction tx = agent.openTx(certificate, "MyAction", false)) {
// Operations here will be audited
tx.commitOnClose();
}
Auditing can be suppressed for a specific transaction:
try (StrolchTransaction tx = agent.openTx(certificate, "NonAuditedAction", false)) {
tx.suppressAudits();
// ...
}
The AuditHandler is configured in StrolchConfiguration.xml.
<Component>
<name>AuditHandler</name>
<api>li.strolch.handler.audits.AuditHandler</api>
<impl>li.strolch.handler.audits.AuditHandler</impl>
<depends>RealmHandler</depends>
</Component>