Class ReplicatedEventQueueItem
java.lang.Object
io.a2a.extras.queuemanager.replicated.core.ReplicatedEventQueueItem
- All Implemented Interfaces:
EventQueueItem
-
Constructor Summary
ConstructorsConstructorDescriptionReplicatedEventQueueItem(String taskId, io.a2a.spec.Event event) ReplicatedEventQueueItem(String taskId, io.a2a.spec.JSONRPCError error) ReplicatedEventQueueItem(String taskId, io.a2a.spec.StreamingEventKind event) -
Method Summary
Modifier and TypeMethodDescriptionio.a2a.spec.JSONRPCErrorGet the JSONRPCError 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).voidsetClosedEvent(boolean closedEvent) Set the closed event flag (for JSON deserialization).voidsetError(io.a2a.spec.JSONRPCError 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.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:
getEventin interfaceEventQueueItem- 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:
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 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
-