Class JpaDatabasePushNotificationConfigStore
- All Implemented Interfaces:
PushNotificationConfigStore
-
Field Summary
Fields inherited from interface PushNotificationConfigStore
DEFAULT_MAX_PUSH_CONFIGS_PER_TASK -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteInfo(String taskId, String configId) Deletes a push notification configuration for a task.Retrieves push notification configurations for a task with pagination support.getProtocolVersion(String taskId, String configId) Gets the protocol version associated with a push notification configuration.getProtocolVersions(String taskId) Gets all protocol versions for a task's push notification configurations in a single call.setInfo(TaskPushNotificationConfig notificationConfig) Sets or updates the push notification configuration for a task.setInfo(TaskPushNotificationConfig notificationConfig, @Nullable String protocolVersion) Sets or updates the push notification configuration for a task, along with the protocol version that registered it.
-
Constructor Details
-
JpaDatabasePushNotificationConfigStore
public JpaDatabasePushNotificationConfigStore()
-
-
Method Details
-
setInfo
Description copied from interface:PushNotificationConfigStoreSets or updates the push notification configuration for a task.If
notificationConfig.id()is null or empty, the store creates the default config with the task ID. Omitting the ID is a create-only shorthand: if the default config already exists, the store rejects the request instead of silently replacing it. To update the default config, provide the task ID explicitly. Configurations beyond the default one must always provide an ID. The v0.3 compatibility path keeps its historical single-config update behavior.- Specified by:
setInfoin interfacePushNotificationConfigStore- Parameters:
notificationConfig- the task push notification configuration- Returns:
- the potentially updated configuration (with ID set if it was null)
-
setInfo
public TaskPushNotificationConfig setInfo(TaskPushNotificationConfig notificationConfig, @Nullable String protocolVersion) Description copied from interface:PushNotificationConfigStoreSets or updates the push notification configuration for a task, along with the protocol version that registered it.This merged method ensures the protocol version is stored using the normalized config ID (after
PushNotificationConfigStore.setInfo(TaskPushNotificationConfig)applies defaults).- Specified by:
setInfoin interfacePushNotificationConfigStore- Parameters:
notificationConfig- the task push notification configurationprotocolVersion- the protocol version string, or null to useAgentInterface.CURRENT_PROTOCOL_VERSION- Returns:
- the potentially updated configuration (with ID set if it was null)
-
getInfo
Description copied from interface:PushNotificationConfigStoreRetrieves push notification configurations for a task with pagination support.Returns all configs if
params.pageSize()is 0. Otherwise, returns up topageSizeconfigs and a continuation token for the next page.Pagination Example:
// First page ListTaskPushNotificationConfigsParams params = new ListTaskPushNotificationConfigsParams(taskId, 10, null, tenant); ListTaskPushNotificationConfigsResult result = store.getInfo(params); // Next page if (result.nextPageToken() != null) { params = new ListTaskPushNotificationConfigsParams( taskId, 10, result.nextPageToken(), tenant); result = store.getInfo(params); }- Specified by:
getInfoin interfacePushNotificationConfigStore- 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
Description copied from interface:PushNotificationConfigStoreDeletes a push notification configuration for a task.If
configIdis 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:
deleteInfoin interfacePushNotificationConfigStore- Parameters:
taskId- the task IDconfigId- the push notification configuration ID (null = use task ID)
-
getProtocolVersion
Description copied from interface:PushNotificationConfigStoreGets the protocol version associated with a push notification configuration.- Specified by:
getProtocolVersionin interfacePushNotificationConfigStore- Parameters:
taskId- the task IDconfigId- the push notification configuration ID- Returns:
- the protocol version string, defaults to the current protocol version if not set
-
getProtocolVersions
Description copied from interface:PushNotificationConfigStoreGets all protocol versions for a task's push notification configurations in a single call.- Specified by:
getProtocolVersionsin interfacePushNotificationConfigStore- Parameters:
taskId- the task ID- Returns:
- a map of config ID to protocol version (only includes configs with a version set)
-