Package com.avoka.fc.core.entity
Class EmailQueue
java.lang.Object
org.apache.cayenne.PersistentObject
org.apache.cayenne.BaseDataObject
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
Provides an email queue entry that can be queued and automatically retried.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Indicates that the email concerns a receipt sent to a userstatic final String
Indicates that the email is just clonedstatic final String
Indicates that the email has been sent successfullystatic final String
Indicates that an error has occurred but that the email will be resent laterstatic final String
Indicates that the email has been retried unsuccessfully too many times and will not be automatically resent.static final String
Indicates that the email is not yet ready to be sent (e.g.static final String
Indicates that the email is ready to be sentstatic final String[]
The full set of status values an email queue entry can assumestatic final String
The number of attachmentsFields 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
Fields inherited from class org.apache.cayenne.CayenneDataObject
values
Fields inherited from class org.apache.cayenne.BaseDataObject
snapshotVersion
Fields inherited from class org.apache.cayenne.PersistentObject
objectContext, objectId, persistenceState
Fields inherited from interface org.apache.cayenne.DataObject
DEFAULT_VERSION
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturn the deserialized attachment mapgetBody()
Return the body value.int
Return the number of attachments in the attachment mapboolean
Determine whether the email has been sent successfully.boolean
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
Set the body value.static int
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
makePath, readPropertyDirectly, readState, setPersistenceState, writePropertyDirectly, writeState
Methods inherited from class org.apache.cayenne.BaseDataObject
addToManyTarget, beforePropertyRead, beforePropertyWrite, getSnapshotVersion, readNestedProperty, readProperty, readSerialized, removeToManyTarget, setObjectContext, setReverseRelationship, setSnapshotVersion, setToManyTarget, setToOneTarget, toStringBuffer, unsetReverseRelationship, validateForDelete, validateForInsert, validateForSave, validateForUpdate, willConnect, writeProperty, writeSerialized
Methods inherited from class org.apache.cayenne.PersistentObject
getMapKey, getObjectContext, getObjectId, getPersistenceState, setObjectId
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.cayenne.Persistent
getObjectContext, getObjectId, getPersistenceState, setObjectContext, setObjectId, setPersistenceState
-
Field Details
-
NUMBER_OF_ATTACHMENTS_PROPERTY
The number of attachments- See Also:
-
EMAIL_STATUS_NOT_READY
Indicates that the email is not yet ready to be sent (e.g. waiting on receipt generation)- See Also:
-
EMAIL_STATUS_READY
Indicates that the email is ready to be sent- See Also:
-
EMAIL_STATUS_CLONED
Indicates that the email is just cloned- See Also:
-
EMAIL_STATUS_COMPLETED
Indicates that the email has been sent successfully- See Also:
-
EMAIL_STATUS_ERROR
Indicates that an error has occurred but that the email will be resent later- See Also:
-
EMAIL_STATUS_MAX_RETRIES
Indicates that the email has been retried unsuccessfully too many times and will not be automatically resent.- See Also:
-
EMAIL_STATUS_VALUES
The full set of status values an email queue entry can assume -
CATEGORY_USER_RECEIPT
Indicates that the email concerns a receipt sent to a user- See Also:
-
-
Constructor Details
-
EmailQueue
public EmailQueue()
-
-
Method Details
-
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
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
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
Return the body value.- Overrides:
getBody
in class_EmailQueue
- Returns:
- body the body value
-
setBody
Set the body value.- Overrides:
setBody
in class_EmailQueue
- Parameters:
body
- the body value to set
-