Class AbstractSenderModule
java.lang.Object
com.helger.as2lib.AbstractDynamicComponent
com.helger.as2lib.processor.module.AbstractProcessorModule
com.helger.as2lib.processor.sender.AbstractSenderModule
- All Implemented Interfaces:
IDynamicComponent
,IProcessorModule
,IProcessorSenderModule
- Direct Known Subclasses:
AbstractHttpSenderModule
public abstract class AbstractSenderModule
extends AbstractProcessorModule
implements IProcessorSenderModule
An abstract sender module that allows for retry. It allows to configure the
maximum number of retries.
- Author:
- Philip Helger
-
Field Summary
Fields inherited from class com.helger.as2lib.AbstractDynamicComponent
m_aRWLock
Fields inherited from interface com.helger.as2lib.processor.sender.IProcessorSenderModule
DO_SEND, DO_SEND_ASYNC_MDN
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final boolean
doResend
(String sResendAction, IMessage aMsg, AS2Exception aCause, int nTriesLeft) protected final int
getRetryCount
(Partnership aPartnerhsip, Map<String, Object> aOptions) How many times should this message be sent?Methods inherited from class com.helger.as2lib.AbstractDynamicComponent
attrs, equals, getAttributeAsIntRequired, getAttributeAsStringRequired, getName, getSession, hashCode, initDynamicComponent, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.helger.as2lib.IDynamicComponent
attrs, getName, getSession, initDynamicComponent
Methods inherited from interface com.helger.as2lib.processor.module.IProcessorModule
canHandle, handle
-
Constructor Details
-
AbstractSenderModule
public AbstractSenderModule()
-
-
Method Details
-
getRetryCount
@Nonnegative protected final int getRetryCount(@Nullable Partnership aPartnerhsip, @Nullable Map<String, Object> aOptions) How many times should this message be sent?- Parameters:
aPartnerhsip
- Partnership to be used. May benull
aOptions
- Options to choose from. May benull
.- Returns:
- 0 to indicate no retry.
-
doResend
protected final boolean doResend(@Nonnull String sResendAction, @Nonnull IMessage aMsg, @Nullable AS2Exception aCause, int nTriesLeft) throws AS2Exception - Parameters:
sResendAction
- Handler action name to use. May not benull
.aMsg
- The message to be resend. May be an AS2 message or an MDN.aCause
- The error cause.nTriesLeft
- The number of retries left.- Returns:
true
if the message was scheduled for re-sending.- Throws:
AS2Exception
- In case of an error
-