Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/phax/phase4.git
Browse files Browse the repository at this point in the history
  • Loading branch information
phax committed Nov 22, 2024
2 parents 1f144dd + 231e972 commit d6e1452
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,35 @@ public final IMPLTYPE signalMsgConsumer (@Nullable final IAS4SignalMessageConsum
return thisAsT ();
}

/**
* @return The optional Ebms3 Signal Message validation result handled. May be
* <code>null</code>.
* @since 3.0.1
*/
@Nullable
public final IAS4SignalMessageValidationResultHandler signalMsgValidationResultHdl ()
{
return m_aSignalMsgValidationResultHdl;
}

/**
* Set an optional Ebms3 Signal Message validation result handler. This
* handler is invoked, after the synchronous signal message references were
* evaluated. This handler cannot modify any message flow - it is an
* informational callback only.
*
* @param aSignalMsgValidationResultHdl
* The optional signal message consumer. May be <code>null</code>.
* @return this for chaining
* @since 3.0.1
*/
@Nonnull
public final IMPLTYPE signalMsgValidationResultHdl (@Nullable final IAS4SignalMessageValidationResultHandler aSignalMsgValidationResultHdl)
{
m_aSignalMsgValidationResultHdl = aSignalMsgValidationResultHdl;
return thisAsT ();
}

@Override
@Nonnull
@OverridingMethodsMustInvokeSuper
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,35 @@ public final IMPLTYPE signalMsgConsumer (@Nullable final IAS4SignalMessageConsum
return thisAsT ();
}

/**
* @return The optional Ebms3 Signal Message validation result handled. May be
* <code>null</code>.
* @since 3.0.1
*/
@Nullable
public final IAS4SignalMessageValidationResultHandler signalMsgValidationResultHdl ()
{
return m_aSignalMsgValidationResultHdl;
}

/**
* Set an optional Ebms3 Signal Message validation result handler. This
* handler is invoked, after the synchronous signal message references were
* evaluated. This handler cannot modify any message flow - it is an
* informational callback only.
*
* @param aSignalMsgValidationResultHdl
* The optional signal message consumer. May be <code>null</code>.
* @return this for chaining
* @since 3.0.1
*/
@Nonnull
public final IMPLTYPE signalMsgValidationResultHdl (@Nullable final IAS4SignalMessageValidationResultHandler aSignalMsgValidationResultHdl)
{
m_aSignalMsgValidationResultHdl = aSignalMsgValidationResultHdl;
return thisAsT ();
}

@Override
@Nonnull
@OverridingMethodsMustInvokeSuper
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
import com.helger.phase4.peppol.Phase4PeppolValidatonResultHandler;
import com.helger.phase4.sender.EAS4UserMessageSendResult;
import com.helger.phase4.sender.IAS4RawResponseConsumer;
import com.helger.phase4.sender.IAS4SignalMessageValidationResultHandler;
import com.helger.phase4.sender.LoggingAS4SignalMsgValidationResultHandler;
import com.helger.phive.peppol.PeppolValidation2024_05;
import com.helger.servlet.mock.MockServletContext;
import com.helger.smpclient.peppol.SMPClientReadOnly;
Expand Down Expand Up @@ -79,6 +81,7 @@ public void onAS4Message (final AbstractAS4Message <?> aMsg)
LOGGER.info ("Response headers:");
x.getResponseHeaders ().forEachSingleHeader ( (k, v) -> LOGGER.info (" " + k + "=" + v), false);
};
final IAS4SignalMessageValidationResultHandler aSignalMsgValidationResultHdl = new LoggingAS4SignalMsgValidationResultHandler ();
final PeppolUserMessageBuilder aBuilder = Phase4PeppolSender.builder ()
.documentTypeID (Phase4PeppolSender.IF.createDocumentTypeIdentifierWithDefaultScheme ("urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0::2.1"))
.processID (Phase4PeppolSender.IF.createProcessIdentifierWithDefaultScheme ("urn:fdc:peppol.eu:2017:poacc:billing:01:1.0"))
Expand All @@ -94,6 +97,7 @@ public void onAS4Message (final AbstractAS4Message <?> aMsg)
.validationConfiguration (PeppolValidation2024_05.VID_OPENPEPPOL_INVOICE_UBL_V3,
new Phase4PeppolValidatonResultHandler ())
.buildMessageCallback (aBuildMessageCallback)
.signalMsgValidationResultHdl (aSignalMsgValidationResultHdl)
.rawResponseConsumer (aRRC);
final EAS4UserMessageSendResult eResult;
eResult = aBuilder.sendMessageAndCheckForReceipt ();
Expand Down

0 comments on commit d6e1452

Please sign in to comment.