|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.mail.EMailMessage
An instance of this class represents an e-mail message. The subject and text bodies of the e-mail message are defined in terms of resource bundles, keys of entries within the bundles, and arrays of strings to be inserted into the entries. Various types of objects from which principals can be obtained may be added as recipients of the message. The message may be constructed as a multipart message, and the individual parts can be specified as text bodies or as URL's from which objects of any type may be read.
Use the newEMailMessage
static factory method(s), not the
EMailMessage
constructor, to construct instances of this
class. Instances must be constructed using the static factory(s), in
order to ensure proper initialization of the instance.
Supported API: true
Extendable: false
Field Summary | |
private static String |
CLASSNAME
|
private static String |
DEFAULT_MIME_CHARSET
|
private static String |
EMAIL_QUEUE_NAME
|
private static long |
EMAIL_QUEUE_TTL
|
static long |
EXTERNALIZATION_VERSION_UID
|
private static String |
FC_RESOURCE
|
private static String |
MAIL_HOST
|
private static String |
MAIL_TASK
|
private static String |
MIME_CHARSET_CONTENT_PROPERTY
|
private static String |
MIME_CHARSET_HEADERS_PROPERTY
|
private static String |
MIME_CHARSET_PROPERTY
|
static String |
MULTIPART_SUBTYPE
Label for the attribute. |
private static int |
MULTIPART_SUBTYPE_UPPER_LIMIT
|
private String |
multipartSubtype
|
protected static long |
OLD_FORMAT_VERSION_UID
|
private static long |
ONE_DAY
|
private static long |
ONE_HOUR
|
private static long |
ONE_MINUTE
|
private WTPrincipalReference |
originator
|
static String |
ORIGINATOR
Label for the attribute. |
private ObjectVector |
parts
|
private static WTProperties |
properties
|
private ObjectVector |
recipients
|
private static String |
RESOURCE
|
(package private) static long |
serialVersionUID
|
(package private) static boolean |
SERVER
|
private static String |
SMTP_PASSWORD
|
private static String |
SMTP_USERNAME
|
protected static String |
SUBJECT_INSERTS
Label for the attribute. |
protected static String |
SUBJECT_KEY
Label for the attribute. |
private static int |
SUBJECT_KEY_UPPER_LIMIT
|
protected static String |
SUBJECT_RESOURCE
Label for the attribute. |
private static int |
SUBJECT_RESOURCE_UPPER_LIMIT
|
private Object[] |
subjectInserts
|
private String |
subjectKey
|
private String |
subjectResource
|
private static long |
TWO_HOURS
|
private static boolean |
VERBOSE
|
Fields inherited from interface wt.method.RemoteAccess |
versionID |
Constructor Summary | |
EMailMessage()
|
Method Summary | |
protected void |
_send(boolean immediate)
Submit the message for delivery to its intended recipients. |
void |
addPart(Notification notification)
Deprecated. |
void |
addPart(String text,
String contentType)
Add a textual message body of a specific MIME content type to the message. |
void |
addPart(String resource,
String key,
Object[] inserts,
String contentType)
Add a textual message body of a specific MIME content type to the message. |
void |
addPart(URL url)
Add a message body whose content is read from a URL. |
void |
addRecipient(EMailDistributionList recipient)
Add the principals associated with a distribution list. |
void |
addRecipient(RoleHolder2 roleHolder,
Vector roles)
Add the principals associated with specific roles of a role holder as recipients of the message. |
void |
addRecipient(WTPrincipal recipient)
Add a specific principal as a recipient of the message. |
void |
addRecipient(WTPrincipalReference recipient)
Add a specific principal by reference as a recipient of the message. |
void |
addRecipient(WTReference recipient,
Vector roles)
Add the principals associated with specific roles of a role holder as recipients of the message. |
private String |
getCharset(Locale locale)
Gets the MIME character set specified by the charset properties in WTProperties for the specified locale. |
ClassInfo |
getClassInfo()
Returns the ClassInfo object for this class. |
String |
getConceptualClassname()
Deprecated. |
private String |
getContentCharset(Locale locale)
Gets the MIME character set specified by the content charset properties in WTProperties for the specified locale. |
private String |
getHeadersCharset(Locale locale)
Gets the MIME character set specified by the headers charset properties in WTProperties for the specified locale. |
String |
getMultipartSubtype()
Gets the value of the attribute: MULTIPART_SUBTYPE. |
WTPrincipalReference |
getOriginator()
Gets the value of the attribute: ORIGINATOR. |
Enumeration |
getRecipients()
Return the current list of recipients as an enumeration of objects. |
protected Object[] |
getSubjectInserts()
Gets the value of the attribute: SUBJECT_INSERTS. |
protected String |
getSubjectKey()
Gets the value of the attribute: SUBJECT_KEY. |
protected String |
getSubjectResource()
Gets the value of the attribute: SUBJECT_RESOURCE. |
protected void |
initialize()
Supports initialization, following construction of an instance. |
static EMailMessage |
newEMailMessage()
Construct a new instance with no recipients, subject, or content. |
protected void |
queueMessage(long deadline,
int backOff,
String status,
String message)
|
void |
readExternal(ObjectInput input)
Reads the non-transient fields of this class from an external source. |
void |
readExternal(PersistentRetrieveIfc input)
Used by Persistent Data Service to populate the persistent attributes of this class from a persistent store. |
private boolean |
readOldVersion(ObjectInput input,
long readSerialVersionUID,
boolean passThrough,
boolean superDone)
Reads the non-transient fields of this class from an external source, which is not the current version. |
protected boolean |
readVersion(EMailMessage thisObject,
ObjectInput input,
long readSerialVersionUID,
boolean passThrough,
boolean superDone)
Reads the non-transient fields of this class from an external source. |
private void |
requeue(Vector addressVector,
WTUser[] users,
long deadline,
int backOff,
String status,
String message)
Requeue a message, possibly with a subset of the its original recipients. |
void |
send(boolean immediate)
Submit the message for delivery to its intended recipients. |
void |
setMultipartSubtype(String a_MultipartSubtype)
Sets the value of the attribute: MULTIPART_SUBTYPE. |
void |
setOriginator(WTPrincipal originator)
Set the originator of the message. |
void |
setOriginator(WTPrincipalReference a_Originator)
Sets the value of the attribute: ORIGINATOR. |
void |
setSubject(String subject)
Set the subject of the message. |
void |
setSubject(String resource,
String key,
Object[] inserts)
Set the resource bundle, key, and inserts from which the subject of the message will be obtained. |
protected void |
setSubjectInserts(Object[] a_SubjectInserts)
Sets the value of the attribute: SUBJECT_INSERTS. |
protected void |
setSubjectKey(String a_SubjectKey)
Sets the value of the attribute: SUBJECT_KEY. |
protected void |
setSubjectResource(String a_SubjectResource)
Sets the value of the attribute: SUBJECT_RESOURCE. |
static void |
submitMessage(EMailMessage msg,
Long deadline,
Integer backOff)
|
private void |
submitMessage(long deadline,
int backOff)
Submit the message to the mail server for delivery to the recipients. |
String |
toString()
Returns the conceptual (modeled) name for the class. |
void |
writeExternal(ObjectOutput output)
Writes the non-transient fields of this class to an external source. |
void |
writeExternal(PersistentStoreIfc output)
Used by Persistent Data Service to obtain the values of the persistent attributes of this class, so they can be written to a persistent store. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private static final String RESOURCE
private static final String CLASSNAME
protected static final String SUBJECT_RESOURCE
private static int SUBJECT_RESOURCE_UPPER_LIMIT
private String subjectResource
protected static final String SUBJECT_KEY
private static int SUBJECT_KEY_UPPER_LIMIT
private String subjectKey
protected static final String SUBJECT_INSERTS
private Object[] subjectInserts
public static final String ORIGINATOR
private WTPrincipalReference originator
public static final String MULTIPART_SUBTYPE
private static int MULTIPART_SUBTYPE_UPPER_LIMIT
private String multipartSubtype
private ObjectVector recipients
private ObjectVector parts
static final boolean SERVER
private static final String FC_RESOURCE
static final long serialVersionUID
public static final long EXTERNALIZATION_VERSION_UID
protected static final long OLD_FORMAT_VERSION_UID
private static final String MIME_CHARSET_PROPERTY
private static final String MIME_CHARSET_CONTENT_PROPERTY
private static final String MIME_CHARSET_HEADERS_PROPERTY
private static final String DEFAULT_MIME_CHARSET
private static long ONE_MINUTE
private static long ONE_HOUR
private static long TWO_HOURS
private static long ONE_DAY
private static final String EMAIL_QUEUE_NAME
private static final long EMAIL_QUEUE_TTL
private static final String MAIL_HOST
private static final String MAIL_TASK
private static final String SMTP_USERNAME
private static final String SMTP_PASSWORD
private static final boolean VERBOSE
private static WTProperties properties
Constructor Detail |
public EMailMessage()
Method Detail |
public void writeExternal(ObjectOutput output) throws IOException
writeExternal
in interface Externalizable
output
-
IOException
public void readExternal(ObjectInput input) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
input
-
IOException
ClassNotFoundException
protected boolean readVersion(EMailMessage thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone) throws IOException, ClassNotFoundException
thisObject
- input
- readSerialVersionUID
- passThrough
- superDone
-
IOException
ClassNotFoundException
private boolean readOldVersion(ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone) throws IOException, ClassNotFoundException
input
- readSerialVersionUID
- passThrough
- superDone
-
IOException
ClassNotFoundException
public void writeExternal(PersistentStoreIfc output) throws SQLException, DatastoreException
(Not intended for general use.)
Supported API: false
writeExternal
in interface ObjectMappable
output
-
SQLException
DatastoreException
public void readExternal(PersistentRetrieveIfc input) throws SQLException, DatastoreException
(Not intended for general
use.)
Supported API: false
readExternal
in interface ObjectMappable
input
-
SQLException
DatastoreException
public String getConceptualClassname()
getConceptualClassname
in interface NetFactor
public String toString()
public ClassInfo getClassInfo() throws WTIntrospectionException
getClassInfo
in interface NetFactor
WTIntrospectionException
protected String getSubjectResource()
protected void setSubjectResource(String a_SubjectResource)
a_SubjectResource
- protected String getSubjectKey()
protected void setSubjectKey(String a_SubjectKey)
a_SubjectKey
- protected Object[] getSubjectInserts()
protected void setSubjectInserts(Object[] a_SubjectInserts)
a_SubjectInserts
- public WTPrincipalReference getOriginator()
public void setOriginator(WTPrincipalReference a_Originator)
a_Originator
- public String getMultipartSubtype()
public void setMultipartSubtype(String a_MultipartSubtype)
a_MultipartSubtype
- public static EMailMessage newEMailMessage() throws WTException
WTException
protected void initialize() throws WTException
WTException
public void setOriginator(WTPrincipal originator) throws WTException
originator
- The principal who is designated as the originator of the message.
WTException
public void setSubject(String resource, String key, Object[] inserts)
resource
- The name of the resource bundle containing the subject.key
- The key that identifies the entry within the resource bundle providing the message subject.inserts
- The objects to be inserted into the resource bundle entry to produce the subject string.public void setSubject(String subject)
subject
- The subject text.#method(String resource, String key, Object [] inserts)
public void addRecipient(WTPrincipal recipient) throws WTException
recipient
- The principal to add as recipient.
WTException
public void addRecipient(WTPrincipalReference recipient) throws WTException
recipient
- The reference to the principal to be added as recipient.
WTException
public void addRecipient(RoleHolder2 roleHolder, Vector roles) throws WTException
roleHolder
- The role holder containing roles from which recipients will be obtained.roles
- The specific roles within the role holder from which recipients will be obtained.
WTException
public void addRecipient(WTReference recipient, Vector roles) throws WTException
recipient
- The role holder reference.roles
- The roles identifying the role occupants to be added as recipients.
WTException
public void addRecipient(EMailDistributionList recipient) throws WTException
recipient
- The distribution list whose members will be added as recipients.
WTException
public Enumeration getRecipients()
public void addPart(String resource, String key, Object[] inserts, String contentType)
resource
- The name of the resource bundle.key
- The key of the resource within the bundle that contains the message body.inserts
- The objects, if any, to be inserted into the message body.contentType
- The MIME content type of the message body, .e.g., "text/html" or "text/plain".public void addPart(URL url)
url
- The URL of the remote resource that provides the message body.public void addPart(String text, String contentType)
text
- The textual message body.contentType
- The MIME content type of the message body, .e.g., "text/html" or "text/plain".#method(String resource, String key, Object [] inserts, String
contentType)
,
#method(URL url)
public void addPart(Notification notification)
notification
- #method(String resource, String key, Object [] inserts, String
contentType)
,
#method(URL url)
public void send(boolean immediate) throws WTException
immediate
- Indicates whether to submit the message to the mail server immediately (true), or place the message in a queue where it will be submitted to the mail server by a background process (false).
WTException
protected void _send(boolean immediate) throws WTException
immediate
- Indicates whether to submit the message to the mail server immediately (true), or place the message in a queue where it will be submitted to the mail server by a background process (false).
WTException
protected void queueMessage(long deadline, int backOff, String status, String message) throws WTException
WTException
public static void submitMessage(EMailMessage msg, Long deadline, Integer backOff) throws WTException
WTException
private void submitMessage(long deadline, int backOff) throws WTException
WTException
private String getHeadersCharset(Locale locale)
private String getContentCharset(Locale locale)
private String getCharset(Locale locale)
private void requeue(Vector addressVector, WTUser[] users, long deadline, int backOff, String status, String message) throws WTException
WTException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |