public class ERJavaMail extends ERXFrameworkPrincipal
| Name | Description |
|---|---|
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 |
er.javamail.sessionConfigViaJNDI | er.javamail.sessionConfigViaJNDI |
er.javamail.jndiSessionContext | er.javamail.jndiSessionContext |
| Modifier and Type | Class and Description |
|---|---|
static interface |
ERJavaMail.Delegate |
ERXFrameworkPrincipal.Observer| Modifier and Type | Field and Description |
|---|---|
protected 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 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
メール・キューがオーバフローされている時に待つ時間。 (デフォルトでは 6000)
|
protected 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
ブラック・リスト qualifier を保持
|
protected NSArray<String> |
blakListEmailAddressPatterns
holds the array of black list email addresses
ブラック・リスト・メールアドレス配列を保持
|
static Class<?>[] |
REQUIRES |
protected NSArray<String> |
whiteListEmailAddressPatterns
holds the array of white list email addresses
ホワイト・リスト・メールアドレス配列を保持
|
protected com.webobjects.eocontrol.EOOrQualifier |
whiteListQualifier
holds the white list qualifier
ホワイト・リスト qualifier を保持
|
initializedFrameworks, launchingFrameworks, log| Constructor and Description |
|---|
ERJavaMail() |
| Modifier and Type | Method and Description |
|---|---|
String |
adminEmail()
admin email accessor.
|
NSArray<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.
|
String |
defaultXMailerHeader()
Gets the default X-Mailer header to use for sending mails.
|
NSArray<String> |
filterEmailAddresses(NSArray<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(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(Properties props)
Returns a newly allocated Session object from the given Properties
|
javax.mail.Session |
newSessionForContext(Properties properties,
String contextString)
Returns a newly allocated Session object from the given Properties
|
protected javax.mail.Session |
newSessionForContext(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(NSArray<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(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(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(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)
送信キューが一回で保持できるメッセージ数です。 デフォルトでは 50 メッセージで、システム・プロパティの
er.javamail.senderQueue.size
で変更可能です。 |
protected void |
setupSmtpHostSafely()
Helper method to init the smtpHost property.
|
protected void |
setupSmtpProperties(Properties properties,
String contextString) |
static ERJavaMail |
sharedInstance()
Accessor to the ERJavaMail singleton.
|
String |
smtpProtocolForContext(String contextString)
Returns the SMTP protocol to use for connections.
|
String |
validateEmail(com.webobjects.eocontrol.EOEnterpriseObject object,
String key,
String email)
Validates an enterprise object's email attribute (accessed via key).
|
NSArray<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.
|
didFinishInitialization, hasFrameworkInstalled, initialize, setUpFrameworkPrincipalClass, sharedInstance, toStringpublic static final Class<?>[] REQUIRES
protected Pattern _pattern
EMAIL_VALIDATION_PATTERN pattern.protected javax.mail.Session _defaultSession
protected String _adminEmail
protected boolean _debugEnabled
protected String _defaultXMailerHeader
protected boolean _centralize
protected int _senderQueueSize
er.javamail.senderQueue.size system property.protected int _milliSecondsWaitIfSenderOverflowed
protected NSArray<String> whiteListEmailAddressPatterns
protected NSArray<String> blakListEmailAddressPatterns
protected com.webobjects.eocontrol.EOOrQualifier whiteListQualifier
protected com.webobjects.eocontrol.EOOrQualifier blackListQualifier
public static ERJavaMail sharedInstance()
ERJavaMail instance
ERJavaMail シングルトン・アクセス・メソッドpublic void setDelegate(ERJavaMail.Delegate delegate)
public void finishInitialization()
finishInitialization in class ERXFrameworkPrincipalpublic 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.RuntimeException - if neither one of er.javamail.smtpHost, mail.smtp.host or
WOSMTPHost is set.
smtpHost プロパティを初期化するヘルプ・メソッドです。 最初には er.javamail.smtpHost
がセットされているかどうかをチェックします。 セットされていなければ、mail.smtp.host (標準 JavaMail プロパティ) をチェックし、最終的には
WOSMTPHost プロパティ。 正しいプロパティが見つかると結果値を両方のプロパティにセットします。見つからない場合には RuntimeException が発生します。RuntimeException - - er.javamail.smtpHost, mail.smtp.host 又は WOSMTPHost
がセットされていなければ protected void setupSmtpProperties(Properties properties, String contextString)
public void setDefaultSession(javax.mail.Session session)
session - the default javax.mail.Session
JavaMail のデフォルト・セッションをセットします。 フレームワークの初期化時に設定されのですが、独自で設定する時には ここを実行するといいのです。session - - デフォルト javax.mail.Session public javax.mail.Session defaultSession()
javax.mail.Session instance
JavaMail のデフォルト・セッション・アクセス方法です。 即時配信処理のために共有されています。 延期配信は独自の JavaMail セッションを使用しています。public javax.mail.Session newSession(Properties props)
props - a Properties valueprops - - Properties 値javax.mail.Session value initialized from the given properties
指定プロパティを使った新規セッションを戻します。public javax.mail.Session newSession()
javax.mail.Session value
システム・プロパティを使った新規セッションを戻します。public javax.mail.Session newSessionForMessage(ERMessage message)
message - the messagejavax.mail.Session valuepublic javax.mail.Session sessionForMessage(ERMessage message)
javax.mail.Session valueprotected javax.mail.Session newSessionForContext(String contextString)
er.javamail.sessionConfigViaJNDI is set to true the JNDI is used to lookup the session informations.
You may change the default JNDI context with the property er.javamail.jndiSessionContextcontextString - the message contextjavax.mail.Session valuepublic javax.mail.Session newSessionForContext(Properties properties, String contextString)
properties - a Properties valuejavax.mail.Session value initialized from the given propertiesprotected javax.mail.Session sessionForContext(String contextString)
contextString - the message contextjavax.mail.Session valuepublic String adminEmail()
String value
centralizeMails == true の場合で使用されるメール・アドレスpublic void setAdminEmail(String adminEmail)
er.javamail.adminEmail Property.adminEmail - a String value
この値は初期化中で er.javamail.adminEmail プロパティより設定されますが、 このコマンドでオーバライドが可能です。adminEmail - - メール・アドレス public boolean debugEnabled()
true if JavaMail is debug enabled.boolean value
JavaMail がデバッグ中の場合には true が戻ります。public void setDebugEnabled(boolean debug)
debug - a boolean value sets JavaMail in debug mode
JavaMail のデバッグ・モードをセットします。debug - - boolean でデバッグ・モードを On / Off できます public String defaultXMailerHeader()
public void setDefaultXMailerHeader(String header)
header - a String value
送信時の XMailer ヘッダーのデフォルト値をセットします。header - - String 値 public boolean centralize()
boolean value
すべてのメールを er.javamail.adminEmail ユーザに送信します。(デバッグ中に便利)public 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.
er.javamail.centralize プロパティの値をセットします。centralize - - true の場合にはすべてのメールが adminEmail へ送信されます。 public String smtpProtocolForContext(String contextString)
contextString - - SMTP プロトコール名 public int senderQueueSize()
public void setSenderQueueSize(int value)
er.javamail.senderQueue.size
で変更可能です。 public int milliSecondsWaitIfSenderOverflowed()
int value
メール・キューがオーバフローされている時に待つ時間を設定します。この時間内ではメールが送信され、キューが減ります。
期間が過ぎるとキューがオーバフロー制限より以下であれば、メールが再度に送信されます。public void setMilliSecondsWaitIfSenderOverflowed(int value)
er.javamail.milliSecondsWaitIfSenderOverflowed Property.value - an int value in milli-seconds.
er.javamail.milliSecondsWaitIfSenderOverflowed プロパティをセットします。value - - int ミリ秒 public String validateEmail(com.webobjects.eocontrol.EOEnterpriseObject object, String key, String email)
object - the object to be validatedkey - the attribute's nameemail - the email valueobject - - 検証するオブジェクトkey - - アトリビュート名email - - メール値public boolean isValidEmail(String email)
email - the email String value to validateemail - - 検証するメール値public boolean hasWhiteList()
public boolean hasBlackList()
public NSArray<String> whiteListEmailAddressPatterns()
public NSArray<String> blackListEmailAddressPatterns()
public com.webobjects.eocontrol.EOOrQualifier whiteListQualifier()
public com.webobjects.eocontrol.EOOrQualifier blackListQualifier()
protected com.webobjects.eocontrol.EOOrQualifier qualifierArrayForEmailPatterns(NSArray<String> emailPatterns)
emailPatterns - array of email patternsemailPatterns - - メール・パタンの配列public NSArray<String> filterEmailAddresses(NSArray<String> emailAddresses)
emailAddresses - array of email addresses to be filteredemailAddresses - - フィルターするメール・アドレス配列Copyright © 2002 – 2020 Project Wonder.