xmlBlaster 2.2.0 API

org.xmlBlaster.client.protocol.email
Class EmailConnection

java.lang.Object
  extended by org.xmlBlaster.util.protocol.RequestReplyExecutor
      extended by org.xmlBlaster.util.protocol.email.EmailExecutor
          extended by org.xmlBlaster.client.protocol.email.EmailConnection
All Implemented Interfaces:
I_XmlBlasterConnection, I_AdminPlugin, I_AdminUsage, I_ResponseListener, I_Plugin, EmailExecutorMBean, RequestReplyExecutorMBean

public class EmailConnection
extends EmailExecutor
implements I_XmlBlasterConnection

This driver sends emails to the xmlBlaster server, the return QOS are polled via POP3.

This "email" driver needs to be registered in xmlBlaster.properties and will be started on xmlBlaster startup:

 ClientProtocolPlugin[email][1.0]=org.xmlBlaster.client.protocol.email.EmailConnection
 

All adjustable parameters are explained in usage()

Author:
Marcel Ruff.
See Also:
The protocol.email requirement

Nested Class Summary
 
Nested classes/interfaces inherited from class org.xmlBlaster.util.protocol.email.EmailExecutor
EmailExecutor.LoopProtection
 
Field Summary
private  Global glob
           
private  boolean isInitialized
           
private  boolean isLoggedIn
           
private static java.util.logging.Logger log
           
protected  java.lang.String loginName
           
private  java.lang.String ME
           
private  PluginInfo pluginInfo
           
private  boolean stripSecurityQosCDATA
           
 
Fields inherited from class org.xmlBlaster.util.protocol.email.EmailExecutor
bcc, BOUNCE_MAILFROM_KEY, BOUNCE_MAILTO_KEY, BOUNCE_MESSAGEID_KEY, cc, fromAddress, messageIdFileName, msgInfoParserClassName, payloadFileNamePrefix, pop3Driver, senderLoopProtectionMap, smtpClient, SUBJECT_MESSAGEID_TOKEN, subjectTemplate, toAddress
 
Fields inherited from class org.xmlBlaster.util.protocol.RequestReplyExecutor
addressConfig, addressServer, cbClient, compressZlib, compressZlibStream, contextNode, mbeanHandle, minSizeForCompression, ONEWAY, pingResponseTimeout, prefix, progressListener, responseListenerMap, responseTimeout, updateResponseTimeout, useEmailExpiryTimestamp, WAIT_ON_RESPONSE
 
Constructor Summary
EmailConnection()
          Called by plugin loader which calls init(Global, PluginInfo) thereafter.
 
Method Summary
 java.lang.String connect(java.lang.String connectQos)
          Login to the server.
 void connectLowlevel(Address address)
          Connects to xmlBlaster with one email connection.
 boolean disconnect(java.lang.String qos)
          Does a logout and removes the callback server.
 java.lang.String[] erase(java.lang.String xmlKey_literal, java.lang.String qos_literal)
          Delete messages.
 MsgUnitRaw[] get(java.lang.String xmlKey_literal, java.lang.String qos_literal)
          Synchronous access a message.
 java.lang.String getLoginName()
           
 java.lang.String getProtocol()
          Returns the protocol type.
 java.lang.String getType()
          Enforced by I_Plugin
 java.lang.String getVersion()
          Enforced by I_Plugin
 void init(Global glob, PluginInfo pluginInfo)
          This method is called by the PluginManager (enforced by I_Plugin).
 boolean isLoggedIn()
           
 java.lang.String ping(java.lang.String qos)
          Check server.
 java.lang.String publish(MsgUnitRaw msgUnit)
          Publish a message.
 java.lang.String[] publishArr(MsgUnitRaw[] msgUnitArr)
          Publish multiple messages in one sweep.
 void publishOneway(MsgUnitRaw[] msgUnitArr)
          Publish multiple messages in one sweep.
 void resetConnection()
          Reset the driver on problems
 void setConnectReturnQos(ConnectReturnQos connectReturnQos)
          Pass the driver the decrypted and parsed ConnectReturnQos directly after a connect.
 void shutdown()
          Shut down the callback server.
 java.lang.String subscribe(java.lang.String xmlKey_literal, java.lang.String qos_literal)
          Enforced by I_XmlBlasterConnection interface (failsafe mode).
 java.lang.String[] unSubscribe(java.lang.String xmlKey_literal, java.lang.String qos_literal)
          Unsubscribe from messages.
 java.lang.String usage()
          Command line usage.
 
Methods inherited from class org.xmlBlaster.util.protocol.email.EmailExecutor
createMessageId, getBcc, getCc, getDefaultResponseTimeout, getDefaultUpdateResponseTimeout, getEmailSessionId, getEmailSessionId, getFrom, getLoopProtectionList, getLoopProtections, getMsgInfoParserClassName, getPop3Driver, getSecretSessionId, getSmtpClient, getTo, getUsageUrl, incomingMessage, init, isAlive, isLoopingMail, isShutdown, removeFromLoopProtection, sendEmail, sendEmail, sendEmail, sendEmail, sendMessage, sendUpdateOneway, setBcc, setCc, setEmailSessionId, setEmailSessionId, setFrom, setSecretSessionId, setTo, setUsageUrl
 
Methods inherited from class org.xmlBlaster.util.protocol.RequestReplyExecutor
addResponseListener, clearResponseListenerMap, executeException, executeResponse, freePendingThreads, getAddressServer, getCbClient, getDefaultPingResponseTimeout, getExpiryTimestamp, getMinSizeForCompression, getPendingRequestList, getPingResponseTimeout, getProgressListener, getResponseListener, getResponseTimeout, getResponseTimeout, getResponseTimeout, getResponseTimeoutPropertyName, getUpdateResponseTimeout, getXmlBlasterCore, hasConnection, initialize, initializeCb, interruptInvocation, isCompressZlib, isCompressZlibStream, isShutdownCompletly, isUseEmailExpiryTimestamp, receiveReply, registerProgressListener, removeResponseListener, requestAndBlockForReply, setCbClient, setCompressZlib, setCompressZlibStream, setLoginName, setMinSizeForCompression, setPingResponseTimeout, setResponseTimeout, setUpdateResponseTimeout, setUseEmailExpiryTimestamp, setXmlBlasterCore
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.xmlBlaster.client.protocol.I_XmlBlasterConnection
registerProgressListener
 
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
 

Field Detail

log

private static java.util.logging.Logger log

ME

private java.lang.String ME

glob

private Global glob

loginName

protected java.lang.String loginName

pluginInfo

private PluginInfo pluginInfo

isLoggedIn

private boolean isLoggedIn

isInitialized

private boolean isInitialized

stripSecurityQosCDATA

private boolean stripSecurityQosCDATA
Constructor Detail

EmailConnection

public EmailConnection()
Called by plugin loader which calls init(Global, PluginInfo) thereafter.

Method Detail

getLoginName

public java.lang.String getLoginName()

getType

public java.lang.String getType()
Enforced by I_Plugin

Specified by:
getType in interface I_AdminPlugin
Specified by:
getType in interface I_Plugin
Specified by:
getType in class RequestReplyExecutor
Returns:
"SOCKET" or "EMAIL", never null

getVersion

public java.lang.String getVersion()
Enforced by I_Plugin

Specified by:
getVersion in interface I_AdminPlugin
Specified by:
getVersion in interface I_Plugin
Returns:
For example "1.0"

init

public void init(Global glob,
                 PluginInfo pluginInfo)
          throws XmlBlasterException
This method is called by the PluginManager (enforced by I_Plugin).

Specified by:
init in interface I_Plugin
Throws:
XmlBlasterException
See Also:
I_Plugin.init(org.xmlBlaster.util.Global,org.xmlBlaster.util.plugin.PluginInfo)

connectLowlevel

public void connectLowlevel(Address address)
                     throws XmlBlasterException
Connects to xmlBlaster with one email connection.

Specified by:
connectLowlevel in interface I_XmlBlasterConnection
Parameters:
address - Contains the remote address, e.g. the host and port where the remote server listens
Throws:
XmlBlasterException - ErrorCode.COMMUNICATION* if the server is not reachable, in this case we can poll for the server.
Other errors if for example a malformed address is passed, in this case we stop and give up.
See Also:
I_XmlBlasterConnection.connectLowlevel(Address)

resetConnection

public void resetConnection()
Reset the driver on problems

Specified by:
resetConnection in interface I_XmlBlasterConnection

setConnectReturnQos

public void setConnectReturnQos(ConnectReturnQos connectReturnQos)
Description copied from interface: I_XmlBlasterConnection
Pass the driver the decrypted and parsed ConnectReturnQos directly after a connect. Some driver take the secretSessionId from it or a returned remote address

