Nuxeo Enterprise Platform 5.4

org.nuxeo.ecm.platform.audit.ejb
Class LogsBean

java.lang.Object
  extended by org.nuxeo.ecm.platform.audit.ejb.LogsBean
All Implemented Interfaces:
AuditAdmin, AuditLogger, AuditReader, Logs

public class LogsBean
extends java.lang.Object
implements Logs

Stateless bean allowing to query the logs.

This class takes advantage of EJBQL. :XXX: http://jira.nuxeo.org/browse/NXP-514

Author:
Julien Anguenot, Thierry Delprat

Constructor Summary
LogsBean()
           
 
Method Summary
 void addLogEntries(java.util.List<LogEntry> entries)
          Adds given log entries.
 java.util.List<LogEntry> getLogEntriesFor(java.lang.String uuid)
          Returns the logs given a doc uuid.
 java.util.List<LogEntry> getLogEntriesFor(java.lang.String uuid, java.util.Map<java.lang.String,FilterMapEntry> filterMap, boolean doDefaultSort)
           
 LogEntry getLogEntryByID(long id)
          Returns a given log entry given its id.
 void logEvent(Event event)
          Logs an Event.
 void logEvents(EventBundle eventBundle)
          Logs a bundle of events
 java.util.List<?> nativeQuery(java.lang.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 can be used
 java.util.List<?> nativeQuery(java.lang.String query, java.util.Map<java.lang.String,java.lang.Object> params, int pageNb, int pageSize)
          Returns a batched list of entries.
 java.util.List<LogEntry> nativeQueryLogs(java.lang.String whereClause, int pageNb, int pageSize)
          Returns a batched list of log entries.
 java.util.List<LogEntry> queryLogs(java.lang.String[] eventIds, java.lang.String dateRange)
          Returns the list of log entries.
 java.util.List<LogEntry> queryLogsByPage(java.lang.String[] eventIds, java.util.Date limit, java.lang.String[] categories, java.lang.String path, int pageNb, int pageSize)
           
 java.util.List<LogEntry> queryLogsByPage(java.lang.String[] eventIds, java.util.Date limit, java.lang.String category, java.lang.String path, int pageNb, int pageSize)
          Returns the batched list of log entries.
 java.util.List<LogEntry> queryLogsByPage(java.lang.String[] eventIds, java.lang.String dateRange, java.lang.String[] categories, java.lang.String path, int pageNb, int pageSize)
           
 java.util.List<LogEntry> queryLogsByPage(java.lang.String[] eventIds, java.lang.String dateRange, java.lang.String category, java.lang.String path, int pageNb, int pageSize)
          Returns the batched list of log entries.
 long syncLogCreationEntries(java.lang.String repoId, java.lang.String path, java.lang.Boolean recurs)
          Forces log Synchronisation for a branch of the repository.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogsBean

public LogsBean()
Method Detail

addLogEntries

public void addLogEntries(java.util.List<LogEntry> entries)
Description copied from interface: AuditLogger
Adds given log entries.

Specified by:
addLogEntries in interface AuditLogger
Parameters:
entries - the list of log entries.

getLogEntriesFor

public java.util.List<LogEntry> getLogEntriesFor(java.lang.String uuid)
Description copied from interface: AuditReader
Returns the logs given a doc uuid.

:XXX: add parameters to this method for paging.

Specified by:
getLogEntriesFor in interface AuditReader
Parameters:
uuid - the document uuid
Returns:
a list of log entries

getLogEntriesFor

public java.util.List<LogEntry> getLogEntriesFor(java.lang.String uuid,
                                                 java.util.Map<java.lang.String,FilterMapEntry> filterMap,
                                                 boolean doDefaultSort)
Specified by:
getLogEntriesFor in interface AuditReader

nativeQueryLogs

public java.util.List<LogEntry> nativeQueryLogs(java.lang.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 can be used.

Specified by:
nativeQueryLogs in interface AuditReader

nativeQuery

public java.util.List<?> nativeQuery(java.lang.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 can be used

Specified by:
nativeQuery in interface AuditReader

nativeQuery

public java.util.List<?> nativeQuery(java.lang.String query,
                                     java.util.Map<java.lang.String,java.lang.Object> params,
                                     int pageNb,
                                     int pageSize)
Description copied from interface: AuditReader
Returns a batched list of entries.

Specified by:
nativeQuery in interface AuditReader
Parameters:
query - a JPA query language query
params - parameters for the query
pageNb - the page number (starts at 1)
pageSize - the number of results per page

queryLogsByPage

public java.util.List<LogEntry> queryLogsByPage(java.lang.String[] eventIds,
                                                java.util.Date limit,
                                                java.lang.String category,
                                                java.lang.String path,
                                                int pageNb,
                                                int pageSize)
Description copied from interface: AuditReader
Returns the batched list of log entries.

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

Specified by:
queryLogsByPage in interface AuditReader
Parameters:
eventIds - the event ids.
limit - filter events by date from limit to now
category - add filter on events category
path - add filter on document path
pageNb - page number (ignore if <=1)
pageSize - number of results per page
Returns:
a list of log entries.
See Also:
DateRangeQueryConstants

queryLogsByPage

public java.util.List<LogEntry> queryLogsByPage(java.lang.String[] eventIds,
                                                java.lang.String dateRange,
                                                java.lang.String category,
                                                java.lang.String path,
                                                int pageNb,
                                                int pageSize)
Description copied from interface: AuditReader
Returns the batched list of log entries.

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

Specified by:
queryLogsByPage in interface AuditReader
Parameters:
eventIds - the event ids.
dateRange - a preset date range.
category - add filter on events category
path - add filter on document path
pageNb - page number (ignore if <=1)
pageSize - number of results per page
Returns:
a list of log entries.
See Also:
DateRangeQueryConstants

queryLogs

public java.util.List<LogEntry> queryLogs(java.lang.String[] eventIds,
                                          java.lang.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.

Specified by:
queryLogs in interface AuditReader
Parameters:
eventIds - the event ids.
dateRange - a preset date range.
Returns:
a list of log entries.
See Also:
DateRangeQueryConstants

getLogEntryByID

public LogEntry getLogEntryByID(long id)
Description copied from interface: AuditReader
Returns a given log entry given its id.

Specified by:
getLogEntryByID in interface AuditReader
Parameters:
id - the log entry identifier
Returns:
a LogEntry instance

syncLogCreationEntries

public long syncLogCreationEntries(java.lang.String repoId,
                                   java.lang.String path,
                                   java.lang.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.

Specified by:
syncLogCreationEntries in interface AuditAdmin

logEvent

public void logEvent(Event event)
              throws AuditException
Description copied from interface: AuditLogger
Logs an Event.

Specified by:
logEvent in interface AuditLogger
Throws:
AuditException

logEvents

public void logEvents(EventBundle eventBundle)
               throws AuditException
Description copied from interface: AuditLogger
Logs a bundle of events

Specified by:
logEvents in interface AuditLogger
Throws:
AuditException

queryLogsByPage

public java.util.List<LogEntry> queryLogsByPage(java.lang.String[] eventIds,
                                                java.lang.String dateRange,
                                                java.lang.String[] categories,
                                                java.lang.String path,
                                                int pageNb,
                                                int pageSize)
Specified by:
queryLogsByPage in interface AuditReader

queryLogsByPage

public java.util.List<LogEntry> queryLogsByPage(java.lang.String[] eventIds,
                                                java.util.Date limit,
                                                java.lang.String[] categories,
                                                java.lang.String path,
                                                int pageNb,
                                                int pageSize)
Specified by:
queryLogsByPage in interface AuditReader

Nuxeo Enterprise Platform 5.4

Copyright © 2010 Nuxeo SAS. All Rights Reserved.