public class NXAuditEventsService extends DefaultComponent implements NXAuditEvents
Modifier and Type | Field and Description |
---|---|
static String |
DISABLE_AUDIT_LOGGER
If passed as true on the event properties, event not logged
|
static ComponentName |
NAME |
Constructor and Description |
---|
NXAuditEventsService() |
Modifier and Type | Method and Description |
---|---|
void |
addLogEntries(EntityManager em,
List<LogEntry> entries) |
void |
addLogEntries(List<LogEntry> entries)
Adds given log entries.
|
void |
addLogEntry(EntityManager em,
LogEntry entry) |
void |
addLogEntry(LogEntry entry) |
void |
deactivate(ComponentContext context)
Deactivates the component.
|
<T> T |
getAdapter(Class<T> adapter)
Returns an object which is an instance of the given class
associated with this object.
|
Set<String> |
getAuditableEventNames()
Returns the list of auditable event names.
|
Long |
getEventsCount(EntityManager em,
String eventId) |
Long |
getEventsCount(String eventId) |
List<LogEntry> |
getLogEntriesFor(EntityManager em,
String uuid) |
List<LogEntry> |
getLogEntriesFor(EntityManager em,
String uuid,
Map<String,FilterMapEntry> filterMap,
boolean doDefaultSort) |
List<LogEntry> |
getLogEntriesFor(String uuid)
Returns the logs given a doc uuid.
|
List<LogEntry> |
getLogEntriesFor(String uuid,
Map<String,FilterMapEntry> filterMap,
boolean doDefaultSort) |
LogEntry |
getLogEntryByID(EntityManager em,
long id) |
LogEntry |
getLogEntryByID(long id)
Returns a given log entry given its id.
|
List<String> |
getLoggedEventIds() |
List<String> |
getLoggedEventIds(EntityManager em) |
PersistenceProvider |
getOrCreatePersistenceProvider() |
AdapterDescriptor[] |
getRegisteredAdapters() |
void |
logEvent(EntityManager em,
Event event) |
void |
logEvent(Event event)
Logs an Event.
|
void |
logEvents(EntityManager em,
EventBundle eventBundle) |
void |
logEvents(EventBundle eventBundle)
Logs a bundle of events
|
List<?> |
nativeQuery(EntityManager em,
String query,
int pageNb,
int pageSize) |
List<?> |
nativeQuery(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.
|
List<LogEntry> |
nativeQueryLogs(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
|
LogEntry |
newLogEntry()
Create a new LogEntry instance.
|
List<LogEntry> |
queryLogs(EntityManager em,
String[] eventIds,
String dateRange) |
List<LogEntry> |
queryLogs(String[] eventIds,
String dateRange)
Returns the list of log entries.
|
List<LogEntry> |
queryLogsByPage(EntityManager em,
String[] eventIds,
Date limit,
String[] category,
String path,
int pageNb,
int pageSize) |
List<LogEntry> |
queryLogsByPage(EntityManager em,
String[] eventIds,
Date limit,
String category,
String path,
int pageNb,
int pageSize) |
List<LogEntry> |
queryLogsByPage(EntityManager em,
String[] eventIds,
String dateRange,
String[] category,
String path,
int pageNb,
int pageSize) |
List<LogEntry> |
queryLogsByPage(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,
Date limit,
String category,
String path,
int pageNb,
int pageSize)
Returns the batched list of log entries.
|
List<LogEntry> |
queryLogsByPage(String[] eventIds,
String dateRange,
String[] category,
String path,
int pageNb,
int pageSize) |
List<LogEntry> |
queryLogsByPage(String[] eventIds,
String dateRange,
String category,
String path,
int pageNb,
int pageSize)
Returns the batched list of log entries.
|
void |
registerContribution(Object contribution,
String extensionPoint,
ComponentInstance contributor) |
long |
syncLogCreationEntries(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.
|
void |
unregisterContribution(Object contribution,
String extensionPoint,
ComponentInstance contributor) |
activate, applicationStarted, getApplicationStartedOrder, getLastModified, registerExtension, setLastModified, unregisterExtension
public static final ComponentName NAME
public static final String DISABLE_AUDIT_LOGGER
public PersistenceProvider getOrCreatePersistenceProvider()
public void deactivate(ComponentContext context) throws Exception
Component
This method is called by the runtime when a component is deactivated.
deactivate
in interface Component
deactivate
in class DefaultComponent
context
- the runtime contextException
- if an error occurs during activationpublic void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor) throws Exception
registerContribution
in class DefaultComponent
Exception
public void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor) throws Exception
unregisterContribution
in class DefaultComponent
Exception
public Set<String> getAuditableEventNames()
AuditLogger
getAuditableEventNames
in interface AuditLogger
public AdapterDescriptor[] getRegisteredAdapters()
public void addLogEntries(List<LogEntry> entries)
AuditLogger
addLogEntries
in interface AuditLogger
entries
- the list of log entries.public void addLogEntries(EntityManager em, List<LogEntry> entries)
public List<LogEntry> getLogEntriesFor(String uuid)
AuditReader
getLogEntriesFor
in interface AuditReader
uuid
- the document uuidpublic List<LogEntry> getLogEntriesFor(EntityManager em, String uuid)
public List<LogEntry> getLogEntriesFor(String uuid, Map<String,FilterMapEntry> filterMap, boolean doDefaultSort)
getLogEntriesFor
in interface AuditReader
public List<LogEntry> getLogEntriesFor(EntityManager em, String uuid, Map<String,FilterMapEntry> filterMap, boolean doDefaultSort)
public LogEntry getLogEntryByID(long id)
AuditReader
getLogEntryByID
in interface AuditReader
id
- the log entry identifierpublic LogEntry getLogEntryByID(EntityManager em, long id)
public List<LogEntry> nativeQueryLogs(String whereClause, int pageNb, int pageSize)
AuditReader
nativeQueryLogs
in interface AuditReader
public List<LogEntry> nativeQueryLogs(EntityManager em, String whereClause, int pageNb, int pageSize)
public List<?> nativeQuery(String query, int pageNb, int pageSize)
AuditReader
nativeQuery
in interface AuditReader
public List<?> nativeQuery(EntityManager em, String query, int pageNb, int pageSize)
public List<?> nativeQuery(String query, Map<String,Object> params, int pageNb, int pageSize)
AuditReader
nativeQuery
in interface AuditReader
query
- a JPA query language queryparams
- parameters for the querypageNb
- the page number (starts at 1)pageSize
- the number of results per pagepublic List<?> nativeQuery(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
eventIds
- the event ids.dateRange
- a preset date range.DateRangeQueryConstants
public List<LogEntry> queryLogs(EntityManager em, String[] eventIds, String dateRange)
public List<LogEntry> queryLogsByPage(String[] eventIds, String dateRange, String[] category, String path, int pageNb, int pageSize)
queryLogsByPage
in interface AuditReader
public List<LogEntry> queryLogsByPage(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)
queryLogsByPage
in interface AuditReader
public List<LogEntry> queryLogsByPage(EntityManager em, String[] eventIds, Date limit, String[] category, String path, int pageNb, int pageSize)
public long syncLogCreationEntries(String repoId, String path, Boolean recurs)
AuditAdmin
syncLogCreationEntries
in interface AuditAdmin
public long syncLogCreationEntries(EntityManager em, String repoId, String path, Boolean recurs)
public void addLogEntry(LogEntry entry)
public void addLogEntry(EntityManager em, LogEntry entry)
public Long getEventsCount(EntityManager em, String eventId)
public List<String> getLoggedEventIds(EntityManager em)
public void logEvent(Event event)
AuditLogger
logEvent
in interface AuditLogger
public void logEvents(EventBundle eventBundle)
AuditLogger
logEvents
in interface AuditLogger
public void logEvents(EntityManager em, EventBundle eventBundle)
public void logEvent(EntityManager em, Event event)
public List<LogEntry> queryLogsByPage(EntityManager em, String[] eventIds, String dateRange, String category, String path, int pageNb, int pageSize)
public List<LogEntry> queryLogsByPage(String[] eventIds, String dateRange, String category, String path, int pageNb, int pageSize)
AuditReader
Note we will use NXQL in the future when the search engine will index history.
queryLogsByPage
in interface AuditReader
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 pageDateRangeQueryConstants
public List<LogEntry> queryLogsByPage(String[] eventIds, Date limit, String category, String path, int pageNb, int pageSize)
AuditReader
Note we will use NXQL in the future when the search engine will index history.
queryLogsByPage
in interface AuditReader
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 pageDateRangeQueryConstants
public List<LogEntry> queryLogsByPage(EntityManager em, String[] eventIds, Date limit, String category, String path, int pageNb, int pageSize)
public LogEntry newLogEntry()
AuditLogger
newLogEntry
in interface AuditLogger
public ExtendedInfo newExtendedInfo(Serializable value)
AuditLogger
newExtendedInfo
in interface AuditLogger
public <T> T getAdapter(Class<T> adapter)
Adaptable
null
if
no such object can be found.getAdapter
in interface Adaptable
getAdapter
in class DefaultComponent
adapter
- the adapter class to look upnull
if this object does not
have an adapter for the given classCopyright © 2013 Nuxeo SA. All Rights Reserved.