Package com.helger.as2lib.session
Class AS2Session
java.lang.Object
com.helger.as2lib.session.AS2Session
- All Implemented Interfaces:
IAS2Session
Default implementation of
IAS2Session
- Author:
- Philip Helger
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal void
addComponent
(String sComponentID, IDynamicComponent aComponent) Registers a component to a specified ID.protected final com.helger.commons.collection.impl.ICommonsMap<String,
IDynamicComponent> All modifications done here, have impact on the whole sessionfinal com.helger.commons.collection.impl.ICommonsMap<String,
IDynamicComponent> Return a map of component ID's toComponent
objects.final String
final ICertificateFactory
Short-cut method to retrieve a certificate factory.final IDynamicComponent
getComponent
(String sComponentID) Gets theComponent
currently registered with an IDfinal Proxy
Get the optional HTTP/HTTPS proxy settings to be used for sending AS2 messages and asynchronous MDNs.final IMessageProcessor
Short-cut method to retrieve a processor.final IPartnershipFactory
Short-cut method to retrieve a partner factory.final boolean
final boolean
static void
void
final void
setAS2VersionID
(String sAS2Version) void
setCertificateFactory
(ICertificateFactory aCertFactory) final void
setCryptoSignIncludeCertificateInBodyPart
(boolean bCryptoSignIncludeCertificateInBodyPart) Settings flag, whether a the signing certificate should be included in the signed MIME body part or not.final void
setCryptoVerifyUseCertificateInBodyPart
(boolean bCryptoVerifyUseCertificateInBodyPart) Settings flag, whether a contained certificate is used for message verification.final 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) toString()
-
Field Details
-
COMPONENT_ID_CERTIFICATE_FACTORY
- See Also:
-
COMPONENT_ID_PARTNERSHIP_FACTORY
- See Also:
-
COMPONENT_ID_MESSAGE_PROCESSOR
- See Also:
-
DEFAULT_CRYPTO_SIGN_INCLUDE_CERTIFICATE_IN_BODY_PART
public static final boolean DEFAULT_CRYPTO_SIGN_INCLUDE_CERTIFICATE_IN_BODY_PART- See Also:
-
DEFAULT_CRYPTO_VERIFY_USE_CERTIFICATE_IN_BODY_PART
public static final boolean DEFAULT_CRYPTO_VERIFY_USE_CERTIFICATE_IN_BODY_PART- See Also:
-
-
Constructor Details
-
AS2Session
public AS2Session()Constructor
-
-
Method Details
-
makeAS2CommandMapChanges
public static void makeAS2CommandMapChanges() -
addComponent
public final void addComponent(@Nonnull @Nonempty String sComponentID, @Nonnull IDynamicComponent aComponent) throws AS2ComponentDuplicateException Description copied from interface:IAS2Session
Registers a component to a specified ID.- Specified by:
addComponent
in interfaceIAS2Session
- Parameters:
sComponentID
- registers the component to this IDaComponent
- component to register- Throws:
AS2ComponentDuplicateException
- In case a component with the same ID is already present- See Also:
-
setCertificateFactory
public void setCertificateFactory(@Nonnull ICertificateFactory aCertFactory) throws AS2ComponentDuplicateException - Throws:
AS2ComponentDuplicateException
-
setPartnershipFactory
public void setPartnershipFactory(@Nonnull IPartnershipFactory aPartnershipFactory) throws AS2ComponentDuplicateException - Throws:
AS2ComponentDuplicateException
-
setMessageProcessor
public void setMessageProcessor(@Nonnull IMessageProcessor aMsgProcessor) throws AS2ComponentDuplicateException - Throws:
AS2ComponentDuplicateException
-
getComponent
@Nonnull public final IDynamicComponent getComponent(@Nonnull @Nonempty String sComponentID) throws AS2ComponentNotFoundException Description copied from interface:IAS2Session
Gets theComponent
currently registered with an ID- Specified by:
getComponent
in interfaceIAS2Session
- Parameters:
sComponentID
- ID to search for- Returns:
- the component registered to the ID and never
null
. - Throws:
AS2ComponentNotFoundException
- If a component is not registered with the ID
-
components
@Nonnull @ReturnsMutableObject protected final com.helger.commons.collection.impl.ICommonsMap<String,IDynamicComponent> components()All modifications done here, have impact on the whole session- Returns:
- The mutual component map. Never
null
handle with care.
-
getAllComponents
@Nonnull @ReturnsMutableCopy public final com.helger.commons.collection.impl.ICommonsMap<String,IDynamicComponent> getAllComponents()Description copied from interface:IAS2Session
Return a map of component ID's toComponent
objects.- Specified by:
getAllComponents
in interfaceIAS2Session
- Returns:
- all registered components, mapped by ID
-
getCertificateFactory
@Nonnull public final ICertificateFactory getCertificateFactory() throws AS2ComponentNotFoundExceptionDescription copied from interface:IAS2Session
Short-cut method to retrieve a certificate factory.- Specified by:
getCertificateFactory
in interfaceIAS2Session
- Returns:
- the currently registered
CertificateFactory
component - Throws:
AS2ComponentNotFoundException
- If aCertificateFactory
component has not been registered- See Also:
-
getPartnershipFactory
@Nonnull public final IPartnershipFactory getPartnershipFactory() throws AS2ComponentNotFoundExceptionDescription copied from interface:IAS2Session
Short-cut method to retrieve a partner factory.- Specified by:
getPartnershipFactory
in interfaceIAS2Session
- Returns:
- the currently registered
PartnerFactory
component - Throws:
AS2ComponentNotFoundException
- If aPartnerFactory
component has not been registered- See Also:
-
getMessageProcessor
Description copied from interface:IAS2Session
Short-cut method to retrieve a processor.- Specified by:
getMessageProcessor
in interfaceIAS2Session
- Returns:
- the currently registered
Processor
component - Throws:
AS2ComponentNotFoundException
- If aProcessor
component has not been registered- See Also:
-
isCryptoSignIncludeCertificateInBodyPart
public final boolean isCryptoSignIncludeCertificateInBodyPart()- Specified by:
isCryptoSignIncludeCertificateInBodyPart
in interfaceIAS2Session
- Returns:
true
if the certificate used for signing a message should be included in the signed MIME body part or not. Defaults totrue
.- See Also:
-
setCryptoSignIncludeCertificateInBodyPart
public final void setCryptoSignIncludeCertificateInBodyPart(boolean bCryptoSignIncludeCertificateInBodyPart) Description copied from interface:IAS2Session
Settings flag, whether a the signing certificate should be included in the signed MIME body part or not.- Specified by:
setCryptoSignIncludeCertificateInBodyPart
in interfaceIAS2Session
- Parameters:
bCryptoSignIncludeCertificateInBodyPart
-true
to include the signing certificate in the signed MIME body part,false
to not do so.- See Also:
-
isCryptoVerifyUseCertificateInBodyPart
public final boolean isCryptoVerifyUseCertificateInBodyPart()- Specified by:
isCryptoVerifyUseCertificateInBodyPart
in interfaceIAS2Session
- Returns:
true
if any certificate passed in a message body is used for certificate verification orfalse
if only the certificate present in the partnership factory is to be used. Defaults totrue
.- See Also:
-
setCryptoVerifyUseCertificateInBodyPart
public final void setCryptoVerifyUseCertificateInBodyPart(boolean bCryptoVerifyUseCertificateInBodyPart) Description copied from interface:IAS2Session
Settings flag, whether a contained certificate is used for message verification.- Specified by:
setCryptoVerifyUseCertificateInBodyPart
in interfaceIAS2Session
- Parameters:
bCryptoVerifyUseCertificateInBodyPart
-true
if any certificate passed in a message body is used for certificate verification orfalse
if only the certificate present in the partnership factory is to be used.- See Also:
-
getHttpProxy
Description copied from interface:IAS2Session
Get the optional HTTP/HTTPS proxy settings to be used for sending AS2 messages and asynchronous MDNs.- Specified by:
getHttpProxy
in interfaceIAS2Session
- Returns:
- The HTTP/HTTPS proxy object to be used. May be
null
. - See Also:
-
setHttpProxy
Description copied from interface:IAS2Session
Set the optional HTTP/HTTPS proxy settings to be used for sending AS2 messages and asynchronous MDNs.- Specified by:
setHttpProxy
in interfaceIAS2Session
- Parameters:
aHttpProxy
- The HTTP/HTTPS proxy object to be used. May benull
.- See Also:
-
getAS2VersionID
- Specified by:
getAS2VersionID
in interfaceIAS2Session
- Returns:
- The AS2 version to use. The default is
CAS2Header.DEFAULT_AS2_VERSION
. Neithernull
nor empty.
-
setAS2VersionID
- Specified by:
setAS2VersionID
in interfaceIAS2Session
- Parameters:
sAS2Version
- Set the AS2 version to use. May neither benull
nor empty.
-
resetToDefault
-
toString
-