Class 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
  • 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 be null
      aOptions - Options to choose from. May be null.
      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 be null.
      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