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 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, IllegalAccessException
      Carries 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 action
      action - 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 action
      data - the notification's routing data as echoed by the device (untrusted beyond objectKey)
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException - when the target object no longer exists
      IllegalAccessException - when the user may not act on the object
      IllegalArgumentException - when the action or data is invalid