public class AS2SenderModule extends AbstractHttpSenderModule
ATTR_CONNECT_TIMEOUT, ATTR_QUOTE_HEADER_VALUES, ATTR_RESPONSE_TIMEOUT, DEFAULT_CONNECT_TIMEOUT, DEFAULT_QUOTE_HEADER_VALUES, DEFAULT_RESPONSE_TIMEOUTm_aRWLockDO_SEND, DO_SEND_ASYNC_MDN| Constructor and Description |
|---|
AS2SenderModule() |
| Modifier and Type | Method and Description |
|---|---|
protected MIC |
calculateAndStoreMIC(AS2Message aMsg)
From RFC 4130 section 7.3.1:
For any signed messages, the MIC to be returned is calculated on the
RFC1767/RFC3023 MIME header and content.
|
boolean |
canHandle(String sAction,
IMessage aMsg,
Map<String,Object> aOptions) |
protected void |
checkRequired(AS2Message aMsg) |
static javax.mail.internet.MimeBodyPart |
compressMimeBodyPart(javax.mail.internet.MimeBodyPart aData,
ECompressionType eCompressionType,
com.helger.mail.cte.EContentTransferEncoding eCTE) |
boolean |
equals(Object o) |
IAS2IncomingMDNCallback |
getIncomingMDNCallback() |
IMICMatchingHandler |
getMICMatchingHandler() |
Consumer<? super X509Certificate> |
getVerificationCertificateConsumer() |
void |
handle(String sAction,
IMessage aBaseMsg,
Map<String,Object> aOptions) |
int |
hashCode() |
protected void |
onReceivedMDNError(AS2Message aMsg,
AS2Exception ex)
Handler for errors in MDN processing.
|
protected OutputStream |
openPendingInfoStreamForWriting(AS2Message aMsg,
String sMsgFilename)
Override this method to store pending MDN messages somewhere else than on
disc.
|
protected void |
receiveSyncMDN(AS2Message aMsg,
AS2HttpClient aHttpClient,
MIC aOriginalMIC,
IHTTPIncomingDumper aIncomingDumper,
AS2ResourceHelper aResHelper) |
protected javax.mail.internet.MimeBodyPart |
secure(IMessage aMsg,
com.helger.mail.cte.EContentTransferEncoding eCTE) |
static javax.mail.internet.MimeBodyPart |
secureMimeBodyPart(javax.mail.internet.MimeBodyPart aSrcPart,
com.helger.mail.cte.EContentTransferEncoding eCTE,
ECompressionType eCompressionType,
boolean bCompressBeforeSign,
Consumer<javax.mail.internet.MimeBodyPart> aCompressBeforeSignCallback,
ECryptoAlgorithmSign eSignAlgorithm,
X509Certificate aSenderCert,
PrivateKey aSenderKey,
boolean bIncludeCertificateInSignedContent,
boolean bUseRFC3851MICAlg,
boolean bRemoveCmsAlgorithmProtect,
ECryptoAlgorithmCrypt eCryptAlgorithm,
X509Certificate aReceiverCert,
String sLoggingText) |
void |
setIncomingMDNCallback(IAS2IncomingMDNCallback aIMC)
Set the incoming MDN callback that is invoked for each received MDN.
|
AS2SenderModule |
setMICMatchingHandler(IMICMatchingHandler aMICMatchingHandler)
Set the MIC matching handler to used.
|
AS2SenderModule |
setVerificationCertificateConsumer(Consumer<? super X509Certificate> aVerificationCertificateConsumer)
Set the consumer for the effective certificate upon signature verification.
|
protected void |
storePendingInfo(AS2Message aMsg,
MIC aMIC)
For storing original MIC and outgoing file into pending information file.
|
protected void |
updateHttpHeaders(AS2HttpHeaderSetter aHeaderSetter,
IMessage aMsg)
Update the HTTP headers based on the provided message, before sending takes
place.
|
createHostnameVerifier, createSSLContext, getConnectTimeout, getEffectiveHttpIncomingDumper, getHttpClient, getHttpIncomingDumper, getHttpOutgoingDumper, getHttpOutgoingDumperFactory, getOutgoingHttpCallback, getResponseTimeout, isQuoteHeaderValues, isUseSSL, setConnectTimeoutMilliseconds, setHttpIncomingDumper, setHttpOutgoingDumperFactory, setOutgoingHttpCallback, setQuoteHeaderValues, setResponseTimeoutMillisecondsdoResend, getRetryCountattrs, getAttributeAsIntRequired, getAttributeAsStringRequired, getName, getSession, initDynamicComponent, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitattrs, getName, getSession, initDynamicComponent@Nonnull public final IMICMatchingHandler getMICMatchingHandler()
null.@Nonnull public final AS2SenderModule setMICMatchingHandler(@Nonnull IMICMatchingHandler aMICMatchingHandler)
aMICMatchingHandler - The new handler. May not be null.@Nullable public final IAS2IncomingMDNCallback getIncomingMDNCallback()
null.public final void setIncomingMDNCallback(@Nullable IAS2IncomingMDNCallback aIMC)
aIMC - The callback to be invoked. May be null.@Nullable public final Consumer<? super X509Certificate> getVerificationCertificateConsumer()
null. The default is
null.@Nonnull public final AS2SenderModule setVerificationCertificateConsumer(@Nullable Consumer<? super X509Certificate> aVerificationCertificateConsumer)
aVerificationCertificateConsumer - The consumer to be used. May be null.public boolean canHandle(@Nonnull String sAction, @Nonnull IMessage aMsg, @Nullable Map<String,Object> aOptions)
protected void checkRequired(@Nonnull AS2Message aMsg) throws AS2InvalidParameterException
AS2InvalidParameterException@Nullable @OverrideOnDemand protected OutputStream openPendingInfoStreamForWriting(@Nonnull AS2Message aMsg, @Nonnull @Nonempty String sMsgFilename) throws AS2Exception
aMsg - The message for which an async MDN is requested. Never
null.sMsgFilename - The filename (without the path), derived from the Message ID, in
which the data should be stored.null if the configuration is not correct.AS2Exception - In case of an errorprotected void storePendingInfo(@Nonnull AS2Message aMsg, @Nonnull MIC aMIC) throws AS2Exception
aMsg - AS2Message. May not be null.aMIC - MIC value. May not be null.AS2Exception - In case of an error@Nonnull protected MIC calculateAndStoreMIC(@Nonnull AS2Message aMsg) throws Exception
aMsg - Source messagenull nor empty.Exception - On security or AS2 issues@Nonnull public static javax.mail.internet.MimeBodyPart compressMimeBodyPart(@Nonnull javax.mail.internet.MimeBodyPart aData, @Nonnull ECompressionType eCompressionType, @Nonnull com.helger.mail.cte.EContentTransferEncoding eCTE) throws org.bouncycastle.mail.smime.SMIMEException
org.bouncycastle.mail.smime.SMIMEException@Nonnull public static javax.mail.internet.MimeBodyPart secureMimeBodyPart(@Nonnull javax.mail.internet.MimeBodyPart aSrcPart, @Nonnull com.helger.mail.cte.EContentTransferEncoding eCTE, @Nullable ECompressionType eCompressionType, boolean bCompressBeforeSign, @Nullable Consumer<javax.mail.internet.MimeBodyPart> aCompressBeforeSignCallback, @Nullable ECryptoAlgorithmSign eSignAlgorithm, @Nullable X509Certificate aSenderCert, @Nullable PrivateKey aSenderKey, boolean bIncludeCertificateInSignedContent, boolean bUseRFC3851MICAlg, boolean bRemoveCmsAlgorithmProtect, @Nullable ECryptoAlgorithmCrypt eCryptAlgorithm, @Nullable X509Certificate aReceiverCert, @Nonnull String sLoggingText) throws Exception
Exception@Nonnull protected javax.mail.internet.MimeBodyPart secure(@Nonnull IMessage aMsg, @Nonnull com.helger.mail.cte.EContentTransferEncoding eCTE) throws Exception
Exceptionprotected void updateHttpHeaders(@Nonnull AS2HttpHeaderSetter aHeaderSetter, @Nonnull IMessage aMsg)
aHeaderSetter - The connection abstraction. Never null.aMsg - The message to be send. Never null.protected void receiveSyncMDN(@Nonnull AS2Message aMsg, @Nonnull AS2HttpClient aHttpClient, @Nonnull MIC aOriginalMIC, @Nullable IHTTPIncomingDumper aIncomingDumper, @Nonnull AS2ResourceHelper aResHelper) throws AS2Exception, IOException
aMsg - AS2MessageaHttpClient - URLConnectionaOriginalMIC - mic value from original msgaIncomingDumper - Incoming dumper. May be null.aResHelper - Resource helperAS2Exception - in case of an errorIOException - in case of an IO error@OverrideOnDemand protected void onReceivedMDNError(@Nonnull AS2Message aMsg, @Nonnull AS2Exception ex) throws AS2Exception
aMsg - The source message that was sendex - The exception that was caughtAS2Exception - In case an overload wants to throw the exceptionpublic void handle(@Nonnull String sAction, @Nonnull IMessage aBaseMsg, @Nullable Map<String,Object> aOptions) throws AS2Exception
AS2Exceptionpublic boolean equals(Object o)
equals in class AbstractDynamicComponentpublic int hashCode()
hashCode in class AbstractDynamicComponentCopyright © 2013–2022 Philip Helger. All rights reserved.