Class A2ARestServerResource

java.lang.Object
org.wildfly.extras.a2a.server.apps.rest.A2ARestServerResource

@Path("/") public class A2ARestServerResource extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    jakarta.ws.rs.core.Response
    cancelTask(String taskId, String body, jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.ws.rs.core.SecurityContext securityContext)
     
    jakarta.ws.rs.core.Response
    deleteTaskPushNotificationConfiguration(String taskId, String configId, jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.ws.rs.core.SecurityContext securityContext)
     
    jakarta.ws.rs.core.Response
    Handles incoming GET requests to the agent card endpoint.
    jakarta.ws.rs.core.Response
     
    jakarta.ws.rs.core.Response
    getTask(String taskId, String history_length, jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.ws.rs.core.SecurityContext securityContext)
     
    jakarta.ws.rs.core.Response
    getTaskPushNotificationConfiguration(String taskId, String configId, jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.ws.rs.core.SecurityContext securityContext)
     
    jakarta.ws.rs.core.Response
    listTaskPushNotificationConfigurations(String taskId, jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.ws.rs.core.SecurityContext securityContext)
     
    void
    resubscribeTask(String taskId, jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.servlet.http.HttpServletResponse httpResponse, jakarta.ws.rs.core.SecurityContext securityContext)
     
    jakarta.ws.rs.core.Response
    sendMessage(String body, jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.ws.rs.core.SecurityContext securityContext)
    Handles incoming POST requests to the main A2A endpoint.Dispatches the request to the appropriate JSON-RPC handler method and returns the response.
    void
    sendMessageStreaming(String body, jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.servlet.http.HttpServletResponse httpResponse, jakarta.ws.rs.core.SecurityContext securityContext)
     
    static void
    setStreamingIsSubscribedRunnable(Runnable streamingIsSubscribedRunnable)
     
    jakarta.ws.rs.core.Response
    setTaskPushNotificationConfiguration(String taskId, String body, jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.ws.rs.core.SecurityContext securityContext)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • A2ARestServerResource

      public A2ARestServerResource()
  • Method Details

    • sendMessage

      @POST @Consumes("application/json") @Produces("application/json") @Path("v1/message:send") public jakarta.ws.rs.core.Response sendMessage(String body, @Context jakarta.servlet.http.HttpServletRequest httpRequest, @Context jakarta.ws.rs.core.SecurityContext securityContext)
      Handles incoming POST requests to the main A2A endpoint.Dispatches the request to the appropriate JSON-RPC handler method and returns the response.
      Parameters:
      body -
      httpRequest - the HTTP request
      Returns:
      the JSON-RPC response which may be an error response
    • sendMessageStreaming

      @POST @Consumes("application/json") @Produces("text/event-stream") @Path("v1/message:stream") public void sendMessageStreaming(String body, @Context jakarta.servlet.http.HttpServletRequest httpRequest, @Context jakarta.servlet.http.HttpServletResponse httpResponse, @Context jakarta.ws.rs.core.SecurityContext securityContext) throws IOException
      Throws:
      IOException
    • resubscribeTask

      @POST @Consumes("application/json") @Produces("text/event-stream") @Path("v1/tasks/{taskId}:subscribe") public void resubscribeTask(@PathParam("taskId") String taskId, @Context jakarta.servlet.http.HttpServletRequest httpRequest, @Context jakarta.servlet.http.HttpServletResponse httpResponse, @Context jakarta.ws.rs.core.SecurityContext securityContext) throws IOException
      Throws:
      IOException
    • getAgentCard

      @GET @Path(".well-known/agent-card.json") @Consumes("application/json") @Produces("application/json") public jakarta.ws.rs.core.Response getAgentCard()
      Handles incoming GET requests to the agent card endpoint. Returns the agent card in JSON format.
      Returns:
      the agent card
    • getAuthenticatedExtendedCard

      @GET @Path("v1/card") @Consumes("application/json") @Produces("application/json") public jakarta.ws.rs.core.Response getAuthenticatedExtendedCard()
    • getTask

      @GET @Path("v1/tasks/{taskId}") @Consumes("application/json") @Produces("application/json") public jakarta.ws.rs.core.Response getTask(@PathParam("taskId") String taskId, @QueryParam("history_length") String history_length, @Context jakarta.servlet.http.HttpServletRequest httpRequest, @Context jakarta.ws.rs.core.SecurityContext securityContext)
    • cancelTask

      @POST @Path("v1/tasks/{taskId}:cancel") @Consumes("application/json") @Produces("application/json") public jakarta.ws.rs.core.Response cancelTask(@PathParam("taskId") String taskId, String body, @Context jakarta.servlet.http.HttpServletRequest httpRequest, @Context jakarta.ws.rs.core.SecurityContext securityContext)
    • setTaskPushNotificationConfiguration

      @POST @Path("v1/tasks/{taskId}/pushNotificationConfigs") @Consumes("application/json") @Produces("application/json") public jakarta.ws.rs.core.Response setTaskPushNotificationConfiguration(@PathParam("taskId") String taskId, String body, @Context jakarta.servlet.http.HttpServletRequest httpRequest, @Context jakarta.ws.rs.core.SecurityContext securityContext)
    • getTaskPushNotificationConfiguration

      @GET @Path("v1/tasks/{taskId}/pushNotificationConfigs/{configId}") @Consumes("application/json") @Produces("application/json") public jakarta.ws.rs.core.Response getTaskPushNotificationConfiguration(@PathParam("taskId") String taskId, @PathParam("configId") String configId, @Context jakarta.servlet.http.HttpServletRequest httpRequest, @Context jakarta.ws.rs.core.SecurityContext securityContext)
    • listTaskPushNotificationConfigurations

      @GET @Path("v1/tasks/{taskId}/pushNotificationConfigs") @Consumes("application/json") @Produces("application/json") public jakarta.ws.rs.core.Response listTaskPushNotificationConfigurations(@PathParam("taskId") String taskId, @Context jakarta.servlet.http.HttpServletRequest httpRequest, @Context jakarta.ws.rs.core.SecurityContext securityContext)
    • deleteTaskPushNotificationConfiguration

      @DELETE @Path("v1/tasks/{taskId}/pushNotificationConfigs/{configId}") @Consumes("application/json") @Produces("application/json") public jakarta.ws.rs.core.Response deleteTaskPushNotificationConfiguration(@PathParam("taskId") String taskId, @PathParam("configId") String configId, @Context jakarta.servlet.http.HttpServletRequest httpRequest, @Context jakarta.ws.rs.core.SecurityContext securityContext)
    • setStreamingIsSubscribedRunnable

      public static void setStreamingIsSubscribedRunnable(Runnable streamingIsSubscribedRunnable)