public abstract class AbstractAuditBackend extends Object implements AuditBackend
AuditBackend
implementationsModifier and Type | Field and Description |
---|---|
protected NXAuditEventsService |
component |
protected ExpressionEvaluator |
expressionEvaluator |
static String |
FORCE_AUDIT_FACET |
protected static org.apache.commons.logging.Log |
log |
Constructor and Description |
---|
AbstractAuditBackend() |
Modifier and Type | Method and Description |
---|---|
void |
activate(NXAuditEventsService component) |
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)
Returns the logs given a doc uuid.
|
protected DocumentModel |
guardedDocument(CoreSession session,
DocumentRef reference) |
protected DocumentModelList |
guardedDocumentChildren(CoreSession session,
DocumentRef reference) |
void |
logEvent(Event event)
Logs an Event.
|
void |
logEvents(EventBundle eventBundle)
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
deactivate, onApplicationStarted
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 NXAuditEventsService component
protected final ExpressionEvaluator expressionEvaluator
public AbstractAuditBackend()
public void activate(NXAuditEventsService component)
activate
in interface AuditBackend
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 eventBundle)
AuditLogger
logEvents
in interface AuditLogger
public void logEvent(Event event)
AuditLogger
logEvent
in interface AuditLogger
public List<LogEntry> getLogEntriesFor(String uuid)
AuditReader
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 © 2015 Nuxeo SA. All rights reserved.