Package org.nuxeo.ecm.platform.audit.api
Interface AuditReader
-
- All Known Subinterfaces:
AuditBackend
,Logs
,LogsRemote
- All Known Implementing Classes:
AbstractAuditBackend
,DefaultAuditBackend
,ESAuditBackend
,MongoDBAuditBackend
public interface AuditReader
Interface for reading data from the Audit service.- Author:
- tiry
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description 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.default List<LogEntry>
getLogEntriesFor(String uuid)
Deprecated.since 8.4, usegetLogEntriesFor(String, String)
instead.default List<LogEntry>
getLogEntriesFor(String uuid, String repositoryId)
Returns the logs given a doc uuid and a repository id.List<LogEntry>
getLogEntriesFor(String uuid, Map<String,FilterMapEntry> filterMap, boolean doDefaultSort)
Deprecated.since 9.3, this method doesn't take into account the document repository, usequeryLogs(QueryBuilder)
instead.LogEntry
getLogEntryByID(long id)
Returns a given log entry given its id.default 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.default List<LogEntry>
nativeQueryLogs(String whereClause, int pageNb, int pageSize)
Returns a batched list of log entries.default List<LogEntry>
queryLogs(String[] eventIds, String dateRange)
Returns the list of log entries.List<LogEntry>
queryLogs(QueryBuilder builder)
Returns the logs given a collection of predicates and a default sort.default List<LogEntry>
queryLogsByPage(String[] eventIds, String dateRange, String[] categories, String path, int pageNb, int pageSize)
default List<LogEntry>
queryLogsByPage(String[] eventIds, String dateRange, String category, String path, int pageNb, int pageSize)
Returns the batched list of log entries.List<LogEntry>
queryLogsByPage(String[] eventIds, Date limit, String[] categories, String path, int pageNb, int pageSize)
default List<LogEntry>
queryLogsByPage(String[] eventIds, Date limit, String category, String path, int pageNb, int pageSize)
Returns the batched list of log entries.
-
-
-
Method Detail
-
getLogEntriesFor
default List<LogEntry> getLogEntriesFor(String uuid, String repositoryId)
Returns the logs given a doc uuid and a repository id.- Parameters:
uuid
- the document uuidrepositoryId
- the repository id- Returns:
- a list of log entries
- Since:
- 8.4
-
getLogEntriesFor
@Deprecated default List<LogEntry> getLogEntriesFor(String uuid)
Deprecated.since 8.4, usegetLogEntriesFor(String, String)
instead.Returns the logs given a doc uuid.- Parameters:
uuid
- the document uuid- Returns:
- a list of log entries
-
getLogEntriesFor
@Deprecated List<LogEntry> getLogEntriesFor(String uuid, Map<String,FilterMapEntry> filterMap, boolean doDefaultSort)
Deprecated.since 9.3, this method doesn't take into account the document repository, usequeryLogs(QueryBuilder)
instead.Returns the logs given a doc uuid, a map of filters and a default sort.- Parameters:
uuid
- the document uuidfilterMap
- the map of filters to applydoDefaultSort
- the default sort to set (eventDate desc)- Returns:
- a list of log entries
-
getLogEntryByID
LogEntry getLogEntryByID(long id)
Returns a given log entry given its id.- Parameters:
id
- the log entry identifier- Returns:
- a LogEntry instance
-
queryLogs
List<LogEntry> queryLogs(QueryBuilder builder)
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
- Since:
- 9.3
-
queryLogs
default List<LogEntry> queryLogs(String[] eventIds, String dateRange)
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
-
queryLogsByPage
default List<LogEntry> queryLogsByPage(String[] eventIds, String dateRange, String category, String path, int pageNb, int pageSize)
Returns the batched 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.category
- add filter on events categorypath
- add filter on document pathpageNb
- page number (ignore if <=1)pageSize
- number of results per page- Returns:
- a list of log entries.
- See Also:
DateRangeQueryConstants
-
queryLogsByPage
default List<LogEntry> queryLogsByPage(String[] eventIds, String dateRange, String[] categories, String path, int pageNb, int pageSize)
-
queryLogsByPage
default List<LogEntry> queryLogsByPage(String[] eventIds, Date limit, String category, String path, int pageNb, int pageSize)
Returns the batched list of log entries.Note we will use NXQL in the future when the search engine will index history.
- Parameters:
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 page- Returns:
- a list of log entries.
- See Also:
DateRangeQueryConstants
-
queryLogsByPage
List<LogEntry> queryLogsByPage(String[] eventIds, Date limit, String[] categories, String path, int pageNb, int pageSize)
-
nativeQueryLogs
default List<LogEntry> nativeQueryLogs(String whereClause, int pageNb, int pageSize)
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
default List<?> nativeQuery(String query, int pageNb, int pageSize)
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
List<?> nativeQuery(String query, Map<String,Object> params, int pageNb, int pageSize)
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 Elasticsearchparams
- parameters for the querypageNb
- the page number (starts at 1)pageSize
- the number of results per page
-
getLatestLogId
long getLatestLogId(String repositoryId, String... eventIds)
Returns the latest log id matching events and repository or 0 when no match found.- Since:
- 9.3
-
-