public abstract class AbstractAuditBackend extends Object implements AuditBackend
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.commons.logging.Log |
log |
Modifier | Constructor and Description |
---|---|
protected |
AbstractAuditBackend(NXAuditEventsService component,
AuditBackendDescriptor config) |
Modifier and Type | Method and Description |
---|---|
boolean |
await(long time,
TimeUnit unit) |
protected LogEntry |
buildEntryFromEvent(Event 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) |
Set<String> |
getAuditableEventNames()
Returns the list of auditable event names.
|
List<LogEntry> |
getLogEntriesFor(String uuid)
Deprecated.
since 8.4, use
(org.nuxeo.ecm.platform.audit.service.AbstractAuditBackend.getLogEntriesFor(String, String))
instead. |
List<LogEntry> |
getLogEntriesFor(String uuid,
String repositoryId)
Returns the logs given a doc uuid and a repository id.
|
protected DocumentModel |
guardedDocument(CoreSession session,
DocumentRef reference) |
protected DocumentModelList |
guardedDocumentChildren(CoreSession session,
DocumentRef reference) |
protected boolean |
isAuditable(EventBundle eventBundle) |
void |
logEvent(Event event)
Logs an Event.
|
void |
logEvents(EventBundle bundle)
Logs a bundle of events
|
List<?> |
nativeQuery(String query,
int pageNb,
int pageSize)
Returns a batched list of entries.
|
List<LogEntry> |
nativeQueryLogs(String whereClause,
int pageNb,
int pageSize)
Returns a batched list of log entries.
|
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> |
queryLogs(String[] eventIds,
String dateRange)
Returns the list of log entries.
|
List<LogEntry> |
queryLogsByPage(String[] eventIds,
Date limit,
String category,
String path,
int pageNb,
int pageSize)
Returns the batched list of log entries.
|
List<LogEntry> |
queryLogsByPage(String[] eventIds,
String dateRange,
String category,
String path,
int pageNb,
int pageSize)
Returns the batched list of log entries.
|
protected long |
syncLogCreationEntries(BaseLogEntryProvider provider,
String repoId,
String path,
Boolean recurs) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getApplicationStartedOrder, onApplicationStarted, onShutdown
getLogEntriesFor, getLogEntryByID, nativeQuery, queryLogsByPage, queryLogsByPage
addLogEntries
getEventsCount, syncLogCreationEntries
protected static final org.apache.commons.logging.Log 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 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
protected LogEntry buildEntryFromEvent(Event event)
public List<LogEntry> queryLogsByPage(String[] eventIds, String dateRange, String category, String path, int pageNb, int pageSize)
AuditReader
Note we will use NXQL in the future when the search engine will index history.
queryLogsByPage
in interface AuditReader
eventIds
- the event ids.dateRange
- a preset date range.category
- add filter on events categorypath
- add filter on document pathpageNb
- page number (ignore if <=1)pageSize
- number of results per pageDateRangeQueryConstants
public List<LogEntry> queryLogsByPage(String[] eventIds, Date limit, String category, String path, int pageNb, int pageSize)
AuditReader
Note we will use NXQL in the future when the search engine will index history.
queryLogsByPage
in interface AuditReader
eventIds
- the event ids.limit
- filter events by date from limit to nowcategory
- add filter on events categorypath
- add filter on document pathpageNb
- page number (ignore if <=1)pageSize
- number of results per pageDateRangeQueryConstants
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)
public void logEvents(EventBundle bundle)
AuditLogger
logEvents
in interface AuditLogger
protected boolean isAuditable(EventBundle eventBundle)
public void logEvent(Event event)
AuditLogger
logEvent
in interface AuditLogger
public boolean await(long time, TimeUnit unit) throws InterruptedException
await
in interface AuditLogger
InterruptedException
public List<LogEntry> getLogEntriesFor(String uuid, String repositoryId)
getLogEntriesFor
in interface AuditReader
uuid
- the document uuidrepositoryId
- the repository id@Deprecated public List<LogEntry> getLogEntriesFor(String uuid)
(org.nuxeo.ecm.platform.audit.service.AbstractAuditBackend.getLogEntriesFor(String, String))
instead.getLogEntriesFor
in interface AuditReader
uuid
- the document uuidpublic List<?> nativeQuery(String query, int pageNb, int pageSize)
AuditReader
nativeQuery
in interface AuditReader
public List<LogEntry> queryLogs(String[] eventIds, String dateRange)
AuditReader
Note we will use NXQL in the future when the search engine will index history.
queryLogs
in interface AuditReader
eventIds
- the event ids.dateRange
- a preset date range.DateRangeQueryConstants
public List<LogEntry> nativeQueryLogs(String whereClause, int pageNb, int pageSize)
AuditReader
nativeQueryLogs
in interface AuditReader
Copyright © 2016 Nuxeo SA. All rights reserved.