Package org.nuxeo.audit.mem
Class MemAuditBackend
java.lang.Object
org.nuxeo.ecm.platform.audit.service.AbstractAuditBackend<LogEntry>
org.nuxeo.audit.service.AbstractAuditBackend
org.nuxeo.audit.mem.MemAuditBackend
- 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 org.apache.commons.collections4.queue.CircularFifoQueue
<LogEntry> protected final AtomicLong
protected static final com.fasterxml.jackson.databind.ObjectMapper
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.protected void
INTERNAL METHOD FOR TESTS, DO NOT USE.protected int
protected Object
convertToLiteralsJavaType
(Object leftValue) protected Comparator
<LogEntry> createComparator
(OrderByExpr queryOrder) protected Comparator
<LogEntry> createComparator
(OrderByList queryOrders) createPredicate
(Predicate queryPredicate) 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.mapJsonContent
(Map<String, Object> extended) List
<?> nativeQuery
(String query, Map<String, Object> params, int pageNb, int pageSize) Returns a batched list of entries.queryLogs
(QueryBuilder builder) Returns the logs given a collection of predicates and a default sort.Methods inherited from class org.nuxeo.audit.service.AbstractAuditBackend
append, doCreateAndFillEntryFromDocument, getApplicationStartedOrder, newExtendedInfo, onApplicationStarted, onApplicationStopped, scroll, scroll, syncLogCreationEntries
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, nativeQueryLogs, queryLogs, queryLogsByPage, queryLogsByPage, queryLogsByPage, queryLogsByPage
-
Field Details
-
MAPPER
protected static final com.fasterxml.jackson.databind.ObjectMapper MAPPER -
entries
-
idCounter
-
-
Constructor Details
-
MemAuditBackend
public MemAuditBackend()
-
-
Method Details
-
getEventsCount
-
addLogEntries
Description copied from interface:AuditBackend
Adds given log entries.- Parameters:
entries
- the list of log entries.
-
mapJsonContent
-
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
-
createPredicate
-
compare
-
convertToLiteralsJavaType
-
createComparator
-
createComparator
-
hasCapability
Description copied from interface:AuditBackend
Checks whether the backend has the capability. -
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
-