Package com.avoka.fc.core.service
Class EventOutboxService
java.lang.Object
com.avoka.fc.core.service.BaseService
com.avoka.fc.core.service.CayenneService
com.avoka.fc.core.service.EventOutboxService
Provides an event outbox service which handles event outbox entity creation and updating.
- Since:
- 22.10.0
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreateOutboxEvent
(ServiceConnection serviceConnection, String eventTopic, String payload, String eventDetails, EventOutbox.EntityType entityType, String entityId, UserAccount user) create a new EventOutbox entity.boolean
updateEventOutboxToDelivered
(EventOutbox eventOutbox, String response) update an eventOutbox with delivered status.boolean
updateEventOutboxToFailedBeforeProcessing
(EventOutbox eventOutbox) Update an eventOutbox with before failed processing statusboolean
updateEventOutboxToFailedProcessing
(EventOutbox eventOutbox, ErrorLog errorLog) Update an eventOutbox with failed processing status.boolean
updateEventOutboxToInProgress
(EventOutbox eventOutbox) Update an eventOutbox with in progress status.boolean
updateEventOutboxToInQueue
(EventOutbox eventOutbox) Update an eventOutbox with in queue processing status.Methods inherited from class com.avoka.fc.core.service.CayenneService
commitChanges, deleteObject, deleteObjects, findObject, getDataContext, getDataDomain, getObjectForPK, getObjectStore, newObject, performNamedQuery, performNamedQuery, performNamedQuery, performNonSelectingQuery, performNonSelectingQuery, performNonSelectingQuery, performNonSelectingQuery, performQuery, performQuery, refetchEntity, refetchObject, registerNewObject, rollbackChanges, toMap, toMap
Methods inherited from class com.avoka.fc.core.service.BaseService
getLogger
-
Constructor Details
-
EventOutboxService
public EventOutboxService()
-
-
Method Details
-
createOutboxEvent
public EventOutbox createOutboxEvent(ServiceConnection serviceConnection, String eventTopic, String payload, String eventDetails, EventOutbox.EntityType entityType, String entityId, UserAccount user) create a new EventOutbox entity. This method doesn't include commit and caller should commit the change.- Parameters:
serviceConnection
- the serviceConnection value to seteventTopic
- an event topicpayload
- a payload valueuser
- the current user- Returns:
- the created EventOutbox entity
-
updateEventOutboxToInProgress
Update an eventOutbox with in progress status.- Parameters:
eventOutbox
- the eventOutbox- Returns:
- true if eventOutbox status changed to in progress, false if there is a lock exception
-
updateEventOutboxToInQueue
Update an eventOutbox with in queue processing status.- Parameters:
eventOutbox
- the eventOutbox- Returns:
- true if eventOutbox status changed to in queue, false if there is a lock exception
-
updateEventOutboxToFailedProcessing
Update an eventOutbox with failed processing status.- Parameters:
eventOutbox
- the eventOutboxerrorLog
- the errorLog- Returns:
- true if eventOutbox status changed to in queue, false if there is a lock exception
-
updateEventOutboxToFailedBeforeProcessing
Update an eventOutbox with before failed processing status- Parameters:
eventOutbox
- the eventOutbox- Returns:
- true if eventOutbox error type changed to FailBeforeProcessing, false if there is a lock exception
-
updateEventOutboxToDelivered
update an eventOutbox with delivered status.- Parameters:
eventOutbox
- the eventOutboxresponse
- the response- Returns:
- true if eventOutbox status changed to delivered, false if there is a lock exception
-