Class Convert_v0_3_To10RequestHandler

java.lang.Object
org.a2aproject.sdk.compat03.conversion.Convert_v0_3_To10RequestHandler

@ApplicationScoped public class Convert_v0_3_To10RequestHandler extends Object
Request handler that converts v0.3 protocol requests to v1.0 and delegates to the v1.0 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 Details

    • Convert_v0_3_To10RequestHandler

      public Convert_v0_3_To10RequestHandler()
    • Convert_v0_3_To10RequestHandler

      @Inject public Convert_v0_3_To10RequestHandler(RequestHandler v10Handler)
  • 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 params
      context - 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 params
      context - 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 params
      context - 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 params
      context - 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: onSetTaskPushNotificationConfig v1.0 method name: onCreateTaskPushNotificationConfig

      Parameters:
      v03Config - the v0.3 task push notification config
      context - 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 params
      context - 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: onResubscribeToTask v1.0 method name: onSubscribeToTask

      Parameters:
      v03Params - the v0.3 task ID params
      context - 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 params
      context - 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 params
      context - the server call context
      Throws:
      A2AError - if an error occurs