Class EventOutboxService


public class EventOutboxService extends CayenneService
Provides an event outbox service which handles event outbox entity creation and updating.
Since:
22.10.0
  • 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 set
      eventTopic - an event topic
      payload - a payload value
      user - the current user
      Returns:
      the created EventOutbox entity
    • updateEventOutboxToInProgress

      public boolean updateEventOutboxToInProgress(EventOutbox eventOutbox)
      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

      public boolean updateEventOutboxToInQueue(EventOutbox eventOutbox)
      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

      public boolean updateEventOutboxToFailedProcessing(EventOutbox eventOutbox, ErrorLog errorLog)
      Update an eventOutbox with failed processing status.
      Parameters:
      eventOutbox - the eventOutbox
      errorLog - the errorLog
      Returns:
      true if eventOutbox status changed to in queue, false if there is a lock exception
    • updateEventOutboxToFailedBeforeProcessing

      public boolean updateEventOutboxToFailedBeforeProcessing(EventOutbox eventOutbox)
      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

      public boolean updateEventOutboxToDelivered(EventOutbox eventOutbox, String response)
      update an eventOutbox with delivered status.
      Parameters:
      eventOutbox - the eventOutbox
      response - the response
      Returns:
      true if eventOutbox status changed to delivered, false if there is a lock exception