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 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 voidaddCustomHeaders(Message msg)protected voidaddCustomOuterMimeHeaders(Message msg, javax.mail.internet.MimeBodyPart dataBP)protected voidcalcAndStoreMic(Message msg, javax.mail.internet.MimeBodyPart mbp, boolean includeHeaders)booleancanHandle(java.lang.String action, Message msg, java.util.Map<java.lang.Object,java.lang.Object> options)protected voidcheckRequired(Message msg)protected voiddetectFailedSentMessages()protected javax.mail.internet.InternetHeadersgetHttpHeaders(Message msg, javax.mail.internet.MimeBodyPart securedData)voidhandle(java.lang.String action, Message msg, java.util.Map<java.lang.Object,java.lang.Object> options)voidschedule(java.util.concurrent.ScheduledExecutorService executor)protected javax.mail.internet.MimeBodyPartsecure(Message msg)Returns a MimeBodyPart or MimeMultipart objectprotected voidstorePendingInfo(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:
canHandlein 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:
handlein interfaceProcessorModule- Throws:
OpenAS2Exception
-
checkRequired
protected void checkRequired(Message msg) throws InvalidParameterException
- Throws:
InvalidParameterException
-
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:
schedulein interfaceHasSchedule
-
-