|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectutil.PropertyContainer
util.PropertyResources
util.PropertyBundles
util.Mailer
public class Mailer
Used to create a e-mail transport session out of PropertyBearing.
| Nested Class Summary | |
|---|---|
static class |
Mailer.Google
Send a test message via my google account. |
| Nested classes/interfaces inherited from class util.PropertyResources |
|---|
PropertyResources.URLResource |
| Field Summary | |
|---|---|
private boolean |
debug
A debug flag, acts globally. |
static String |
KEY_DEBUG
If true, messages are not sent. |
static String |
KEY_PASSWORD
Given together with a username, we use password authentication. |
static String |
KEY_SMTPHOST
Key pointing to the smtp server. |
static String |
KEY_SMTPPORT
Key pointing to the smtp server port. |
static String |
KEY_USERNAME
Given together with a password, we use password authentication. |
static String |
KEY_USESSL
If true, we use SSL. |
private static String |
MAILAUTH
The key for authentication use. |
private javax.mail.Session |
mailer
The mailer used internally. |
private static String |
MAILSAUTH
The key for authentication use. |
private static String |
MAILSMTPHOST
The key in the smtp-session key denoting the host for JavaMail. |
private static String |
MAILSMTPPORT
The key for authentication use. |
private static String |
MAILSMTPSHOST
The key in the smtp-session key denoting the host for JavaMail. |
static String |
STELLAMAINTENANCE
A generic user receiving maintenance mails from STELLA. |
static String |
STELLAROBOTIC
A generic user receiving maintenance mails from STELLA. |
private com.sun.mail.smtp.SMTPTransport |
transport
The transporter. |
| Fields inherited from class util.PropertyBundles |
|---|
KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_RESOURCEBUNDLES |
| Fields inherited from class util.PropertyResources |
|---|
applet, DEFURLUSECONFIG, DEFURLUSECURRENT, DEFURLUSEHOME, KEY_NOINITONCREATE, localurl, locate, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_URL, urlset |
| Fields inherited from class util.PropertyContainer |
|---|
KEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR |
| Fields inherited from interface util.ResourceSupplying |
|---|
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME |
| Fields inherited from interface util.PropertySupplying |
|---|
CONFIG, KEY_CLASS |
| Constructor Summary | |
|---|---|
Mailer(Map<String,String> prop)
Subclasses that directly want to create their mailer may use this constructor. |
|
| Method Summary | |
|---|---|
void |
close()
|
private boolean |
createMailSession()
We create our private mailer session out of the properties. |
private javax.mail.Session |
createMailSession(PropertySupplying i)
Creates a mailer session out of some properties. |
static Mailer |
createStellaRoboticMailer()
Factory method to create a mailer for the robotic account on Google |
private com.sun.mail.smtp.SMTPTransport |
createTransport(javax.mail.Session s,
boolean usessl)
Creates the transport agent for the send-mail protocol. |
static javax.mail.Address[] |
getAddresses(String comma)
Converts a comma-separated list of RFC-822 formatted mail addresses into an array of internet addresses. |
static javax.mail.Address |
getStellaMaintenance()
Creates a useable e-mail address for the stella maintenance user. |
static javax.mail.Address |
getStellaRobotic()
Creates a useable e-mail address for the stella maintenance user. |
void |
init()
We prepare the session for sending mail. |
javax.mail.internet.MimeMessage |
prepareMail(javax.mail.Address from,
javax.mail.Address[] to,
javax.mail.Address[] cc,
javax.mail.Address[] bcc,
String subject,
String text,
Date time)
Prepares a mail for the given session. |
boolean |
sendMail(javax.mail.internet.MimeMessage errmail)
Truly sends a previously prepared mail. |
boolean |
sendMail(javax.mail.internet.MimeMessage errmail,
boolean debug)
Sends a previously prepared mail or debugs. |
Thread |
threadMail(javax.mail.internet.MimeMessage errmail,
boolean debug)
Sends a previously prepared mail or debugs. |
| Methods inherited from class util.PropertyBundles |
|---|
clone, getLocalized, getLocalized, getLocalizedString, getLocalizedString, loadResource |
| Methods inherited from class util.PropertyResources |
|---|
createFrom, createFrom, createFrom, getApplet, getAsResources, getLocalClassLoader, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, keyCreate, keyCreate, loadAppletResource, reload, setApplet |
| Methods inherited from class util.PropertyContainer |
|---|
augment, augment, augment, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, isNew, parseObject, reload, removeProperty, rescanned, setObject, setProperties, setProperty, stringProperties, toString |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface util.ResourceSupplying |
|---|
getResource, getResourceAsStream, getResources |
| Methods inherited from interface util.PropertySupplying |
|---|
defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, parseObject, removeProperty, setObject, setProperty, stringProperties |
| Field Detail |
|---|
public static final String KEY_SMTPHOST
public static final String KEY_SMTPPORT
public static final String KEY_USESSL
public static final String KEY_USERNAME
public static final String KEY_PASSWORD
public static final String KEY_DEBUG
public static final String STELLAROBOTIC
public static final String STELLAMAINTENANCE
private static final String MAILSMTPSHOST
private static final String MAILSAUTH
private static final String MAILSMTPHOST
private static final String MAILAUTH
private static final String MAILSMTPPORT
private javax.mail.Session mailer
private com.sun.mail.smtp.SMTPTransport transport
private boolean debug
sendMail(MimeMessage,boolean).
| Constructor Detail |
|---|
public Mailer(Map<String,String> prop)
| Method Detail |
|---|
public void init()
init in interface Initializableinit in class PropertyResourcesprivate boolean createMailSession()
private javax.mail.Session createMailSession(PropertySupplying i)
private com.sun.mail.smtp.SMTPTransport createTransport(javax.mail.Session s,
boolean usessl)
s - The Session, also created with SSL usageusessl - True, if smtps should be used as transport protocol.
public static final javax.mail.Address[] getAddresses(String comma)
throws javax.mail.internet.AddressException
javax.mail.internet.AddressExceptionpublic static javax.mail.Address getStellaMaintenance()
public static javax.mail.Address getStellaRobotic()
public javax.mail.internet.MimeMessage prepareMail(javax.mail.Address from,
javax.mail.Address[] to,
javax.mail.Address[] cc,
javax.mail.Address[] bcc,
String subject,
String text,
Date time)
public boolean sendMail(javax.mail.internet.MimeMessage errmail)
public boolean sendMail(javax.mail.internet.MimeMessage errmail,
boolean debug)
public Thread threadMail(javax.mail.internet.MimeMessage errmail,
boolean debug)
public void close()
throws javax.mail.MessagingException
javax.mail.MessagingExceptionpublic static final Mailer createStellaRoboticMailer()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||