Class A2AServerResource
java.lang.Object
org.wildfly.extras.a2a.server.apps.jakarta.A2AServerResource
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionio.a2a.spec.AgentCardHandles incoming GET requests to the agent card endpoint.io.a2a.spec.JSONRPCResponse<?>handleNonStreamingRequests(io.a2a.spec.NonStreamingJSONRPCRequest<?> request, jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.ws.rs.core.SecurityContext securityContext) Handles incoming POST requests to the main A2A endpoint.voidhandleStreamingRequests(io.a2a.spec.StreamingJSONRPCRequest<?> request, jakarta.servlet.http.HttpServletResponse response, jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.ws.rs.core.SecurityContext securityContext, jakarta.ws.rs.ext.Providers providers) 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 io.a2a.spec.JSONRPCResponse<?> handleNonStreamingRequests(io.a2a.spec.NonStreamingJSONRPCRequest<?> request, @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:
request- the JSON-RPC request- Returns:
- the JSON-RPC response which may be an error response
-
handleStreamingRequests
@POST @Consumes("application/json") @Produces("text/event-stream") public void handleStreamingRequests(io.a2a.spec.StreamingJSONRPCRequest<?> request, @Context jakarta.servlet.http.HttpServletResponse response, @Context jakarta.servlet.http.HttpServletRequest httpRequest, @Context jakarta.ws.rs.core.SecurityContext securityContext, @Context jakarta.ws.rs.ext.Providers providers) 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
-