|
xmlBlaster 2.2.0 client API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xmlBlaster.util.protocol.RequestReplyExecutor org.xmlBlaster.util.protocol.email.EmailExecutor
public abstract class EmailExecutor
Base class to handle request/reply for emails.
Nested Class Summary | |
---|---|
protected class |
EmailExecutor.LoopProtection
Use to protect against looping messages |
Field Summary | |
---|---|
protected java.lang.String |
bcc
|
static java.lang.String |
BOUNCE_MAILFROM_KEY
|
static java.lang.String |
BOUNCE_MAILTO_KEY
|
protected java.lang.String |
BOUNCE_MESSAGEID_KEY
|
protected java.lang.String |
cc
|
protected javax.mail.internet.InternetAddress |
fromAddress
|
protected java.lang.String |
messageIdFileName
'messageId.mid' |
protected java.lang.String |
msgInfoParserClassName
Which message format parser to use |
protected java.lang.String |
payloadFileNamePrefix
The extension is added later to for example "xmlBlasterMessage.xfb" |
protected Pop3Driver |
pop3Driver
|
protected java.util.Map |
senderLoopProtectionMap
|
protected SmtpClient |
smtpClient
|
protected java.lang.String |
SUBJECT_MESSAGEID_TOKEN
|
protected java.lang.String |
subjectTemplate
|
protected javax.mail.internet.InternetAddress |
toAddress
|
Fields inherited from class org.xmlBlaster.util.protocol.RequestReplyExecutor |
---|
addressConfig, addressServer, cbClient, compressZlib, compressZlibStream, contextNode, glob, mbeanHandle, minSizeForCompression, ONEWAY, pingResponseTimeout, prefix, progressListener, responseListenerMap, responseTimeout, updateResponseTimeout, useEmailExpiryTimestamp, WAIT_ON_RESPONSE |
Constructor Summary | |
---|---|
EmailExecutor()
|
Method Summary | |
---|---|
protected java.lang.String |
createMessageId(MsgInfo msgInfo,
java.lang.String requestId,
MethodName methodName,
java.sql.Timestamp expiryTimestamp)
|
java.lang.String |
getBcc()
|
java.lang.String |
getCc()
|
long |
getDefaultResponseTimeout()
Defaults to one day. |
long |
getDefaultUpdateResponseTimeout()
Defaults to one day. |
java.lang.String |
getEmailSessionId()
The sessionId used to register at Pop3Driver and send in subject: of email |
java.lang.String |
getEmailSessionId(MsgInfo msgInfo)
Is overwritten for example by EmailDriver.java singleton. |
java.lang.String |
getFrom()
|
java.lang.String |
getLoopProtectionList()
Returns a comma seperated list of all 'from email addresses'. |
protected EmailExecutor.LoopProtection[] |
getLoopProtections()
|
java.lang.String |
getMsgInfoParserClassName()
Which parser to use. |
Pop3Driver |
getPop3Driver()
Access the Pop3Driver. |
java.lang.String |
getSecretSessionId()
|
SmtpClient |
getSmtpClient()
TODO: Put into engine.Global and util.Global (see EventPlugin.java) |
java.lang.String |
getTo()
|
java.lang.String |
getUsageUrl()
|
void |
incomingMessage(java.lang.String requestId,
java.lang.Object response)
Notification by Pop3Driver when a (response) email message arrives. |
void |
init(Global glob,
AddressBase addressBase,
PluginInfo pluginConfig)
This init() is called after the init(Global, PluginInfo) |
boolean |
isAlive()
|
protected boolean |
isLoopingMail(MsgInfo msgInfo,
EmailData emailData)
Some weak looping protection. |
boolean |
isShutdown()
I_AdminPlugin#isShutodwn |
java.lang.String |
ping(java.lang.String qos)
Ping to check if callback server is alive. |
protected EmailExecutor.LoopProtection |
removeFromLoopProtection(java.lang.String key)
Cleanup |
java.lang.Object |
sendEmail(MsgUnitRaw[] msgArr,
MethodName methodName,
boolean expectingResponse)
This sends the update to the client. |
java.lang.Object |
sendEmail(MsgUnitRaw msgUnit,
MethodName methodName,
boolean expectingResponse)
|
java.lang.Object |
sendEmail(java.lang.String qos,
MethodName methodName,
boolean expectingResponse)
|
java.lang.Object |
sendEmail(java.lang.String key,
java.lang.String qos,
MethodName methodName,
boolean expectingResponse)
|
protected void |
sendMessage(MsgInfo msgInfo,
java.lang.String requestId,
MethodName methodName,
boolean udp)
Extends RequestReplyExecutor.sendMessage |
void |
sendUpdateOneway(MsgUnitRaw[] msgArr)
The oneway variant, without return value. |
void |
setBcc(java.lang.String bcc)
Send all emails additionally to the given bcc. |
void |
setCc(java.lang.String cc)
Send all emails additionally to the given CC addresses. |
protected void |
setEmailSessionId(SessionName sessionName)
Email protocol contract with server side CallbackEmailDriver.java and client side EmailCallbackImpl.java We use |
void |
setEmailSessionId(java.lang.String emailSessionId)
|
void |
setFrom(java.lang.String from)
JMX |
void |
setSecretSessionId(java.lang.String secretSessionId)
|
void |
setTo(java.lang.String to)
JMX |
void |
setUsageUrl(java.lang.String url)
|
void |
shutdown()
This method shuts down the driver. |
java.lang.String |
usage()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.xmlBlaster.util.protocol.RequestReplyExecutorMBean |
---|
getMinSizeForCompression, getPingResponseTimeout, getResponseTimeout, getResponseTimeout, getUpdateResponseTimeout, interruptInvocation, isCompressZlib, isCompressZlibStream, isUseEmailExpiryTimestamp, setCompressZlib, setCompressZlibStream, setMinSizeForCompression, setPingResponseTimeout, setResponseTimeout, setUpdateResponseTimeout, setUseEmailExpiryTimestamp |
Methods inherited from interface org.xmlBlaster.util.admin.I_AdminPlugin |
---|
getType, getVersion |
Field Detail |
---|
protected javax.mail.internet.InternetAddress fromAddress
protected javax.mail.internet.InternetAddress toAddress
protected java.lang.String cc
protected java.lang.String bcc
protected SmtpClient smtpClient
protected Pop3Driver pop3Driver
protected java.lang.String msgInfoParserClassName
protected java.util.Map senderLoopProtectionMap
protected final java.lang.String BOUNCE_MESSAGEID_KEY
public static final java.lang.String BOUNCE_MAILTO_KEY
public static final java.lang.String BOUNCE_MAILFROM_KEY
protected java.lang.String messageIdFileName
protected java.lang.String payloadFileNamePrefix
protected java.lang.String subjectTemplate
protected final java.lang.String SUBJECT_MESSAGEID_TOKEN
Constructor Detail |
---|
public EmailExecutor()
Method Detail |
---|
public void init(Global glob, AddressBase addressBase, PluginInfo pluginConfig) throws XmlBlasterException
addressBase
- Contains the email TO: address
XmlBlasterException
public Pop3Driver getPop3Driver() throws XmlBlasterException
XmlBlasterException
public SmtpClient getSmtpClient() throws XmlBlasterException
XmlBlasterException
public long getDefaultResponseTimeout()
getDefaultResponseTimeout
in class RequestReplyExecutor
public long getDefaultUpdateResponseTimeout()
getDefaultUpdateResponseTimeout
in class RequestReplyExecutor
public java.lang.String getMsgInfoParserClassName()
public java.lang.Object sendEmail(java.lang.String qos, MethodName methodName, boolean expectingResponse) throws XmlBlasterException
XmlBlasterException
public java.lang.Object sendEmail(java.lang.String key, java.lang.String qos, MethodName methodName, boolean expectingResponse) throws XmlBlasterException
XmlBlasterException
public java.lang.Object sendEmail(MsgUnitRaw msgUnit, MethodName methodName, boolean expectingResponse) throws XmlBlasterException
XmlBlasterException
public java.lang.Object sendEmail(MsgUnitRaw[] msgArr, MethodName methodName, boolean expectingResponse) throws XmlBlasterException
methodName
- MethodName.UPDATE and otherswithResponse
- one of SocketExecutor.WAIT_ON_RESPONSE or SocketExecutor.ONEWAY
XmlBlasterException
public void incomingMessage(java.lang.String requestId, java.lang.Object response)
incomingMessage
in interface I_ResponseListener
protected boolean isLoopingMail(MsgInfo msgInfo, EmailData emailData)
protected EmailExecutor.LoopProtection removeFromLoopProtection(java.lang.String key)
key
- this is the sender email address, for example "xmlBlaster@localhost" for a client
or "demo@localhost" on server side (emailData.getFrom())
public java.lang.String getLoopProtectionList()
getLoopProtectionList
in interface EmailExecutorMBean
protected EmailExecutor.LoopProtection[] getLoopProtections()
protected java.lang.String createMessageId(MsgInfo msgInfo, java.lang.String requestId, MethodName methodName, java.sql.Timestamp expiryTimestamp)
protected void sendMessage(MsgInfo msgInfo, java.lang.String requestId, MethodName methodName, boolean udp) throws XmlBlasterException, java.io.IOException
sendMessage
in class RequestReplyExecutor
XmlBlasterException
java.io.IOException
public void sendUpdateOneway(MsgUnitRaw[] msgArr) throws XmlBlasterException
XmlBlasterException
- Is never from the client (oneway).public java.lang.String ping(java.lang.String qos) throws XmlBlasterException
qos
- Currently an empty string ""
XmlBlasterException
- If client not reachablepublic void shutdown()
shutdown
in interface I_AdminPlugin
shutdown
in class RequestReplyExecutor
public boolean isShutdown()
isShutdown
in interface I_AdminPlugin
isShutdown
in class RequestReplyExecutor
public boolean isAlive()
public java.lang.String getSecretSessionId()
public void setSecretSessionId(java.lang.String secretSessionId)
secretSessionId
- The secretSessionId to set.public java.lang.String getEmailSessionId()
public java.lang.String getEmailSessionId(MsgInfo msgInfo)
msgInfo
-
public void setEmailSessionId(java.lang.String emailSessionId)
protected void setEmailSessionId(SessionName sessionName)
public java.lang.String getCc()
getCc
in interface EmailExecutorMBean
public void setCc(java.lang.String cc)
setCc
in interface EmailExecutorMBean
cc
- The copy addresses, for example "joe@localhost,jack@localhost"public void setTo(java.lang.String to) throws java.lang.IllegalArgumentException
setTo
in interface EmailExecutorMBean
java.lang.IllegalArgumentException
public java.lang.String getTo()
getTo
in interface EmailExecutorMBean
public void setFrom(java.lang.String from) throws java.lang.IllegalArgumentException
setFrom
in interface EmailExecutorMBean
java.lang.IllegalArgumentException
public java.lang.String getFrom()
getFrom
in interface EmailExecutorMBean
public java.lang.String getBcc()
getBcc
in interface EmailExecutorMBean
public void setBcc(java.lang.String bcc)
setBcc
in interface EmailExecutorMBean
bcc
- The blind copy addresses, for example "joe@localhost,jack@localhost"public java.lang.String usage()
usage
in interface I_AdminUsage
usage
in class RequestReplyExecutor
public java.lang.String getUsageUrl()
getUsageUrl
in interface I_AdminUsage
public void setUsageUrl(java.lang.String url)
setUsageUrl
in interface I_AdminUsage
|
xmlBlaster 2.2.0 client API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |