Class AS2MDNReceiverHandler
java.lang.Object
com.helger.as2lib.processor.receiver.net.AbstractReceiverHandler
com.helger.as2lib.processor.receiver.net.AS2MDNReceiverHandler
- All Implemented Interfaces:
INetModuleHandler
The main handler for receiving AS2 async MDN messages.
- Author:
- Philip Helger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
checkAsyncMDN
(AS2Message aMsg) verify if the mic is matched.protected com.helger.commons.state.ESuccess
deletePendingFile
(AS2Message aMsg, String sPendingFilename) Delete the pending file itself.protected com.helger.commons.state.ESuccess
Delete the pending info file.final IAS2IncomingMDNCallback
final IMICMatchingHandler
final AS2MDNReceiverModule
protected File
getPendingInfoFile
(AS2Message aMsg) Get the pending info file itself.void
handle
(AbstractActiveNetModule aOwner, Socket aSocket) void
handleIncomingMessage
(String sClientInfo, jakarta.activation.DataSource aMsgData, AS2Message aMsg, IAS2HttpResponseHandler aResponseHandler) protected InputStream
Delete the pending info file for reading.protected final void
receiveMDN
(AS2Message aMsg, byte[] aData, IAS2HttpResponseHandler aResponseHandler, AS2ResourceHelper aResHelper) method for receiving and processing Async MDN sent from receiver.void
reparse
(AS2Message aMsg, AS2HttpClient aHttpClient, IHTTPIncomingDumper aIncomingDumper) final void
Set the incoming MDN callback that is invoked for each received MDN.final void
setMICMatchingHandler
(IMICMatchingHandler aMICMatchingHandler) Set the MIC matching handler to used.Methods inherited from class com.helger.as2lib.processor.receiver.net.AbstractReceiverHandler
getClientInfo, getEffectiveHttpIncomingDumper, getHttpIncomingDumper, getVerificationCertificateConsumer, setHttpIncomingDumper, setVerificationCertificateConsumer
-
Constructor Details
-
AS2MDNReceiverHandler
- Parameters:
aModule
- The receiver module for attributes, session etc. May not benull
.
-
-
Method Details
-
getModule
- Returns:
- The receiver module passed in the constructor. Never
null
.
-
getMICMatchingHandler
- Returns:
- The current MIC matching handler. Never
null
. - Since:
- 4.4.0
-
setMICMatchingHandler
Set the MIC matching handler to used.- Parameters:
aMICMatchingHandler
- The new handler. May not benull
.- Since:
- 4.4.0
-
getIncomingMDNCallback
- Returns:
- The incoming MDN callback. May be
null
. - Since:
- v4.7.1
-
setIncomingMDNCallback
Set the incoming MDN callback that is invoked for each received MDN.- Parameters:
aIMC
- The callback to be invoked. May be null.- Since:
- v4.7.1
-
getPendingInfoFile
Get the pending info file itself.- Parameters:
aMsg
- Source message. Nevernull
.- Returns:
- The file.
- Throws:
AS2Exception
- In case of error- Since:
- 4.10.2
-
openPendingInfoStreamForReading
@Nullable @OverrideOnDemand protected InputStream openPendingInfoStreamForReading(@Nonnull AS2Message aMsg) throws AS2Exception Delete the pending info file for reading.- Parameters:
aMsg
- Source message. Nevernull
.- Returns:
null
if open failed.- Throws:
AS2Exception
- In case of error- Since:
- 4.10.2
-
deletePendingInfoStream
@OverrideOnDemand protected com.helger.commons.state.ESuccess deletePendingInfoStream(@Nonnull AS2Message aMsg) throws AS2Exception Delete the pending info file.- Parameters:
aMsg
- Source message. Nevernull
.- Returns:
ESuccess
- Throws:
AS2Exception
- In case of error- Since:
- 4.10.2
-
deletePendingFile
@OverrideOnDemand protected com.helger.commons.state.ESuccess deletePendingFile(@Nonnull AS2Message aMsg, @Nonnull String sPendingFilename) throws AS2Exception Delete the pending file itself.- Parameters:
aMsg
- Source message. Nevernull
.sPendingFilename
- Pending filename- Returns:
ESuccess
- Throws:
AS2Exception
- In case of error- Since:
- 4.10.2
-
checkAsyncMDN
verify if the mic is matched.- Parameters:
aMsg
- Message- Returns:
true
if the MDN was processed,false
e.g. on MIC mismatch- Throws:
AS2Exception
- In case of error; e.g. MIC mismatch
-
receiveMDN
protected final void receiveMDN(@Nonnull AS2Message aMsg, byte[] aData, @Nonnull IAS2HttpResponseHandler aResponseHandler, @Nonnull AS2ResourceHelper aResHelper) throws AS2Exception, IOException method for receiving and processing Async MDN sent from receiver.- Parameters:
aMsg
- The MDN messageaData
- The MDN contentaResponseHandler
- The HTTP response handler for setting the correct HTTP response codeaResHelper
- Resource helper- Throws:
AS2Exception
- In case of errorIOException
- In case of IO error
-
reparse
public void reparse(@Nonnull AS2Message aMsg, @Nonnull AS2HttpClient aHttpClient, @Nullable IHTTPIncomingDumper aIncomingDumper) throws AS2Exception - Throws:
AS2Exception
-
handleIncomingMessage
public void handleIncomingMessage(@Nonnull @Nonempty String sClientInfo, @Nonnull jakarta.activation.DataSource aMsgData, @Nonnull AS2Message aMsg, @Nonnull IAS2HttpResponseHandler aResponseHandler) -
handle
-