Package org.openas2.mail
Class EmailSender
- java.lang.Object
-
- org.openas2.BaseComponent
-
- org.openas2.mail.EmailSender
-
- All Implemented Interfaces:
Component
public class EmailSender extends BaseComponent
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
isDebugOn
static java.lang.String
PARAM_BODY
static java.lang.String
PARAM_BODYTEMPLATE
static java.lang.String
PARAM_FROM
static java.lang.String
PARAM_FROM_DISPLAY
static java.lang.String
PARAM_SMTPPORT
static java.lang.String
PARAM_SMTPPROTOCOL
static java.lang.String
PARAM_SMTPSERVER
static java.lang.String
PARAM_SUBJECT
static java.lang.String
PARAM_TO
private java.util.Properties
props
-
Constructor Summary
Constructors Constructor Description EmailSender()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ParameterParser
createParser()
protected CompositeParameters
createParser(AS2Message msg, java.lang.Throwable t, boolean terminated)
protected java.lang.String
getTemplateText()
void
init(Session session, java.util.Map<java.lang.String,java.lang.String> parameters)
Component lifecycle hook.protected java.lang.String
parseText(java.lang.Throwable t, boolean terminated, java.lang.String text)
protected java.lang.String
parseText(AS2Message msg, java.lang.String text)
protected void
sendMessage(java.lang.String subject, java.lang.String text)
-
Methods inherited from class org.openas2.BaseComponent
destroy, getName, getParameter, getParameter, getParameterInt, getParameters, getSession, setParameter, setParameter
-
-
-
-
Field Detail
-
PARAM_FROM_DISPLAY
public static final java.lang.String PARAM_FROM_DISPLAY
- See Also:
- Constant Field Values
-
PARAM_FROM
public static final java.lang.String PARAM_FROM
- See Also:
- Constant Field Values
-
PARAM_TO
public static final java.lang.String PARAM_TO
- See Also:
- Constant Field Values
-
PARAM_SMTPSERVER
public static final java.lang.String PARAM_SMTPSERVER
- See Also:
- Constant Field Values
-
PARAM_SMTPPORT
public static final java.lang.String PARAM_SMTPPORT
- See Also:
- Constant Field Values
-
PARAM_SMTPPROTOCOL
public static final java.lang.String PARAM_SMTPPROTOCOL
- See Also:
- Constant Field Values
-
PARAM_SUBJECT
public static final java.lang.String PARAM_SUBJECT
- See Also:
- Constant Field Values
-
PARAM_BODY
public static final java.lang.String PARAM_BODY
- See Also:
- Constant Field Values
-
PARAM_BODYTEMPLATE
public static final java.lang.String PARAM_BODYTEMPLATE
- See Also:
- Constant Field Values
-
props
private java.util.Properties props
-
isDebugOn
private boolean isDebugOn
-
-
Method Detail
-
init
public void init(Session session, java.util.Map<java.lang.String,java.lang.String> parameters) throws OpenAS2Exception
Description copied from interface:Component
Component lifecycle hook. After creating a Component object, this method should be called to set any parameters used by the component. Component implementations typically have required parameter checking and code to start timers and threads within this method.- Specified by:
init
in interfaceComponent
- Overrides:
init
in classBaseComponent
- Parameters:
session
- the component uses this object to access other componentsparameters
- configuration values for the component- Throws:
OpenAS2Exception
- If an error occurs while initializing the component- See Also:
Session
-
getTemplateText
protected java.lang.String getTemplateText() throws InvalidParameterException
- Throws:
InvalidParameterException
-
createParser
protected ParameterParser createParser()
-
createParser
protected CompositeParameters createParser(AS2Message msg, java.lang.Throwable t, boolean terminated)
-
parseText
protected java.lang.String parseText(java.lang.Throwable t, boolean terminated, java.lang.String text) throws InvalidParameterException
- Throws:
InvalidParameterException
-
parseText
protected java.lang.String parseText(AS2Message msg, java.lang.String text) throws InvalidParameterException
- Throws:
InvalidParameterException
-
sendMessage
protected void sendMessage(java.lang.String subject, java.lang.String text) throws OpenAS2Exception
- Throws:
OpenAS2Exception
-
-