November 2018
Intermediate to advanced
388 pages
9h 5m
English
We can also specify types of audit messages. We can choose to intercept the request based on its type:
@InterceptorBinding@Retention(RetentionPolicy.RUNTIME)@Documentedannotation class Auditable(val value: Auditor.AuditType)
The AuditType is defined in the Auditor class. We have defined CREATE, READ, UPDATE, and DELETE as audit types in this case:
class Auditor { fun audit(message: String) { println(message) } enum class AuditType () { CREATE, READ, UPDATE, DELETE }}
We might want to use the @Auditable annotation in cases where we need to perform an audit event based on the type of operation.
Let's say we are going to carry out an audit on the CREATE type:
@Statelessclass App { @Inject private lateinit ...Read now
Unlock full access