Package com.avoka.fc.core.entity
Class EmailQueue
- java.lang.Object
-
- org.apache.cayenne.PersistentObject
-
- org.apache.cayenne.CayenneDataObject
-
- com.avoka.core.entity.BaseEntity
-
- com.avoka.fc.core.entity.auto._EmailQueue
-
- com.avoka.fc.core.entity.EmailQueue
-
- All Implemented Interfaces:
IEntity
,Serializable
,org.apache.cayenne.DataObject
,org.apache.cayenne.Persistent
,org.apache.cayenne.Validating
public class EmailQueue extends _EmailQueue
Provides an email queue entry that can be queued and automatically retried.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
CATEGORY_USER_RECEIPT
Indicates that the email concerns a receipt sent to a userstatic String
EMAIL_STATUS_CLONED
Indicates that the email is just clonedstatic String
EMAIL_STATUS_COMPLETED
Indicates that the email has been sent successfullystatic String
EMAIL_STATUS_ERROR
Indicates that an error has occurred but that the email will be resent laterstatic String
EMAIL_STATUS_MAX_RETRIES
Indicates that the email has been retried unsuccessfully too many times and will not be automatically resent.static String
EMAIL_STATUS_NOT_READY
Indicates that the email is not yet ready to be sent (e.g.static String
EMAIL_STATUS_READY
Indicates that the email is ready to be sentstatic String[]
EMAIL_STATUS_VALUES
The full set of status values an email queue entry can assumestatic String
NUMBER_OF_ATTACHMENTS_PROPERTY
The number of attachments-
Fields inherited from class com.avoka.fc.core.entity.auto._EmailQueue
ADDRESS_FROM, ADDRESS_FROM_PROPERTY, ADDRESSES_BCC, ADDRESSES_BCC_PROPERTY, ADDRESSES_CC, ADDRESSES_CC_PROPERTY, ADDRESSES_REPLY_TO, ADDRESSES_REPLY_TO_PROPERTY, ADDRESSES_TO, ADDRESSES_TO_PROPERTY, ATTACH_SUBMISSION_RECEIPT_FLAG, ATTACH_SUBMISSION_RECEIPT_FLAG_PROPERTY, ATTACHMENTS, ATTACHMENTS_PROPERTY, BODY, BODY_PROPERTY, CATEGORY, CATEGORY_PROPERTY, CREATED_TIMESTAMP, CREATED_TIMESTAMP_PROPERTY, DELIVERY_ATTEMPTS, DELIVERY_ATTEMPTS_PROPERTY, EMAIL_QUEUE_DATA, EMAIL_QUEUE_DATA_PROPERTY, EMAIL_QUEUE_OID_PK_COLUMN, EMAIL_STATUS, EMAIL_STATUS_PROPERTY, ERROR_LOG, ERROR_LOG_PROPERTY, EVENT_LOG, EVENT_LOG_PROPERTY, MAX_DELIVERY_ATTEMPTS, MAX_DELIVERY_ATTEMPTS_PROPERTY, PLAIN_BODY, PLAIN_BODY_PROPERTY, PORTAL, PORTAL_PROPERTY, SUBJECT, SUBJECT_PROPERTY, SUBMISSION, SUBMISSION_PROPERTY
-
Fields inherited from class com.avoka.core.entity.BaseEntity
ID_PROPERTY
-
-
Constructor Summary
Constructors Constructor Description EmailQueue()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,byte[]>
getAttachmentMap()
Return the deserialized attachment mapString
getBody()
Return the body value.int
getNumberOfAttachments()
Return the number of attachments in the attachment mapboolean
isCompleted()
Determine whether the email has been sent successfully.boolean
isMaxRetriesExceeded()
Determine whether the email has been retried unsuccessfully too many times and will not be automatically resent.void
setAttachmentMap(Map<String,byte[]> attachmentMap)
Set the map of email attachmentsvoid
setBody(String body)
Set the body value.static int
toAddressMaxLength()
Returns the maximum length of the toAddresses attribute.-
Methods inherited from class com.avoka.fc.core.entity.auto._EmailQueue
addToErrorLog, addToEventLog, getAddressesBcc, getAddressesCc, getAddressesReplyTo, getAddressesTo, getAddressFrom, getAttachments, getCategory, getCreatedTimestamp, getDeliveryAttempts, getEmailQueueData, getEmailStatus, getErrorLog, getEventLog, getMaxDeliveryAttempts, getPlainBody, getPortal, getSubject, getSubmission, isAttachSubmissionReceiptFlag, removeFromErrorLog, removeFromEventLog, setAddressesBcc, setAddressesCc, setAddressesReplyTo, setAddressesTo, setAddressFrom, setAttachments, setAttachSubmissionReceiptFlag, setCategory, setCreatedTimestamp, setDeliveryAttempts, setEmailQueueData, setEmailStatus, setMaxDeliveryAttempts, setPlainBody, setPortal, setSubject, setSubmission
-
Methods inherited from class com.avoka.core.entity.BaseEntity
appendProperties, getId, getValuesMap, isNew, setId, toString
-
Methods inherited from class org.apache.cayenne.CayenneDataObject
addToManyTarget, getSnapshotVersion, makePath, readNestedProperty, readProperty, readPropertyDirectly, removeToManyTarget, setObjectContext, setPersistenceState, setReverseRelationship, setSnapshotVersion, setToManyTarget, setToOneTarget, toStringBuffer, unsetReverseRelationship, validateForDelete, validateForInsert, validateForSave, validateForUpdate, willConnect, writeProperty, writePropertyDirectly
-
Methods inherited from class org.apache.cayenne.PersistentObject
getMapKey, getObjectContext, getObjectId, getPersistenceState, setObjectId
-
-
-
-
Field Detail
-
NUMBER_OF_ATTACHMENTS_PROPERTY
public static final String NUMBER_OF_ATTACHMENTS_PROPERTY
The number of attachments- See Also:
- Constant Field Values
-
EMAIL_STATUS_NOT_READY
public static final String EMAIL_STATUS_NOT_READY
Indicates that the email is not yet ready to be sent (e.g. waiting on receipt generation)- See Also:
- Constant Field Values
-
EMAIL_STATUS_READY
public static final String EMAIL_STATUS_READY
Indicates that the email is ready to be sent- See Also:
- Constant Field Values
-
EMAIL_STATUS_CLONED
public static final String EMAIL_STATUS_CLONED
Indicates that the email is just cloned- See Also:
- Constant Field Values
-
EMAIL_STATUS_COMPLETED
public static final String EMAIL_STATUS_COMPLETED
Indicates that the email has been sent successfully- See Also:
- Constant Field Values
-
EMAIL_STATUS_ERROR
public static final String EMAIL_STATUS_ERROR
Indicates that an error has occurred but that the email will be resent later- See Also:
- Constant Field Values
-
EMAIL_STATUS_MAX_RETRIES
public static final String EMAIL_STATUS_MAX_RETRIES
Indicates that the email has been retried unsuccessfully too many times and will not be automatically resent.- See Also:
- Constant Field Values
-
EMAIL_STATUS_VALUES
public static final String[] EMAIL_STATUS_VALUES
The full set of status values an email queue entry can assume
-
CATEGORY_USER_RECEIPT
public static final String CATEGORY_USER_RECEIPT
Indicates that the email concerns a receipt sent to a user- See Also:
- Constant Field Values
-
-
Method Detail
-
toAddressMaxLength
public static int toAddressMaxLength()
Returns the maximum length of the toAddresses attribute.- Returns:
- the maximum length of the toAddresses attribute.
-
isCompleted
public boolean isCompleted()
Determine whether the email has been sent successfully.- Returns:
- true if the status is
EMAIL_STATUS_COMPLETED
-
isMaxRetriesExceeded
public boolean isMaxRetriesExceeded()
Determine whether the email has been retried unsuccessfully too many times and will not be automatically resent.- Returns:
- true if the status is
EMAIL_STATUS_MAX_RETRIES
-
getAttachmentMap
public Map<String,byte[]> getAttachmentMap() throws IOException, ClassNotFoundException
Return the deserialized attachment map- Returns:
- the attachment map
- Throws:
IOException
- if an input/output error occursClassNotFoundException
- if the class of a serialized object could not be found
-
setAttachmentMap
public void setAttachmentMap(Map<String,byte[]> attachmentMap) throws IOException
Set the map of email attachments- Parameters:
attachmentMap
- the new attachment map- Throws:
IOException
- of the attachment map cannot be serialized
-
getNumberOfAttachments
public int getNumberOfAttachments()
Return the number of attachments in the attachment map- Returns:
- the number of attachments, or 0 if the attachment map could not be deserialized
-
getBody
public String getBody()
Return the body value.- Overrides:
getBody
in class_EmailQueue
- Returns:
- body the body value
-
setBody
public void setBody(String body)
Set the body value.- Overrides:
setBody
in class_EmailQueue
- Parameters:
body
- the body value to set
-
-