@NotThreadSafe public class AS2Session extends Object implements IAS2Session
IAS2Session| Modifier and Type | Field and Description |
|---|---|
static String |
COMPONENT_ID_CERTIFICATE_FACTORY |
static String |
COMPONENT_ID_MESSAGE_PROCESSOR |
static String |
COMPONENT_ID_PARTNERSHIP_FACTORY |
static boolean |
DEFAULT_CRYPTO_SIGN_INCLUDE_CERTIFICATE_IN_BODY_PART |
static boolean |
DEFAULT_CRYPTO_VERIFY_USE_CERTIFICATE_IN_BODY_PART |
| Constructor and Description |
|---|
AS2Session()
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
addComponent(String sComponentID,
IDynamicComponent aComponent)
Registers a component to a specified ID.
|
protected com.helger.commons.collection.impl.ICommonsMap<String,IDynamicComponent> |
components()
All modifications done here, have impact on the whole session
|
com.helger.commons.collection.impl.ICommonsMap<String,IDynamicComponent> |
getAllComponents()
Return a map of component ID's to
Component objects. |
String |
getAS2VersionID() |
ICertificateFactory |
getCertificateFactory()
Short-cut method to retrieve a certificate factory.
|
IDynamicComponent |
getComponent(String sComponentID)
Gets the
Component currently registered with an ID |
Proxy |
getHttpProxy()
Get the optional HTTP/HTTPS proxy settings to be used for sending AS2
messages and asynchronous MDNs.
|
IMessageProcessor |
getMessageProcessor()
Short-cut method to retrieve a processor.
|
IPartnershipFactory |
getPartnershipFactory()
Short-cut method to retrieve a partner factory.
|
boolean |
isCryptoSignIncludeCertificateInBodyPart() |
boolean |
isCryptoVerifyUseCertificateInBodyPart() |
static void |
makeAS2CommandMapChanges() |
void |
resetToDefault() |
void |
setAS2VersionID(String sAS2Version) |
void |
setCertificateFactory(ICertificateFactory aCertFactory) |
void |
setCryptoSignIncludeCertificateInBodyPart(boolean bCryptoSignIncludeCertificateInBodyPart)
Settings flag, whether a the signing certificate should be included in the
signed MIME body part or not.
|
void |
setCryptoVerifyUseCertificateInBodyPart(boolean bCryptoVerifyUseCertificateInBodyPart)
Settings flag, whether a contained certificate is used for message
verification.
|
void |
setHttpProxy(Proxy aHttpProxy)
Set the optional HTTP/HTTPS proxy settings to be used for sending AS2
messages and asynchronous MDNs.
|
void |
setMessageProcessor(IMessageProcessor aMsgProcessor) |
void |
setPartnershipFactory(IPartnershipFactory aPartnershipFactory) |
String |
toString() |
public static final String COMPONENT_ID_CERTIFICATE_FACTORY
public static final String COMPONENT_ID_PARTNERSHIP_FACTORY
public static final String COMPONENT_ID_MESSAGE_PROCESSOR
public static final boolean DEFAULT_CRYPTO_SIGN_INCLUDE_CERTIFICATE_IN_BODY_PART
public static final boolean DEFAULT_CRYPTO_VERIFY_USE_CERTIFICATE_IN_BODY_PART
public static void makeAS2CommandMapChanges()
public final void addComponent(@Nonnull @Nonempty String sComponentID, @Nonnull IDynamicComponent aComponent) throws AS2ComponentDuplicateException
IAS2SessionaddComponent in interface IAS2SessionsComponentID - registers the component to this IDaComponent - component to registerAS2ComponentDuplicateException - In case a component with the same ID is already presentIDynamicComponentpublic void setCertificateFactory(@Nonnull ICertificateFactory aCertFactory) throws AS2ComponentDuplicateException
AS2ComponentDuplicateExceptionpublic void setPartnershipFactory(@Nonnull IPartnershipFactory aPartnershipFactory) throws AS2ComponentDuplicateException
AS2ComponentDuplicateExceptionpublic void setMessageProcessor(@Nonnull IMessageProcessor aMsgProcessor) throws AS2ComponentDuplicateException
AS2ComponentDuplicateException@Nonnull public final IDynamicComponent getComponent(@Nonnull @Nonempty String sComponentID) throws AS2ComponentNotFoundException
IAS2SessionComponent currently registered with an IDgetComponent in interface IAS2SessionsComponentID - ID to search fornull.AS2ComponentNotFoundException - If a component is not registered with the ID@Nonnull @ReturnsMutableObject protected final com.helger.commons.collection.impl.ICommonsMap<String,IDynamicComponent> components()
null handle with care.@Nonnull @ReturnsMutableCopy public final com.helger.commons.collection.impl.ICommonsMap<String,IDynamicComponent> getAllComponents()
IAS2SessionComponent objects.getAllComponents in interface IAS2Session@Nonnull public final ICertificateFactory getCertificateFactory() throws AS2ComponentNotFoundException
IAS2SessiongetCertificateFactory in interface IAS2SessionCertificateFactory componentAS2ComponentNotFoundException - If a CertificateFactory component has not been
registeredICertificateFactory,
IDynamicComponent@Nonnull public final IPartnershipFactory getPartnershipFactory() throws AS2ComponentNotFoundException
IAS2SessiongetPartnershipFactory in interface IAS2SessionPartnerFactory componentAS2ComponentNotFoundException - If a PartnerFactory component has not been registeredIPartnershipFactory,
IDynamicComponent@Nonnull public final IMessageProcessor getMessageProcessor() throws AS2ComponentNotFoundException
IAS2SessiongetMessageProcessor in interface IAS2SessionProcessor componentAS2ComponentNotFoundException - If a Processor component has not been registeredIMessageProcessor,
IDynamicComponentpublic final boolean isCryptoSignIncludeCertificateInBodyPart()
isCryptoSignIncludeCertificateInBodyPart in interface IAS2Sessiontrue if the certificate used for signing a message
should be included in the signed MIME body part or not. Defaults to
true.IAS2Session.setCryptoSignIncludeCertificateInBodyPart(boolean)public final void setCryptoSignIncludeCertificateInBodyPart(boolean bCryptoSignIncludeCertificateInBodyPart)
IAS2SessionsetCryptoSignIncludeCertificateInBodyPart in interface IAS2SessionbCryptoSignIncludeCertificateInBodyPart - true to include the signing certificate in the signed
MIME body part, false to not do so.IAS2Session.isCryptoSignIncludeCertificateInBodyPart()public final boolean isCryptoVerifyUseCertificateInBodyPart()
isCryptoVerifyUseCertificateInBodyPart in interface IAS2Sessiontrue if any certificate passed in a message body is
used for certificate verification or false if only the
certificate present in the partnership factory is to be used.
Defaults to true.IAS2Session.setCryptoVerifyUseCertificateInBodyPart(boolean)public final void setCryptoVerifyUseCertificateInBodyPart(boolean bCryptoVerifyUseCertificateInBodyPart)
IAS2SessionsetCryptoVerifyUseCertificateInBodyPart in interface IAS2SessionbCryptoVerifyUseCertificateInBodyPart - true if any certificate passed in a message body is
used for certificate verification or false if only the
certificate present in the partnership factory is to be used.IAS2Session.isCryptoVerifyUseCertificateInBodyPart()@Nullable public final Proxy getHttpProxy()
IAS2SessiongetHttpProxy in interface IAS2Sessionnull.IAS2Session.setHttpProxy(Proxy)public final void setHttpProxy(@Nullable Proxy aHttpProxy)
IAS2SessionsetHttpProxy in interface IAS2SessionaHttpProxy - The HTTP/HTTPS proxy object to be used. May be null.IAS2Session.getHttpProxy()@Nonnull @Nonempty public final String getAS2VersionID()
getAS2VersionID in interface IAS2SessionCAS2Header.DEFAULT_AS2_VERSION.
Neither null nor empty.public final void setAS2VersionID(@Nonnull @Nonempty String sAS2Version)
setAS2VersionID in interface IAS2SessionsAS2Version - Set the AS2 version to use. May neither be null nor
empty.@OverridingMethodsMustInvokeSuper public void resetToDefault()
Copyright © 2013–2022 Philip Helger. All rights reserved.