Class ReplicatedEventQueueItem

java.lang.Object
io.a2a.extras.queuemanager.replicated.core.ReplicatedEventQueueItem
All Implemented Interfaces:
EventQueueItem

public class ReplicatedEventQueueItem extends Object implements EventQueueItem
  • Constructor Details

    • ReplicatedEventQueueItem

      public ReplicatedEventQueueItem()
    • ReplicatedEventQueueItem

      public ReplicatedEventQueueItem(String taskId, io.a2a.spec.StreamingEventKind event)
    • ReplicatedEventQueueItem

      public ReplicatedEventQueueItem(String taskId, io.a2a.spec.A2AError error)
    • ReplicatedEventQueueItem

      public ReplicatedEventQueueItem(String taskId, io.a2a.spec.Event event)
  • Method Details

    • getTaskId

      public String getTaskId()
    • setTaskId

      public void setTaskId(String taskId)
    • getStreamingEvent

      public io.a2a.spec.StreamingEventKind getStreamingEvent()
      Get the StreamingEventKind event field (for JSON serialization).
      Returns:
      the StreamingEventKind event or null
    • setEvent

      public void setEvent(io.a2a.spec.StreamingEventKind event)
    • getErrorObject

      public io.a2a.spec.A2AError getErrorObject()
      Get the A2AError field (for JSON serialization).
      Returns:
      the A2AError or null
    • setError

      public void setError(io.a2a.spec.A2AError error)
    • getEvent

      public io.a2a.spec.Event getEvent()
      Get the contained event as the generic Event interface (implements EventQueueItem). This is the method required by the EventQueueItem interface.
      Specified by:
      getEvent in interface EventQueueItem
      Returns:
      the event (StreamingEventKind, A2AError, or QueueClosedEvent) or null if none is set
    • isReplicated

      public boolean isReplicated()
      Indicates this is a replicated event (implements EventQueueItem).
      Specified by:
      isReplicated in interface EventQueueItem
      Returns:
      always true for replicated events
    • hasEvent

      public boolean hasEvent()
      Check if this ReplicatedEvent contains an event (vs an error).
      Returns:
      true if it contains a StreamingEventKind event
    • hasError

      public boolean hasError()
      Check if this ReplicatedEvent contains an error.
      Returns:
      true if it contains a A2AError
    • isClosedEvent

      public boolean isClosedEvent()
      Check if this is a QueueClosedEvent (poison pill). For JSON serialization.
      Returns:
      true if this is a queue closed event
    • setClosedEvent

      public void setClosedEvent(boolean closedEvent)
      Set the closed event flag (for JSON deserialization).
      Parameters:
      closedEvent - true if this is a queue closed event
    • isTaskEvent

      public boolean isTaskEvent()
      Check if this event is a Task event. Task events should always be processed even for inactive tasks, as they carry the final task state.
      Returns:
      true if this is a Task event
    • toString

      public String toString()
      Overrides:
      toString in class Object