This method allows a client to issue an audit record to the audit trail.
Syntax
void
audit
(
String
resourceClass
,
String
resourceID
,
String
action
,
Decision
decision
,
Map< String, Object >
attributes
) throws SecException
Parameters
-
resourceClass –
The resource class of the audit record. This string will be prepended by "client." in the audit trail to identify client-supplied audit records.
-
resourceID –
The resource ID
-
action –
The action being performed
-
decision –
The decision
-
attributes –
Any extra attributes to include in the audit request. The default audit record formatting logic specially handles classes such as java.util.Date, java.security.cert.X509Certificate, and most of the classes in the java.util.* collections framework.
Exceptions
-
SecException class –
If a critical error occurred while issuing the audit record. Depending on the configuration of the auditing system, failures to audit to a specific destination may not qualify.
-
IllegalArgumentException –
if a null resource class, resouce ID, action or decision are supplied
Usage
There is no guarantee that the record will actually be added to any of the configured audit destinations or that there are even any destinations configured. The client may wish to call
SecContext.isAuditEnabled
in order to determine if the audit record will actually be written. This can save some time building up extra attributes for the audit record.