Package org.nuxeo.audit.sql
Class SQLAuditBackend
java.lang.Object
org.nuxeo.ecm.platform.audit.service.AbstractAuditBackend<LogEntry>
org.nuxeo.audit.service.AbstractAuditBackend
org.nuxeo.audit.sql.SQLAuditBackend
- All Implemented Interfaces:
AuditBackend
,AuditAdmin
,AuditLogger<LogEntry>
,AuditReader<LogEntry>
,AuditStorage
,Logs<LogEntry>
,AuditBackend<LogEntry>
- Since:
- 2025.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.nuxeo.audit.service.AuditBackend
AuditBackend.Capability
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final DefaultAuditBackend
protected static final LogEntryImplToLogEntry
protected static final LogEntryToLogEntryImpl
Fields inherited from class org.nuxeo.audit.service.AbstractAuditBackend
log
Fields inherited from class org.nuxeo.ecm.platform.audit.service.AbstractAuditBackend
component, config, expressionEvaluator, FORCE_AUDIT_FACET
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addLogEntries
(List<LogEntry> entries) Adds given log entries.void
protected void
INTERNAL METHOD FOR TESTS, DO NOT USE.protected void
int
getEventsCount
(String eventId) getLogEntryByID
(long id) Returns a given log entry given its id.boolean
hasCapability
(AuditBackend.Capability capability) Checks whether the backend has the capability.List
<?> nativeQuery
(String query, Map<String, Object> params, int pageNb, int pageSize) Returns a batched list of entries.nativeQueryLogs
(String whereClause, int pageNb, int pageSize) Returns a batched list of log entries.newExtendedInfo
(Serializable value) Create a new ExtendedInfo instancevoid
void
queryLogs
(QueryBuilder builder) Returns the logs given a collection of predicates and a default sort.scroll
(QueryBuilder queryBuilder, int batchSize, int keepAliveSeconds) long
syncLogCreationEntries
(String repoId, String path, Boolean recurs) Forces log Synchronisation for a branch of the repository.Methods inherited from class org.nuxeo.audit.service.AbstractAuditBackend
doCreateAndFillEntryFromDocument
Methods inherited from class org.nuxeo.ecm.platform.audit.service.AbstractAuditBackend
await, buildEntryFromEvent, doPutExtendedInfos, doSyncNode, getAuditableEventNames, guardedDocument, guardedDocumentChildren, isAuditable, newLogEntry, populateExtendedInfo, restore, syncLogCreationEntries
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.nuxeo.audit.service.AuditBackend
getLatestLogId, getLogEntriesFor
Methods inherited from interface org.nuxeo.ecm.platform.audit.service.AuditBackend
restore
Methods inherited from interface org.nuxeo.ecm.platform.audit.api.AuditLogger
await, buildEntryFromEvent, getAuditableEventNames, newLogEntry
Methods inherited from interface org.nuxeo.ecm.platform.audit.api.AuditReader
getLogEntriesAfter, nativeQuery, queryLogs, queryLogsByPage, queryLogsByPage, queryLogsByPage, queryLogsByPage
-
Field Details
-
FROM_LOG_ENTRY_SQL_MAPPER
-
TO_LOG_ENTRY_SQL_MAPPER
-
backend
-
-
Constructor Details
-
SQLAuditBackend
public SQLAuditBackend()
-
-
Method Details
-
newExtendedInfo
Description copied from interface:AuditLogger
Create a new ExtendedInfo instance- Specified by:
newExtendedInfo
in interfaceAuditLogger<LogEntry>
- Overrides:
newExtendedInfo
in classAbstractAuditBackend
-
addLogEntries
Description copied from interface:AuditBackend
Adds given log entries.- Parameters:
entries
- the list of log entries.
-
append
- Specified by:
append
in interfaceAuditStorage
- Overrides:
append
in classAbstractAuditBackend
-
scroll
- Specified by:
scroll
in interfaceAuditStorage
- Overrides:
scroll
in classAbstractAuditBackend
-
scroll
- Specified by:
scroll
in interfaceAuditStorage
- Overrides:
scroll
in classAbstractAuditBackend
-
getApplicationStartedOrder
public int getApplicationStartedOrder()- Specified by:
getApplicationStartedOrder
in interfaceAuditBackend<LogEntry>
- Overrides:
getApplicationStartedOrder
in classAbstractAuditBackend
-
onApplicationStarted
public void onApplicationStarted()- Specified by:
onApplicationStarted
in interfaceAuditBackend<LogEntry>
- Overrides:
onApplicationStarted
in classAbstractAuditBackend
-
onApplicationStopped
public void onApplicationStopped()- Specified by:
onApplicationStopped
in interfaceAuditBackend<LogEntry>
- Overrides:
onApplicationStopped
in classAbstractAuditBackend
-
syncLogCreationEntries
Description copied from interface:AuditAdmin
Forces log Synchronisation for a branch of the repository. This can be useful to add the create entries if DB was initialized from a bulk import.- Specified by:
syncLogCreationEntries
in interfaceAuditAdmin
- Overrides:
syncLogCreationEntries
in classAbstractAuditBackend
-
getEventsCount
-
getLogEntryByID
Description copied from interface:AuditBackend
Returns a given log entry given its id.- Parameters:
id
- the log entry identifier- Returns:
- a LogEntry instance
-
queryLogs
Description copied from interface:AuditBackend
Returns the logs given a collection of predicates and a default sort.- Parameters:
builder
- the query builder to fetch log entries- Returns:
- a list of log entries
-
hasCapability
Description copied from interface:AuditBackend
Checks whether the backend has the capability. -
nativeQueryLogs
Description copied from interface:AuditReader
Returns a batched list of log entries. WhereClause is a native where clause for the backend: here EJBQL 3.0 must be used if implementation of audit backend is JPA (< 7.3 or audit.elasticsearch.enabled=false) and JSON if implementation is Elasticsearch. -
nativeQuery
Description copied from interface:AuditReader
Returns a batched list of entries.- Parameters:
query
- a JPA query language query if implementation of audit backend is JPA (< 7.3 or audit.elasticsearch.enabled=false) and JSON if implementation is Elasticsearchparams
- parameters for the querypageNb
- the page number (starts at 1)pageSize
- the number of results per page
-
clearEntries
protected void clearEntries()Description copied from class:AbstractAuditBackend
INTERNAL METHOD FOR TESTS, DO NOT USE.- Overrides:
clearEntries
in classAbstractAuditBackend
-
doClearEntries
protected void doClearEntries() -
getLoggedEventIds
-