Class ReplicatedEventQueueItem
java.lang.Object
io.a2a.extras.queuemanager.replicated.core.ReplicatedEventQueueItem
- All Implemented Interfaces:
EventQueueItem
-
Constructor Summary
ConstructorsConstructorDescriptionReplicatedEventQueueItem(String taskId, io.a2a.spec.A2AError error) ReplicatedEventQueueItem(String taskId, io.a2a.spec.Event event) ReplicatedEventQueueItem(String taskId, io.a2a.spec.StreamingEventKind event) -
Method Summary
Modifier and TypeMethodDescriptionio.a2a.spec.A2AErrorGet the A2AError field (for JSON serialization).io.a2a.spec.EventgetEvent()Get the contained event as the generic Event interface (implements EventQueueItem).io.a2a.spec.StreamingEventKindGet the StreamingEventKind event field (for JSON serialization).booleanhasError()Check if this ReplicatedEvent contains an error.booleanhasEvent()Check if this ReplicatedEvent contains an event (vs an error).booleanCheck if this is a QueueClosedEvent (poison pill).booleanIndicates this is a replicated event (implements EventQueueItem).booleanCheck if this event is a Task event.voidsetClosedEvent(boolean closedEvent) Set the closed event flag (for JSON deserialization).voidsetError(io.a2a.spec.A2AError error) voidsetEvent(io.a2a.spec.StreamingEventKind event) voidtoString()
-
Constructor Details
-
ReplicatedEventQueueItem
public ReplicatedEventQueueItem() -
ReplicatedEventQueueItem
-
ReplicatedEventQueueItem
-
ReplicatedEventQueueItem
-
-
Method Details
-
getTaskId
-
setTaskId
-
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:
getEventin interfaceEventQueueItem- 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:
isReplicatedin interfaceEventQueueItem- 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
-