public abstract class AbstractAuditBackend extends Object implements AuditBackend, AuditStorage
AuditBackend
implementationsModifier and Type | Field and Description |
---|---|
protected NXAuditEventsService |
component |
protected AuditBackendDescriptor |
config |
protected ExpressionEvaluator |
expressionEvaluator |
static String |
FORCE_AUDIT_FACET |
protected static org.apache.logging.log4j.Logger |
log |
Modifier | Constructor and Description |
---|---|
protected |
AbstractAuditBackend() |
protected |
AbstractAuditBackend(NXAuditEventsService component,
AuditBackendDescriptor config) |
Modifier and Type | Method and Description |
---|---|
boolean |
await(long time,
TimeUnit unit) |
LogEntry |
buildEntryFromEvent(Event event)
Returns a log entry representation of an event.
|
protected Predicate |
convert(FilterMapEntry entry) |
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) |
Set<String> |
getAuditableEventNames()
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.
|
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 DocumentModel |
guardedDocument(CoreSession session,
DocumentRef reference) |
protected DocumentModelList |
guardedDocumentChildren(CoreSession session,
DocumentRef reference) |
protected boolean |
isAuditable(EventBundle eventBundle) |
void |
logEvent(Event event)
Deprecated.
|
void |
logEvents(EventBundle bundle)
Deprecated.
|
abstract ExtendedInfo |
newExtendedInfo(Serializable value)
Create a new ExtendedInfo instance
|
LogEntry |
newLogEntry()
Create a new LogEntry instance.
|
protected void |
populateExtendedInfo(LogEntry entry,
DocumentModel source,
ExpressionContext context,
Collection<ExtendedInfoDescriptor> extInfos) |
List<LogEntry> |
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 given
AuditStorage |
protected long |
syncLogCreationEntries(BaseLogEntryProvider provider,
String repoId,
String path,
Boolean recurs) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getApplicationStartedOrder, onApplicationStarted, onApplicationStopped, onShutdown
getLogEntriesFor, getLogEntriesFor, getLogEntryByID, nativeQuery, nativeQuery, nativeQueryLogs, queryLogs, queryLogs, queryLogsByPage, queryLogsByPage, queryLogsByPage
addLogEntries
getEventsCount, syncLogCreationEntries
append, scroll, scroll
protected static final org.apache.logging.log4j.Logger log
public static final String FORCE_AUDIT_FACET
protected final NXAuditEventsService component
protected final AuditBackendDescriptor config
protected final ExpressionEvaluator expressionEvaluator
protected AbstractAuditBackend(NXAuditEventsService component, AuditBackendDescriptor config)
protected AbstractAuditBackend()
protected DocumentModel guardedDocument(CoreSession session, DocumentRef reference)
protected DocumentModelList guardedDocumentChildren(CoreSession session, DocumentRef reference)
protected LogEntry doCreateAndFillEntryFromDocument(DocumentModel doc, Principal principal)
protected void doPutExtendedInfos(LogEntry entry, EventContext eventContext, DocumentModel source, Principal principal)
protected void populateExtendedInfo(LogEntry entry, DocumentModel source, ExpressionContext context, Collection<ExtendedInfoDescriptor> extInfos)
public Set<String> getAuditableEventNames()
AuditLogger
getAuditableEventNames
in interface AuditLogger
public LogEntry buildEntryFromEvent(Event event)
AuditLogger
buildEntryFromEvent
in interface AuditLogger
public LogEntry newLogEntry()
AuditLogger
newLogEntry
in interface AuditLogger
public abstract ExtendedInfo newExtendedInfo(Serializable value)
AuditLogger
newExtendedInfo
in interface AuditLogger
protected long syncLogCreationEntries(BaseLogEntryProvider provider, String repoId, String path, Boolean recurs)
protected long doSyncNode(BaseLogEntryProvider provider, CoreSession session, DocumentModel node, boolean recurs)
@Deprecated public void logEvents(EventBundle bundle)
AuditLogger
logEvents
in interface AuditLogger
protected boolean isAuditable(EventBundle eventBundle)
@Deprecated public void logEvent(Event event)
AuditLogger
logEvent
in interface AuditLogger
public boolean await(long time, TimeUnit unit) throws InterruptedException
await
in interface AuditLogger
InterruptedException
@Deprecated public List<LogEntry> getLogEntriesFor(String uuid, Map<String,FilterMapEntry> filterMap, boolean doDefaultSort)
AuditReader
getLogEntriesFor
in interface AuditReader
uuid
- the document uuidfilterMap
- the map of filters to applydoDefaultSort
- the default sort to set (eventDate desc)protected Predicate convert(FilterMapEntry entry)
public List<LogEntry> queryLogsByPage(String[] eventIds, Date limit, String[] categories, String path, int pageNb, int pageSize)
queryLogsByPage
in interface AuditReader
public long getLatestLogId(String repositoryId, String... eventIds)
AuditReader
getLatestLogId
in interface AuditReader
public List<LogEntry> getLogEntriesAfter(long logIdOffset, int limit, String repositoryId, String... eventIds)
AuditReader
getLogEntriesAfter
in interface AuditReader
public void restore(AuditStorage auditStorage, int batchSize, int keepAlive)
AuditBackend
AuditStorage
restore
in interface AuditBackend
auditStorage
- the audit storagebatchSize
- the batch sizekeepAlive
- the keep alive durationCopyright © 2019 Nuxeo. All rights reserved.