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 DefaultAuditBackendprotected static final LogEntryImplToLogEntryprotected static final LogEntryToLogEntryImplFields inherited from class org.nuxeo.audit.service.AbstractAuditBackend
logFields inherited from class org.nuxeo.ecm.platform.audit.service.AbstractAuditBackend
component, config, expressionEvaluator, FORCE_AUDIT_FACET -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddLogEntries(List<LogEntry> entries) Adds given log entries.voidprotected voidINTERNAL METHOD FOR TESTS, DO NOT USE.protected voidintgetEventsCount(String eventId) getLogEntryByID(long id) Returns a given log entry given its id.booleanhasCapability(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 instancevoidvoidqueryLogs(QueryBuilder builder) Returns the logs given a collection of predicates and a default sort.scroll(QueryBuilder queryBuilder, int batchSize, int keepAliveSeconds) longsyncLogCreationEntries(String repoId, String path, Boolean recurs) Forces log Synchronisation for a branch of the repository.Methods inherited from class org.nuxeo.audit.service.AbstractAuditBackend
doCreateAndFillEntryFromDocumentMethods inherited from class org.nuxeo.ecm.platform.audit.service.AbstractAuditBackend
await, buildEntryFromEvent, doPutExtendedInfos, doSyncNode, getAuditableEventNames, guardedDocument, guardedDocumentChildren, isAuditable, newLogEntry, populateExtendedInfo, restore, syncLogCreationEntriesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.nuxeo.audit.service.AuditBackend
getLatestLogId, getLogEntriesForMethods inherited from interface org.nuxeo.ecm.platform.audit.service.AuditBackend
restoreMethods inherited from interface org.nuxeo.ecm.platform.audit.api.AuditLogger
await, buildEntryFromEvent, getAuditableEventNames, newLogEntryMethods 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:AuditLoggerCreate a new ExtendedInfo instance- Specified by:
newExtendedInfoin interfaceAuditLogger<LogEntry>- Overrides:
newExtendedInfoin classAbstractAuditBackend
-
addLogEntries
Description copied from interface:AuditBackendAdds given log entries.- Parameters:
entries- the list of log entries.
-
append
- Specified by:
appendin interfaceAuditStorage- Overrides:
appendin classAbstractAuditBackend
-
scroll
- Specified by:
scrollin interfaceAuditStorage- Overrides:
scrollin classAbstractAuditBackend
-
scroll
- Specified by:
scrollin interfaceAuditStorage- Overrides:
scrollin classAbstractAuditBackend
-
getApplicationStartedOrder
public int getApplicationStartedOrder()- Specified by:
getApplicationStartedOrderin interfaceAuditBackend<LogEntry>- Overrides:
getApplicationStartedOrderin classAbstractAuditBackend
-
onApplicationStarted
public void onApplicationStarted()- Specified by:
onApplicationStartedin interfaceAuditBackend<LogEntry>- Overrides:
onApplicationStartedin classAbstractAuditBackend
-
onApplicationStopped
public void onApplicationStopped()- Specified by:
onApplicationStoppedin interfaceAuditBackend<LogEntry>- Overrides:
onApplicationStoppedin classAbstractAuditBackend
-
syncLogCreationEntries
Description copied from interface:AuditAdminForces 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:
syncLogCreationEntriesin interfaceAuditAdmin- Overrides:
syncLogCreationEntriesin classAbstractAuditBackend
-
getEventsCount
-
getLogEntryByID
Description copied from interface:AuditBackendReturns a given log entry given its id.- Parameters:
id- the log entry identifier- Returns:
- a LogEntry instance
-
queryLogs
Description copied from interface:AuditBackendReturns 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:AuditBackendChecks whether the backend has the capability. -
nativeQueryLogs
Description copied from interface:AuditReaderReturns 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:AuditReaderReturns 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:AbstractAuditBackendINTERNAL METHOD FOR TESTS, DO NOT USE.- Overrides:
clearEntriesin classAbstractAuditBackend
-
doClearEntries
protected void doClearEntries() -
getLoggedEventIds
-