Package io.meeds.pwa.service
Class PwaNotificationService
java.lang.Object
io.meeds.pwa.service.PwaNotificationService
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreate(long webNotificationId) Send a Push Notification to display to user device(s)Send a Push Notification to display to user device(s)voiddestroy()org.exoplatform.services.resources.LocaleConfiggetLocaleConfig(String username) getNotification(long webNotificationId, String username) getNotificationFromPush(long webNotificationId, String authorizationHeader, String username) getPushDeliveryDelayStatus(String username, String subscriptionId) voidinit()voidreportPushDeliveryDelay(long webNotificationId, String authorizationHeader, String username, long sentAt, long receivedAt) voidresetPushDeliveryDelay(String username, String subscriptionId) voidsetDefaultNotificationMessageProperties(PwaNotificationMessage notificationMessage, String notificationId, org.exoplatform.services.resources.LocaleConfig localeConfig) voidupdateNotification(long webNotificationId, String action, String username) voidupdateNotificationFromPush(long webNotificationId, String action, String authorizationHeader, String username)
-
Field Details
-
PROOF_PARAM
- See Also:
-
TIMESTAMP_PARAM
- See Also:
-
SUBSCRIPTION_ID_PARAM
- See Also:
-
PUSH_TOKEN_PARAM
- See Also:
-
PWA_NOTIFICATION_CREATED
- See Also:
-
PWA_NOTIFICATION_RECEIVED
- See Also:
-
PWA_NOTIFICATION_OPEN_UI_ACTION
- See Also:
-
PWA_NOTIFICATION_MARK_READ_USER_ACTION
- See Also:
-
PWA_NOTIFICATION_MARK_READ_ACTION_LABEL
- See Also:
-
PWA_NOTIFICATION_PUSH_DELAY_TIME
- See Also:
-
PWA_NOTIFICATION_PUSH_EFFECTIVE_RECEIVED_TIME
- See Also:
-
PWA_NOTIFICATION_PUSH_RECEIVED_TIME
- See Also:
-
PWA_NOTIFICATION_PUSH_SENT_TIME
- See Also:
-
EVENT_NOTIFICATION_SENT
- See Also:
-
EVENT_NOTIFICATION_RESPONSE_ERROR
- See Also:
-
EVENT_NOTIFICATION_SENDING_ERROR
- See Also:
-
EVENT_OUTDATED_SUBSCRIPTION
- See Also:
-
EVENT_ERROR_PARAM_NAME
- See Also:
-
EVENT_SUBSCRIPTION_PARAM_NAME
- See Also:
-
EVENT_HTTP_RESPONSE_PARAM_NAME
- See Also:
-
EVENT_NOTIFICATION_ID_PARAM_NAME
- See Also:
-
EVENT_ACTION_PARAM_NAME
- See Also:
-
EVENT_NOTIFICATION_TYPE_PARAM_NAME
- See Also:
-
WEB_NOTIFICATION
- See Also:
-
EVENT_USERNAME_PARAM_NAME
- See Also:
-
EVENT_DURATION_PARAM_NAME
- See Also:
-
EVENT_NOTIFICATION_TOKEN_PARAM_NAME
- See Also:
-
EVENT_SUBSCRIPTION_ID_PARAM_NAME
- See Also:
-
-
Constructor Details
-
PwaNotificationService
public PwaNotificationService()
-
-
Method Details
-
init
@PostConstruct public void init() -
destroy
@PreDestroy public void destroy() -
getNotification
public PwaNotificationMessage getNotification(long webNotificationId, String username) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException - Throws:
org.exoplatform.commons.exception.ObjectNotFoundExceptionIllegalAccessException
-
getNotificationFromPush
public PwaNotificationMessage getNotificationFromPush(long webNotificationId, String authorizationHeader, String username) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException - Throws:
org.exoplatform.commons.exception.ObjectNotFoundExceptionIllegalAccessException
-
updateNotificationFromPush
public void updateNotificationFromPush(long webNotificationId, String action, String authorizationHeader, String username) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException - Throws:
org.exoplatform.commons.exception.ObjectNotFoundExceptionIllegalAccessException
-
reportPushDeliveryDelay
public void reportPushDeliveryDelay(long webNotificationId, String authorizationHeader, String username, long sentAt, long receivedAt) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException - Throws:
IllegalAccessExceptionorg.exoplatform.commons.exception.ObjectNotFoundException
-
getPushDeliveryDelayStatus
-
resetPushDeliveryDelay
-
updateNotification
public void updateNotification(long webNotificationId, String action, String username) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException - Throws:
org.exoplatform.commons.exception.ObjectNotFoundExceptionIllegalAccessException
-
create
Send a Push Notification to display to user device(s)- Parameters:
webNotificationId-
-
create
Send a Push Notification to display to user device(s)- Parameters:
params-
-
getVapidPublicKeyString
- Returns:
- VAPID Public Key encoded using Base64url
-
setDefaultNotificationMessageProperties
public void setDefaultNotificationMessageProperties(PwaNotificationMessage notificationMessage, String notificationId, org.exoplatform.services.resources.LocaleConfig localeConfig) -
getLocaleConfig
-