public class DefaultAuditBackend extends AbstractAuditBackend
Modifier and Type | Field and Description |
---|---|
protected PersistenceProvider |
persistenceProvider |
component, config, expressionEvaluator, FORCE_AUDIT_FACET, log
Constructor and Description |
---|
DefaultAuditBackend(NXAuditEventsService component,
AuditBackendDescriptor config) |
Modifier and Type | Method and Description |
---|---|
protected void |
activatePersistenceProvider() |
protected void |
addLogEntries(javax.persistence.EntityManager em,
List<LogEntry> entries) |
void |
addLogEntries(List<LogEntry> entries)
Adds given log entries.
|
int |
getApplicationStartedOrder() |
Long |
getEventsCount(javax.persistence.EntityManager em,
String eventId) |
Long |
getEventsCount(String eventId) |
protected List<LogEntry> |
getLogEntriesFor(javax.persistence.EntityManager em,
String uuid) |
protected List<LogEntry> |
getLogEntriesFor(javax.persistence.EntityManager em,
String uuid,
Map<String,FilterMapEntry> filterMap,
boolean doDefaultSort) |
protected List<LogEntry> |
getLogEntriesFor(javax.persistence.EntityManager em,
String uuid,
String repositoryId) |
List<LogEntry> |
getLogEntriesFor(String uuid)
Returns the logs given a doc uuid.
|
List<LogEntry> |
getLogEntriesFor(String uuid,
Map<String,FilterMapEntry> filterMap,
boolean doDefaultSort)
Returns the logs given a doc uuid, a map of filters and a default sort.
|
List<LogEntry> |
getLogEntriesFor(String uuid,
String repositoryId)
Returns the logs given a doc uuid and a repository id.
|
protected LogEntry |
getLogEntryByID(javax.persistence.EntityManager em,
long id) |
LogEntry |
getLogEntryByID(long id)
Returns a given log entry given its id.
|
List<String> |
getLoggedEventIds() |
protected List<String> |
getLoggedEventIds(javax.persistence.EntityManager em) |
PersistenceProvider |
getOrCreatePersistenceProvider() |
protected List<?> |
nativeQuery(javax.persistence.EntityManager em,
String query,
int pageNb,
int pageSize) |
protected List<?> |
nativeQuery(javax.persistence.EntityManager em,
String query,
Map<String,Object> params,
int pageNb,
int pageSize) |
List<?> |
nativeQuery(String query,
int pageNb,
int pageSize)
Returns a batched list of entries.
|
List<?> |
nativeQuery(String query,
Map<String,Object> params,
int pageNb,
int pageSize)
Returns a batched list of entries.
|
protected List<LogEntry> |
nativeQueryLogs(javax.persistence.EntityManager em,
String whereClause,
int pageNb,
int pageSize) |
List<LogEntry> |
nativeQueryLogs(String whereClause,
int pageNb,
int pageSize)
Returns a batched list of log entries.
|
ExtendedInfo |
newExtendedInfo(Serializable value)
Create a new ExtendedInfo instance
|
void |
onApplicationStarted() |
void |
onShutdown() |
protected List<LogEntry> |
queryLogs(javax.persistence.EntityManager em,
String[] eventIds,
String dateRange) |
List<LogEntry> |
queryLogs(String[] eventIds,
String dateRange)
Returns the list of log entries.
|
protected List<LogEntry> |
queryLogsByPage(javax.persistence.EntityManager em,
String[] eventIds,
Date limit,
String[] category,
String path,
int pageNb,
int pageSize) |
protected List<LogEntry> |
queryLogsByPage(javax.persistence.EntityManager em,
String[] eventIds,
Date limit,
String category,
String path,
int pageNb,
int pageSize) |
protected List<LogEntry> |
queryLogsByPage(javax.persistence.EntityManager em,
String[] eventIds,
String dateRange,
String[] category,
String path,
int pageNb,
int pageSize) |
protected List<LogEntry> |
queryLogsByPage(javax.persistence.EntityManager em,
String[] eventIds,
String dateRange,
String category,
String path,
int pageNb,
int pageSize) |
List<LogEntry> |
queryLogsByPage(String[] eventIds,
Date limit,
String[] category,
String path,
int pageNb,
int pageSize) |
List<LogEntry> |
queryLogsByPage(String[] eventIds,
String dateRange,
String[] category,
String path,
int pageNb,
int pageSize) |
protected long |
syncLogCreationEntries(javax.persistence.EntityManager em,
String repoId,
String path,
Boolean recurs) |
long |
syncLogCreationEntries(String repoId,
String path,
Boolean recurs)
Forces log Synchronisation for a branch of the repository.
|
await, buildEntryFromEvent, doCreateAndFillEntryFromDocument, doPutExtendedInfos, doSyncNode, getAuditableEventNames, guardedDocument, guardedDocumentChildren, isAuditable, logEvent, logEvents, newLogEntry, populateExtendedInfo, queryLogsByPage, queryLogsByPage, syncLogCreationEntries
protected PersistenceProvider persistenceProvider
public DefaultAuditBackend(NXAuditEventsService component, AuditBackendDescriptor config)
public int getApplicationStartedOrder()
public void onApplicationStarted()
public void onShutdown()
public PersistenceProvider getOrCreatePersistenceProvider()
protected void activatePersistenceProvider()
public void addLogEntries(List<LogEntry> entries)
AuditLogger
entries
- the list of log entries.protected void addLogEntries(javax.persistence.EntityManager em, List<LogEntry> entries)
public List<LogEntry> getLogEntriesFor(String uuid, String repositoryId)
AbstractAuditBackend
getLogEntriesFor
in interface AuditReader
getLogEntriesFor
in class AbstractAuditBackend
uuid
- the document uuidrepositoryId
- the repository idprotected List<LogEntry> getLogEntriesFor(javax.persistence.EntityManager em, String uuid, String repositoryId)
public List<LogEntry> getLogEntriesFor(String uuid)
AbstractAuditBackend
getLogEntriesFor
in interface AuditReader
getLogEntriesFor
in class AbstractAuditBackend
uuid
- the document uuidprotected List<LogEntry> getLogEntriesFor(javax.persistence.EntityManager em, String uuid)
public List<LogEntry> getLogEntriesFor(String uuid, Map<String,FilterMapEntry> filterMap, boolean doDefaultSort)
AuditReader
uuid
- the document uuidfilterMap
- the map of filters to applydoDefaultSort
- the default sort to setprotected List<LogEntry> getLogEntriesFor(javax.persistence.EntityManager em, String uuid, Map<String,FilterMapEntry> filterMap, boolean doDefaultSort)
public LogEntry getLogEntryByID(long id)
AuditReader
id
- the log entry identifierprotected LogEntry getLogEntryByID(javax.persistence.EntityManager em, long id)
public List<LogEntry> nativeQueryLogs(String whereClause, int pageNb, int pageSize)
AuditReader
nativeQueryLogs
in interface AuditReader
nativeQueryLogs
in class AbstractAuditBackend
protected List<LogEntry> nativeQueryLogs(javax.persistence.EntityManager em, String whereClause, int pageNb, int pageSize)
public List<?> nativeQuery(String query, int pageNb, int pageSize)
AuditReader
nativeQuery
in interface AuditReader
nativeQuery
in class AbstractAuditBackend
protected List<?> nativeQuery(javax.persistence.EntityManager em, String query, int pageNb, int pageSize)
public List<?> nativeQuery(String query, Map<String,Object> params, int pageNb, int pageSize)
AuditReader
query
- a JPA query language query if implementation of audit backend is JPA (< 7.3 or
audit.elasticsearch.enabled=false) and JSON if implementation is Elasticsearchparams
- parameters for the querypageNb
- the page number (starts at 1)pageSize
- the number of results per pageprotected List<?> nativeQuery(javax.persistence.EntityManager em, String query, Map<String,Object> params, int pageNb, int pageSize)
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
queryLogs
in class AbstractAuditBackend
eventIds
- the event ids.dateRange
- a preset date range.DateRangeQueryConstants
protected List<LogEntry> queryLogs(javax.persistence.EntityManager em, String[] eventIds, String dateRange)
public List<LogEntry> queryLogsByPage(String[] eventIds, String dateRange, String[] category, String path, int pageNb, int pageSize)
protected List<LogEntry> queryLogsByPage(javax.persistence.EntityManager em, String[] eventIds, String dateRange, String[] category, String path, int pageNb, int pageSize)
public List<LogEntry> queryLogsByPage(String[] eventIds, Date limit, String[] category, String path, int pageNb, int pageSize)
protected List<LogEntry> queryLogsByPage(javax.persistence.EntityManager em, String[] eventIds, Date limit, String[] category, String path, int pageNb, int pageSize)
public long syncLogCreationEntries(String repoId, String path, Boolean recurs)
AuditAdmin
protected long syncLogCreationEntries(javax.persistence.EntityManager em, String repoId, String path, Boolean recurs)
public Long getEventsCount(String eventId)
public Long getEventsCount(javax.persistence.EntityManager em, String eventId)
public List<String> getLoggedEventIds()
protected List<String> getLoggedEventIds(javax.persistence.EntityManager em)
protected List<LogEntry> queryLogsByPage(javax.persistence.EntityManager em, String[] eventIds, String dateRange, String category, String path, int pageNb, int pageSize)
protected List<LogEntry> queryLogsByPage(javax.persistence.EntityManager em, String[] eventIds, Date limit, String category, String path, int pageNb, int pageSize)
public ExtendedInfo newExtendedInfo(Serializable value)
AuditLogger
newExtendedInfo
in interface AuditLogger
newExtendedInfo
in class AbstractAuditBackend
Copyright © 2016 Nuxeo SA. All rights reserved.