|
Project Wonder 5.0 | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecter.extensions.ERXFrameworkPrincipal
er.javamail.ERJavaMail
public class ERJavaMail
ERJavaMail is the principal class for the ERJavaMail framework.
Properties | |
er.javamail.centralize | er.javamail.centralize |
er.javamail.adminEmail | er.javamail.adminEmail |
er.javamail.debugEnabled | er.javamail.debugEnabled |
er.javamail.senderQueue.size | er.javamail.senderQueue.size |
er.javamail.milliSecondsWaitIfSenderOverflowed | er.javamail.milliSecondsWaitIfSenderOverflowed |
er.javamail.XMailerHeader | er.javamail.XMailerHeader |
er.javamail.smtpProtocol | er.javamail.smtpProtocol |
er.javamail.smtpHost | er.javamail.smtpHost |
mail.[smtpProtocol].host | mail.[smtpProtocol].host |
WOSMTPHost | WOSMTPHost |
er.javamail.smtpPort | er.javamail.smtpPort |
mail.[smtpProtocol].port | mail.[smtpProtocol].port |
er.javamail.smtpAuth | er.javamail.smtpAuth |
mail.[smtpProtocol].auth | mail.[smtpProtocol].auth |
er.javamail.smtpUser | er.javamail.smtpUser |
mail.[smtpProtocol].user | mail.[smtpProtocol].user |
er.javamail.smtpPassword | er.javamail.smtpPassword |
mail.[smtpProtocol].password | mail.[smtpProtocol].password |
mail.smtps.socketFactory.fallback | mail.smtps.socketFactory.fallback |
er.javamail.emailPattern | er.javamail.emailPattern |
er.javamail.WhiteListEmailAddressPatterns | er.javamail.WhiteListEmailAddressPatterns |
er.javamail.BlackListEmailAddressPatterns | er.javamail.BlackListEmailAddressPatterns |
Nested Class Summary | |
---|---|
static interface |
ERJavaMail.Delegate
|
Nested classes/interfaces inherited from class er.extensions.ERXFrameworkPrincipal |
---|
ERXFrameworkPrincipal.Observer |
Field Summary | |
---|---|
protected java.lang.String |
_adminEmail
email address used when centralizeMails == true Needed when debugging application so that mails are always sent to only one destination. |
protected boolean |
_centralize
Used to send mail to adminEmail only. |
protected boolean |
_debugEnabled
This property specify wether JavaMail is debug enabled or not. |
protected javax.mail.Session |
_defaultSession
This is the default JavaMail Session. |
protected java.lang.String |
_defaultXMailerHeader
This property sets the default header for the X-Mailer property |
protected int |
_milliSecondsWaitIfSenderOverflowed
Wait n milliseconds (by default this value is 6000) if the mail sender is overflowed |
protected java.util.regex.Pattern |
_pattern
The compiled form of the EMAIL_VALIDATION_PATTERN pattern. |
protected int |
_senderQueueSize
Number of messages that the sender queue can hold at a time; default to 50 messages and can be configured by er.javamail.senderQueue.size system property. |
protected com.webobjects.eocontrol.EOOrQualifier |
blackListQualifier
holds the black list qualifier |
protected com.webobjects.foundation.NSArray<java.lang.String> |
blakListEmailAddressPatterns
holds the array of black list email addresses |
static java.lang.Class<?>[] |
REQUIRES
|
protected static ERJavaMail |
sharedInstance
ERJavaMail class singleton. |
protected com.webobjects.foundation.NSArray<java.lang.String> |
whiteListEmailAddressPatterns
holds the array of white list email addresses |
protected com.webobjects.eocontrol.EOOrQualifier |
whiteListQualifier
holds the white list qualifier |
Fields inherited from class er.extensions.ERXFrameworkPrincipal |
---|
initializedFrameworks, launchingFrameworks |
Constructor Summary | |
---|---|
ERJavaMail()
|
Method Summary | |
---|---|
java.lang.String |
adminEmail()
admin email accessor. |
com.webobjects.foundation.NSArray<java.lang.String> |
blackListEmailAddressPatterns()
Gets the array of black list email address patterns. |
com.webobjects.eocontrol.EOOrQualifier |
blackListQualifier()
Gets the Or qualifier to match any of the patterns in the black list. |
boolean |
centralize()
Centralize is used to send all the outbound email to a single address which is useful when debugging. |
boolean |
debugEnabled()
Returns true if JavaMail is debug enabled. |
javax.mail.Session |
defaultSession()
This is the deafult JavaMail Session accessor. |
java.lang.String |
defaultXMailerHeader()
Gets the default X-Mailer header to use for sending mails. |
com.webobjects.foundation.NSArray<java.lang.String> |
filterEmailAddresses(com.webobjects.foundation.NSArray<java.lang.String> emailAddresses)
Filters an array of email addresses by the black and white lists. |
void |
finishInitialization()
Specialized implementation of the method from ERXPrincipalClass. |
boolean |
hasBlackList()
Determines if a black list has been specified |
boolean |
hasWhiteList()
Determines if a white list has been specified |
void |
initializeFrameworkFromSystemProperties()
This method is used to initialize ERJavaMail from System properties. |
boolean |
isValidEmail(java.lang.String email)
Predicate used to validate email well-formness. |
int |
milliSecondsWaitIfSenderOverflowed()
This method return the time spent waiting if the mail queue if overflowed. |
javax.mail.Session |
newSession()
Returns a newly allocated Session object from the System Properties |
javax.mail.Session |
newSession(java.util.Properties props)
Returns a newly allocated Session object from the given Properties |
javax.mail.Session |
newSessionForContext(java.util.Properties properties,
java.lang.String contextString)
Returns a newly allocated Session object from the given Properties |
protected javax.mail.Session |
newSessionForContext(java.lang.String contextString)
Returns a new Session object that is appropriate for the given context. |
javax.mail.Session |
newSessionForMessage(ERMessage message)
Returns a newly allocated Session object for the given message. |
protected com.webobjects.eocontrol.EOOrQualifier |
qualifierArrayForEmailPatterns(com.webobjects.foundation.NSArray<java.lang.String> emailPatterns)
Constructs an Or qualifier for filtering an array of strings that might have the * wildcard character. |
int |
senderQueueSize()
|
protected javax.mail.Session |
sessionForContext(java.lang.String contextString)
Returns the Session object that is appropriate for the given context. |
javax.mail.Session |
sessionForMessage(ERMessage message)
Returns the Session object that is appropriate for the given message. |
void |
setAdminEmail(java.lang.String adminEmail)
Sets the admin email to another value. |
void |
setCentralize(boolean centralize)
Sets the value of the er.javamail.centralize Property. |
void |
setDebugEnabled(boolean debug)
Sets the debug mode of JavaMail. |
void |
setDefaultSession(javax.mail.Session session)
Sets the default JavaMail session to a particular value. |
void |
setDefaultXMailerHeader(java.lang.String header)
Sets the default value of the XMailer header used when sending mails. |
void |
setDelegate(ERJavaMail.Delegate delegate)
|
void |
setMilliSecondsWaitIfSenderOverflowed(int value)
Sets the value of the er.javamail.milliSecondsWaitIfSenderOverflowed Property. |
void |
setSenderQueueSize(int value)
|
protected void |
setupSmtpHostSafely()
Helper method to init the smtpHost property. |
protected void |
setupSmtpProperties(java.util.Properties properties,
java.lang.String contextString)
|
static ERJavaMail |
sharedInstance()
Accessor to the ERJavaMail singleton. |
java.lang.String |
smtpProtocolForContext(java.lang.String contextString)
Returns the SMTP protocol to use for connections. |
java.lang.String |
validateEmail(com.webobjects.eocontrol.EOEnterpriseObject object,
java.lang.String key,
java.lang.String email)
Validates an enterprise object's email attribute (accessed via key). |
com.webobjects.foundation.NSArray<java.lang.String> |
whiteListEmailAddressPatterns()
Gets the array of white list email address patterns. |
com.webobjects.eocontrol.EOOrQualifier |
whiteListQualifier()
Whilte list Or qualifier to match any of the patterns in the white list. |
Methods inherited from class er.extensions.ERXFrameworkPrincipal |
---|
didFinishInitialization, initialize, setUpFrameworkPrincipalClass, sharedInstance, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.Class<?>[] REQUIRES
protected static ERJavaMail sharedInstance
protected java.util.regex.Pattern _pattern
EMAIL_VALIDATION_PATTERN
pattern.
protected javax.mail.Session _defaultSession
protected java.lang.String _adminEmail
protected boolean _debugEnabled
protected java.lang.String _defaultXMailerHeader
protected boolean _centralize
protected int _senderQueueSize
er.javamail.senderQueue.size
system property.
protected int _milliSecondsWaitIfSenderOverflowed
protected com.webobjects.foundation.NSArray<java.lang.String> whiteListEmailAddressPatterns
protected com.webobjects.foundation.NSArray<java.lang.String> blakListEmailAddressPatterns
protected com.webobjects.eocontrol.EOOrQualifier whiteListQualifier
protected com.webobjects.eocontrol.EOOrQualifier blackListQualifier
Constructor Detail |
---|
public ERJavaMail()
Method Detail |
---|
public static ERJavaMail sharedInstance()
ERJavaMail
instancepublic void setDelegate(ERJavaMail.Delegate delegate)
public void finishInitialization()
finishInitialization
in class ERXFrameworkPrincipal
public void initializeFrameworkFromSystemProperties()
protected void setupSmtpHostSafely()
er.javamail.smtpHost
is
set. If it is not set, then it looks for mail.smtp.host
(standard JavaMail property) and finally
the WOSMTPHost
property. When a correct property is found, then it sets both properties to the
found value. If no properties are found, a RuntimeException is thrown.
java.lang.RuntimeException
- if neither one of er.javamail.smtpHost
, mail.smtp.host
or
WOSMTPHost
is set.protected void setupSmtpProperties(java.util.Properties properties, java.lang.String contextString)
public void setDefaultSession(javax.mail.Session session)
session
- the default javax.mail.Session
public javax.mail.Session defaultSession()
javax.mail.Session
instancepublic javax.mail.Session newSession(java.util.Properties props)
props
- a Properties
value
javax.mail.Session
value initialized from the given propertiespublic javax.mail.Session newSession()
javax.mail.Session
valuepublic javax.mail.Session newSessionForMessage(ERMessage message)
message
- the message
javax.mail.Session
valuepublic javax.mail.Session sessionForMessage(ERMessage message)
javax.mail.Session
valueprotected javax.mail.Session newSessionForContext(java.lang.String contextString)
contextString
- the message context
javax.mail.Session
valuepublic javax.mail.Session newSessionForContext(java.util.Properties properties, java.lang.String contextString)
properties
- a Properties
value
javax.mail.Session
value initialized from the given propertiesprotected javax.mail.Session sessionForContext(java.lang.String contextString)
contextString
- the message context
javax.mail.Session
valuepublic java.lang.String adminEmail()
String
valuepublic void setAdminEmail(java.lang.String adminEmail)
er.javamail.adminEmail
Property.
adminEmail
- a String
valuepublic boolean debugEnabled()
true
if JavaMail is debug enabled.
boolean
valuepublic void setDebugEnabled(boolean debug)
debug
- a boolean
value sets JavaMail in debug modepublic java.lang.String defaultXMailerHeader()
public void setDefaultXMailerHeader(java.lang.String header)
header
- a String
valuepublic boolean centralize()
boolean
valuepublic void setCentralize(boolean centralize)
er.javamail.centralize
Property.
centralize
- if the boolean value is true, then all the outbound mails will be sent to adminEmail
email address.public java.lang.String smtpProtocolForContext(java.lang.String contextString)
public int senderQueueSize()
public void setSenderQueueSize(int value)
public int milliSecondsWaitIfSenderOverflowed()
int
valuepublic void setMilliSecondsWaitIfSenderOverflowed(int value)
er.javamail.milliSecondsWaitIfSenderOverflowed
Property.
value
- an int
value in milli-seconds.public java.lang.String validateEmail(com.webobjects.eocontrol.EOEnterpriseObject object, java.lang.String key, java.lang.String email)
object
- the object to be validatedkey
- the attribute's nameemail
- the email value
public boolean isValidEmail(java.lang.String email)
email
- the email String value to validate
public boolean hasWhiteList()
public boolean hasBlackList()
public com.webobjects.foundation.NSArray<java.lang.String> whiteListEmailAddressPatterns()
public com.webobjects.foundation.NSArray<java.lang.String> blackListEmailAddressPatterns()
public com.webobjects.eocontrol.EOOrQualifier whiteListQualifier()
public com.webobjects.eocontrol.EOOrQualifier blackListQualifier()
protected com.webobjects.eocontrol.EOOrQualifier qualifierArrayForEmailPatterns(com.webobjects.foundation.NSArray<java.lang.String> emailPatterns)
emailPatterns
- array of email patterns
public com.webobjects.foundation.NSArray<java.lang.String> filterEmailAddresses(com.webobjects.foundation.NSArray<java.lang.String> emailAddresses)
emailAddresses
- array of email addresses to be filtered
|
Last updated: Tue, Feb 21, 2017 05:45 PM CET | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |