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
FieldsModifier and TypeFieldDescriptionprotected final NXAuditEventsServiceprotected final AuditBackendDescriptorprotected final ExpressionEvaluatorstatic final Stringprotected static final org.apache.logging.log4j.Logger -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedAbstractAuditBackend(NXAuditEventsService component, AuditBackendDescriptor config) -
Method Summary
Modifier and TypeMethodDescriptionbooleanbuildEntryFromEvent(Event event) Returns a log entry representation of an event.protected LogEntrydoCreateAndFillEntryFromDocument(DocumentModel doc, Principal principal) protected voiddoPutExtendedInfos(LogEntry entry, EventContext eventContext, DocumentModel source, Principal principal) protected longdoSyncNode(BaseLogEntryProvider provider, CoreSession session, DocumentModel node, boolean recurs) Returns the list of auditable event names.longgetLatestLogId(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 DocumentModelguardedDocument(CoreSession session, DocumentRef reference) protected DocumentModelListguardedDocumentChildren(CoreSession session, DocumentRef reference) protected booleanisAuditable(EventBundle eventBundle) voidDeprecated.voidlogEvents(EventBundle bundle) Deprecated.abstract ExtendedInfonewExtendedInfo(Serializable value) Create a new ExtendedInfo instanceCreate a new LogEntry instance.protected voidpopulateExtendedInfo(LogEntry entry, DocumentModel source, ExpressionContext context, Collection<ExtendedInfoDescriptor> extInfos) queryLogsByPage(String[] eventIds, Date limit, String[] categories, String path, int pageNb, int pageSize) voidrestore(AuditStorage auditStorage, int batchSize, int keepAlive) Restore the backend from the givenAuditStorageprotected longsyncLogCreationEntries(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, waitMethods inherited from interface org.nuxeo.ecm.platform.audit.api.AuditAdmin
getEventsCount, syncLogCreationEntriesMethods inherited from interface org.nuxeo.ecm.platform.audit.service.AuditBackend
getApplicationStartedOrder, onApplicationStarted, onApplicationStoppedMethods inherited from interface org.nuxeo.ecm.platform.audit.api.AuditLogger
addLogEntriesMethods inherited from interface org.nuxeo.ecm.platform.audit.api.AuditReader
getLogEntriesFor, getLogEntryByID, nativeQuery, nativeQuery, nativeQueryLogs, queryLogs, queryLogs, queryLogsByPage, queryLogsByPage, queryLogsByPageMethods 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:AuditLoggerReturns the list of auditable event names.- Specified by:
getAuditableEventNamesin interfaceAuditLogger- Returns:
- list of String representing event names.
-
buildEntryFromEvent
Description copied from interface:AuditLoggerReturns a log entry representation of an event.- Specified by:
buildEntryFromEventin interfaceAuditLogger
-
newLogEntry
Description copied from interface:AuditLoggerCreate a new LogEntry instance.- Specified by:
newLogEntryin interfaceAuditLogger
-
newExtendedInfo
Description copied from interface:AuditLoggerCreate a new ExtendedInfo instance- Specified by:
newExtendedInfoin 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:AuditLoggerLogs a bundle of events- Specified by:
logEventsin interfaceAuditLogger
-
isAuditable
-
logEvent
Deprecated.Description copied from interface:AuditLoggerLogs an Event.- Specified by:
logEventin interfaceAuditLogger
-
await
- Specified by:
awaitin interfaceAuditLogger- Throws:
InterruptedException
-
queryLogsByPage
public List<LogEntry> queryLogsByPage(String[] eventIds, Date limit, String[] categories, String path, int pageNb, int pageSize) - Specified by:
queryLogsByPagein interfaceAuditReader
-
getLatestLogId
Description copied from interface:AuditReaderReturns the latest log id matching events and repository or 0 when no match found.- Specified by:
getLatestLogIdin interfaceAuditReader
-
getLogEntriesAfter
public List<LogEntry> getLogEntriesAfter(long logIdOffset, int limit, String repositoryId, String... eventIds) Description copied from interface:AuditReaderReturns up to limit log entries matching events and repository with log id greater or equal to logIdOffset.- Specified by:
getLogEntriesAfterin interfaceAuditReader
-
restore
Description copied from interface:AuditBackendRestore the backend from the givenAuditStorage- Specified by:
restorein interfaceAuditBackend- Parameters:
auditStorage- the audit storagebatchSize- the batch sizekeepAlive- the keep alive duration
-