Interface IPartnershipFactory

All Superinterfaces:
IDynamicComponent
All Known Subinterfaces:
IPartnershipFactoryWithPartners, IRefreshablePartnershipFactory
All Known Implementing Classes:
AbstractPartnershipFactory, AbstractPartnershipFactoryWithPartners, SelfFillingPartnershipFactory, SelfFillingXMLPartnershipFactory, XMLPartnershipFactory

public interface IPartnershipFactory extends IDynamicComponent
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 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 be null. 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

      @Nonnull Partnership getPartnership(@Nonnull Partnership aPartnership) throws AS2Exception
      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

      @Nullable Partnership getPartnershipByName(@Nullable String sName)
      Find an existing partnership by its name.
      Parameters:
      sName - The partnership name to be looked up. May be null.
      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

      void updatePartnership(@Nonnull IMessage aMsg, boolean bOverwrite) throws AS2Exception
      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 be null 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

      void updatePartnership(@Nonnull IMessageMDN aMdn, boolean bOverwrite) throws AS2Exception
      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 be null 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: