Package com.helger.as2lib.partner.xml
Class XMLPartnershipFactory
java.lang.Object
com.helger.as2lib.AbstractDynamicComponent
com.helger.as2lib.partner.AbstractPartnershipFactory
com.helger.as2lib.partner.xml.AbstractPartnershipFactoryWithPartners
com.helger.as2lib.partner.xml.XMLPartnershipFactory
- All Implemented Interfaces:
IDynamicComponent
,IPartnershipFactory
,IRefreshablePartnershipFactory
,IPartnershipFactoryWithPartners
- Direct Known Subclasses:
SelfFillingXMLPartnershipFactory
public class XMLPartnershipFactory
extends AbstractPartnershipFactoryWithPartners
implements IRefreshablePartnershipFactory
original author unknown this release added logic to store partnerships and
provide methods for partner/partnership command line processor
- Author:
- joseph mcverry
-
Field Summary
Fields inherited from class com.helger.as2lib.AbstractDynamicComponent
m_aRWLock
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
initDynamicComponent
(IAS2Session session, com.helger.commons.collection.attr.IStringMap parameters) After creating a Component object, this method should be called to set any parameters used by the component.boolean
protected void
load
(InputStream aIS) loadPartner
(com.helger.xml.microdom.IMicroElement ePartner) protected void
loadPartnerIDs
(com.helger.xml.microdom.IMicroElement ePartnership, IPartnerMap aAllPartners, Partnership aPartnership, boolean bIsSender) loadPartnership
(com.helger.xml.microdom.IMicroElement ePartnership, IPartnerMap aAllPartners) protected void
loadPartnershipAttributes
(com.helger.xml.microdom.IMicroElement aNode, Partnership aPartnership) void
Refresh the partnership factory.void
setDisableBackup
(boolean bDisableBackup) void
setFilename
(String filename) void
Store the current status of the partnerships to a file.Methods inherited from class com.helger.as2lib.partner.xml.AbstractPartnershipFactoryWithPartners
addPartner, equals, getAllPartnerNames, getAllPartners, getPartnerMap, getPartnerOfName, hashCode, removePartner, setPartners
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
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
Methods inherited from interface com.helger.as2lib.partner.IPartnershipFactory
addPartnership, getAllPartnershipNames, getAllPartnerships, getPartnership, getPartnershipByName, removePartnership, updatePartnership, updatePartnership
-
Field Details
-
ATTR_FILENAME
- See Also:
-
ATTR_DISABLE_BACKUP
- See Also:
-
-
Constructor Details
-
XMLPartnershipFactory
public XMLPartnershipFactory()
-
-
Method Details
-
getFilename
- Throws:
AS2InvalidParameterException
-
setFilename
-
isDisableBackup
public boolean isDisableBackup() -
setDisableBackup
public void setDisableBackup(boolean bDisableBackup) -
initDynamicComponent
public void initDynamicComponent(@Nonnull IAS2Session session, @Nullable com.helger.commons.collection.attr.IStringMap parameters) throws AS2Exception Description copied from interface:IDynamicComponent
After creating a Component object, this method should be called to set any parameters used by the component. Component implementations typically have required parameter checking and code to start timers and threads within this method.- Specified by:
initDynamicComponent
in interfaceIDynamicComponent
- Overrides:
initDynamicComponent
in classAbstractDynamicComponent
- Parameters:
session
- the component uses this object to access other componentsparameters
- configuration values for the component. All parameters will be stored as attributes of this component. All attributes existing before this method is called will be removed!- Throws:
AS2Exception
- If an error occurs while initializing the componentAS2InvalidParameterException
- If a required parameter is null in the parameters Map- See Also:
-
refreshPartnershipFactory
Description copied from interface:IRefreshablePartnershipFactory
Refresh the partnership factory.- Specified by:
refreshPartnershipFactory
in interfaceIRefreshablePartnershipFactory
- Throws:
AS2Exception
- On error
-
load
- Throws:
AS2Exception
-
loadPartnershipAttributes
protected void loadPartnershipAttributes(@Nonnull com.helger.xml.microdom.IMicroElement aNode, @Nonnull Partnership aPartnership) throws AS2Exception - Throws:
AS2Exception
-
loadPartner
@Nonnull public Partner loadPartner(@Nonnull com.helger.xml.microdom.IMicroElement ePartner) throws AS2Exception - Throws:
AS2Exception
-
loadPartnerIDs
protected void loadPartnerIDs(@Nonnull com.helger.xml.microdom.IMicroElement ePartnership, @Nonnull IPartnerMap aAllPartners, @Nonnull Partnership aPartnership, boolean bIsSender) throws AS2Exception - Throws:
AS2Exception
-
loadPartnership
@Nonnull public Partnership loadPartnership(@Nonnull com.helger.xml.microdom.IMicroElement ePartnership, @Nonnull IPartnerMap aAllPartners) throws AS2Exception - Throws:
AS2Exception
-
storePartnership
Store the current status of the partnerships to a file.- Throws:
AS2Exception
- In case of an error
-