Interface ClientTransport

All Known Implementing Classes:
GrpcTransport, JSONRPCTransport, OpenTelemetryClientPropagatorTransport, OpenTelemetryClientTransport, RestTransport

public interface ClientTransport
Interface for a client transport.
  • Method Details

    • sendMessage

      EventKind sendMessage(MessageSendParams request, @Nullable ClientCallContext context) throws A2AClientException
      Send a non-streaming message request to the agent.
      Parameters:
      request - the message send parameters
      context - optional client call context for the request (may be null)
      Returns:
      the response, either a Task or Message
      Throws:
      A2AClientException - if sending the message fails for any reason
    • sendMessageStreaming

      void sendMessageStreaming(MessageSendParams request, Consumer<StreamingEventKind> eventConsumer, Consumer<Throwable> errorConsumer, @Nullable ClientCallContext context) throws A2AClientException
      Send a streaming message request to the agent and receive responses as they arrive.
      Parameters:
      request - the message send parameters
      eventConsumer - consumer that will receive streaming events as they arrive
      errorConsumer - consumer that will be called if an error occurs during streaming
      context - optional client call context for the request (may be null)
      Throws:
      A2AClientException - if setting up the streaming connection fails
    • getTask

      Task getTask(TaskQueryParams request, @Nullable ClientCallContext context) throws A2AClientException
      Retrieve the current state and history of a specific task.
      Parameters:
      request - the task query parameters specifying which task to retrieve
      context - optional client call context for the request (may be null)
      Returns:
      the task
      Throws:
      A2AClientException - if retrieving the task fails for any reason
    • cancelTask

      Task cancelTask(CancelTaskParams request, @Nullable ClientCallContext context) throws A2AClientException
      Request the agent to cancel a specific task.
      Parameters:
      request - the task ID parameters specifying which task to cancel
      context - optional client call context for the request (may be null)
      Returns:
      the cancelled task
      Throws:
      A2AClientException - if cancelling the task fails for any reason
    • listTasks

      ListTasksResult listTasks(ListTasksParams request, @Nullable ClientCallContext context) throws A2AClientException
      List tasks with optional filtering and pagination.
      Parameters:
      request - the list tasks parameters including filters and pagination
      context - optional client call context for the request (may be null)
      Returns:
      the list tasks result containing tasks and pagination information
      Throws:
      A2AClientException - if listing tasks fails for any reason
    • createTaskPushNotificationConfiguration

      TaskPushNotificationConfig createTaskPushNotificationConfiguration(TaskPushNotificationConfig request, @Nullable ClientCallContext context) throws A2AClientException
      Create or update the push notification configuration for a specific task.
      Parameters:
      request - the push notification configuration to set for the task
      context - optional client call context for the request (may be null)
      Returns:
      the configured TaskPushNotificationConfig
      Throws:
      A2AClientException - if creating or updating the task push notification configuration fails for any reason
    • getTaskPushNotificationConfiguration

      TaskPushNotificationConfig getTaskPushNotificationConfiguration(GetTaskPushNotificationConfigParams request, @Nullable ClientCallContext context) throws A2AClientException
      Retrieve the push notification configuration for a specific task.
      Parameters:
      request - the parameters specifying which task's notification config to retrieve
      context - optional client call context for the request (may be null)
      Returns:
      the task push notification config
      Throws:
      A2AClientException - if getting the task push notification config fails for any reason
    • listTaskPushNotificationConfigurations

      ListTaskPushNotificationConfigsResult listTaskPushNotificationConfigurations(ListTaskPushNotificationConfigsParams request, @Nullable ClientCallContext context) throws A2AClientException
      Retrieve the list of push notification configurations for a specific task with pagination support.
      Parameters:
      request - the parameters specifying which task's notification configs to retrieve
      context - optional client call context for the request (may be null)
      Returns:
      the result containing the list of task push notification configs and pagination information
      Throws:
      A2AClientException - if getting the task push notification configs fails for any reason
    • deleteTaskPushNotificationConfigurations

      void deleteTaskPushNotificationConfigurations(DeleteTaskPushNotificationConfigParams request, @Nullable ClientCallContext context) throws A2AClientException
      Delete the list of push notification configurations for a specific task.
      Parameters:
      request - the parameters specifying which task's notification configs to delete
      context - optional client call context for the request (may be null)
      Throws:
      A2AClientException - if deleting the task push notification configs fails for any reason
    • subscribeToTask

      void subscribeToTask(TaskIdParams request, Consumer<StreamingEventKind> eventConsumer, Consumer<Throwable> errorConsumer, @Nullable ClientCallContext context) throws A2AClientException
      Reconnect to get task updates for an existing task.
      Parameters:
      request - the task ID parameters specifying which task to subscribe to
      eventConsumer - consumer that will receive streaming events as they arrive
      errorConsumer - consumer that will be called if an error occurs during streaming
      context - optional client call context for the request (may be null)
      Throws:
      A2AClientException - if subscribing to the task fails for any reason
    • getExtendedAgentCard

      AgentCard getExtendedAgentCard(GetExtendedAgentCardParams params, @Nullable ClientCallContext context) throws A2AClientException
      Retrieve the extended AgentCard.
      Parameters:
      params - the parameters to get the extended agent card.
      context - optional client call context for the request (may be null)
      Returns:
      the extended agent card
      Throws:
      A2AClientException - if retrieving the agent card fails for any reason
    • close

      void close()
      Close the transport and release any associated resources.