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 Details

    • JpaNotification

      public JpaNotification()
  • Method Details

    • fromMe

      public org.modelmapper.ModelMapper fromMe()
      Specified by:
      fromMe in interface com.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable
    • toMe

      public org.modelmapper.ModelMapper toMe()
      Specified by:
      toMe in interface com.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable
    • getBusinessDomainType

      public Class<?> getBusinessDomainType()
      Specified by:
      getBusinessDomainType in interface com.broadleafcommerce.data.tracking.core.mapping.BusinessTypeAware
    • getContextId

      public String getContextId()
      The jpa primary key.
      Specified by:
      getContextId in interface com.broadleafcommerce.data.tracking.core.Trackable
      Returns:
      The jpa primary key
    • getNotificationStatus

      public String 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

      public String 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

      public String 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

      public String getSubject()
      The subject of the notification. Subject may be required by certain providers (especially EMAIL deliveryType).
      Returns:
      the subject of the Notification
    • getTemplateName

      public String 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

      public String getTemplateData()
      A JSON structure representing the data for the notification template.
      Returns:
      a JSON structure representing the data for the notification template.
    • getMessageBody

      public String 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

      public List<Recipient> getRecipients()
    • getSender

      public Sender 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

      public Instant getCreateDate()
      The date that this notification was first created.
      Returns:
      The date that this notification was first created.
    • getSentDate

      public Instant getSentDate()
      The date that this notification was first created.
      Returns:
      The date that this notification was sent to a provider.
    • getProperties

      public Map<String,Object> getProperties()
    • getTracking

      public com.broadleafcommerce.data.tracking.jpa.filtering.domain.TenantJpaTracking getTracking()
      Specified by:
      getTracking in interface com.broadleafcommerce.data.tracking.core.Trackable
      See Also:
      • TenantJpaTracking
    • setContextId

      public void setContextId(String contextId)
      The jpa primary key.
      Specified by:
      setContextId in interface com.broadleafcommerce.data.tracking.core.Trackable
      Parameters:
      NOTIFICATION_ID - (or contextId) - The jpa primary key
    • setNotificationStatus

      public void setNotificationStatus(String notificationStatus)
      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

      public void setMessageType(String messageType)
      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

      public void setDeliveryType(String deliveryType)
      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

      public void setSubject(String subject)
      The subject of the notification. Subject may be required by certain providers (especially EMAIL deliveryType).
      Parameters:
      subject -
    • setTemplateName

      public void setTemplateName(String templateName)
      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

      public void setTemplateData(String templateData)
      A JSON structure representing the data for the notification template.
      Parameters:
      templateData -
    • setMessageBody

      public void setMessageBody(String messageBody)
      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

      public void setRecipients(List<Recipient> recipients)
    • setSender

      public void setSender(Sender sender)
    • setRetryCount

      public void setRetryCount(int retryCount)
      The number of times this message has been retried.
      Parameters:
      retryCount -
    • setCreateDate

      public void setCreateDate(Instant createDate)
      The date that this notification was first created.
      Parameters:
      createDate - The date that this notification was first created.
    • setSentDate

      public void setSentDate(Instant sentDate)
      The date that this notification was first created.
      Parameters:
      sentDate - The date that this notification was sent to a provider.
    • setProperties

      public void setProperties(Map<String,Object> properties)
    • setTracking

      public void setTracking(com.broadleafcommerce.data.tracking.jpa.filtering.domain.TenantJpaTracking tracking)
      Specified by:
      setTracking in interface com.broadleafcommerce.data.tracking.core.TypedTrackable<com.broadleafcommerce.data.tracking.jpa.filtering.domain.TenantJpaTracking>
      See Also:
      • TenantJpaTracking
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object