Package de.xima.fc.audit
Interface AuditService
-
- All Known Implementing Classes:
AuditServiceImpl
public interface AuditServiceService for writing protocol (audit) entries. It offers onerecordmethod per kind of entry, distinguished by the input type — a system entry, a tenant entry, a form-version entry, or an (informational) form-record entry. Each entry is attributed to the actinguser; the referenced tenant, form version or form record is resolved internally from the ids carried by the input.The service only writes entries; it deliberately offers no read or query operations. It will grow further
recordoverloads over time (e.g. richer form-record entry kinds).- Since:
- 8.5.6
- Author:
- Norman Lorenz
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static AuditServicegetInstance()Retrieves the singleton instance of theAuditService.AuditEntryHandlerecord(FormRecordAuditEntry entry, User user)Writes an informational form-record protocol entry.AuditEntryHandlerecord(FormVersionAuditEntry entry, User user)Writes a tenant-scoped protocol entry tied to a form version.AuditEntryHandlerecord(SystemAuditEntry entry, User user)Writes a system protocol entry.AuditEntryHandlerecord(TenantAuditEntry entry, User user)Writes a tenant-scoped protocol entry.
-
-
-
Method Detail
-
getInstance
static AuditService getInstance()
Retrieves the singleton instance of theAuditService. This method uses CDI to obtain the instance.- Returns:
- the singleton instance of the
AuditService. - Since:
- 8.5.6
-
record
AuditEntryHandle record(SystemAuditEntry entry, User user) throws FcAuditException
Writes a system protocol entry.- Parameters:
entry- the entry to write. Must not benulland must carry a non-blank message.user- the acting user the entry is attributed to. Must not benull.- Returns:
- a handle to the created entry.
- Throws:
IllegalArgumentException- ifentryoruserisnull, or the message is blank.FcAuditException- if persistence fails.- Since:
- 8.5.6
-
record
AuditEntryHandle record(TenantAuditEntry entry, User user) throws FcAuditException
Writes a tenant-scoped protocol entry.- Parameters:
entry- the entry to write. Must not benulland must carry a tenant UUID and a non-blank message.user- the acting user the entry is attributed to. Must not benull.- Returns:
- a handle to the created entry.
- Throws:
IllegalArgumentException- ifentryoruserisnull, the tenant UUID isnull, or the message is blank.FcAuditException- if the tenant does not exist (AuditErrorType.NOT_FOUND) or persistence fails.- Since:
- 8.5.6
-
record
AuditEntryHandle record(FormVersionAuditEntry entry, User user) throws FcAuditException
Writes a tenant-scoped protocol entry tied to a form version. The owning tenant is resolved from the form version.- Parameters:
entry- the entry to write. Must not benulland must carry a non-blank message.user- the acting user the entry is attributed to. Must not benull.- Returns:
- a handle to the created entry.
- Throws:
IllegalArgumentException- ifentryoruserisnull, or the message is blank.FcAuditException- if the form version does not exist (AuditErrorType.NOT_FOUND) or persistence fails.- Since:
- 8.5.6
-
record
AuditEntryHandle record(FormRecordAuditEntry entry, User user) throws FcAuditException
Writes an informational form-record protocol entry. The form record, its project and owning tenant are resolved from the entry's process id.- Parameters:
entry- the entry to write. Must not benulland must carry a non-blank process id and message.user- the acting user the entry is attributed to. Must not benull.- Returns:
- a handle to the created entry.
- Throws:
IllegalArgumentException- ifentryoruserisnull, or the process id or message is blank.FcAuditException- if no form record exists for the process id (AuditErrorType.NOT_FOUND) or persistence fails.- Since:
- 8.5.6
-
-