Class JpaNotification
java.lang.Object
com.broadleafcommerce.notification.provider.jpa.domain.JpaNotification
- All Implemented Interfaces:
com.broadleafcommerce.common.messaging.notification.domain.NotificationStateAware
,com.broadleafcommerce.data.tracking.core.mapping.BusinessTypeAware
,com.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable
,com.broadleafcommerce.data.tracking.core.TenantTrackable<com.broadleafcommerce.data.tracking.jpa.filtering.domain.TenantJpaTracking>
,com.broadleafcommerce.data.tracking.core.Trackable
,com.broadleafcommerce.data.tracking.core.TypedTrackable<com.broadleafcommerce.data.tracking.jpa.filtering.domain.TenantJpaTracking>
,Serializable
@Entity
@TrackableExtension(TENANT)
public class JpaNotification
extends Object
implements Serializable, com.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable, com.broadleafcommerce.data.tracking.core.mapping.BusinessTypeAware, com.broadleafcommerce.data.tracking.core.TenantTrackable<com.broadleafcommerce.data.tracking.jpa.filtering.domain.TenantJpaTracking>
JPA representation of an
Notification
.- Author:
- Broadleaf Commerce
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
org.modelmapper.ModelMapper
fromMe()
Class<?>
The jpa primary key.The date that this notification was first created.Delivery Type (EMAIL, SMS) represents how the message will be delivered.The messageBody for the Notification.Message Type (RESET_PASSWORD, ORDER_CONFIRMATION) represents the type of notification being sent.Notification STATUS (NEW, READY_TO_SEND, SENDING, SENT, RETRY, ERROR) The notification status indicates the delivery status of a message.int
The number of times this message has been retried.The date that this notification was first created.The subject of the notification.A JSON structure representing the data for the notification template.The templateName used by the provider to construct the messageBody.com.broadleafcommerce.data.tracking.jpa.filtering.domain.TenantJpaTracking
int
hashCode()
void
setContextId
(String contextId) The jpa primary key.void
setCreateDate
(Instant createDate) The date that this notification was first created.void
setDeliveryType
(String deliveryType) Delivery Type (EMAIL, SMS) represents how the message will be delivered.void
setMessageBody
(String messageBody) The messageBody for the Notification.void
setMessageType
(String messageType) Message Type (RESET_PASSWORD, ORDER_CONFIRMATION) represents the type of notification being sent.void
setNotificationStatus
(String notificationStatus) Notification STATUS (NEW, READY_TO_SEND, SENDING, SENT, RETRY, ERROR) The notification status indicates the delivery status of a message.void
setProperties
(Map<String, Object> properties) void
setRecipients
(List<Recipient> recipients) void
setRetryCount
(int retryCount) The number of times this message has been retried.void
void
setSentDate
(Instant sentDate) The date that this notification was first created.void
setSubject
(String subject) The subject of the notification.void
setTemplateData
(String templateData) A JSON structure representing the data for the notification template.void
setTemplateName
(String templateName) The templateName used by the provider to construct the messageBody.void
setTracking
(com.broadleafcommerce.data.tracking.jpa.filtering.domain.TenantJpaTracking tracking) org.modelmapper.ModelMapper
toMe()
toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable
postFromMe, postToMe, preFromMe, preToMe
Methods inherited from interface com.broadleafcommerce.common.messaging.notification.domain.NotificationStateAware
findNotificationState
Methods inherited from interface com.broadleafcommerce.data.tracking.core.Trackable
getDisplay, getNotificationStates, getNotificationStates, setNotificationStates
Methods inherited from interface com.broadleafcommerce.data.tracking.core.TypedTrackable
setTracking
-
Constructor Details
-
JpaNotification
public JpaNotification()
-
-
Method Details
-
fromMe
public org.modelmapper.ModelMapper fromMe()- Specified by:
fromMe
in interfacecom.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable
-
toMe
public org.modelmapper.ModelMapper toMe()- Specified by:
toMe
in interfacecom.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable
-
getBusinessDomainType
- Specified by:
getBusinessDomainType
in interfacecom.broadleafcommerce.data.tracking.core.mapping.BusinessTypeAware
-
getContextId
The jpa primary key.- Specified by:
getContextId
in interfacecom.broadleafcommerce.data.tracking.core.Trackable
- Returns:
- The jpa primary key
-
getNotificationStatus
Notification STATUS (NEW, READY_TO_SEND, SENDING, SENT, RETRY, ERROR) The notification status indicates the delivery status of a message. NEW - Notification is being prepared or not ready to send. READY_TO_SEND - Notification can be sent by a provider SENDING - Provider has been requested to send the notification. SENT - Provider responded that the message was sent RETRY - Provider responded with an ERROR that can be retried ERROR - Provider responded with an unknown ERROR or an ERROR that should not be retried. Since there are edge cases that can occur with message sending, providers should take a conservative approach to message sending. A provider should typically be developed to allow AT MOST ONCE delivery. This means that in extreme cases, no message would be sent but that in no case would a user get multiple messages.- Returns:
- the notification status
-
getMessageType
Message Type (RESET_PASSWORD, ORDER_CONFIRMATION) represents the type of notification being sent. The messageType is typically use along with the deliveryType to determine the appropriate provider to build and deliver the message.- Returns:
- the message type of this Notification
-
getDeliveryType
Delivery Type (EMAIL, SMS) represents how the message will be delivered. The deliveryType typically use along with the notificationType to determine the appropriate provider to build and deliver the message.- Returns:
- the delivery type of this Notification
-
getSubject
The subject of the notification. Subject may be required by certain providers (especially EMAIL deliveryType).- Returns:
- the subject of the Notification
-
getTemplateName
The templateName used by the provider to construct the messageBody. Providers may utilize the templateName and templateData to construct a messageBody if one is not provided. It is typical for a provider to resolve the templateName using the notificationType- Returns:
- the name of a template used for this notification
-
getTemplateData
A JSON structure representing the data for the notification template.- Returns:
- a JSON structure representing the data for the notification template.
-
getMessageBody
The messageBody for the Notification. Required for messages that are not built using a templateName and templateData. This field is typically not populated when using a 3rd party processor to process the template.- Returns:
- the message
-
getRecipients
-
getSender
-
getRetryCount
public int getRetryCount()The number of times this message has been retried.- Returns:
- The number of retry attempts to send this notification.
-
getCreateDate
The date that this notification was first created.- Returns:
- The date that this notification was first created.
-
getSentDate
The date that this notification was first created.- Returns:
- The date that this notification was sent to a provider.
-
getProperties
-
getTracking
public com.broadleafcommerce.data.tracking.jpa.filtering.domain.TenantJpaTracking getTracking()- Specified by:
getTracking
in interfacecom.broadleafcommerce.data.tracking.core.Trackable
- See Also:
-
TenantJpaTracking
-
setContextId
The jpa primary key.- Specified by:
setContextId
in interfacecom.broadleafcommerce.data.tracking.core.Trackable
- Parameters:
NOTIFICATION_ID
- (or contextId) - The jpa primary key
-
setNotificationStatus
Notification STATUS (NEW, READY_TO_SEND, SENDING, SENT, RETRY, ERROR) The notification status indicates the delivery status of a message. NEW - Notification is being prepared or not ready to send. READY_TO_SEND - Notification can be sent by a provider SENDING - Provider has been requested to send the notification. SENT - Provider responded that the message was sent RETRY - Provider responded with an ERROR that can be retried ERROR - Provider responded with an unknown ERROR or an ERROR that should not be retried. Since there are edge cases that can occur with message sending, providers should take a conservative approach to message sending. A provider should typically be developed to allow AT MOST ONCE delivery. This means that in extreme cases, no message would be sent but that in no case would a user get multiple messages.- Parameters:
notificationStatus
-
-
setMessageType
Message Type (RESET_PASSWORD, ORDER_CONFIRMATION) represents the type of notification being sent. The messageType is typically use along with the deliveryType to determine the appropriate provider to build and deliver the message.- Parameters:
messageType
-
-
setDeliveryType
Delivery Type (EMAIL, SMS) represents how the message will be delivered. The deliveryType typically use along with the notificationType to determine the appropriate provider to build and deliver the message.- Parameters:
deliveryType
-
-
setSubject
The subject of the notification. Subject may be required by certain providers (especially EMAIL deliveryType).- Parameters:
subject
-
-
setTemplateName
The templateName used by the provider to construct the messageBody. Providers may utilize the templateName and templateData to construct a messageBody if one is not provided. It is typical for a provider to resolve the templateName using the notificationType- Parameters:
templateName
-
-
setTemplateData
A JSON structure representing the data for the notification template.- Parameters:
templateData
-
-
setMessageBody
The messageBody for the Notification. Required for messages that are not built using a templateName and templateData. This field is typically not populated when using a 3rd party processor to process the template.- Parameters:
messageBody
-
-
setRecipients
-
setSender
-
setRetryCount
public void setRetryCount(int retryCount) The number of times this message has been retried.- Parameters:
retryCount
-
-
setCreateDate
The date that this notification was first created.- Parameters:
createDate
- The date that this notification was first created.
-
setSentDate
The date that this notification was first created.- Parameters:
sentDate
- The date that this notification was sent to a provider.
-
setProperties
-
setTracking
public void setTracking(com.broadleafcommerce.data.tracking.jpa.filtering.domain.TenantJpaTracking tracking) - Specified by:
setTracking
in interfacecom.broadleafcommerce.data.tracking.core.TypedTrackable<com.broadleafcommerce.data.tracking.jpa.filtering.domain.TenantJpaTracking>
- See Also:
-
TenantJpaTracking
-
toString
-
equals
-
canEqual
-
hashCode
public int hashCode()
-