Package com.helger.as2lib.partner.xml
Class AbstractPartnershipFactoryWithPartners
java.lang.Object
com.helger.as2lib.AbstractDynamicComponent
com.helger.as2lib.partner.AbstractPartnershipFactory
com.helger.as2lib.partner.xml.AbstractPartnershipFactoryWithPartners
- All Implemented Interfaces:
IDynamicComponent
,IPartnershipFactory
,IPartnershipFactoryWithPartners
- Direct Known Subclasses:
XMLPartnershipFactory
@ThreadSafe
public abstract class AbstractPartnershipFactoryWithPartners
extends AbstractPartnershipFactory
implements IPartnershipFactoryWithPartners
Abstract
IPartnershipFactoryWithPartners
implementation based on
AbstractPartnershipFactory
using PartnerMap
as the underlying
data storage object for the partners.- Author:
- Philip Helger
-
Field Summary
Fields inherited from class com.helger.as2lib.AbstractDynamicComponent
m_aRWLock
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addPartner
(Partner aNewPartner) Add a partner.boolean
com.helger.commons.collection.impl.ICommonsSet<String>
com.helger.commons.collection.impl.ICommonsList<Partner>
getPartnerOfName
(String sPartnerName) Get all the partner data of the partner with the given name.int
hashCode()
com.helger.commons.state.EChange
removePartner
(String sPartnerName) Remove a partner.protected final void
setPartners
(PartnerMap aPartners) Methods inherited from class com.helger.as2lib.partner.AbstractPartnershipFactory
addPartnership, getAllPartnershipNames, getAllPartnerships, getPartnership, getPartnershipByName, getPartnershipMap, 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
Methods inherited from interface com.helger.as2lib.partner.IPartnershipFactory
addPartnership, getAllPartnershipNames, getAllPartnerships, getPartnership, getPartnershipByName, removePartnership, updatePartnership, updatePartnership
-
Constructor Details
-
AbstractPartnershipFactoryWithPartners
public AbstractPartnershipFactoryWithPartners()
-
-
Method Details
-
setPartners
- Throws:
AS2Exception
-
addPartner
Description copied from interface:IPartnershipFactoryWithPartners
Add a partner.- Specified by:
addPartner
in interfaceIPartnershipFactoryWithPartners
- Parameters:
aNewPartner
- The partner data to be used. May not benull
.- Throws:
AS2Exception
- Generic error
-
removePartner
@Nonnull public com.helger.commons.state.EChange removePartner(@Nullable String sPartnerName) throws AS2Exception Description copied from interface:IPartnershipFactoryWithPartners
Remove a partner.- Specified by:
removePartner
in interfaceIPartnershipFactoryWithPartners
- Parameters:
sPartnerName
- The name of the partner to be removed.- Returns:
EChange.CHANGED
if the partner was successfully removed,EChange.UNCHANGED
if no such partner exists.- Throws:
AS2Exception
- Generic error
-
getPartnerOfName
Description copied from interface:IPartnershipFactoryWithPartners
Get all the partner data of the partner with the given name.- Specified by:
getPartnerOfName
in interfaceIPartnershipFactoryWithPartners
- Parameters:
sPartnerName
- Partner name to search. May benull
.- Returns:
null
if no such partner exists.
-
getAllPartnerNames
@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsSet<String> getAllPartnerNames()- Specified by:
getAllPartnerNames
in interfaceIPartnershipFactoryWithPartners
- Returns:
- A set with all contained partner names. Never
null
but maybe empty.
-
getAllPartners
@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsList<Partner> getAllPartners()- Specified by:
getAllPartners
in interfaceIPartnershipFactoryWithPartners
- Returns:
- An (unordered) list of all contained partner data.
-
getPartnerMap
-
equals
- Overrides:
equals
in classAbstractPartnershipFactory
-
hashCode
public int hashCode()- Overrides:
hashCode
in classAbstractPartnershipFactory
-