Specified by:
setConnectReturnQos in interface I_XmlBlasterConnection
See Also:
I_XmlBlasterConnection.setConnectReturnQos(ConnectReturnQos)

connect

public java.lang.String connect(java.lang.String connectQos)
                         throws XmlBlasterException
Login to the server.

Specified by:
connect in interface I_XmlBlasterConnection
Parameters:
connectQos - The encrypted connect QoS
Returns:
ConnectReturnQos XML string
Throws:
XmlBlasterException - if login fails

getProtocol

public final java.lang.String getProtocol()
Returns the protocol type.

Specified by:
getProtocol in interface I_XmlBlasterConnection
Returns:
"email"

disconnect

public boolean disconnect(java.lang.String qos)
                   throws XmlBlasterException
Does a logout and removes the callback server.

Specified by:
disconnect in interface I_XmlBlasterConnection
Parameters:
sessionId - The client sessionId
Throws:
XmlBlasterException

shutdown

public void shutdown()
Shut down the callback server. Is called by logout()

Specified by:
shutdown in interface I_XmlBlasterConnection
Specified by:
shutdown in interface I_AdminPlugin
Specified by:
shutdown in interface I_Plugin
Overrides:
shutdown in class EmailExecutor

isLoggedIn

public final boolean isLoggedIn()
Specified by:
isLoggedIn in interface I_XmlBlasterConnection
Returns:
true if you are logged in

subscribe

public final java.lang.String subscribe(java.lang.String xmlKey_literal,
                                        java.lang.String qos_literal)
                                 throws XmlBlasterException
Enforced by I_XmlBlasterConnection interface (failsafe mode). Subscribe to messages.

Specified by:
subscribe in interface I_XmlBlasterConnection
Throws:
XmlBlasterException
See Also:
The interface.subscribe requirement

unSubscribe

public final java.lang.String[] unSubscribe(java.lang.String xmlKey_literal,
                                            java.lang.String qos_literal)
                                     throws XmlBlasterException
Unsubscribe from messages.

Specified by:
unSubscribe in interface I_XmlBlasterConnection
Throws:
XmlBlasterException
See Also:
The interface.unSubscribe requirement

publish

public final java.lang.String publish(MsgUnitRaw msgUnit)
                               throws XmlBlasterException
Publish a message. The normal publish is handled here like a publishArr

Specified by:
publish in interface I_XmlBlasterConnection
Throws:
XmlBlasterException
See Also:
The interface.publish requirement

publishArr

public final java.lang.String[] publishArr(MsgUnitRaw[] msgUnitArr)
                                    throws XmlBlasterException
Publish multiple messages in one sweep.

Specified by:
publishArr in interface I_XmlBlasterConnection
Throws:
XmlBlasterException
See Also:
The interface.publish requirement

publishOneway

public final void publishOneway(MsgUnitRaw[] msgUnitArr)
                         throws XmlBlasterException
Publish multiple messages in one sweep.

Specified by:
publishOneway in interface I_XmlBlasterConnection
Throws:
XmlBlasterException
See Also:
The interface.publish requirement

erase

public final java.lang.String[] erase(java.lang.String xmlKey_literal,
                                      java.lang.String qos_literal)
                               throws XmlBlasterException
Delete messages.

Specified by:
erase in interface I_XmlBlasterConnection
Throws:
XmlBlasterException
See Also:
The interface.erase requirement

get

public final MsgUnitRaw[] get(java.lang.String xmlKey_literal,
                              java.lang.String qos_literal)
                       throws XmlBlasterException
Synchronous access a message.

Specified by:
get in interface I_XmlBlasterConnection
Throws:
XmlBlasterException
See Also:
The interface.get requirement

ping

public java.lang.String ping(java.lang.String qos)
                      throws XmlBlasterException
Check server.

Specified by:
ping in interface I_XmlBlasterConnection
Overrides:
ping in class EmailExecutor
Parameters:
qos - Currently an empty string ""
Returns:
Currently an empty string ""
Throws:
XmlBlasterException - If client not reachable
See Also:
CORBA xmlBlaster.idl

usage

public java.lang.String usage()
Command line usage.

Specified by:
usage in interface I_AdminUsage
Overrides:
usage in class EmailExecutor
Returns:
a human readable usage help string
See Also:
SmtpClient#setSessionProperties(Properties, Global, I_PluginConfig)

xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.