Class AS2ReceiverHandler
java.lang.Object
com.helger.as2lib.processor.receiver.net.AbstractReceiverHandler
com.helger.as2lib.processor.receiver.net.AS2ReceiverHandler
- All Implemented Interfaces:
INetModuleHandler
The main handler for receiving AS2 messages.
- Author:
- Philip Helger
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final boolean
static final boolean
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected AS2Message
createMessage
(Socket aSocket) Create a new message and record the source ip and portprotected void
decompress
(IMessage aMsg) protected void
decrypt
(IMessage aMsg, AS2ResourceHelper aResHelper) protected final AS2ReceiverModule
void
handle
(AbstractActiveNetModule aOwner, Socket aSocket) void
handleIncomingMessage
(String sClientInfo, jakarta.activation.DataSource aMsgData, AS2Message aMsg, IAS2HttpResponseHandler aResponseHandler) This method can be used to handle an incoming HTTP message AFTER the headers where extracted.final boolean
final boolean
This method is only evaluated, ifisSendExceptionsInMDN()
returnstrue
.protected void
sendMDN
(String sClientInfo, IAS2HttpResponseHandler aResponseHandler, AS2Message aMsg, DispositionType aDisposition, String sText, com.helger.commons.state.ESuccess eSuccess) final AS2ReceiverHandler
setSendExceptionsInMDN
(boolean bSendExceptionsInMDN) final AS2ReceiverHandler
setSendExceptionStackTraceInMDN
(boolean bSendExceptionStackTraceInMDN) This setting is only evaluated, ifisSendExceptionsInMDN()
returnstrue
.protected void
verify
(IMessage aMsg, AS2ResourceHelper aResHelper) Methods inherited from class com.helger.as2lib.processor.receiver.net.AbstractReceiverHandler
getClientInfo, getEffectiveHttpIncomingDumper, getHttpIncomingDumper, getVerificationCertificateConsumer, setHttpIncomingDumper, setVerificationCertificateConsumer
-
Field Details
-
DEFAULT_SEND_EXCEPTIONS_IN_MDN
public static final boolean DEFAULT_SEND_EXCEPTIONS_IN_MDN- See Also:
-
DEFAULT_SEND_EXCEPTION_STACKTRACE_IN_MDN
public static final boolean DEFAULT_SEND_EXCEPTION_STACKTRACE_IN_MDN- See Also:
-
-
Constructor Details
-
AS2ReceiverHandler
- Parameters:
aModule
- The receiver module to be used. May not benull
. Required for the session and the error handling.
-
-
Method Details
-
getReceiverModule
- Returns:
- The receiver module provided in the constructor. Never
null
.
-
isSendExceptionsInMDN
public final boolean isSendExceptionsInMDN()- Returns:
true
if exceptions should be send in the MDN,false
if not. Default isDEFAULT_SEND_EXCEPTIONS_IN_MDN
- Since:
- 4.4.2
-
setSendExceptionsInMDN
- Parameters:
bSendExceptionsInMDN
-true
to send back exception in the MDN,false
if not.- Returns:
- this for chaining
- Since:
- 4.4.2
-
isSendExceptionStackTraceInMDN
public final boolean isSendExceptionStackTraceInMDN()This method is only evaluated, ifisSendExceptionsInMDN()
returnstrue
.- Returns:
true
if exception stack traces should be send in the MDN,false
if not. Default isDEFAULT_SEND_EXCEPTION_STACKTRACE_IN_MDN
.- Since:
- 4.4.6
-
setSendExceptionStackTraceInMDN
@Nonnull public final AS2ReceiverHandler setSendExceptionStackTraceInMDN(boolean bSendExceptionStackTraceInMDN) This setting is only evaluated, ifisSendExceptionsInMDN()
returnstrue
.- Parameters:
bSendExceptionStackTraceInMDN
-true
to send back exception stack traces in the MDN,false
if not.- Returns:
- this for chaining
- Since:
- 4.4.6
-
createMessage
Create a new message and record the source ip and port- Parameters:
aSocket
- The socket through which the message will be read.- Returns:
- The
AS2Message
to use and nevernull
.
-
decrypt
protected void decrypt(@Nonnull IMessage aMsg, @Nonnull AS2ResourceHelper aResHelper) throws AS2Exception - Throws:
AS2Exception
-
verify
protected void verify(@Nonnull IMessage aMsg, @Nonnull AS2ResourceHelper aResHelper) throws AS2Exception - Throws:
AS2Exception
-
decompress
- Throws:
AS2DispositionException
-
sendMDN
protected void sendMDN(@Nonnull String sClientInfo, @Nonnull IAS2HttpResponseHandler aResponseHandler, @Nonnull AS2Message aMsg, @Nonnull DispositionType aDisposition, @Nonnull String sText, @Nonnull com.helger.commons.state.ESuccess eSuccess) -
handleIncomingMessage
public void handleIncomingMessage(@Nonnull String sClientInfo, @Nonnull jakarta.activation.DataSource aMsgData, @Nonnull AS2Message aMsg, @Nonnull IAS2HttpResponseHandler aResponseHandler) This method can be used to handle an incoming HTTP message AFTER the headers where extracted.- Parameters:
sClientInfo
- Client connection infoaMsgData
- The message bodyaMsg
- The AS2 message that will be filled by this methodaResponseHandler
- The response handler which handles HTTP error messages as well as synchronous MDN.
-
handle
-