Class SubscribeToTaskRequest
java.lang.Object
org.a2aproject.sdk.jsonrpc.common.wrappers.A2ARequest<T>
org.a2aproject.sdk.jsonrpc.common.wrappers.StreamingJSONRPCRequest<TaskIdParams>
org.a2aproject.sdk.jsonrpc.common.wrappers.SubscribeToTaskRequest
- All Implemented Interfaces:
A2AMessage
JSON-RPC request to subscribe to an ongoing or completed task's event stream.
This request allows clients to reconnect to a task and receive its events, enabling recovery from disconnections or retrieval of missed updates. The agent will stream events for the task starting from its current state.
Resubscription is particularly useful for:
- Recovering from network interruptions without losing task context
- Multiple clients observing the same task
- Retrieving final results for completed tasks
This class implements the JSON-RPC SubscribeToTask method as specified in the A2A Protocol.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder for constructing instances. -
Field Summary
Fields inherited from class org.a2aproject.sdk.jsonrpc.common.wrappers.A2ARequest
id, jsonrpc, method, paramsFields inherited from interface org.a2aproject.sdk.jsonrpc.common.wrappers.A2AMessage
JSONRPC_VERSION -
Constructor Summary
ConstructorsConstructorDescriptionSubscribeToTaskRequest(Object id, TaskIdParams params) Constructs request with ID and parameters.SubscribeToTaskRequest(String jsonrpc, Object id, TaskIdParams params) Constructs request with all parameters. -
Method Summary
Methods inherited from class org.a2aproject.sdk.jsonrpc.common.wrappers.A2ARequest
getId, getJsonrpc, getMethod, getParams, validateAndSetJsonParameters
-
Constructor Details
-
SubscribeToTaskRequest
Constructs request with all parameters.- Parameters:
jsonrpc- the JSON-RPC versionid- the request IDparams- the request parameters
-
SubscribeToTaskRequest
Constructs request with ID and parameters.- Parameters:
id- the request IDparams- the request parameters
-
-
Method Details
-
builder
Create a new Builder- Returns:
- the builder
-