Class A2ARestServerResource
java.lang.Object
org.wildfly.extras.a2a.server.apps.rest.A2ARestServerResource
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjakarta.ws.rs.core.ResponsecancelTask(String taskId, String body, jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.ws.rs.core.SecurityContext securityContext) jakarta.ws.rs.core.ResponsedeleteTaskPushNotificationConfiguration(String taskId, String configId, jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.ws.rs.core.SecurityContext securityContext) jakarta.ws.rs.core.ResponseHandles incoming GET requests to the agent card endpoint.jakarta.ws.rs.core.Responsejakarta.ws.rs.core.ResponsegetTask(String taskId, String history_length, jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.ws.rs.core.SecurityContext securityContext) jakarta.ws.rs.core.ResponsegetTaskPushNotificationConfiguration(String taskId, String configId, jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.ws.rs.core.SecurityContext securityContext) jakarta.ws.rs.core.ResponselistTaskPushNotificationConfigurations(String taskId, jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.ws.rs.core.SecurityContext securityContext) voidresubscribeTask(String taskId, jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.servlet.http.HttpServletResponse httpResponse, jakarta.ws.rs.core.SecurityContext securityContext) jakarta.ws.rs.core.ResponsesendMessage(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.voidsendMessageStreaming(String body, jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.servlet.http.HttpServletResponse httpResponse, jakarta.ws.rs.core.SecurityContext securityContext) static voidsetStreamingIsSubscribedRunnable(Runnable streamingIsSubscribedRunnable) jakarta.ws.rs.core.ResponsesetTaskPushNotificationConfiguration(String taskId, String body, jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.ws.rs.core.SecurityContext securityContext)
-
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
-