Interface FileAuditListener
- All Superinterfaces:
EventListener
- All Known Subinterfaces:
AgentAuditPolicy
- All Known Implementing Classes:
DefaultAgentAuditPolicy
The
FileAuditListener interface is implemented by objects that want to monitor and
optionally prevent file system access (read, write, create and delete) within the SNMP4J-Agent.
Implementations are notified before a file is read, written, created or deleted through the single
fileAudit(FileAuditEvent) method.
The fileAudit(FileAuditEvent) method acts both as an authorization hook and as an audit
hook: returning false denies (prevents) the corresponding file access, while returning
true allows it. Implementations may additionally write the audited FileAuditEvent
to a dedicated audit log.
This interface is the file system equivalent of the
TransportAuditListener used for transport level auditing.
- Since:
- 3.12.0
- Version:
- 3.12.0
- Author:
- Frank Fock
-
Method Summary
Modifier and TypeMethodDescriptionbooleanfileAudit(FileAuditEvent event) Audits a file system operation described by the providedFileAuditEventand decides whether the operation is permitted.
-
Method Details
-
fileAudit
Audits a file system operation described by the providedFileAuditEventand decides whether the operation is permitted.- Parameters:
event- theFileAuditEventdescribing the file operation to be audited.- Returns:
trueif the operation is permitted,falseto deny (prevent) it. The return value is ignored forFileAuditEvent.FileOperation.DELETEevents that report an already executed deletion.
-