Package org.openas2.processor.sender
Class AS2SenderModule
- java.lang.Object
-
- org.openas2.BaseComponent
-
- org.openas2.processor.BaseProcessorModule
-
- org.openas2.processor.sender.BaseSenderModule
-
- org.openas2.processor.sender.HttpSenderModule
-
- org.openas2.processor.sender.AS2SenderModule
-
- All Implemented Interfaces:
Component
,ProcessorModule
,SenderModule
,HasSchedule
public class AS2SenderModule extends HttpSenderModule implements HasSchedule
-
-
Field Summary
Fields Modifier and Type Field Description private org.apache.commons.logging.Log
logger
-
Fields inherited from class org.openas2.processor.sender.HttpSenderModule
PARAM_CONNECT_TIMEOUT, PARAM_READ_TIMEOUT
-
Fields inherited from interface org.openas2.processor.sender.SenderModule
DEFAULT_RETRIES, DO_SEND, DO_SENDMDN, SOPT_RETRIES
-
-
Constructor Summary
Constructors Constructor Description AS2SenderModule()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addCustomHeaders(Message msg)
protected void
addCustomOuterMimeHeaders(Message msg, javax.mail.internet.MimeBodyPart dataBP)
protected void
calcAndStoreMic(Message msg, javax.mail.internet.MimeBodyPart mbp, boolean includeHeaders)
boolean
canHandle(java.lang.String action, Message msg, java.util.Map<java.lang.Object,java.lang.Object> options)
protected void
checkRequired(Message msg)
protected void
detectFailedSentMessages()
protected javax.mail.internet.InternetHeaders
getHttpHeaders(Message msg, javax.mail.internet.MimeBodyPart securedData)
void
handle(java.lang.String action, Message msg, java.util.Map<java.lang.Object,java.lang.Object> options)
private void
processResponse(Message msg, ResponseWrapper response)
private void
resend(Message msg, OpenAS2Exception cause, java.lang.String tries, boolean keepRestoredData)
void
schedule(java.util.concurrent.ScheduledExecutorService executor)
protected javax.mail.internet.MimeBodyPart
secure(Message msg)
Returns a MimeBodyPart or MimeMultipart objectprivate void
sendMessage(java.lang.String url, Message msg, javax.mail.internet.MimeBodyPart securedData, java.lang.String retries)
protected void
storePendingInfo(AS2Message msg, boolean isResend)
Stores metadata into pending information file and storing message object from first send attempt.-
Methods inherited from class org.openas2.processor.sender.HttpSenderModule
getHttpOptions
-
Methods inherited from class org.openas2.BaseComponent
destroy, getName, getParameter, getParameter, getParameterInt, getParameters, getSession, init, setParameter, setParameter
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.openas2.Component
destroy, getName, getParameters, getSession, init
-
-
-
-
Method Detail
-
canHandle
public boolean canHandle(java.lang.String action, Message msg, java.util.Map<java.lang.Object,java.lang.Object> options)
- Specified by:
canHandle
in interfaceProcessorModule
-
handle
public void handle(java.lang.String action, Message msg, java.util.Map<java.lang.Object,java.lang.Object> options) throws OpenAS2Exception
- Specified by:
handle
in interfaceProcessorModule
- Throws:
OpenAS2Exception
-
checkRequired
protected void checkRequired(Message msg) throws InvalidParameterException
- Throws:
InvalidParameterException
-
sendMessage
private void sendMessage(java.lang.String url, Message msg, javax.mail.internet.MimeBodyPart securedData, java.lang.String retries) throws java.lang.Exception
- Throws:
java.lang.Exception
-
processResponse
private void processResponse(Message msg, ResponseWrapper response)
-
resend
private void resend(Message msg, OpenAS2Exception cause, java.lang.String tries, boolean keepRestoredData) throws OpenAS2Exception
- Throws:
OpenAS2Exception
-
secure
protected javax.mail.internet.MimeBodyPart secure(Message msg) throws java.lang.Exception
Returns a MimeBodyPart or MimeMultipart object- Parameters:
msg
- The message object carried around containing necessary information- Returns:
- The secured mimebodypart
- Throws:
java.lang.Exception
- some unforseen issue has occurred
-
addCustomHeaders
protected void addCustomHeaders(Message msg) throws OpenAS2Exception
- Throws:
OpenAS2Exception
-
addCustomOuterMimeHeaders
protected void addCustomOuterMimeHeaders(Message msg, javax.mail.internet.MimeBodyPart dataBP) throws javax.mail.MessagingException
- Throws:
javax.mail.MessagingException
-
getHttpHeaders
protected javax.mail.internet.InternetHeaders getHttpHeaders(Message msg, javax.mail.internet.MimeBodyPart securedData) throws javax.mail.MessagingException
- Throws:
javax.mail.MessagingException
-
storePendingInfo
protected void storePendingInfo(AS2Message msg, boolean isResend) throws java.lang.Exception
Stores metadata into pending information file and storing message object from first send attempt. The message object is written to a separate file to avoid repeated rewrites of possibly very large objects since it contains the original file data- Parameters:
msg
- AS2Message structureisResend
- Boolean to determine if this is a resend of an already sent message or not- Throws:
java.lang.Exception
- some unforseen issue has occurred
-
calcAndStoreMic
protected void calcAndStoreMic(Message msg, javax.mail.internet.MimeBodyPart mbp, boolean includeHeaders) throws java.lang.Exception
- Throws:
java.lang.Exception
-
detectFailedSentMessages
protected void detectFailedSentMessages()
-
schedule
public void schedule(java.util.concurrent.ScheduledExecutorService executor)
- Specified by:
schedule
in interfaceHasSchedule
-
-