public class AS2ClientSettings extends Object
| Modifier and Type | Field and Description |
|---|---|
static boolean |
DEFAULT_COMPRESS_BEFORE_SIGNING
If compression and signing are enabled, compression happens before singing
|
static org.apache.hc.core5.util.Timeout |
DEFAULT_CONNECT_TIMEOUT
Default connection timeout: 60 seconds
|
static boolean |
DEFAULT_IS_MDN_REQUESTED
By default an MDN is requested.
|
static String |
DEFAULT_MDN_OPTIONS
The default MDN options to be used.
|
static String |
DEFAULT_MESSAGE_ID_FORMAT
The default message ID format to use.
|
static boolean |
DEFAULT_QUOTE_HEADER_VALUES
Default quote header values: false
|
static org.apache.hc.core5.util.Timeout |
DEFAULT_RESPONSE_TIMEOUT
Default read timeout: 60 seconds
|
static int |
DEFAULT_RETRY_COUNT
By default no retry happens.
|
| Constructor and Description |
|---|
AS2ClientSettings() |
| Modifier and Type | Method and Description |
|---|---|
com.helger.commons.http.HttpHeaderMap |
customHeaders() |
String |
getAsyncMDNUrl() |
ECompressionType |
getCompressionType() |
org.apache.hc.core5.util.Timeout |
getConnectTimeout() |
ECryptoAlgorithmCrypt |
getCryptAlgo() |
String |
getCryptAlgoID() |
String |
getDestinationAS2URL() |
IHTTPIncomingDumper |
getHttpIncomingDumper() |
IHTTPOutgoingDumperFactory |
getHttpOutgoingDumperFactory() |
byte[] |
getKeyStoreBytes() |
File |
getKeyStoreFile() |
String |
getKeyStorePassword() |
com.helger.security.keystore.IKeyStoreType |
getKeyStoreType() |
String |
getMDNOptions()
Get the current MDN options.
|
String |
getMessageIDFormat() |
IMICMatchingHandler |
getMICMatchingHandler() |
String |
getPartnershipName() |
String |
getReceiverAS2ID() |
X509Certificate |
getReceiverCertificate() |
String |
getReceiverKeyAlias() |
org.apache.hc.core5.util.Timeout |
getResponseTimeout() |
int |
getRetryCount() |
String |
getSenderAS2ID() |
String |
getSenderEmailAddress() |
String |
getSenderKeyAlias() |
ECryptoAlgorithmSign |
getSignAlgo() |
String |
getSignAlgoID() |
Consumer<? super X509Certificate> |
getVerificationCertificateConsumer() |
boolean |
hasMDNOptions() |
boolean |
isAsyncMDNRequested() |
boolean |
isCompressBeforeSigning()
Check if compress before sign or sign before compress is used.
|
boolean |
isMDNRequested() |
boolean |
isQuoteHeaderValues() |
boolean |
isSaveKeyStoreChangesToFile() |
AS2ClientSettings |
setAsyncMDNUrl(String sAsyncMDNUrl)
Set the asynchronous MDN URL to be used.
|
AS2ClientSettings |
setCompress(ECompressionType eCompressionType,
boolean bCompressBeforeSigning)
Enable or disable the compression of the message.
|
AS2ClientSettings |
setConnectTimeout(org.apache.hc.core5.util.Timeout aConnectTimeout)
Set the connect timeout.
|
AS2ClientSettings |
setEncryptAndSign(ECryptoAlgorithmCrypt eCryptAlgo,
ECryptoAlgorithmSign eSignAlgo)
Set the encryption and signing algorithms to use.
|
AS2ClientSettings |
setHttpIncomingDumper(IHTTPIncomingDumper aHttpIncomingDumper)
Set the HTTP incoming dumper.
|
AS2ClientSettings |
setHttpOutgoingDumperFactory(IHTTPOutgoingDumperFactory aHttpOutgoingDumperFactory)
Set the HTTP outgoing dumper factory.
|
AS2ClientSettings |
setKeyStore(com.helger.security.keystore.IKeyStoreType aKeyStoreType,
byte[] aBytes,
String sPassword)
Set the details of the certificate store of the client.
|
AS2ClientSettings |
setKeyStore(com.helger.security.keystore.IKeyStoreType aKeyStoreType,
File aFile,
String sPassword)
Set the details of the certificate store of the client.
|
AS2ClientSettings |
setMDNOptions(DispositionOptions aDispositionOptions)
Set the MDN options to be used.
|
AS2ClientSettings |
setMDNOptions(String sMDNOptions)
Set the MDN options to be used.
|
AS2ClientSettings |
setMDNRequested(boolean bMDNRequested)
Determine if an MDN is requested at all.
|
AS2ClientSettings |
setMessageIDFormat(String sMessageIDFormat)
Set the Message ID format.
|
AS2ClientSettings |
setMICMatchingHandler(IMICMatchingHandler aMICMatchingHandler)
Set a custom MIC matching handler
|
AS2ClientSettings |
setPartnershipName(String sPartnershipName)
Set the name of the partnership for lookup and dynamic creation.
|
AS2ClientSettings |
setQuoteHeaderValues(boolean bQuoteHeaderValues)
Set whether HTTP header values for outgoing messages should be quoted or
not according to RFC 2616.
|
AS2ClientSettings |
setReceiverCertificate(X509Certificate aReceiverCertificate)
Explicitly set the receiver certificate to be used.
|
AS2ClientSettings |
setReceiverData(String sAS2ID,
String sKeyAlias,
String sAS2URL)
Set the receiver data.
|
AS2ClientSettings |
setResponseTimeout(org.apache.hc.core5.util.Timeout aResponseTimeout)
Set the response/read timeout.
|
AS2ClientSettings |
setRetryCount(int nRetryCount)
Set the retry count for sending,
|
AS2ClientSettings |
setSaveKeyStoreChangesToFile(boolean bSaveKeyStoreChangesToFile)
Change the behavior if all changes to the keystore should trigger a saving
to the original file.
|
AS2ClientSettings |
setSenderData(String sAS2ID,
String sEmailAddress,
String sKeyAlias)
Set the sender data.
|
AS2ClientSettings |
setVerificationCertificateConsumer(Consumer<? super X509Certificate> aVerificationCertificateConsumer)
Set a custom MIC matching handler
|
public static final boolean DEFAULT_COMPRESS_BEFORE_SIGNING
public static final boolean DEFAULT_IS_MDN_REQUESTED
public static final String DEFAULT_MDN_OPTIONS
setMDNOptions(DispositionOptions)public static final String DEFAULT_MESSAGE_ID_FORMAT
setMessageIDFormat(String),
Constant Field Valuespublic static final int DEFAULT_RETRY_COUNT
public static final org.apache.hc.core5.util.Timeout DEFAULT_CONNECT_TIMEOUT
public static final org.apache.hc.core5.util.Timeout DEFAULT_RESPONSE_TIMEOUT
public static final boolean DEFAULT_QUOTE_HEADER_VALUES
@Nonnull public final com.helger.security.keystore.IKeyStoreType getKeyStoreType()
null.setKeyStore(IKeyStoreType, File, String),
setKeyStore(IKeyStoreType, byte[], String)@Nullable public final File getKeyStoreFile()
null if not yet set. Either
File or byte[] may be set. Never both.setKeyStore(IKeyStoreType, File, String)@Nullable public final byte[] getKeyStoreBytes()
null if not yet set.
Either File or byte[] may be set. Never both.setKeyStore(IKeyStoreType, byte[], String)@Nullable public final String getKeyStorePassword()
null if not yet set.setKeyStore(IKeyStoreType, File, String),
setKeyStore(IKeyStoreType, byte[], String)@Nonnull public final AS2ClientSettings setKeyStore(@Nonnull com.helger.security.keystore.IKeyStoreType aKeyStoreType, @Nonnull File aFile, @Nonnull String sPassword)
aKeyStoreType - Key store type. May not be null.aFile - The key store file. May not be null.sPassword - The password used to open the key store. May not be
null.@Nonnull public final AS2ClientSettings setKeyStore(@Nonnull com.helger.security.keystore.IKeyStoreType aKeyStoreType, @Nonnull byte[] aBytes, @Nonnull String sPassword)
aKeyStoreType - Key store type. May not be null.aBytes - The key store bytes. May not be null.sPassword - The password used to open the key store. May not be
null.public final boolean isSaveKeyStoreChangesToFile()
true if key store changes should be written back to
the file, false if not.@Nonnull public final AS2ClientSettings setSaveKeyStoreChangesToFile(boolean bSaveKeyStoreChangesToFile)
bSaveKeyStoreChangesToFile - true if key store changes should be written back to the
file, false if not.@Nullable public final String getSenderAS2ID()
null if not set.setSenderData(String, String, String)@Nullable public final String getSenderEmailAddress()
null if not set.setSenderData(String, String, String)@Nullable public final String getSenderKeyAlias()
null if
not set.setSenderData(String, String, String),
setKeyStore(IKeyStoreType, File, String)@Nonnull public final AS2ClientSettings setSenderData(@Nonnull String sAS2ID, @Nonnull String sEmailAddress, @Nonnull String sKeyAlias)
sAS2ID - Sender AS2 ID. May not be null.sEmailAddress - Sender email address. May not be null.sKeyAlias - Alias into the keystore for identifying the sender's key. May not be
null.@Nullable public final String getReceiverAS2ID()
null if not set.setReceiverData(String, String, String)@Nullable public final String getReceiverKeyAlias()
null
if not set.setReceiverData(String, String, String),
setKeyStore(IKeyStoreType, File, String)@Nullable public final String getDestinationAS2URL()
null if not set.setReceiverData(String, String, String)@Nonnull public final AS2ClientSettings setReceiverData(@Nonnull String sAS2ID, @Nonnull String sKeyAlias, @Nonnull String sAS2URL)
sAS2ID - Receiver AS2 ID. May not be null.sKeyAlias - Alias into the keystore for identifying the receivers certificate.
May not be null.sAS2URL - Destination URL to send the request to. May not be null
.@Nullable public final X509Certificate getReceiverCertificate()
null.setReceiverCertificate(X509Certificate)@Nonnull public final AS2ClientSettings setReceiverCertificate(@Nullable X509Certificate aReceiverCertificate)
aReceiverCertificate - The receiver certificate. May be null.@Nullable public final ECryptoAlgorithmCrypt getCryptAlgo()
null
if not set.setEncryptAndSign(ECryptoAlgorithmCrypt, ECryptoAlgorithmSign)@Nullable public final String getCryptAlgoID()
null if not set.setEncryptAndSign(ECryptoAlgorithmCrypt, ECryptoAlgorithmSign)@Nullable public final ECryptoAlgorithmSign getSignAlgo()
null if
not set.setEncryptAndSign(ECryptoAlgorithmCrypt, ECryptoAlgorithmSign)@Nullable public final String getSignAlgoID()
null if not set.setEncryptAndSign(ECryptoAlgorithmCrypt, ECryptoAlgorithmSign)@Nonnull public final AS2ClientSettings setEncryptAndSign(@Nullable ECryptoAlgorithmCrypt eCryptAlgo, @Nullable ECryptoAlgorithmSign eSignAlgo)
eCryptAlgo - The encryption algorithm. May be null to indicate that
the message should not be encrypted.eSignAlgo - The signing algorithm. May be null to indicate that the
message should not be signed.@Nullable public final ECompressionType getCompressionType()
null to indicate no compression.setCompress(ECompressionType, boolean)public final boolean isCompressBeforeSigning()
getCompressionType() is not null.true to compress before signing, false to
sign before compressingsetCompress(ECompressionType, boolean)@Nonnull public final AS2ClientSettings setCompress(@Nullable ECompressionType eCompressionType, boolean bCompressBeforeSigning)
eCompressionType - The compression type to use. Pass null to not compress
the message (that is also the default).bCompressBeforeSigning - true to compress the data before it is signed,
false to sign first and than compress the message. The
default is true.@Nullable public final String getPartnershipName()
null if not
set.setPartnershipName(String)@Nonnull public final AS2ClientSettings setPartnershipName(@Nonnull String sPartnershipName)
sPartnershipName - The partnership name. May not be null.public final boolean isMDNRequested()
true if an MDN is requested at all (sync or async),
false if not.@Nonnull public final AS2ClientSettings setMDNRequested(boolean bMDNRequested)
bMDNRequested - true to request an MDN (is the default),
false to not request one.@Nullable public final String getMDNOptions()
null.Disposition-Notification-Options
header) to be used. May be null. The default is
defined in DEFAULT_MDN_OPTIONS.setMDNOptions(DispositionOptions),
setMDNOptions(String)public final boolean hasMDNOptions()
true if MDN options are specified (the default),
false if not.@Nonnull public final AS2ClientSettings setMDNOptions(@Nullable String sMDNOptions)
null.sMDNOptions - The Disposition-Notification-Options String to be used.
May be null.setMDNOptions(DispositionOptions)@Nonnull public final AS2ClientSettings setMDNOptions(@Nonnull DispositionOptions aDispositionOptions)
aDispositionOptions - The Disposition-Notification-Options structured object
to be used. May not be null.setMDNOptions(String)@Nullable public final String getAsyncMDNUrl()
null than
a synchronous MDN is requested. By default a synchronous MDN is
requested.public final boolean isAsyncMDNRequested()
true if an asynchronous MDN is requested,
false if not (default).getAsyncMDNUrl()@Nonnull public final AS2ClientSettings setAsyncMDNUrl(@Nullable String sAsyncMDNUrl)
sAsyncMDNUrl - May be null in which case a synchronous MDN is
requested (which is also the default).@Nonnull public final String getMessageIDFormat()
null. It defaults
to "as2-lib-$date.ddMMuuuuHHmmssZ$-$rand.1234$@$msg.sender.as2_id$_$msg.receiver.as2_id$".DEFAULT_MESSAGE_ID_FORMAT,
setMessageIDFormat(String)@Nonnull public final AS2ClientSettings setMessageIDFormat(@Nonnull String sMessageIDFormat)
com.helger.as2lib.params parameters parsers.sMessageIDFormat - The message ID format to use. May not be null.public final int getRetryCount()
DEFAULT_RETRY_COUNT.setRetryCount(int)@Nonnull public final AS2ClientSettings setRetryCount(int nRetryCount)
nRetryCount - Sending retry count. Values ≤ 0 mean "no retry".getRetryCount()public final org.apache.hc.core5.util.Timeout getConnectTimeout()
DEFAULT_CONNECT_TIMEOUT.@Nonnull public final AS2ClientSettings setConnectTimeout(@Nonnull org.apache.hc.core5.util.Timeout aConnectTimeout)
aConnectTimeout - Connect timeout. May not be null.getConnectTimeout()@Nonnull public final org.apache.hc.core5.util.Timeout getResponseTimeout()
DEFAULT_RESPONSE_TIMEOUT.@Nonnull public final AS2ClientSettings setResponseTimeout(@Nonnull org.apache.hc.core5.util.Timeout aResponseTimeout)
aResponseTimeout - Response timeout. May not be null.getResponseTimeout()public final boolean isQuoteHeaderValues()
true if HTTP header values should be quoted according
to RFC 2616, false if not.@Nonnull public final AS2ClientSettings setQuoteHeaderValues(boolean bQuoteHeaderValues)
bQuoteHeaderValues - true if quoting should be enabled, false
if not.@Nullable public final IHTTPOutgoingDumperFactory getHttpOutgoingDumperFactory()
null.@Nonnull public final AS2ClientSettings setHttpOutgoingDumperFactory(@Nullable IHTTPOutgoingDumperFactory aHttpOutgoingDumperFactory)
aHttpOutgoingDumperFactory - The factory to be used. May be null.@Nullable public final IHTTPIncomingDumper getHttpIncomingDumper()
null.@Nonnull public final AS2ClientSettings setHttpIncomingDumper(@Nullable IHTTPIncomingDumper aHttpIncomingDumper)
aHttpIncomingDumper - The dumper to be used. May be null.@Nonnull @ReturnsMutableObject public final com.helger.commons.http.HttpHeaderMap customHeaders()
null.@Nullable public final IMICMatchingHandler getMICMatchingHandler()
null.@Nonnull public final AS2ClientSettings setMICMatchingHandler(@Nullable IMICMatchingHandler aMICMatchingHandler)
aMICMatchingHandler - The handler to be used. May be null.@Nullable public final Consumer<? super X509Certificate> getVerificationCertificateConsumer()
null.@Nonnull public final AS2ClientSettings setVerificationCertificateConsumer(@Nullable Consumer<? super X509Certificate> aVerificationCertificateConsumer)
aVerificationCertificateConsumer - The factory to be used. May be null.Copyright © 2013–2022 Philip Helger. All rights reserved.