Package com.helger.as2lib.partner
Class SelfFillingPartnershipFactory
java.lang.Object
com.helger.as2lib.AbstractDynamicComponent
com.helger.as2lib.partner.AbstractPartnershipFactory
com.helger.as2lib.partner.SelfFillingPartnershipFactory
- All Implemented Interfaces:
IDynamicComponent
,IPartnershipFactory
A special in-memory partnership factory that adds a partnership if it is not
existing yet.
- Author:
- Philip Helger
-
Field Summary
Fields inherited from class com.helger.as2lib.AbstractDynamicComponent
m_aRWLock
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
ensureUsablePartnership
(Partnership aPartnership) Ensure that a new partnership is usable.final Partnership
getPartnership
(Partnership aPartnership) Get the partnership identified by the provided stub partnership.protected void
onBeforeAddPartnership
(Partnership aPartnership) Callback method that is invoked every time a new partnership is automatically added.Methods inherited from class com.helger.as2lib.partner.AbstractPartnershipFactory
addPartnership, equals, getAllPartnershipNames, getAllPartnerships, getPartnershipByName, getPartnershipMap, hashCode, markAsChanged, removePartnership, setPartnerships, toString, updatePartnership, updatePartnership
Methods inherited from class com.helger.as2lib.AbstractDynamicComponent
attrs, getAttributeAsIntRequired, getAttributeAsStringRequired, getName, getSession, initDynamicComponent
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.helger.as2lib.IDynamicComponent
attrs, getName, getSession, initDynamicComponent
-
Constructor Details
-
SelfFillingPartnershipFactory
public SelfFillingPartnershipFactory()
-
-
Method Details
-
ensureUsablePartnership
Ensure that a new partnership is usable. It ensure the following properties present:- Sender X509 alias
- Receiver X509 alias
- Unique name
- Fallback signing algorithm SHA_1
- Parameters:
aPartnership
- The partnership to be used.
-
onBeforeAddPartnership
@OverrideOnDemand @OverridingMethodsMustInvokeSuper protected void onBeforeAddPartnership(@Nonnull Partnership aPartnership) throws AS2Exception Callback method that is invoked every time a new partnership is automatically added. This method is called BEFORE the main add-process is started.- Parameters:
aPartnership
- The partnership that will be added. Nevernull
.- Throws:
AS2Exception
- In case of an error.
-
getPartnership
@Nonnull public final Partnership getPartnership(@Nonnull Partnership aPartnership) throws AS2Exception Description copied from interface:IPartnershipFactory
Get the partnership identified by the provided stub partnership.- Specified by:
getPartnership
in interfaceIPartnershipFactory
- Overrides:
getPartnership
in classAbstractPartnershipFactory
- Parameters:
aPartnership
- Stub partnership which must contain either a name or a set of sender and receiver IDs.- Returns:
- The Partnership as stored in this factory. Never
null
. - Throws:
AS2Exception
- If no partnership matching the provided stub partnership can be found.
-