Interface ClientTransport


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

    Modifier and Type
    Method
    Description
    org.a2aproject.sdk.spec.Task
    cancelTask(org.a2aproject.sdk.spec.CancelTaskParams request, @Nullable ClientCallContext context)
    Request the agent to cancel a specific task.
    void
    Close the transport and release any associated resources.
    org.a2aproject.sdk.spec.TaskPushNotificationConfig
    createTaskPushNotificationConfiguration(org.a2aproject.sdk.spec.TaskPushNotificationConfig request, @Nullable ClientCallContext context)
    Create or update the push notification configuration for a specific task.
    void
    deleteTaskPushNotificationConfigurations(org.a2aproject.sdk.spec.DeleteTaskPushNotificationConfigParams request, @Nullable ClientCallContext context)
    Delete the list of push notification configurations for a specific task.
    org.a2aproject.sdk.spec.AgentCard
    getExtendedAgentCard(org.a2aproject.sdk.spec.GetExtendedAgentCardParams params, @Nullable ClientCallContext context)
    Retrieve the extended AgentCard.
    org.a2aproject.sdk.spec.Task
    getTask(org.a2aproject.sdk.spec.TaskQueryParams request, @Nullable ClientCallContext context)
    Retrieve the current state and history of a specific task.
    org.a2aproject.sdk.spec.TaskPushNotificationConfig
    getTaskPushNotificationConfiguration(org.a2aproject.sdk.spec.GetTaskPushNotificationConfigParams request, @Nullable ClientCallContext context)
    Retrieve the push notification configuration for a specific task.
    org.a2aproject.sdk.spec.ListTaskPushNotificationConfigsResult
    listTaskPushNotificationConfigurations(org.a2aproject.sdk.spec.ListTaskPushNotificationConfigsParams request, @Nullable ClientCallContext context)
    Retrieve the list of push notification configurations for a specific task with pagination support.
    org.a2aproject.sdk.jsonrpc.common.wrappers.ListTasksResult
    listTasks(org.a2aproject.sdk.spec.ListTasksParams request, @Nullable ClientCallContext context)
    List tasks with optional filtering and pagination.
    org.a2aproject.sdk.spec.EventKind
    sendMessage(org.a2aproject.sdk.spec.MessageSendParams request, @Nullable ClientCallContext context)
    Send a non-streaming message request to the agent.
    void
    sendMessageStreaming(org.a2aproject.sdk.spec.MessageSendParams request, Consumer<org.a2aproject.sdk.spec.StreamingEventKind> eventConsumer, Consumer<Throwable> errorConsumer, @Nullable ClientCallContext context)
    Send a streaming message request to the agent and receive responses as they arrive.
    void
    subscribeToTask(org.a2aproject.sdk.spec.TaskIdParams request, Consumer<org.a2aproject.sdk.spec.StreamingEventKind> eventConsumer, Consumer<Throwable> errorConsumer, @Nullable ClientCallContext context)
    Reconnect to get task updates for an existing task.
  • Method Details

    • sendMessage

      org.a2aproject.sdk.spec.EventKind sendMessage(org.a2aproject.sdk.spec.MessageSendParams request, @Nullable ClientCallContext context) throws org.a2aproject.sdk.spec.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:
      org.a2aproject.sdk.spec.A2AClientException - if sending the message fails for any reason
    • sendMessageStreaming

      void sendMessageStreaming(org.a2aproject.sdk.spec.MessageSendParams request, Consumer<org.a2aproject.sdk.spec.StreamingEventKind> eventConsumer, Consumer<Throwable> errorConsumer, @Nullable ClientCallContext context) throws org.a2aproject.sdk.spec.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:
      org.a2aproject.sdk.spec.A2AClientException - if setting up the streaming connection fails
    • getTask

      org.a2aproject.sdk.spec.Task getTask(org.a2aproject.sdk.spec.TaskQueryParams request, @Nullable ClientCallContext context) throws org.a2aproject.sdk.spec.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:
      org.a2aproject.sdk.spec.A2AClientException - if retrieving the task fails for any reason
    • cancelTask

      org.a2aproject.sdk.spec.Task cancelTask(org.a2aproject.sdk.spec.CancelTaskParams request, @Nullable ClientCallContext context) throws org.a2aproject.sdk.spec.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:
      org.a2aproject.sdk.spec.A2AClientException - if cancelling the task fails for any reason
    • listTasks

      org.a2aproject.sdk.jsonrpc.common.wrappers.ListTasksResult listTasks(org.a2aproject.sdk.spec.ListTasksParams request, @Nullable ClientCallContext context) throws org.a2aproject.sdk.spec.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:
      org.a2aproject.sdk.spec.A2AClientException - if listing tasks fails for any reason
    • createTaskPushNotificationConfiguration

      org.a2aproject.sdk.spec.TaskPushNotificationConfig createTaskPushNotificationConfiguration(org.a2aproject.sdk.spec.TaskPushNotificationConfig request, @Nullable ClientCallContext context) throws org.a2aproject.sdk.spec.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:
      org.a2aproject.sdk.spec.A2AClientException - if creating or updating the task push notification configuration fails for any reason
    • getTaskPushNotificationConfiguration

      org.a2aproject.sdk.spec.TaskPushNotificationConfig getTaskPushNotificationConfiguration(org.a2aproject.sdk.spec.GetTaskPushNotificationConfigParams request, @Nullable ClientCallContext context) throws org.a2aproject.sdk.spec.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:
      org.a2aproject.sdk.spec.A2AClientException - if getting the task push notification config fails for any reason
    • listTaskPushNotificationConfigurations

      org.a2aproject.sdk.spec.ListTaskPushNotificationConfigsResult listTaskPushNotificationConfigurations(org.a2aproject.sdk.spec.ListTaskPushNotificationConfigsParams request, @Nullable ClientCallContext context) throws org.a2aproject.sdk.spec.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:
      org.a2aproject.sdk.spec.A2AClientException - if getting the task push notification configs fails for any reason
    • deleteTaskPushNotificationConfigurations

      void deleteTaskPushNotificationConfigurations(org.a2aproject.sdk.spec.DeleteTaskPushNotificationConfigParams request, @Nullable ClientCallContext context) throws org.a2aproject.sdk.spec.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:
      org.a2aproject.sdk.spec.A2AClientException - if deleting the task push notification configs fails for any reason
    • subscribeToTask

      void subscribeToTask(org.a2aproject.sdk.spec.TaskIdParams request, Consumer<org.a2aproject.sdk.spec.StreamingEventKind> eventConsumer, Consumer<Throwable> errorConsumer, @Nullable ClientCallContext context) throws org.a2aproject.sdk.spec.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:
      org.a2aproject.sdk.spec.A2AClientException - if subscribing to the task fails for any reason
    • getExtendedAgentCard

      org.a2aproject.sdk.spec.AgentCard getExtendedAgentCard(org.a2aproject.sdk.spec.GetExtendedAgentCardParams params, @Nullable ClientCallContext context) throws org.a2aproject.sdk.spec.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:
      org.a2aproject.sdk.spec.A2AClientException - if retrieving the agent card fails for any reason
    • close

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