public class DefaultAuditBackend extends AbstractAuditBackend
| Modifier and Type | Class and Description | 
|---|---|
class  | 
DefaultAuditBackend.SQLAuditCursorResult  | 
| Modifier and Type | Field and Description | 
|---|---|
protected CursorService<Iterator<LogEntry>,LogEntry,String> | 
cursorService  | 
protected static com.fasterxml.jackson.databind.ObjectMapper | 
OBJECT_MAPPER  | 
protected PersistenceProvider | 
persistenceProvider  | 
component, config, expressionEvaluator, FORCE_AUDIT_FACET, log| Constructor and Description | 
|---|
DefaultAuditBackend()  | 
DefaultAuditBackend(NXAuditEventsService component,
                   AuditBackendDescriptor config)  | 
| Modifier and Type | Method and Description | 
|---|---|
protected void | 
accept(boolean needActivateSession,
      Consumer<LogEntryProvider> consumer)  | 
protected void | 
activatePersistenceProvider()  | 
void | 
addLogEntries(List<LogEntry> entries)
Adds given log entries. 
 | 
void | 
append(List<String> jsonEntries)  | 
protected <T> T | 
apply(boolean needActivateSession,
     Function<LogEntryProvider,T> function)  | 
int | 
getApplicationStartedOrder()  | 
Long | 
getEventsCount(String eventId)  | 
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)
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. 
 | 
LogEntry | 
getLogEntryByID(long id)
Returns a given log entry given its id. 
 | 
List<String> | 
getLoggedEventIds()  | 
PersistenceProvider | 
getOrCreatePersistenceProvider()  | 
protected String | 
getParamNames(String[] eventId)  | 
protected Map<String,Object> | 
getParams(String[] eventId)  | 
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. 
 | 
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 | 
onApplicationStopped()  | 
List<LogEntry> | 
queryLogs(QueryBuilder builder)
Returns the logs given a collection of predicates and a default sort. 
 | 
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)  | 
ScrollResult<String> | 
scroll(QueryBuilder builder,
      int batchSize,
      int keepAliveSeconds)  | 
ScrollResult<String> | 
scroll(String scrollId)  | 
long | 
syncLogCreationEntries(String repoId,
                      String path,
                      Boolean recurs)
Forces log Synchronisation for a branch of the repository. 
 | 
await, buildEntryFromEvent, convert, doCreateAndFillEntryFromDocument, doPutExtendedInfos, doSyncNode, getAuditableEventNames, guardedDocument, guardedDocumentChildren, isAuditable, logEvent, logEvents, newLogEntry, populateExtendedInfo, restore, syncLogCreationEntriesclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitonShutdownqueryLogsByPage, queryLogsByPage, queryLogsByPageprotected static final com.fasterxml.jackson.databind.ObjectMapper OBJECT_MAPPER
protected PersistenceProvider persistenceProvider
protected CursorService<Iterator<LogEntry>,LogEntry,String> cursorService
public DefaultAuditBackend(NXAuditEventsService component, AuditBackendDescriptor config)
public DefaultAuditBackend()
public int getApplicationStartedOrder()
public void onApplicationStarted()
public void onApplicationStopped()
public PersistenceProvider getOrCreatePersistenceProvider()
protected void activatePersistenceProvider()
protected <T> T apply(boolean needActivateSession, Function<LogEntryProvider,T> function)
protected void accept(boolean needActivateSession, Consumer<LogEntryProvider> consumer)
public void addLogEntries(List<LogEntry> entries)
AuditLoggerentries - the list of log entries.public List<LogEntry> getLogEntriesFor(String uuid, String repositoryId)
AuditReaderuuid - the document uuidrepositoryId - the repository idpublic List<LogEntry> getLogEntriesFor(String uuid)
AuditReaderuuid - the document uuidpublic List<LogEntry> getLogEntriesFor(String uuid, Map<String,FilterMapEntry> filterMap, boolean doDefaultSort)
AuditReadergetLogEntriesFor in interface AuditReadergetLogEntriesFor in class AbstractAuditBackenduuid - the document uuidfilterMap - the map of filters to applydoDefaultSort - the default sort to set (eventDate desc)public LogEntry getLogEntryByID(long id)
AuditReaderid - the log entry identifierpublic List<LogEntry> nativeQueryLogs(String whereClause, int pageNb, int pageSize)
AuditReaderpublic List<?> nativeQuery(String query, int pageNb, int pageSize)
AuditReaderpublic List<?> nativeQuery(String query, Map<String,Object> params, int pageNb, int pageSize)
AuditReaderquery - 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 pagepublic List<LogEntry> queryLogs(QueryBuilder builder)
AuditReaderbuilder - the query builder to fetch log entriespublic List<LogEntry> queryLogs(String[] eventIds, String dateRange)
AuditReaderNote we will use NXQL in the future when the search engine will index history.
eventIds - the event ids.dateRange - a preset date range.DateRangeQueryConstantspublic List<LogEntry> queryLogsByPage(String[] eventIds, Date limit, String[] category, String path, int pageNb, int pageSize)
queryLogsByPage in interface AuditReaderqueryLogsByPage in class AbstractAuditBackendpublic long syncLogCreationEntries(String repoId, String path, Boolean recurs)
AuditAdminpublic Long getEventsCount(String eventId)
public List<String> getLoggedEventIds()
public ExtendedInfo newExtendedInfo(Serializable value)
AuditLoggernewExtendedInfo in interface AuditLoggernewExtendedInfo in class AbstractAuditBackendpublic long getLatestLogId(String repositoryId, String... eventIds)
AuditReadergetLatestLogId in interface AuditReadergetLatestLogId in class AbstractAuditBackendpublic List<LogEntry> getLogEntriesAfter(long logIdOffset, int limit, String repositoryId, String... eventIds)
AuditReadergetLogEntriesAfter in interface AuditReadergetLogEntriesAfter in class AbstractAuditBackendprotected String getParamNames(String[] eventId)
public ScrollResult<String> scroll(QueryBuilder builder, int batchSize, int keepAliveSeconds)
public ScrollResult<String> scroll(String scrollId)
Copyright © 2019 Nuxeo. All rights reserved.