Class CustomPeppolIncomingViaInterfaceSPI

java.lang.Object
com.helger.phase4.springboot.spi.CustomPeppolIncomingViaInterfaceSPI
All Implemented Interfaces:
com.helger.phase4.peppol.servlet.IPhase4PeppolIncomingSBDHandlerSPI

@IsSPIImplementation public class CustomPeppolIncomingViaInterfaceSPI extends Object implements com.helger.phase4.peppol.servlet.IPhase4PeppolIncomingSBDHandlerSPI
This is one way of handling incoming messages: have an interface CustomPeppolIncomingViaInterfaceSPI.IPeppolIncomingHandler that mimics the parameters of the IPhase4PeppolIncomingSBDHandlerSPI handling method. Use a static member of this class to set it. Each invocation of the SPI triggers a call to the registered handler.
Based on https://github.com/phax/phase4/discussions/115
Author:
Philip Helger
  • Constructor Details

    • CustomPeppolIncomingViaInterfaceSPI

      public CustomPeppolIncomingViaInterfaceSPI()
  • Method Details

    • getIncomingHandler

      Returns:
      The statically defined incoming handler. May be null. Is null by default.
    • setIncomingHandler

      public static void setIncomingHandler(@Nullable CustomPeppolIncomingViaInterfaceSPI.IPeppolIncomingHandler aHandler)
      Call this method once on application startup. Should only be called once.
      Parameters:
      aHandler - The handler to be used. May be null but makes no sense.
    • handleIncomingSBD

      public void handleIncomingSBD(@Nonnull com.helger.phase4.messaging.IAS4IncomingMessageMetadata aMessageMetadata, @Nonnull com.helger.commons.http.HttpHeaderMap aHeaders, @Nonnull com.helger.phase4.ebms3header.Ebms3UserMessage aUserMessage, @Nonnull byte[] aSBDBytes, @Nonnull org.unece.cefact.namespaces.sbdh.StandardBusinessDocument aSBD, @Nonnull com.helger.peppol.sbdh.PeppolSBDHDocument aPeppolSBD, @Nonnull com.helger.phase4.servlet.IAS4MessageState aState) throws Exception
      Specified by:
      handleIncomingSBD in interface com.helger.phase4.peppol.servlet.IPhase4PeppolIncomingSBDHandlerSPI
      Throws:
      Exception
    • exceptionTranslatesToAS4Error

      public boolean exceptionTranslatesToAS4Error()
      Specified by:
      exceptionTranslatesToAS4Error in interface com.helger.phase4.peppol.servlet.IPhase4PeppolIncomingSBDHandlerSPI