Package io.meeds.pwa.plugin
Interface PwaDirectNotificationActionPlugin
public interface PwaDirectNotificationActionPlugin
Handles the quick actions a user triggers on a direct (self-contained) push
notification of one kind (e.g. "chat"). The pwa layer authenticates the
device (token + HMAC proof) and resolves the user before dispatching; the
plugin only carries the domain behavior of the action.
-
Method Summary
Modifier and TypeMethodDescriptionvoidCarries out an action a device triggered on a direct notification.
-
Method Details
-
getNotificationKind
String getNotificationKind()- Returns:
- the direct-notification kind this plugin handles, the same key
used when scheduling (
scheduleDirectNotification)
-
handleAction
void handleAction(String username, String action, String objectKey, Map<String, String> data) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessExceptionCarries out an action a device triggered on a direct notification.Implementations must be idempotent: the single-use credential is consumed once the action has returned, so that a failed action can be retried, and two devices replaying the same notification concurrently can both reach this method before either consumes it.
- Parameters:
username- authenticated owner of the device that triggered the actionaction- the action id carried by the notification (e.g. "markRead")objectKey- the object the device's token was scoped to (the notification tag at scheduling time) — the only trusted target of the actiondata- the notification's routing data as echoed by the device (untrusted beyondobjectKey)- Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- when the target object no longer existsIllegalAccessException- when the user may not act on the objectIllegalArgumentException- when the action or data is invalid
-