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, unregisterExtensionpublic static final ComponentName NAME
public static final String DISABLE_AUDIT_LOGGER
public PersistenceProvider getOrCreatePersistenceProvider()
public void deactivate(ComponentContext context) throws Exception
ComponentThis method is called by the runtime when a component is deactivated.
deactivate in interface Componentdeactivate in class DefaultComponentcontext - the runtime contextException - if an error occurs during activationpublic void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor) throws Exception
registerContribution in class DefaultComponentExceptionpublic void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor) throws Exception
unregisterContribution in class DefaultComponentExceptionpublic Set<String> getAuditableEventNames()
AuditLoggergetAuditableEventNames in interface AuditLoggerpublic AdapterDescriptor[] getRegisteredAdapters()
public void addLogEntries(List<LogEntry> entries)
AuditLoggeraddLogEntries in interface AuditLoggerentries - the list of log entries.public void addLogEntries(EntityManager em, List<LogEntry> entries)
public List<LogEntry> getLogEntriesFor(String uuid)
AuditReadergetLogEntriesFor in interface AuditReaderuuid - 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 AuditReaderpublic List<LogEntry> getLogEntriesFor(EntityManager em, String uuid, Map<String,FilterMapEntry> filterMap, boolean doDefaultSort)
public LogEntry getLogEntryByID(long id)
AuditReadergetLogEntryByID in interface AuditReaderid - the log entry identifierpublic LogEntry getLogEntryByID(EntityManager em, long id)
public List<LogEntry> nativeQueryLogs(String whereClause, int pageNb, int pageSize)
AuditReadernativeQueryLogs in interface AuditReaderpublic List<LogEntry> nativeQueryLogs(EntityManager em, String whereClause, int pageNb, int pageSize)
public List<?> nativeQuery(String query, int pageNb, int pageSize)
AuditReadernativeQuery in interface AuditReaderpublic List<?> nativeQuery(EntityManager em, String query, int pageNb, int pageSize)
public List<?> nativeQuery(String query, Map<String,Object> params, int pageNb, int pageSize)
AuditReadernativeQuery in interface AuditReaderquery - 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)
AuditReaderNote we will use NXQL in the future when the search engine will index history.
queryLogs in interface AuditReadereventIds - the event ids.dateRange - a preset date range.DateRangeQueryConstantspublic 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 AuditReaderpublic 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 AuditReaderpublic 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)
AuditAdminsyncLogCreationEntries in interface AuditAdminpublic 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)
AuditLoggerlogEvent in interface AuditLoggerpublic void logEvents(EventBundle eventBundle)
AuditLoggerlogEvents in interface AuditLoggerpublic 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)
AuditReaderNote we will use NXQL in the future when the search engine will index history.
queryLogsByPage in interface AuditReadereventIds - 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 pageDateRangeQueryConstantspublic List<LogEntry> queryLogsByPage(String[] eventIds, Date limit, String category, String path, int pageNb, int pageSize)
AuditReaderNote we will use NXQL in the future when the search engine will index history.
queryLogsByPage in interface AuditReadereventIds - 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 pageDateRangeQueryConstantspublic List<LogEntry> queryLogsByPage(EntityManager em, String[] eventIds, Date limit, String category, String path, int pageNb, int pageSize)
public LogEntry newLogEntry()
AuditLoggernewLogEntry in interface AuditLoggerpublic ExtendedInfo newExtendedInfo(Serializable value)
AuditLoggernewExtendedInfo in interface AuditLoggerpublic <T> T getAdapter(Class<T> adapter)
Adaptablenull if
no such object can be found.getAdapter in interface AdaptablegetAdapter in class DefaultComponentadapter - the adapter class to look upnull if this object does not
have an adapter for the given classCopyright © 2013 Nuxeo SA. All Rights Reserved.