Class Partner

java.lang.Object
org.kopi.ebics.client.Partner
All Implemented Interfaces:
EbicsPartner, Savable

public class Partner extends Object implements EbicsPartner, Savable
Simple implementation of an EBICS customer. This object is not serializable, but it should be persisted every time it needs to be saved. Persistence is achieved via save(ObjectOutputStream) and the matching constructor.
  • Constructor Details

    • Partner

      public Partner(EbicsBank bank, ObjectInputStream ois) throws IOException
      Reconstructs a persisted EBICS customer.
      Parameters:
      bank - the bank
      ois - the stream object
      Throws:
      IOException
    • Partner

      public Partner(EbicsBank bank, String partnerId)
      First time constructor.
      Parameters:
      bank - the bank
      partnerId - the partner ID
  • Method Details

    • getNextOrderId

      public Integer getNextOrderId()
      Returns the next order available ID
      Returns:
      the next order ID
    • setOrderId

      public void setOrderId(Integer orderId)
      Sets the order ID
      Parameters:
      orderId - the order ID
    • save

      public void save(ObjectOutputStream oos) throws IOException
      Description copied from interface: Savable
      Writes all persistable attributes to the given stream.
      Specified by:
      save in interface Savable
      Parameters:
      oos - the given stream.
      Throws:
      IOException - save process failed
    • needsSave

      public boolean needsSave()
      Did any persistable attribute change since last load/save operation.
      Returns:
      True if the object needs to be saved.
    • getBank

      public EbicsBank getBank()
      Description copied from interface: EbicsPartner
      Returns the bank we are customer of.
      Specified by:
      getBank in interface EbicsPartner
      Returns:
      the bank we are customer of
    • getPartnerId

      public String getPartnerId()
      Description copied from interface: EbicsPartner
      Returns the customers id at the bank.
      Specified by:
      getPartnerId in interface EbicsPartner
      Returns:
      the customers id at the bank.
    • nextOrderId

      public String nextOrderId()
      In EBICS XSD schema - ebics_types.xsd, The order ID pattern is defined as following: pattern value="[A-Z][A-Z0-9]{3}".

      This means that the order ID should start with a letter followed by three alphanumeric characters.

      The nextOrderId() aims to generate orders from A000 to ZZZZ. The sequence cycle is performed infinitely.

      The order index orderId is saved whenever it changes.

      Specified by:
      nextOrderId in interface EbicsPartner
      Returns:
      the next order number.
    • getSaveName

      public String getSaveName()
      Description copied from interface: Savable
      Returns the save name of this savable object.
      Specified by:
      getSaveName in interface Savable
      Returns:
      the save name