Class InMemoryPushNotificationConfigStore

java.lang.Object
io.a2a.server.tasks.InMemoryPushNotificationConfigStore
All Implemented Interfaces:
PushNotificationConfigStore

@ApplicationScoped public class InMemoryPushNotificationConfigStore extends Object implements PushNotificationConfigStore
In-memory implementation of the PushNotificationConfigStore interface. Stores push notification configurations in memory
  • Constructor Details

    • InMemoryPushNotificationConfigStore

      @Inject public InMemoryPushNotificationConfigStore()
  • Method Details

    • setInfo

      public PushNotificationConfig setInfo(String taskId, PushNotificationConfig notificationConfig)
      Description copied from interface: PushNotificationConfigStore
      Sets or updates the push notification configuration for a task.

      If notificationConfig.id() is null or empty, it's set to the task ID. If a config with the same ID already exists for this task, it's replaced.

      Specified by:
      setInfo in interface PushNotificationConfigStore
      Parameters:
      taskId - the task ID
      notificationConfig - the push notification configuration
      Returns:
      the potentially updated configuration (with ID set if it was null)
    • getInfo

      Description copied from interface: PushNotificationConfigStore
      Retrieves push notification configurations for a task with pagination support.

      Returns all configs if params.pageSize() is 0. Otherwise, returns up to pageSize configs and a continuation token for the next page.

      Pagination Example:

      
       // First page
       ListTaskPushNotificationConfigParams params =
           new ListTaskPushNotificationConfigParams(taskId, 10, null, tenant);
       ListTaskPushNotificationConfigResult result = store.getInfo(params);
      
       // Next page
       if (result.nextPageToken() != null) {
           params = new ListTaskPushNotificationConfigParams(
               taskId, 10, result.nextPageToken(), tenant);
           result = store.getInfo(params);
       }
       
      Specified by:
      getInfo in interface PushNotificationConfigStore
      Parameters:
      params - the query parameters including task ID, page size, and page token
      Returns:
      the configurations for this task (empty list if none found)
    • deleteInfo

      public void deleteInfo(String taskId, String configId)
      Description copied from interface: PushNotificationConfigStore
      Deletes a push notification configuration for a task.

      If configId is null, it defaults to the task ID (deletes the default config). If no config exists with the given ID, this method returns normally (idempotent).

      Specified by:
      deleteInfo in interface PushNotificationConfigStore
      Parameters:
      taskId - the task ID
      configId - the push notification configuration ID (null = use task ID)