Class A2AServerResource
java.lang.Object
org.wildfly.extras.a2a.server.apps.jsonrpc.A2AServerResource
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionio.a2a.spec.AgentCardHandles incoming GET requests to the agent card endpoint.handleNonStreamingRequests(String body, jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.ws.rs.core.SecurityContext securityContext) Handles incoming POST requests to the main A2A endpoint.voidhandleStreamingRequests(String body, jakarta.servlet.http.HttpServletResponse response, jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.ws.rs.core.SecurityContext securityContext) Handles incoming POST requests to the main A2A endpoint that involve Server-Sent Events (SSE).static voidsetStreamingIsSubscribedRunnable(Runnable streamingIsSubscribedRunnable)
-
Constructor Details
-
A2AServerResource
public A2AServerResource()
-
-
Method Details
-
handleNonStreamingRequests
@POST @Consumes("application/json") @Produces("application/json") public String handleNonStreamingRequests(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- the JSON-RPC request string- Returns:
- the JSON-RPC response which may be an error response
-
handleStreamingRequests
@POST @Consumes("application/json") @Produces("text/event-stream") public void handleStreamingRequests(String body, @Context jakarta.servlet.http.HttpServletResponse response, @Context jakarta.servlet.http.HttpServletRequest httpRequest, @Context jakarta.ws.rs.core.SecurityContext securityContext) throws IOException Handles incoming POST requests to the main A2A endpoint that involve Server-Sent Events (SSE). Uses custom SSE response handling to avoid JAX-RS SSE compatibility issues with async publishers.- Throws:
IOException
-
getAgentCard
@GET @Path("/.well-known/agent-card.json") @Produces("application/json") public io.a2a.spec.AgentCard getAgentCard()Handles incoming GET requests to the agent card endpoint. Returns the agent card in JSON format.- Returns:
- the agent card
-
setStreamingIsSubscribedRunnable
-