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.JSONRPCError 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.JSONRPCError getErrorObject()
      Get the JSONRPCError field (for JSON serialization).
      Returns:
      the JSONRPCError or null
    • setError

      public void setError(io.a2a.spec.JSONRPCError 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, JSONRPCError, 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 JSONRPCError
    • 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
    • toString

      public String toString()
      Overrides:
      toString in class Object