Skip to content

Commit

Permalink
Moved logging closer to action
Browse files Browse the repository at this point in the history
  • Loading branch information
phax committed Dec 4, 2023
1 parent d442f97 commit 259ee3d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ public static void parseAS4Message (@Nonnull final IAS4IncomingAttachmentFactory
final IMimeType aPlainContentType = aContentType.getCopyWithoutParameters ();

// Fallback to global dumper if none is provided
final IAS4IncomingDumper aRealIncomingDumper = aIncomingDumper != null ? aIncomingDumper
: AS4DumpManager.getIncomingDumper ();
final IAS4IncomingDumper aRealIncomingDumper = aIncomingDumper != null ? aIncomingDumper : AS4DumpManager
.getIncomingDumper ();

Document aSoapDocument = null;
ESoapVersion eSoapVersion = null;
Expand Down Expand Up @@ -468,8 +468,7 @@ private static void _processSoapHeaderElements (@Nonnull final SOAPHeaderElement
aHeader.getNode (),
aIncomingAttachments,
aState,
aErrorList)
.isSuccess ())
aErrorList).isSuccess ())
{
// Mark header as processed (for mustUnderstand check)
aHeader.setProcessed (true);
Expand Down Expand Up @@ -814,8 +813,6 @@ public static IAS4MessageState processEbmsMessage (@Nonnull @WillNotClose final

final boolean bIsPingMessage = AS4Helper.isPingMessage (aPMode);
aState.setPingMessage (bIsPingMessage);
if (bIsPingMessage && (aProfile == null || !aProfile.isInvokeSPIForPingMessage()))
LOGGER.info ("Received an AS4 Ping message - meaning it will NOT be handled by the custom handlers.");
}

return aState;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -666,8 +666,9 @@ private void _invokeSPIsForIncoming (@Nonnull final HttpHeaderMap aHttpHeaders,
"Only one of User OR Signal Message may be present");

final boolean bIsUserMessage = aEbmsUserMessage != null;
final String sMessageID = bIsUserMessage ? aEbmsUserMessage.getMessageInfo ().getMessageId ()
: aEbmsSignalMessage.getMessageInfo ().getMessageId ();
final String sMessageID = bIsUserMessage ? aEbmsUserMessage.getMessageInfo ().getMessageId () : aEbmsSignalMessage
.getMessageInfo ()
.getMessageId ();

// Get all processors
final ICommonsList <IAS4ServletMessageProcessorSPI> aAllProcessors = m_aProcessorSupplier.get ();
Expand Down Expand Up @@ -876,8 +877,8 @@ private void _invokeSPIsForResponse (@Nonnull final IAS4MessageState aState,
byte [] aResponsePayload = null;
if (aResponseFactory != null)
{
final HttpEntity aRealHttpEntity = aHttpEntity != null ? aHttpEntity
: aResponseFactory.getHttpEntityForSending (aMimeType);
final HttpEntity aRealHttpEntity = aHttpEntity != null ? aHttpEntity : aResponseFactory.getHttpEntityForSending (
aMimeType);
if (aRealHttpEntity.isRepeatable ())
{
int nContentLength = (int) aRealHttpEntity.getContentLength ();
Expand Down Expand Up @@ -1395,6 +1396,8 @@ private IAS4ResponseFactory _handleSoapMessage (@Nonnull final HttpHeaderMap aHt
if (aState.isPingMessage ())
bCanInvokeSPIs = aAS4Profile.isInvokeSPIForPingMessage ();
}
if (aState.isPingMessage () && !bCanInvokeSPIs)
LOGGER.info ("Received an AS4 Ping message - meaning it will NOT be handled by the custom handlers.");

if (bCanInvokeSPIs)
{
Expand Down Expand Up @@ -1551,9 +1554,8 @@ private IAS4ResponseFactory _handleSoapMessage (@Nonnull final HttpHeaderMap aHt
new ResponseHandlerXml ());
}
AS4HttpDebug.debug ( () -> "SEND-RESPONSE [async sent] received: " +
(aAsyncResponse == null ? "null"
: XMLWriter.getNodeAsString (aAsyncResponse,
AS4HttpDebug.getDebugXMLWriterSettings ())));
(aAsyncResponse == null ? "null" : XMLWriter.getNodeAsString (aAsyncResponse,
AS4HttpDebug.getDebugXMLWriterSettings ())));
};

final CompletableFuture <Void> aFuture = PhotonWorkerPool.getInstance ()
Expand Down Expand Up @@ -1778,8 +1780,8 @@ public void handleRequest (@Nonnull @WillClose final InputStream aServletRequest
if (aResponder != null)
{
// Response present -> send back
final IAS4OutgoingDumper aRealOutgoingDumper = m_aOutgoingDumper != null ? m_aOutgoingDumper
: AS4DumpManager.getOutgoingDumper ();
final IAS4OutgoingDumper aRealOutgoingDumper = m_aOutgoingDumper != null ? m_aOutgoingDumper : AS4DumpManager
.getOutgoingDumper ();
aResponder.applyToResponse (aHttpResponse, aRealOutgoingDumper);
}
else
Expand Down

0 comments on commit 259ee3d

Please sign in to comment.