Package com.helger.as2lib.partner
Interface IPartnershipFactory
- All Superinterfaces:
IDynamicComponent
- All Known Subinterfaces:
IPartnershipFactoryWithPartners
,IRefreshablePartnershipFactory
- All Known Implementing Classes:
AbstractPartnershipFactory
,AbstractPartnershipFactoryWithPartners
,SelfFillingPartnershipFactory
,SelfFillingXMLPartnershipFactory
,XMLPartnershipFactory
This is the base interface for a partnership factory (it is more manager but
who cares). It consists of partnerships represented by
Partnership
objects.- Author:
- original author unknown, joseph mcverry, Philip Helger
-
Method Summary
Modifier and TypeMethodDescriptioncom.helger.commons.state.EChange
addPartnership
(Partnership aPartnership) Add a partnership.com.helger.commons.collection.impl.ICommonsSet<String>
com.helger.commons.collection.impl.ICommonsList<Partnership>
getPartnership
(Partnership aPartnership) Get the partnership identified by the provided stub partnership.getPartnershipByName
(String sName) Find an existing partnership by its name.com.helger.commons.state.EChange
removePartnership
(Partnership aPartnership) Remove the specified partnership.void
updatePartnership
(IMessageMDN aMdn, boolean bOverwrite) Looks up and fills in any header info for a specific MDN's partnershipvoid
updatePartnership
(IMessage aMsg, boolean bOverwrite) Looks up and fills in any header info for a specific msg's partnership.Methods inherited from interface com.helger.as2lib.IDynamicComponent
attrs, getName, getSession, initDynamicComponent
-
Method Details
-
addPartnership
@Nonnull com.helger.commons.state.EChange addPartnership(@Nonnull Partnership aPartnership) throws AS2Exception Add a partnership.- Parameters:
aPartnership
- The partnership to be added. May not benull
. The name of the partnership must be unique so that it gets added.- Returns:
EChange.CHANGED
if adding was successfully,EChange.UNCHANGED
if the name is already contained.- Throws:
AS2Exception
- Generic error
-
removePartnership
@Nonnull com.helger.commons.state.EChange removePartnership(@Nonnull Partnership aPartnership) throws AS2Exception Remove the specified partnership.- Parameters:
aPartnership
- The partnership to be removed.- Returns:
EChange.CHANGED
if removal was successful,EChange.UNCHANGED
if no such partnership to be removed is present.- Throws:
AS2Exception
- Generic error
-
getPartnership
Get the partnership identified by the provided stub partnership.- 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.
-
getPartnershipByName
Find an existing partnership by its name.- Parameters:
sName
- The partnership name to be looked up. May benull
.- Returns:
null
if no such partnership exists.
-
getAllPartnershipNames
@Nonnull @ReturnsMutableCopy com.helger.commons.collection.impl.ICommonsSet<String> getAllPartnershipNames()- Returns:
- A set with all contained partnership names. Never
null
but maybe empty.
-
getAllPartnerships
@Nonnull @ReturnsMutableCopy com.helger.commons.collection.impl.ICommonsList<Partnership> getAllPartnerships()- Returns:
- A list of all contained partnerships. Never
null
but maybe empty.
-
updatePartnership
Looks up and fills in any header info for a specific msg's partnership.- Parameters:
aMsg
- The message in which the partnership should be updated. May not benull
and must already contain a partnership with at least name or sender and receiver IDs.bOverwrite
-true
to also set the subject of the message with the subject stored in the partnership.- Throws:
AS2Exception
- In case of an error- See Also:
-
updatePartnership
Looks up and fills in any header info for a specific MDN's partnership- Parameters:
aMdn
- The MDN of which the partnership information should be updated. May not benull
and must already contain a partnership with at least name or sender and receiver IDs.bOverwrite
- has no effect currently- Throws:
AS2Exception
- In case of an error- See Also:
-