Class AbstractAuditBackend
java.lang.Object
org.nuxeo.ecm.platform.audit.service.AbstractAuditBackend
- All Implemented Interfaces:
AuditAdmin
,AuditLogger
,AuditReader
,AuditStorage
,Logs
,AuditBackend
- Direct Known Subclasses:
DefaultAuditBackend
,ESAuditBackend
,MongoDBAuditBackend
Abstract class to share code between
AuditBackend
implementations- Author:
- tiry
-
Field Summary
Modifier and TypeFieldDescriptionprotected final NXAuditEventsService
protected final AuditBackendDescriptor
protected final ExpressionEvaluator
static final String
protected static final org.apache.logging.log4j.Logger
-
Constructor Summary
ModifierConstructorDescriptionprotected
protected
AbstractAuditBackend
(NXAuditEventsService component, AuditBackendDescriptor config) -
Method Summary
Modifier and TypeMethodDescriptionboolean
buildEntryFromEvent
(Event event) Returns a log entry representation of an event.protected LogEntry
doCreateAndFillEntryFromDocument
(DocumentModel doc, Principal principal) protected void
doPutExtendedInfos
(LogEntry entry, EventContext eventContext, DocumentModel source, Principal principal) protected long
doSyncNode
(BaseLogEntryProvider provider, CoreSession session, DocumentModel node, boolean recurs) Returns the list of auditable event names.long
getLatestLogId
(String repositoryId, String... eventIds) Returns the latest log id matching events and repository or 0 when no match found.getLogEntriesAfter
(long logIdOffset, int limit, String repositoryId, String... eventIds) Returns up to limit log entries matching events and repository with log id greater or equal to logIdOffset.protected DocumentModel
guardedDocument
(CoreSession session, DocumentRef reference) protected DocumentModelList
guardedDocumentChildren
(CoreSession session, DocumentRef reference) protected boolean
isAuditable
(EventBundle eventBundle) void
Deprecated.void
logEvents
(EventBundle bundle) Deprecated.abstract ExtendedInfo
newExtendedInfo
(Serializable value) Create a new ExtendedInfo instanceCreate a new LogEntry instance.protected void
populateExtendedInfo
(LogEntry entry, DocumentModel source, ExpressionContext context, Collection<ExtendedInfoDescriptor> extInfos) queryLogsByPage
(String[] eventIds, Date limit, String[] categories, String path, int pageNb, int pageSize) void
restore
(AuditStorage auditStorage, int batchSize, int keepAlive) Restore the backend from the givenAuditStorage
protected long
syncLogCreationEntries
(BaseLogEntryProvider provider, String repoId, String path, Boolean recurs) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.nuxeo.ecm.platform.audit.api.AuditAdmin
getEventsCount, syncLogCreationEntries
Methods inherited from interface org.nuxeo.ecm.platform.audit.service.AuditBackend
getApplicationStartedOrder, onApplicationStarted, onApplicationStopped
Methods inherited from interface org.nuxeo.ecm.platform.audit.api.AuditLogger
addLogEntries
Methods inherited from interface org.nuxeo.ecm.platform.audit.api.AuditReader
getLogEntriesFor, getLogEntryByID, nativeQuery, nativeQuery, nativeQueryLogs, queryLogs, queryLogs, queryLogsByPage, queryLogsByPage, queryLogsByPage
Methods inherited from interface org.nuxeo.ecm.platform.audit.api.AuditStorage
append, scroll, scroll
-
Field Details
-
log
protected static final org.apache.logging.log4j.Logger log -
FORCE_AUDIT_FACET
- See Also:
-
component
-
config
-
expressionEvaluator
-
-
Constructor Details
-
AbstractAuditBackend
-
AbstractAuditBackend
protected AbstractAuditBackend()
-
-
Method Details
-
guardedDocument
-
guardedDocumentChildren
-
doCreateAndFillEntryFromDocument
-
doPutExtendedInfos
protected void doPutExtendedInfos(LogEntry entry, EventContext eventContext, DocumentModel source, Principal principal) -
populateExtendedInfo
protected void populateExtendedInfo(LogEntry entry, DocumentModel source, ExpressionContext context, Collection<ExtendedInfoDescriptor> extInfos) - Since:
- 7.4
-
getAuditableEventNames
Description copied from interface:AuditLogger
Returns the list of auditable event names.- Specified by:
getAuditableEventNames
in interfaceAuditLogger
- Returns:
- list of String representing event names.
-
buildEntryFromEvent
Description copied from interface:AuditLogger
Returns a log entry representation of an event.- Specified by:
buildEntryFromEvent
in interfaceAuditLogger
-
newLogEntry
Description copied from interface:AuditLogger
Create a new LogEntry instance.- Specified by:
newLogEntry
in interfaceAuditLogger
-
newExtendedInfo
Description copied from interface:AuditLogger
Create a new ExtendedInfo instance- Specified by:
newExtendedInfo
in interfaceAuditLogger
-
syncLogCreationEntries
protected long syncLogCreationEntries(BaseLogEntryProvider provider, String repoId, String path, Boolean recurs) -
doSyncNode
protected long doSyncNode(BaseLogEntryProvider provider, CoreSession session, DocumentModel node, boolean recurs) -
logEvents
Deprecated.Description copied from interface:AuditLogger
Logs a bundle of events- Specified by:
logEvents
in interfaceAuditLogger
-
isAuditable
-
logEvent
Deprecated.Description copied from interface:AuditLogger
Logs an Event.- Specified by:
logEvent
in interfaceAuditLogger
-
await
- Specified by:
await
in interfaceAuditLogger
- Throws:
InterruptedException
-
queryLogsByPage
public List<LogEntry> queryLogsByPage(String[] eventIds, Date limit, String[] categories, String path, int pageNb, int pageSize) - Specified by:
queryLogsByPage
in interfaceAuditReader
-
getLatestLogId
Description copied from interface:AuditReader
Returns the latest log id matching events and repository or 0 when no match found.- Specified by:
getLatestLogId
in interfaceAuditReader
-
getLogEntriesAfter
public List<LogEntry> getLogEntriesAfter(long logIdOffset, int limit, String repositoryId, String... eventIds) Description copied from interface:AuditReader
Returns up to limit log entries matching events and repository with log id greater or equal to logIdOffset.- Specified by:
getLogEntriesAfter
in interfaceAuditReader
-
restore
Description copied from interface:AuditBackend
Restore the backend from the givenAuditStorage
- Specified by:
restore
in interfaceAuditBackend
- Parameters:
auditStorage
- the audit storagebatchSize
- the batch sizekeepAlive
- the keep alive duration
-