Class Convert_v0_3_To10RequestHandler
RequestHandler.
This class acts as an adapter layer between the v0.3 transport handlers and the v1.0 core request handler. It accepts v0.3 spec types, converts them to v1.0 types, delegates to the v1.0 DefaultRequestHandler, and converts the results back to v0.3 types.
Key responsibilities:
- Convert v0.3 params to v1.0 params using mappers
- Delegate to v1.0 RequestHandler
- Convert v1.0 results back to v0.3 results
- Handle streaming publishers with element-by-element conversion
Method naming differences between v0.3 and v1.0:
onSetTaskPushNotificationConfig(v0.3) →onCreateTaskPushNotificationConfig(v1.0)onResubscribeToTask(v0.3) →onSubscribeToTask(v1.0)onListTaskPushNotificationConfig(v0.3) →onListTaskPushNotificationConfigs(v1.0)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiononCancelTask(TaskIdParams_v0_3 v03Params, ServerCallContext context) Cancels a task.voidonDeleteTaskPushNotificationConfig(DeleteTaskPushNotificationConfigParams_v0_3 v03Params, ServerCallContext context) Deletes a task push notification configuration.onGetTask(TaskQueryParams_v0_3 v03Params, ServerCallContext context) Gets a task by ID.onGetTaskPushNotificationConfig(GetTaskPushNotificationConfigParams_v0_3 v03Params, ServerCallContext context) Gets a task push notification configuration.onListTaskPushNotificationConfig(ListTaskPushNotificationConfigParams_v0_3 v03Params, ServerCallContext context) Lists task push notification configurations.onMessageSend(MessageSendParams_v0_3 v03Params, ServerCallContext context) Sends a message (blocking).onMessageSendStream(MessageSendParams_v0_3 v03Params, ServerCallContext context) Sends a message (streaming).onResubscribeToTask(TaskIdParams_v0_3 v03Params, ServerCallContext context) Resubscribes to task updates (streaming).onSetTaskPushNotificationConfig(TaskPushNotificationConfig_v0_3 v03Config, ServerCallContext context) Sets (creates) a task push notification configuration.
-
Constructor Details
-
Convert_v0_3_To10RequestHandler
public Convert_v0_3_To10RequestHandler() -
Convert_v0_3_To10RequestHandler
-
-
Method Details
-
onGetTask
public Task_v0_3 onGetTask(TaskQueryParams_v0_3 v03Params, ServerCallContext context) throws A2AError Gets a task by ID.v0.3 → v1.0: Converts TaskQueryParams and Task
- Parameters:
v03Params- the v0.3 task query paramscontext- the server call context- Returns:
- the v0.3 task
- Throws:
A2AError- if an error occurs
-
onCancelTask
public Task_v0_3 onCancelTask(TaskIdParams_v0_3 v03Params, ServerCallContext context) throws A2AError Cancels a task.v0.3 → v1.0: Converts TaskIdParams to CancelTaskParams and Task
- Parameters:
v03Params- the v0.3 task ID paramscontext- the server call context- Returns:
- the v0.3 task
- Throws:
A2AError- if an error occurs
-
onMessageSend
public EventKind_v0_3 onMessageSend(MessageSendParams_v0_3 v03Params, ServerCallContext context) throws A2AError Sends a message (blocking).v0.3 → v1.0: Converts MessageSendParams and EventKind
- Parameters:
v03Params- the v0.3 message send paramscontext- the server call context- Returns:
- the v0.3 event kind (Task or Message)
- Throws:
A2AError- if an error occurs
-
onMessageSendStream
public Flow.Publisher<StreamingEventKind_v0_3> onMessageSendStream(MessageSendParams_v0_3 v03Params, ServerCallContext context) throws A2AError Sends a message (streaming).v0.3 → v1.0: Converts MessageSendParams and streams StreamingEventKind
- Parameters:
v03Params- the v0.3 message send paramscontext- the server call context- Returns:
- publisher of v0.3 streaming event kinds
- Throws:
A2AError- if an error occurs
-
onSetTaskPushNotificationConfig
public TaskPushNotificationConfig_v0_3 onSetTaskPushNotificationConfig(TaskPushNotificationConfig_v0_3 v03Config, ServerCallContext context) throws A2AError Sets (creates) a task push notification configuration.v0.3 method name:
onSetTaskPushNotificationConfigv1.0 method name:onCreateTaskPushNotificationConfig- Parameters:
v03Config- the v0.3 task push notification configcontext- the server call context- Returns:
- the v0.3 task push notification config
- Throws:
A2AError- if an error occurs
-
onGetTaskPushNotificationConfig
public TaskPushNotificationConfig_v0_3 onGetTaskPushNotificationConfig(GetTaskPushNotificationConfigParams_v0_3 v03Params, ServerCallContext context) throws A2AError Gets a task push notification configuration.v0.3 → v1.0: Converts GetTaskPushNotificationConfigParams and TaskPushNotificationConfig
v0.3 semantics: If a specific pushNotificationConfigId is provided but not found, fall back to returning the first config (lenient behavior).
- Parameters:
v03Params- the v0.3 get paramscontext- the server call context- Returns:
- the v0.3 task push notification config
- Throws:
A2AError- if an error occurs
-
onResubscribeToTask
public Flow.Publisher<StreamingEventKind_v0_3> onResubscribeToTask(TaskIdParams_v0_3 v03Params, ServerCallContext context) throws A2AError Resubscribes to task updates (streaming).v0.3 method name:
onResubscribeToTaskv1.0 method name:onSubscribeToTask- Parameters:
v03Params- the v0.3 task ID paramscontext- the server call context- Returns:
- publisher of v0.3 streaming event kinds
- Throws:
A2AError- if an error occurs
-
onListTaskPushNotificationConfig
public List<TaskPushNotificationConfig_v0_3> onListTaskPushNotificationConfig(ListTaskPushNotificationConfigParams_v0_3 v03Params, ServerCallContext context) throws A2AError Lists task push notification configurations.v0.3 → v1.0: Converts params and result (List → ListTaskPushNotificationConfigsResult)
- Parameters:
v03Params- the v0.3 list paramscontext- the server call context- Returns:
- list of v0.3 task push notification configs
- Throws:
A2AError- if an error occurs
-
onDeleteTaskPushNotificationConfig
public void onDeleteTaskPushNotificationConfig(DeleteTaskPushNotificationConfigParams_v0_3 v03Params, ServerCallContext context) throws A2AError Deletes a task push notification configuration.v0.3 → v1.0: Converts DeleteTaskPushNotificationConfigParams (adds tenant field)
- Parameters:
v03Params- the v0.3 delete paramscontext- the server call context- Throws:
A2AError- if an error occurs
-