Class DefaultAuditBackend

    • Method Detail

      • getApplicationStartedOrder

        public int getApplicationStartedOrder()
      • onApplicationStarted

        public void onApplicationStarted()
      • onApplicationStopped

        public void onApplicationStopped()
      • activatePersistenceProvider

        protected void activatePersistenceProvider()
      • addLogEntries

        public void addLogEntries​(List<LogEntry> entries)
        Description copied from interface: AuditLogger
        Adds given log entries.
        Parameters:
        entries - the list of log entries.
      • getLogEntriesFor

        public List<LogEntry> getLogEntriesFor​(String uuid,
                                               String repositoryId)
        Description copied from interface: AuditReader
        Returns the logs given a doc uuid and a repository id.
        Parameters:
        uuid - the document uuid
        repositoryId - the repository id
        Returns:
        a list of log entries
      • getLogEntriesFor

        public List<LogEntry> getLogEntriesFor​(String uuid)
        Description copied from interface: AuditReader
        Returns the logs given a doc uuid.
        Parameters:
        uuid - the document uuid
        Returns:
        a list of log entries
      • getLogEntryByID

        public LogEntry getLogEntryByID​(long id)
        Description copied from interface: AuditReader
        Returns a given log entry given its id.
        Parameters:
        id - the log entry identifier
        Returns:
        a LogEntry instance
      • nativeQueryLogs

        public List<LogEntry> nativeQueryLogs​(String whereClause,
                                              int pageNb,
                                              int pageSize)
        Description copied from interface: AuditReader
        Returns a batched list of log entries. WhereClause is a native where clause for the backend: here EJBQL 3.0 must be used if implementation of audit backend is JPA (< 7.3 or audit.elasticsearch.enabled=false) and JSON if implementation is Elasticsearch.
      • nativeQuery

        public List<?> nativeQuery​(String query,
                                   int pageNb,
                                   int pageSize)
        Description copied from interface: AuditReader
        Returns a batched list of entries. query string is a native query clause for the backend : here EJBQL 3.0 must be used if implementation of audit backend is JPA (< 7.3 or audit.elasticsearch.enabled=false) and JSON if implementation is Elasticsearch.
      • nativeQuery

        public List<?> nativeQuery​(String query,
                                   Map<String,​Object> params,
                                   int pageNb,
                                   int pageSize)
        Description copied from interface: AuditReader
        Returns a batched list of entries.
        Parameters:
        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 Elasticsearch
        params - parameters for the query
        pageNb - the page number (starts at 1)
        pageSize - the number of results per page
      • queryLogs

        public List<LogEntry> queryLogs​(QueryBuilder builder)
        Description copied from interface: AuditReader
        Returns the logs given a collection of predicates and a default sort.
        Parameters:
        builder - the query builder to fetch log entries
        Returns:
        a list of log entries
      • queryLogs

        public List<LogEntry> queryLogs​(String[] eventIds,
                                        String dateRange)
        Description copied from interface: AuditReader
        Returns the list of log entries.

        Note we will use NXQL in the future when the search engine will index history.

        Parameters:
        eventIds - the event ids.
        dateRange - a preset date range.
        Returns:
        a list of log entries.
        See Also:
        DateRangeQueryConstants
      • syncLogCreationEntries

        public long syncLogCreationEntries​(String repoId,
                                           String path,
                                           Boolean recurs)
        Description copied from interface: AuditAdmin
        Forces log Synchronisation for a branch of the repository. This can be useful to add the create entries if DB was initialized from a bulk import.
      • getEventsCount

        public Long getEventsCount​(String eventId)
      • getLoggedEventIds

        public List<String> getLoggedEventIds()
      • getParamNames

        protected String getParamNames​(String[] eventId)
      • append

        public void append​(List<String> jsonEntries)