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
FieldsModifier and TypeFieldDescriptionstatic final StringIndicates that the email concerns a receipt sent to a userstatic final StringIndicates that the email is just clonedstatic final StringIndicates that the email has been sent successfullystatic final StringIndicates that an error has occurred but that the email will be resent laterstatic final StringIndicates that the email has been retried unsuccessfully too many times and will not be automatically resent.static final StringIndicates that the email is not yet ready to be sent (e.g.static final StringIndicates that the email is ready to be sentstatic final String[]The full set of status values an email queue entry can assumestatic final StringThe 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_PROPERTYFields inherited from class com.avoka.core.entity.BaseEntity
ID_PROPERTYFields inherited from class org.apache.cayenne.CayenneDataObject
valuesFields inherited from class org.apache.cayenne.BaseDataObject
snapshotVersionFields inherited from class org.apache.cayenne.PersistentObject
objectContext, objectId, persistenceStateFields inherited from interface org.apache.cayenne.DataObject
DEFAULT_VERSION -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturn the deserialized attachment mapgetBody()Return the body value.intReturn the number of attachments in the attachment mapbooleanDetermine whether the email has been sent successfully.booleanDetermine whether the email has been retried unsuccessfully too many times and will not be automatically resent.voidsetAttachmentMap(Map<String, byte[]> attachmentMap) Set the map of email attachmentsvoidSet the body value.voidsetCreatedTimestamp(Date createdTimestamp) Set the createdTimestamp value.static intReturns 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, setDeliveryAttempts, setEmailQueueData, setEmailStatus, setMaxDeliveryAttempts, setPlainBody, setPortal, setSubject, setSubmissionMethods inherited from class com.avoka.core.entity.BaseEntity
appendProperties, getId, getValuesMap, isNew, setId, toStringMethods inherited from class org.apache.cayenne.CayenneDataObject
makePath, readPropertyDirectly, readState, setPersistenceState, writePropertyDirectly, writeStateMethods 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, writeSerializedMethods inherited from class org.apache.cayenne.PersistentObject
getMapKey, getObjectContext, getObjectId, getPersistenceState, setObjectIdMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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:
getBodyin class_EmailQueue- Returns:
- body the body value
-
setBody
Set the body value.- Overrides:
setBodyin class_EmailQueue- Parameters:
body- the body value to set
-
setCreatedTimestamp
Description copied from class:_EmailQueueSet the createdTimestamp value.- Overrides:
setCreatedTimestampin class_EmailQueue- Parameters:
createdTimestamp- the createdTimestamp value to set
-