public class AS2ClientSettings extends Object implements Serializable
| Modifier and Type | Field and Description |
|---|---|
static boolean |
DEFAULT_COMPRESS_BEFORE_SIGNING
If compression and signing are enabled, compression happens before singing
|
static int |
DEFAULT_CONNECT_TIMEOUT_MS
Default connection timeout: 60 seconds
|
static boolean |
DEFAULT_IS_MDN_REQUESTED
By default an MDN is requested.
|
static boolean |
DEFAULT_LARGE_FILE_SUPPORT_ENABLED |
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 int |
DEFAULT_READ_TIMEOUT_MS
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() |
int |
getConnectTimeoutMS() |
ECryptoAlgorithmCrypt |
getCryptAlgo() |
String |
getCryptAlgoID() |
String |
getDestinationAS2URL() |
File |
getKeyStoreFile() |
String |
getKeyStorePassword() |
com.helger.security.keystore.IKeyStoreType |
getKeyStoreType() |
String |
getMDNOptions()
Get the current MDN options.
|
String |
getMessageIDFormat() |
String |
getPartnershipName() |
int |
getReadTimeoutMS() |
String |
getReceiverAS2ID() |
X509Certificate |
getReceiverCertificate() |
String |
getReceiverKeyAlias() |
int |
getRetryCount() |
String |
getSenderAS2ID() |
String |
getSenderEmailAddress() |
String |
getSenderKeyAlias() |
ECryptoAlgorithmSign |
getSignAlgo() |
String |
getSignAlgoID() |
boolean |
hasMDNOptions() |
boolean |
isAsyncMDNRequested() |
boolean |
isCompressBeforeSigning()
Check if compress before sign or sign before compress is used.
|
boolean |
isLargeFileSupport() |
boolean |
isMDNRequested() |
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 |
setConnectTimeoutMS(int nConnectTimeoutMS)
Set the connection timeout in milliseconds.
|
AS2ClientSettings |
setEncryptAndSign(ECryptoAlgorithmCrypt eCryptAlgo,
ECryptoAlgorithmSign eSignAlgo)
Set the encryption and signing algorithms to use.
|
AS2ClientSettings |
setKeyStore(com.helger.security.keystore.IKeyStoreType aKeyStoreType,
File aFile,
String sPassword)
Set the details of the certificate store of the client.
|
AS2ClientSettings |
setLargeFileSupport(boolean bLargeFileSupport) |
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 |
setPartnershipName(String sPartnershipName)
Set the name of the partnership for lookup and dynamic creation.
|
AS2ClientSettings |
setReadTimeoutMS(int nReadTimeoutMS)
Set the read timeout in milliseconds.
|
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 |
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.
|
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 int DEFAULT_CONNECT_TIMEOUT_MS
public static final int DEFAULT_READ_TIMEOUT_MS
public static final boolean DEFAULT_LARGE_FILE_SUPPORT_ENABLED
@Nonnull public 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 com.helger.security.keystore.IKeyStoreType getKeyStoreType()
null.setKeyStore(IKeyStoreType, File, String)@Nullable public File getKeyStoreFile()
null if not yet set.setKeyStore(IKeyStoreType, File, String)@Nullable public String getKeyStorePassword()
null if not yet set.setKeyStore(IKeyStoreType, File, String)@Nonnull public AS2ClientSettings setSaveKeyStoreChangesToFile(boolean bSaveKeyStoreChangesToFile)
bSaveKeyStoreChangesToFile - true if key store changes should be written back to the
file, false if not.public boolean isSaveKeyStoreChangesToFile()
true if key store changes should be written back to
the file, false if not.@Nonnull public 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 String getSenderAS2ID()
null if not set.setSenderData(String, String, String)@Nullable public String getSenderEmailAddress()
null if not set.setSenderData(String, String, String)@Nullable public String getSenderKeyAlias()
null if
not set.setSenderData(String, String, String),
setKeyStore(IKeyStoreType, File, String)@Nonnull public 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 String getReceiverAS2ID()
null if not set.setReceiverData(String, String, String)@Nullable public String getReceiverKeyAlias()
null
if not set.setReceiverData(String, String, String),
setKeyStore(IKeyStoreType, File, String)@Nullable public String getDestinationAS2URL()
null if not set.setReceiverData(String, String, String)@Nonnull public AS2ClientSettings setReceiverCertificate(@Nullable X509Certificate aReceiverCertificate)
aReceiverCertificate - The receiver certificate. May be null.@Nullable public X509Certificate getReceiverCertificate()
null.setReceiverCertificate(X509Certificate)@Nonnull public 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 ECryptoAlgorithmCrypt getCryptAlgo()
null
if not set.setEncryptAndSign(ECryptoAlgorithmCrypt, ECryptoAlgorithmSign)@Nullable public String getCryptAlgoID()
null if not set.setEncryptAndSign(ECryptoAlgorithmCrypt, ECryptoAlgorithmSign)@Nullable public ECryptoAlgorithmSign getSignAlgo()
null if
not set.setEncryptAndSign(ECryptoAlgorithmCrypt, ECryptoAlgorithmSign)@Nullable public String getSignAlgoID()
null if not set.setEncryptAndSign(ECryptoAlgorithmCrypt, ECryptoAlgorithmSign)@Nonnull public 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 ECompressionType getCompressionType()
null to indicate no compression.setCompress(ECompressionType, boolean)public boolean isCompressBeforeSigning()
getCompressionType() is not null.true to compress before signing, false to
sign before compressingsetCompress(ECompressionType, boolean)@Nonnull public AS2ClientSettings setPartnershipName(@Nonnull String sPartnershipName)
sPartnershipName - The partnership name. May not be null.@Nullable public String getPartnershipName()
null if not
set.setPartnershipName(String)@Nonnull public AS2ClientSettings setMDNRequested(boolean bMDNRequested)
bMDNRequested - true to request an MDN (is the default),
false to not request one.public boolean isMDNRequested()
true if an MDN is requested at all (sync or async),
false if not.@Nonnull public AS2ClientSettings setMDNOptions(@Nullable String sMDNOptions)
null.sMDNOptions - The Disposition-Notification-Options String to be used.
May be null.setMDNOptions(DispositionOptions)@Nonnull public AS2ClientSettings setMDNOptions(@Nonnull DispositionOptions aDispositionOptions)
aDispositionOptions - The Disposition-Notification-Options structured object
to be used. May not be null.setMDNOptions(String)@Nullable public 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 boolean hasMDNOptions()
true if MDN options are specified (the default),
false if not.@Nonnull public AS2ClientSettings setAsyncMDNUrl(@Nullable String sAsyncMDNUrl)
sAsyncMDNUrl - May be null in which case a synchronous MDN is
requested (which is also the default).@Nullable public String getAsyncMDNUrl()
null than
a synchronous MDN is requested. By default a synchronous MDN is
requested.public boolean isAsyncMDNRequested()
true if an asynchronous MDN is requested,
false if not (default).getAsyncMDNUrl()@Nonnull public AS2ClientSettings setMessageIDFormat(@Nonnull String sMessageIDFormat)
com.helger.as2lib.params parameters parsers.sMessageIDFormat - The message ID format to use. May not be null.@Nonnull public String getMessageIDFormat()
null. It defaults
to "ph-OpenAS2-$date.ddMMuuuuHHmmssZ$-$rand.1234$@$msg.sender.as2_id$_$msg.receiver.as2_id$".DEFAULT_MESSAGE_ID_FORMAT,
setMessageIDFormat(String)@Nonnull public AS2ClientSettings setRetryCount(int nRetryCount)
nRetryCount - Sending retry count. Values ≤ 0 mean "no retry".getRetryCount()public int getRetryCount()
DEFAULT_RETRY_COUNT.setRetryCount(int)@Nonnull public AS2ClientSettings setConnectTimeoutMS(int nConnectTimeoutMS)
nConnectTimeoutMS - Connect timeout milliseconds.getConnectTimeoutMS()public int getConnectTimeoutMS()
DEFAULT_CONNECT_TIMEOUT_MS.@Nonnull public AS2ClientSettings setReadTimeoutMS(int nReadTimeoutMS)
nReadTimeoutMS - Read timeout milliseconds.getReadTimeoutMS()public int getReadTimeoutMS()
DEFAULT_READ_TIMEOUT_MS.@Nonnull @ReturnsMutableObject public com.helger.commons.http.HttpHeaderMap customHeaders()
null.public boolean isLargeFileSupport()
@Nonnull public AS2ClientSettings setLargeFileSupport(boolean bLargeFileSupport)
bLargeFileSupport - true to enable support for large files, i.e. avoid
holding all file in memoryCopyright © 2013–2019 Philip Helger. All rights reserved.