Interface NotificationStateValueUpdater
- All Superinterfaces:
com.broadleafcommerce.common.messaging.notification.NotificationStateRepository
,com.broadleafcommerce.common.messaging.notification.NotificationStateRepositoryFragment
- All Known Implementing Classes:
JpaNotificationStateRepositoryFragment
public interface NotificationStateValueUpdater
extends com.broadleafcommerce.common.messaging.notification.NotificationStateRepositoryFragment
Additional functionality for flows that need to work with
NotificationState
as a separate
concept from the entity itself. This occurs when the notification state is persisted separately
from the entity, as is the case with Jpa.- Author:
- Jeff Fischer
-
Method Summary
Modifier and TypeMethodDescriptionList<com.broadleafcommerce.common.messaging.notification.domain.NotificationState>
findNotificationMembers
(Class<?> entityType, String nativeId) Based on identifying factorsentityType
, andnativeId
, retrieve all the associatedNotificationState
instances.boolean
setNotificationValues
(Object nativeId, String messageType, Class<?> entityType, Map<String, Object> vals) Based on identifying factorsnativeId
,messageType
, andentityType
, set other fields (identified byvals
map key) onNotificationState
to the corresponding value from thevals
map.Methods inherited from interface com.broadleafcommerce.common.messaging.notification.NotificationStateRepository
findNotificationReadyMembers, setFailedNotificationAttempt, setNotificationAcknowledged
-
Method Details
-
setNotificationValues
boolean setNotificationValues(@NonNull Object nativeId, @NonNull String messageType, @NonNull Class<?> entityType, @NonNull Map<String, Object> vals) Based on identifying factorsnativeId
,messageType
, andentityType
, set other fields (identified byvals
map key) onNotificationState
to the corresponding value from thevals
map.- Parameters:
nativeId
- The primary key value of the related container entity. SeeJpaNotificationState.getContainer()
.messageType
- The message type for this notification state. SeeNotificationState.getMessageType()
.entityType
- The entity type of the related container entity. SeeJpaNotificationState.getEntityType()
.vals
- The field name and update value pairs to apply to the identifiedNotificationState
.- Returns:
- Whether or not a
NotificationState
instance was actually updated as a result of this call.
-
findNotificationMembers
List<com.broadleafcommerce.common.messaging.notification.domain.NotificationState> findNotificationMembers(@NonNull Class<?> entityType, @NonNull String nativeId) Based on identifying factorsentityType
, andnativeId
, retrieve all the associatedNotificationState
instances.- Parameters:
entityType
- The entity type of the related container entity. SeeJpaNotificationState.getEntityType()
.nativeId
- The primary key value of the related container entity. SeeJpaNotificationState.getContainer()
.- Returns:
- The list of related
JpaNotificationState
instances.
-