Package io.a2a.server.requesthandlers
Class DefaultRequestHandler
java.lang.Object
io.a2a.server.requesthandlers.DefaultRequestHandler
- All Implemented Interfaces:
RequestHandler
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultRequestHandler(AgentExecutor agentExecutor, TaskStore taskStore, QueueManager queueManager, PushNotificationConfigStore pushConfigStore, PushNotificationSender pushSender, Executor executor) -
Method Summary
Modifier and TypeMethodDescriptionstatic DefaultRequestHandlercreate(AgentExecutor agentExecutor, TaskStore taskStore, QueueManager queueManager, PushNotificationConfigStore pushConfigStore, PushNotificationSender pushSender, Executor executor) For testingonCancelTask(TaskIdParams params, ServerCallContext context) voidonDeleteTaskPushNotificationConfig(DeleteTaskPushNotificationConfigParams params, ServerCallContext context) onGetTask(TaskQueryParams params, ServerCallContext context) onGetTaskPushNotificationConfig(GetTaskPushNotificationConfigParams params, ServerCallContext context) onListTaskPushNotificationConfig(ListTaskPushNotificationConfigParams params, ServerCallContext context) onMessageSend(MessageSendParams params, ServerCallContext context) onMessageSendStream(MessageSendParams params, ServerCallContext context) onResubscribeToTask(TaskIdParams params, ServerCallContext context) onSetTaskPushNotificationConfig(TaskPushNotificationConfig params, ServerCallContext context) Wait for all background tasks to complete.
-
Constructor Details
-
DefaultRequestHandler
@Inject public DefaultRequestHandler(AgentExecutor agentExecutor, TaskStore taskStore, QueueManager queueManager, PushNotificationConfigStore pushConfigStore, PushNotificationSender pushSender, Executor executor)
-
-
Method Details
-
create
public static DefaultRequestHandler create(AgentExecutor agentExecutor, TaskStore taskStore, QueueManager queueManager, PushNotificationConfigStore pushConfigStore, PushNotificationSender pushSender, Executor executor) For testing -
onGetTask
- Specified by:
onGetTaskin interfaceRequestHandler- Throws:
JSONRPCError
-
onCancelTask
- Specified by:
onCancelTaskin interfaceRequestHandler- Throws:
JSONRPCError
-
onMessageSend
public EventKind onMessageSend(MessageSendParams params, ServerCallContext context) throws JSONRPCError - Specified by:
onMessageSendin interfaceRequestHandler- Throws:
JSONRPCError
-
onMessageSendStream
public Flow.Publisher<StreamingEventKind> onMessageSendStream(MessageSendParams params, ServerCallContext context) throws JSONRPCError - Specified by:
onMessageSendStreamin interfaceRequestHandler- Throws:
JSONRPCError
-
onSetTaskPushNotificationConfig
public TaskPushNotificationConfig onSetTaskPushNotificationConfig(TaskPushNotificationConfig params, ServerCallContext context) throws JSONRPCError - Specified by:
onSetTaskPushNotificationConfigin interfaceRequestHandler- Throws:
JSONRPCError
-
onGetTaskPushNotificationConfig
public TaskPushNotificationConfig onGetTaskPushNotificationConfig(GetTaskPushNotificationConfigParams params, ServerCallContext context) throws JSONRPCError - Specified by:
onGetTaskPushNotificationConfigin interfaceRequestHandler- Throws:
JSONRPCError
-
onResubscribeToTask
public Flow.Publisher<StreamingEventKind> onResubscribeToTask(TaskIdParams params, ServerCallContext context) throws JSONRPCError - Specified by:
onResubscribeToTaskin interfaceRequestHandler- Throws:
JSONRPCError
-
onListTaskPushNotificationConfig
public List<TaskPushNotificationConfig> onListTaskPushNotificationConfig(ListTaskPushNotificationConfigParams params, ServerCallContext context) throws JSONRPCError - Specified by:
onListTaskPushNotificationConfigin interfaceRequestHandler- Throws:
JSONRPCError
-
onDeleteTaskPushNotificationConfig
public void onDeleteTaskPushNotificationConfig(DeleteTaskPushNotificationConfigParams params, ServerCallContext context) - Specified by:
onDeleteTaskPushNotificationConfigin interfaceRequestHandler
-
waitForBackgroundTasks
Wait for all background tasks to complete. Useful for testing to ensure cleanup completes before assertions.- Returns:
- CompletableFuture that completes when all background tasks finish
-