public class EventLogService extends Object
An event that occurs during an update or a processing function within a transaction becomes a fact when the transaction completes successfully. The EventLogService can be used to create this kind of "Change Data Capture" events. An example is the LuceneUpdateService, which should update the index of a document only if the document was successfully written to the database.
The service is bound to the current PersistenceContext and stores a defined type of document entity directly in the database to represent an event. These types of events can be queried by clients through the service.
UpdateService| Constructor and Description |
|---|
EventLogService() |
| Modifier and Type | Method and Description |
|---|---|
EventLog |
createEvent(String topic,
String refID)
Creates/updates a new event log entry.
|
EventLog |
createEvent(String topic,
String refID,
ItemCollection document)
Creates/updates a new event log entry.
|
EventLog |
createEvent(String topic,
String refID,
Map<String,List<Object>> data)
Creates/updates a new event log entry.
|
List<EventLog> |
findEventsByRef(int maxCount,
String ref,
String... topic)
Finds events for one or many given topics assigned to a given document
reference ($uniqueId).
|
List<EventLog> |
findEventsByTopic(int maxCount,
String... topic)
Finds events for one or many given topics
|
EventLog |
getEvent(String id)
Returns an detached event log entry by its ID.
|
void |
removeEvent(EventLog _eventLog)
Deletes an existing eventLog.
|
void |
removeEvent(String id)
Deletes an existing eventLog by its id.
|
public EventLog createEvent(String topic, String refID)
refID - - uniqueid of the document to be assigned to the eventtopic - - the topic of the event.public EventLog createEvent(String topic, String refID, ItemCollection document)
refID - - uniqueId of the document to be assigned to the eventtopic - - the topic of the event.document - - optional document providing a data mappublic EventLog createEvent(String topic, String refID, Map<String,List<Object>> data)
refID - - uniqueId of the document to be assigned to the eventtopic - - the topic of the event.data - - optional data mappublic List<EventLog> findEventsByTopic(int maxCount, String... topic)
maxCount - - maximum count of events to be returnedtopic - - list of topicspublic List<EventLog> findEventsByRef(int maxCount, String ref, String... topic)
maxCount - - maximum count of events to be returnedref - - a reference ID for an assigned Document or Workitem
instancetopic - - list of topicspublic void removeEvent(EventLog _eventLog)
eventLog - public void removeEvent(String id)
eventLog - Copyright © 2006–2020 Imixs Software Solutions GmbH. All rights reserved.