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
public abstract class AbstractAuditBackend extends Object implements AuditBackend, AuditStorage
Abstract class to share code betweenAuditBackendimplementations- Author:
- tiry
-
-
Field Summary
Fields Modifier and Type Field Description protected NXAuditEventsServicecomponentprotected AuditBackendDescriptorconfigprotected ExpressionEvaluatorexpressionEvaluatorstatic StringFORCE_AUDIT_FACETprotected static org.apache.logging.log4j.Loggerlog
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractAuditBackend()protectedAbstractAuditBackend(NXAuditEventsService component, AuditBackendDescriptor config)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanawait(long time, TimeUnit unit)LogEntrybuildEntryFromEvent(Event event)Returns a log entry representation of an event.protected Predicateconvert(FilterMapEntry entry)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)Set<String>getAuditableEventNames()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.List<LogEntry>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.List<LogEntry>getLogEntriesFor(String uuid, Map<String,FilterMapEntry> filterMap, boolean doDefaultSort)Deprecated.protected DocumentModelguardedDocument(CoreSession session, DocumentRef reference)protected DocumentModelListguardedDocumentChildren(CoreSession session, DocumentRef reference)protected booleanisAuditable(EventBundle eventBundle)voidlogEvent(Event event)Deprecated.voidlogEvents(EventBundle bundle)Deprecated.abstract ExtendedInfonewExtendedInfo(Serializable value)Create a new ExtendedInfo instanceLogEntrynewLogEntry()Create a new LogEntry instance.protected voidpopulateExtendedInfo(LogEntry entry, DocumentModel source, ExpressionContext context, Collection<ExtendedInfoDescriptor> extInfos)List<LogEntry>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, 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, onShutdown
-
Methods inherited from interface org.nuxeo.ecm.platform.audit.api.AuditLogger
addLogEntries
-
Methods inherited from interface org.nuxeo.ecm.platform.audit.api.AuditReader
getLogEntriesFor, 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 Detail
-
log
protected static final org.apache.logging.log4j.Logger log
-
FORCE_AUDIT_FACET
public static final String FORCE_AUDIT_FACET
- See Also:
- Constant Field Values
-
component
protected final NXAuditEventsService component
-
config
protected final AuditBackendDescriptor config
-
expressionEvaluator
protected final ExpressionEvaluator expressionEvaluator
-
-
Constructor Detail
-
AbstractAuditBackend
protected AbstractAuditBackend(NXAuditEventsService component, AuditBackendDescriptor config)
-
AbstractAuditBackend
protected AbstractAuditBackend()
-
-
Method Detail
-
guardedDocument
protected DocumentModel guardedDocument(CoreSession session, DocumentRef reference)
-
guardedDocumentChildren
protected DocumentModelList guardedDocumentChildren(CoreSession session, DocumentRef reference)
-
doCreateAndFillEntryFromDocument
protected LogEntry doCreateAndFillEntryFromDocument(DocumentModel doc, Principal principal)
-
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
public Set<String> getAuditableEventNames()
Description copied from interface:AuditLoggerReturns the list of auditable event names.- Specified by:
getAuditableEventNamesin interfaceAuditLogger- Returns:
- list of String representing event names.
-
buildEntryFromEvent
public LogEntry buildEntryFromEvent(Event event)
Description copied from interface:AuditLoggerReturns a log entry representation of an event.- Specified by:
buildEntryFromEventin interfaceAuditLogger
-
newLogEntry
public LogEntry newLogEntry()
Description copied from interface:AuditLoggerCreate a new LogEntry instance.- Specified by:
newLogEntryin interfaceAuditLogger
-
newExtendedInfo
public abstract ExtendedInfo newExtendedInfo(Serializable value)
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 public void logEvents(EventBundle bundle)
Deprecated.Description copied from interface:AuditLoggerLogs a bundle of events- Specified by:
logEventsin interfaceAuditLogger
-
isAuditable
protected boolean isAuditable(EventBundle eventBundle)
-
logEvent
@Deprecated public void logEvent(Event event)
Deprecated.Description copied from interface:AuditLoggerLogs an Event.- Specified by:
logEventin interfaceAuditLogger
-
await
public boolean await(long time, TimeUnit unit) throws InterruptedException- Specified by:
awaitin interfaceAuditLogger- Throws:
InterruptedException
-
getLogEntriesFor
@Deprecated public List<LogEntry> getLogEntriesFor(String uuid, Map<String,FilterMapEntry> filterMap, boolean doDefaultSort)
Deprecated.Description copied from interface:AuditReaderReturns the logs given a doc uuid, a map of filters and a default sort.- Specified by:
getLogEntriesForin interfaceAuditReader- Parameters:
uuid- the document uuidfilterMap- the map of filters to applydoDefaultSort- the default sort to set (eventDate desc)- Returns:
- a list of log entries
-
convert
protected Predicate convert(FilterMapEntry entry)
-
queryLogsByPage
public List<LogEntry> queryLogsByPage(String[] eventIds, Date limit, String[] categories, String path, int pageNb, int pageSize)
- Specified by:
queryLogsByPagein interfaceAuditReader
-
getLatestLogId
public long getLatestLogId(String repositoryId, String... eventIds)
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
public void restore(AuditStorage auditStorage, int batchSize, int keepAlive)
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
-
-