From b945d8aeb09a7e7997d9230ee3fd47444176414d Mon Sep 17 00:00:00 2001 From: Philip Helger Date: Mon, 26 Aug 2024 13:37:57 +0200 Subject: [PATCH] Renamed Peppol specific classes --- .../servlet/Phase4PeppolWebAppListener.java | 18 ++++---- .../IPhase4PeppolIncomingSBDHandlerSPI.java | 21 +--------- ...e4PeppolDefaultReceiverConfiguration.java} | 36 ++++++++-------- ...=> Phase4PeppolReceiverConfiguration.java} | 26 ++++++------ ...hase4PeppolServletMessageProcessorSPI.java | 32 ++++++-------- .../springboot/servlet/ServletConfig.java | 42 +++++++++---------- .../CustomPeppolIncomingSBDHandlerSPI.java | 7 ---- .../CustomPeppolIncomingViaInterfaceSPI.java | 7 ---- 8 files changed, 73 insertions(+), 116 deletions(-) rename phase4-peppol-servlet/src/main/java/com/helger/phase4/peppol/servlet/{Phase4PeppolServletConfiguration.java => Phase4PeppolDefaultReceiverConfiguration.java} (89%) rename phase4-peppol-servlet/src/main/java/com/helger/phase4/peppol/servlet/{Phase4PeppolReceiverCheckData.java => Phase4PeppolReceiverConfiguration.java} (86%) diff --git a/phase4-peppol-server-webapp/src/main/java/com/helger/phase4/peppol/server/servlet/Phase4PeppolWebAppListener.java b/phase4-peppol-server-webapp/src/main/java/com/helger/phase4/peppol/server/servlet/Phase4PeppolWebAppListener.java index 6c7d7ad36..b8cff4a7c 100644 --- a/phase4-peppol-server-webapp/src/main/java/com/helger/phase4/peppol/server/servlet/Phase4PeppolWebAppListener.java +++ b/phase4-peppol-server-webapp/src/main/java/com/helger/phase4/peppol/server/servlet/Phase4PeppolWebAppListener.java @@ -59,7 +59,7 @@ import com.helger.phase4.messaging.IAS4IncomingMessageMetadata; import com.helger.phase4.mgr.MetaAS4Manager; import com.helger.phase4.peppol.server.storage.StorageHelper; -import com.helger.phase4.peppol.servlet.Phase4PeppolServletConfiguration; +import com.helger.phase4.peppol.servlet.Phase4PeppolDefaultReceiverConfiguration; import com.helger.phase4.profile.peppol.AS4PeppolProfileRegistarSPI; import com.helger.phase4.profile.peppol.PeppolCRLDownloader; import com.helger.phase4.profile.peppol.Phase4PeppolHttpClientSettings; @@ -206,12 +206,12 @@ private static void _initPeppolAS4 () { // Our server expects all SBDH to contain the COUNTRY_C1 element in SBDH // (this is the default setting, but added it here for easy modification) - Phase4PeppolServletConfiguration.setCheckSBDHForMandatoryCountryC1 (true); + Phase4PeppolDefaultReceiverConfiguration.setCheckSBDHForMandatoryCountryC1 (true); // Our server should check all signing certificates of incoming messages if // they are revoked or not // (this is the default setting, but added it here for easy modification) - Phase4PeppolServletConfiguration.setCheckSigningCertificateRevocation (true); + Phase4PeppolDefaultReceiverConfiguration.setCheckSigningCertificateRevocation (true); // Make sure the download of CRL is using Apache HttpClient and that the // provided settings are used. If e.g. a proxy is needed to access outbound @@ -322,11 +322,11 @@ private static void _initPeppolAS4 () final String sAPURL = AS4Configuration.getThisEndpointAddress (); if (StringHelper.hasText (sSMPURL) && StringHelper.hasText (sAPURL)) { - Phase4PeppolServletConfiguration.setReceiverCheckEnabled (true); - Phase4PeppolServletConfiguration.setSMPClient (new SMPClientReadOnly (URLHelper.getAsURI (sSMPURL))); - Phase4PeppolServletConfiguration.setWildcardSelectionMode (Phase4PeppolServletConfiguration.DEFAULT_WILDCARD_SELECTION_MODE); - Phase4PeppolServletConfiguration.setAS4EndpointURL (sAPURL); - Phase4PeppolServletConfiguration.setAPCertificate (aAPCert); + Phase4PeppolDefaultReceiverConfiguration.setReceiverCheckEnabled (true); + Phase4PeppolDefaultReceiverConfiguration.setSMPClient (new SMPClientReadOnly (URLHelper.getAsURI (sSMPURL))); + Phase4PeppolDefaultReceiverConfiguration.setWildcardSelectionMode (Phase4PeppolDefaultReceiverConfiguration.DEFAULT_WILDCARD_SELECTION_MODE); + Phase4PeppolDefaultReceiverConfiguration.setAS4EndpointURL (sAPURL); + Phase4PeppolDefaultReceiverConfiguration.setAPCertificate (aAPCert); LOGGER.info (CAS4.LIB_NAME + " Peppol receiver checks are enabled on SMP '" + sSMPURL + @@ -336,7 +336,7 @@ private static void _initPeppolAS4 () } else { - Phase4PeppolServletConfiguration.setReceiverCheckEnabled (false); + Phase4PeppolDefaultReceiverConfiguration.setReceiverCheckEnabled (false); LOGGER.warn (CAS4.LIB_NAME + " Peppol receiver checks are disabled"); } } diff --git a/phase4-peppol-servlet/src/main/java/com/helger/phase4/peppol/servlet/IPhase4PeppolIncomingSBDHandlerSPI.java b/phase4-peppol-servlet/src/main/java/com/helger/phase4/peppol/servlet/IPhase4PeppolIncomingSBDHandlerSPI.java index 49ea4ea84..4b36e600e 100644 --- a/phase4-peppol-servlet/src/main/java/com/helger/phase4/peppol/servlet/IPhase4PeppolIncomingSBDHandlerSPI.java +++ b/phase4-peppol-servlet/src/main/java/com/helger/phase4/peppol/servlet/IPhase4PeppolIncomingSBDHandlerSPI.java @@ -28,7 +28,6 @@ import com.helger.phase4.ebms3header.Ebms3UserMessage; import com.helger.phase4.incoming.IAS4MessageState; import com.helger.phase4.messaging.IAS4IncomingMessageMetadata; -import com.helger.phase4.v3.ChangePhase4V3; /** * This is the interface that must be implemented to handle incoming SBD @@ -72,9 +71,7 @@ public interface IPhase4PeppolIncomingSBDHandlerSPI * if this specific exception is thrown, it translates into a * synchronous AS4 error message. * @throws Exception - * In case it cannot be processed. If - * {@link #exceptionTranslatesToAS4Error()} returns true - * each Exception is converted into a synchronous AS4 error message. + * In case it cannot be processed. */ void handleIncomingSBD (@Nonnull IAS4IncomingMessageMetadata aMessageMetadata, @Nonnull HttpHeaderMap aHeaders, @@ -84,20 +81,4 @@ void handleIncomingSBD (@Nonnull IAS4IncomingMessageMetadata aMessageMetadata, @Nonnull PeppolSBDHData aPeppolSBD, @Nonnull IAS4MessageState aState, @Nonnull ICommonsList aProcessingErrorMessages) throws Exception; - - /** - * Define if an exception from - * {@link #handleIncomingSBD(IAS4IncomingMessageMetadata, HttpHeaderMap, Ebms3UserMessage, byte[], StandardBusinessDocument, PeppolSBDHData, IAS4MessageState, ICommonsList)} - * results in a negative AS4 response or not. By default it is not. - * - * @return true to convert an Exception into an AS4 Error, - * false if the Exception should simply be logged and - * than processing should continue. - * @since 0.12.2 - */ - @ChangePhase4V3 ("Remove Exception handling and force usage of aProcessingErrorMessages") - default boolean exceptionTranslatesToAS4Error () - { - return false; - } } diff --git a/phase4-peppol-servlet/src/main/java/com/helger/phase4/peppol/servlet/Phase4PeppolServletConfiguration.java b/phase4-peppol-servlet/src/main/java/com/helger/phase4/peppol/servlet/Phase4PeppolDefaultReceiverConfiguration.java similarity index 89% rename from phase4-peppol-servlet/src/main/java/com/helger/phase4/peppol/servlet/Phase4PeppolServletConfiguration.java rename to phase4-peppol-servlet/src/main/java/com/helger/phase4/peppol/servlet/Phase4PeppolDefaultReceiverConfiguration.java index 15c13fc59..d3d4bf70a 100644 --- a/phase4-peppol-servlet/src/main/java/com/helger/phase4/peppol/servlet/Phase4PeppolServletConfiguration.java +++ b/phase4-peppol-servlet/src/main/java/com/helger/phase4/peppol/servlet/Phase4PeppolDefaultReceiverConfiguration.java @@ -29,7 +29,6 @@ import com.helger.commons.string.StringHelper; import com.helger.peppol.sbdh.read.PeppolSBDHDocumentReader; import com.helger.phase4.CAS4; -import com.helger.phase4.v3.ChangePhase4V3; import com.helger.smpclient.peppol.ISMPServiceMetadataProvider; import com.helger.smpclient.peppol.PeppolWildcardSelector; import com.helger.smpclient.peppol.PeppolWildcardSelector.EMode; @@ -40,20 +39,19 @@ * {@link Phase4PeppolServletMessageProcessorSPI}. Please note that this class * is not thread safe, as the default values are not meant to be modified during * runtime.
- * See {@link Phase4PeppolReceiverCheckData} for the "per-request" version of - * this class. + * See {@link Phase4PeppolReceiverConfiguration} for the "per-request" version + * of this class. * * @author Philip Helger */ @NotThreadSafe -@ChangePhase4V3 ("Rename to Phase4PeppolGlobalReceiverConfiguration") -public final class Phase4PeppolServletConfiguration +public final class Phase4PeppolDefaultReceiverConfiguration { public static final boolean DEFAULT_RECEIVER_CHECK_ENABLED = true; public static final EMode DEFAULT_WILDCARD_SELECTION_MODE = EMode.WILDCARD_ONLY; public static final boolean DEFAULT_CHECK_SIGNING_CERTIFICATE_REVOCATION = true; - private static final Logger LOGGER = LoggerFactory.getLogger (Phase4PeppolServletConfiguration.class); + private static final Logger LOGGER = LoggerFactory.getLogger (Phase4PeppolDefaultReceiverConfiguration.class); private static boolean s_bReceiverCheckEnabled = DEFAULT_RECEIVER_CHECK_ENABLED; private static ISMPServiceMetadataProvider s_aSMPClient; @@ -64,7 +62,7 @@ public final class Phase4PeppolServletConfiguration private static boolean s_bCheckSBDHForMandatoryCountryC1 = PeppolSBDHDocumentReader.DEFAULT_CHECK_FOR_COUNTRY_C1; private static boolean s_bCheckSigningCertificateRevocation = DEFAULT_CHECK_SIGNING_CERTIFICATE_REVOCATION; - private Phase4PeppolServletConfiguration () + private Phase4PeppolDefaultReceiverConfiguration () {} /** @@ -283,16 +281,16 @@ public static void setCheckSigningCertificateRevocation (final boolean b) /** * Get the statically configured data as a - * {@link Phase4PeppolReceiverCheckData} instance. Returns null - * if the checks are disabled, or if at least one mandatory field is not - * set.
+ * {@link Phase4PeppolReceiverConfiguration} instance. Returns + * null if the checks are disabled, or if at least one mandatory + * field is not set.
* Changed to NonNull in 2.8.1 * * @return The instance data or null. * @since 0.9.13 */ @Nonnull - public static Phase4PeppolReceiverCheckData getAsReceiverCheckData () + public static Phase4PeppolReceiverConfiguration getAsReceiverCheckData () { final ISMPServiceMetadataProvider aSMPClient = getSMPClient (); final String sAS4EndpointURL = getAS4EndpointURL (); @@ -304,13 +302,13 @@ public static Phase4PeppolReceiverCheckData getAsReceiverCheckData () else bReceiverCheckEnabled = isReceiverCheckEnabled (); - return new Phase4PeppolReceiverCheckData (bReceiverCheckEnabled, - aSMPClient, - getWildcardSelectionMode (), - sAS4EndpointURL, - aAPCertificate, - isPerformSBDHValueChecks (), - isCheckSBDHForMandatoryCountryC1 (), - isCheckSigningCertificateRevocation ()); + return new Phase4PeppolReceiverConfiguration (bReceiverCheckEnabled, + aSMPClient, + getWildcardSelectionMode (), + sAS4EndpointURL, + aAPCertificate, + isPerformSBDHValueChecks (), + isCheckSBDHForMandatoryCountryC1 (), + isCheckSigningCertificateRevocation ()); } } diff --git a/phase4-peppol-servlet/src/main/java/com/helger/phase4/peppol/servlet/Phase4PeppolReceiverCheckData.java b/phase4-peppol-servlet/src/main/java/com/helger/phase4/peppol/servlet/Phase4PeppolReceiverConfiguration.java similarity index 86% rename from phase4-peppol-servlet/src/main/java/com/helger/phase4/peppol/servlet/Phase4PeppolReceiverCheckData.java rename to phase4-peppol-servlet/src/main/java/com/helger/phase4/peppol/servlet/Phase4PeppolReceiverConfiguration.java index 58c2394d8..69dfab61b 100644 --- a/phase4-peppol-servlet/src/main/java/com/helger/phase4/peppol/servlet/Phase4PeppolReceiverCheckData.java +++ b/phase4-peppol-servlet/src/main/java/com/helger/phase4/peppol/servlet/Phase4PeppolReceiverConfiguration.java @@ -20,24 +20,22 @@ import javax.annotation.Nonnull; import javax.annotation.Nullable; -import javax.annotation.concurrent.ThreadSafe; +import javax.annotation.concurrent.Immutable; import com.helger.commons.ValueEnforcer; import com.helger.commons.string.ToStringGenerator; -import com.helger.phase4.v3.ChangePhase4V3; import com.helger.smpclient.peppol.ISMPServiceMetadataProvider; import com.helger.smpclient.peppol.PeppolWildcardSelector; /** * This class contains the "per-request" data of - * {@link Phase4PeppolServletConfiguration}. + * {@link Phase4PeppolDefaultReceiverConfiguration}. * * @author Philip Helger * @since 0.9.13 */ -@ThreadSafe -@ChangePhase4V3 ("Rename to Phase4PeppolReceiverConfiguration; remove setter") -public final class Phase4PeppolReceiverCheckData +@Immutable +public final class Phase4PeppolReceiverConfiguration { private final boolean m_bReceiverCheckEnabled; private final ISMPServiceMetadataProvider m_aSMPClient; @@ -76,14 +74,14 @@ public final class Phase4PeppolReceiverCheckData * performed. * @since 2.8.1 */ - public Phase4PeppolReceiverCheckData (final boolean bReceiverCheckEnabled, - @Nullable final ISMPServiceMetadataProvider aSMPClient, - @Nonnull final PeppolWildcardSelector.EMode eWildcardSelectionMode, - @Nullable final String sAS4EndpointURL, - @Nullable final X509Certificate aAPCertificate, - final boolean bPerformSBDHValueChecks, - final boolean bCheckSBDHForMandatoryCountryC1, - final boolean bCheckSigningCertificateRevocation) + public Phase4PeppolReceiverConfiguration (final boolean bReceiverCheckEnabled, + @Nullable final ISMPServiceMetadataProvider aSMPClient, + @Nonnull final PeppolWildcardSelector.EMode eWildcardSelectionMode, + @Nullable final String sAS4EndpointURL, + @Nullable final X509Certificate aAPCertificate, + final boolean bPerformSBDHValueChecks, + final boolean bCheckSBDHForMandatoryCountryC1, + final boolean bCheckSigningCertificateRevocation) { if (bReceiverCheckEnabled) ValueEnforcer.notNull (aSMPClient, "SMPClient"); diff --git a/phase4-peppol-servlet/src/main/java/com/helger/phase4/peppol/servlet/Phase4PeppolServletMessageProcessorSPI.java b/phase4-peppol-servlet/src/main/java/com/helger/phase4/peppol/servlet/Phase4PeppolServletMessageProcessorSPI.java index 1b1224973..3674656c8 100644 --- a/phase4-peppol-servlet/src/main/java/com/helger/phase4/peppol/servlet/Phase4PeppolServletMessageProcessorSPI.java +++ b/phase4-peppol-servlet/src/main/java/com/helger/phase4/peppol/servlet/Phase4PeppolServletMessageProcessorSPI.java @@ -175,7 +175,7 @@ public StandardBusinessDocument standardBusinessDocument () private ICommonsList m_aHandlers; private ISMPTransportProfile m_aTransportProfile = DEFAULT_TRANSPORT_PROFILE; - private Phase4PeppolReceiverCheckData m_aReceiverCheckData; + private Phase4PeppolReceiverConfiguration m_aReceiverCheckData; /** * Constructor. Uses all SPI implementations of @@ -248,14 +248,14 @@ public final Phase4PeppolServletMessageProcessorSPI setTransportProfile (@Nonnul * @since 0.9.13 */ @Nullable - public final Phase4PeppolReceiverCheckData getReceiverCheckData () + public final Phase4PeppolReceiverConfiguration getReceiverCheckData () { return m_aReceiverCheckData; } /** * Set the receiver check data to be used. If set, it overrides the global one - * defined by {@link Phase4PeppolServletConfiguration}. + * defined by {@link Phase4PeppolDefaultReceiverConfiguration}. * * @param aReceiverCheckData * The customer receiver check data to use. May be null. @@ -263,7 +263,7 @@ public final Phase4PeppolReceiverCheckData getReceiverCheckData () * @since 0.9.13 */ @Nonnull - public final Phase4PeppolServletMessageProcessorSPI setReceiverCheckData (@Nullable final Phase4PeppolReceiverCheckData aReceiverCheckData) + public final Phase4PeppolServletMessageProcessorSPI setReceiverCheckData (@Nullable final Phase4PeppolReceiverConfiguration aReceiverCheckData) { m_aReceiverCheckData = aReceiverCheckData; return this; @@ -551,8 +551,8 @@ public AS4MessageProcessorResult processAS4UserMessage (@Nonnull final IAS4Incom final String sLogPrefix = "[" + sMessageID + "] "; // Start consistency checks if the receiver is supported or not - final Phase4PeppolReceiverCheckData aReceiverCheckData = m_aReceiverCheckData != null ? m_aReceiverCheckData - : Phase4PeppolServletConfiguration.getAsReceiverCheckData (); + final Phase4PeppolReceiverConfiguration aReceiverCheckData = m_aReceiverCheckData != null ? m_aReceiverCheckData + : Phase4PeppolDefaultReceiverConfiguration.getAsReceiverCheckData (); // Debug log if (LOGGER.isDebugEnabled ()) @@ -869,23 +869,17 @@ public AS4MessageProcessorResult processAS4UserMessage (@Nonnull final IAS4Incom .refToMessageInError (aState.getMessageID ()) .errorDetail (sDetails, ex) .build ()); - - // Returned AS4 Error without a custom prefix return AS4MessageProcessorResult.createFailure (); } catch (final Exception ex) { - LOGGER.error (sLogPrefix + "Error invoking Peppol handler " + aHandler, ex); - if (aHandler.exceptionTranslatesToAS4Error ()) - { - final String sDetails = "The incoming Peppol message could not be processed."; - LOGGER.error (sLogPrefix + sDetails, ex); - aProcessingErrorMessages.add (EEbmsError.EBMS_OTHER.errorBuilder (aDisplayLocale) - .refToMessageInError (aState.getMessageID ()) - .errorDetail (sDetails, ex) - .build ()); - return AS4MessageProcessorResult.createFailure (); - } + final String sDetails = "The incoming Peppol message could not be processed."; + LOGGER.error (sLogPrefix + sDetails, ex); + aProcessingErrorMessages.add (EEbmsError.EBMS_OTHER.errorBuilder (aDisplayLocale) + .refToMessageInError (aState.getMessageID ()) + .errorDetail (sDetails, ex) + .build ()); + return AS4MessageProcessorResult.createFailure (); } } diff --git a/phase4-spring-boot-demo/src/main/java/com/helger/phase4/springboot/servlet/ServletConfig.java b/phase4-spring-boot-demo/src/main/java/com/helger/phase4/springboot/servlet/ServletConfig.java index dc2f560a8..8228ae4b4 100644 --- a/phase4-spring-boot-demo/src/main/java/com/helger/phase4/springboot/servlet/ServletConfig.java +++ b/phase4-spring-boot-demo/src/main/java/com/helger/phase4/springboot/servlet/ServletConfig.java @@ -47,8 +47,8 @@ import com.helger.phase4.incoming.AS4ServerInitializer; import com.helger.phase4.incoming.mgr.AS4ProfileSelector; import com.helger.phase4.mgr.MetaAS4Manager; -import com.helger.phase4.peppol.servlet.Phase4PeppolReceiverCheckData; -import com.helger.phase4.peppol.servlet.Phase4PeppolServletConfiguration; +import com.helger.phase4.peppol.servlet.Phase4PeppolReceiverConfiguration; +import com.helger.phase4.peppol.servlet.Phase4PeppolDefaultReceiverConfiguration; import com.helger.phase4.peppol.servlet.Phase4PeppolServletMessageProcessorSPI; import com.helger.phase4.profile.peppol.AS4PeppolProfileRegistarSPI; import com.helger.phase4.profile.peppol.PeppolCRLDownloader; @@ -123,28 +123,28 @@ public boolean validateAgainstProfile () { final String sUrl = aRequestScope.getURLDecoded (); // The receiver check data you want to set - final Phase4PeppolReceiverCheckData aReceiverCheckData; + final Phase4PeppolReceiverConfiguration aReceiverCheckData; if (sUrl != null && sUrl.startsWith ("https://ap-prod.example.org/as4")) { - aReceiverCheckData = new Phase4PeppolReceiverCheckData (true, + aReceiverCheckData = new Phase4PeppolReceiverConfiguration (true, new SMPClientReadOnly (URLHelper.getAsURI ("http://smp-prod.example.org")), - Phase4PeppolServletConfiguration.DEFAULT_WILDCARD_SELECTION_MODE, + Phase4PeppolDefaultReceiverConfiguration.DEFAULT_WILDCARD_SELECTION_MODE, "https://ap-prod.example.org/as4", CertificateHelper.convertStringToCertficateOrNull ("....Public Prod AP Cert...."), - Phase4PeppolServletConfiguration.isPerformSBDHValueChecks (), - Phase4PeppolServletConfiguration.isCheckSBDHForMandatoryCountryC1 (), - Phase4PeppolServletConfiguration.isCheckSigningCertificateRevocation ()); + Phase4PeppolDefaultReceiverConfiguration.isPerformSBDHValueChecks (), + Phase4PeppolDefaultReceiverConfiguration.isCheckSBDHForMandatoryCountryC1 (), + Phase4PeppolDefaultReceiverConfiguration.isCheckSigningCertificateRevocation ()); } else { - aReceiverCheckData = new Phase4PeppolReceiverCheckData (true, + aReceiverCheckData = new Phase4PeppolReceiverConfiguration (true, new SMPClientReadOnly (URLHelper.getAsURI ("http://smp-test.example.org")), - Phase4PeppolServletConfiguration.DEFAULT_WILDCARD_SELECTION_MODE, + Phase4PeppolDefaultReceiverConfiguration.DEFAULT_WILDCARD_SELECTION_MODE, "https://ap-test.example.org/as4", CertificateHelper.convertStringToCertficateOrNull ("....Public Test AP Cert...."), - Phase4PeppolServletConfiguration.isPerformSBDHValueChecks (), - Phase4PeppolServletConfiguration.isCheckSBDHForMandatoryCountryC1 (), - Phase4PeppolServletConfiguration.isCheckSigningCertificateRevocation ()); + Phase4PeppolDefaultReceiverConfiguration.isPerformSBDHValueChecks (), + Phase4PeppolDefaultReceiverConfiguration.isCheckSBDHForMandatoryCountryC1 (), + Phase4PeppolDefaultReceiverConfiguration.isCheckSigningCertificateRevocation ()); } // Find the right SPI handler @@ -235,13 +235,13 @@ private static void _initPeppolAS4 () { // Our server expects all SBDH to contain the COUNTRY_C1 element in SBDH // (this is the default setting, but added it here for easy modification) - Phase4PeppolServletConfiguration.setCheckSBDHForMandatoryCountryC1 (true); + Phase4PeppolDefaultReceiverConfiguration.setCheckSBDHForMandatoryCountryC1 (true); // Our server should check all signing certificates of incoming messages // if // they are revoked or not // (this is the default setting, but added it here for easy modification) - Phase4PeppolServletConfiguration.setCheckSigningCertificateRevocation (true); + Phase4PeppolDefaultReceiverConfiguration.setCheckSigningCertificateRevocation (true); // Make sure the download of CRL is using Apache HttpClient and that the // provided settings are used. If e.g. a proxy is needed to access @@ -287,16 +287,16 @@ private static void _initPeppolAS4 () { // To process the message even though the receiver is not registered in // our AP - Phase4PeppolServletConfiguration.setReceiverCheckEnabled (true); - Phase4PeppolServletConfiguration.setSMPClient (new SMPClientReadOnly (URLHelper.getAsURI (sSMPURL))); - Phase4PeppolServletConfiguration.setWildcardSelectionMode (Phase4PeppolServletConfiguration.DEFAULT_WILDCARD_SELECTION_MODE); - Phase4PeppolServletConfiguration.setAS4EndpointURL (sAPURL); - Phase4PeppolServletConfiguration.setAPCertificate (aAPCert); + Phase4PeppolDefaultReceiverConfiguration.setReceiverCheckEnabled (true); + Phase4PeppolDefaultReceiverConfiguration.setSMPClient (new SMPClientReadOnly (URLHelper.getAsURI (sSMPURL))); + Phase4PeppolDefaultReceiverConfiguration.setWildcardSelectionMode (Phase4PeppolDefaultReceiverConfiguration.DEFAULT_WILDCARD_SELECTION_MODE); + Phase4PeppolDefaultReceiverConfiguration.setAS4EndpointURL (sAPURL); + Phase4PeppolDefaultReceiverConfiguration.setAPCertificate (aAPCert); LOGGER.info ("phase4 Peppol receiver checks are enabled"); } else { - Phase4PeppolServletConfiguration.setReceiverCheckEnabled (false); + Phase4PeppolDefaultReceiverConfiguration.setReceiverCheckEnabled (false); LOGGER.warn ("phase4 Peppol receiver checks are disabled"); } } diff --git a/phase4-spring-boot-demo/src/main/java/com/helger/phase4/springboot/spi/CustomPeppolIncomingSBDHandlerSPI.java b/phase4-spring-boot-demo/src/main/java/com/helger/phase4/springboot/spi/CustomPeppolIncomingSBDHandlerSPI.java index a43078ee1..8ff490779 100644 --- a/phase4-spring-boot-demo/src/main/java/com/helger/phase4/springboot/spi/CustomPeppolIncomingSBDHandlerSPI.java +++ b/phase4-spring-boot-demo/src/main/java/com/helger/phase4/springboot/spi/CustomPeppolIncomingSBDHandlerSPI.java @@ -76,11 +76,4 @@ public void handleIncomingSBD (@Nonnull final IAS4IncomingMessageMetadata aMessa service.handle (); LOGGER.info ("Request handled with success."); } - - @Override - public boolean exceptionTranslatesToAS4Error () - { - // If we have an Exception, tell the sender so - return true; - } } diff --git a/phase4-spring-boot-demo/src/main/java/com/helger/phase4/springboot/spi/CustomPeppolIncomingViaInterfaceSPI.java b/phase4-spring-boot-demo/src/main/java/com/helger/phase4/springboot/spi/CustomPeppolIncomingViaInterfaceSPI.java index def02da6f..fee2d96dd 100644 --- a/phase4-spring-boot-demo/src/main/java/com/helger/phase4/springboot/spi/CustomPeppolIncomingViaInterfaceSPI.java +++ b/phase4-spring-boot-demo/src/main/java/com/helger/phase4/springboot/spi/CustomPeppolIncomingViaInterfaceSPI.java @@ -144,11 +144,4 @@ public void handleIncomingSBD (@Nonnull final IAS4IncomingMessageMetadata aMessa else LOGGER.error ("No handler is registered. Make sure to call 'setIncomingHandler' of this class on application startup"); } - - @Override - public boolean exceptionTranslatesToAS4Error () - { - // If we have an Exception, tell the sender so - return true; - } }