Class SelfFillingPartnershipFactory

All Implemented Interfaces:
IDynamicComponent, IPartnershipFactory

public class SelfFillingPartnershipFactory extends AbstractPartnershipFactory
A special in-memory partnership factory that adds a partnership if it is not existing yet.
Author:
Philip Helger
  • Constructor Details

    • SelfFillingPartnershipFactory

      public SelfFillingPartnershipFactory()
  • Method Details

    • ensureUsablePartnership

      public static void ensureUsablePartnership(@Nonnull Partnership aPartnership)
      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. Never null.
      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 interface IPartnershipFactory
      Overrides:
      getPartnership in class AbstractPartnershipFactory
      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.