Class ISOMsg

All Implemented Interfaces:
Externalizable, Serializable, Cloneable, Loggeable
Direct Known Subclasses:
FSDISOMsg, ISOMsgRef.Ref, ISOVMsg

public class ISOMsg extends ISOComponent implements Cloneable, Loggeable, Externalizable
implements Composite within a Composite pattern
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected int
    Message direction: INCOMING or OUTGOING.
    protected boolean
    Dirty flags for tracking state changes.
    protected int
    Field number of this message when nested inside another ISOMsg.
    protected Map<Integer,Object>
    Map of field number to field value.
    protected ISOHeader
    Optional ISO header for this message.
    static final int
    Constant indicating an incoming message direction.
    protected int
    Highest field number currently set in this message.
    protected boolean
    Dirty flags for tracking state changes.
    static final int
    Constant indicating an outgoing message direction.
    protected ISOPackager
    The packager used to pack/unpack this message.
    protected byte[]
    Optional trailer bytes appended to the packed message.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an ISOMsg
    ISOMsg(int fieldNumber)
    Creates a nested ISOMsg
    Creates an ISOMsg with given mti
  • Method Summary

    Modifier and Type
    Method
    Description
     
    clone(int... fields)
    Partially clone an ISOMsg
    clone(String... fpaths)
    Partially clone an ISOMsg by field paths
    void
    dump(PrintStream p, String indent)
    dump the message to a PrintStream.
    byte[]
    getBytes(int fldno)
    Return the byte[] value associated with the given ISOField number
    byte[]
    Return the String value associated with the given field path
    clone fields
    getComponent(int fldno)
    get the component associated with the given field number
    get the component associated with the given field number
    In order to interchange Composites and Leafs we use getComposite().
    int
    Returns the message direction.
    int
    Returns the field number this component occupies within its container.
    byte[]
    get optional message header image
    Return this messages ISOHeader
    valid on Leafs only.
    int
    Returns the highest field number present in this message.
    Returns the message type indicator.
    Returns the packager associated with this message.
    Returns the associated ISOSource (e.g.
    getString(int fldno)
    Return the String value associated with the given ISOField number
    Return the String value associated with the given field path
    byte[]
    Get optional trailer image.
    Returns this message itself as its value.
    getValue(int fldno)
    Return the object value associated with the given field number
    Return the object value associated with the given field path
    boolean
    hasAny(int[] fields)
    Check if the message has any of these fields
    boolean
    hasAny(String... fields)
    Check if the message has any of these fields
    boolean
    hasField(int fldno)
    Check if a given field is present
    boolean
    Check if a field indicated by a fpath is present
    boolean
    Returns true if this message has at least one field set.
    boolean
    hasFields(int[] fields)
    Check if all fields are present
    boolean
    Returns true if this message has an MTI field (field 0) set.
    boolean
    Returns true if this is an administrative message (MTI second digit = 6).
    boolean
    Returns true if this is an authorization message (MTI second digit = 1).
    boolean
    Returns true if this is a chargeback message (MTI second digit = 4, last digit 2 or 3).
    boolean
    Returns true if this is a fee collection message (MTI second digit = 7).
    boolean
    Returns true if this is a file action message (MTI second digit = 3).
    boolean
    Returns true if this is a financial message (MTI second digit = 2).
    boolean
    Returns true if this message was received from a channel.
    boolean
    Returns true if this is an inner (sub-) message.
    boolean
    Returns true if this is a network management message (MTI second digit = 8).
    boolean
    Returns true if this message is to be sent via a channel.
    boolean
    Returns true if this is a reconciliation message (MTI second digit = 5).
    boolean
    Returns true if the MTI suggests this is a request message.
    boolean
    Returns true if the MTI suggests this is a response message.
    boolean
    Returns true if this is a retransmission (MTI last digit = 1).
    boolean
    Returns true if this is a reversal message (MTI second digit = 4, last digit 0 or 1).
    void
    Merges the content of the specified ISOMsg into this ISOMsg instance, excluding the header.
    void
    merge(ISOMsg m, boolean mergeHeader)
    Merges the content of the specified ISOMsg into this ISOMsg instance.
    void
    move(int oldFieldNumber, int newFieldNumber)
    moves a field (renumber)
    byte[]
    Packs this message using the configured packager.
    protected void
    Deserializes the message direction from the given ObjectInput.
    void
     
    protected void
    Deserializes the message header from the given ObjectInput.
    protected void
    Deserializes the packager from the given ObjectInput.
    void
    setup BitMap
    void
    set(int fldno, byte[] value)
    Creates an ISOBinaryField associated with fldno within this ISOMsg.
    void
    set(int fldno, String value)
    Creates an ISOField associated with fldno within this ISOMsg.
    void
    set(String fpath, byte[] value)
    Creates an ISOField associated with fldno within this ISOMsg.
    void
    set(String fpath, String value)
    Creates an ISOField associated with fldno within this ISOMsg.
    void
    set(String fpath, ISOComponent c)
    Creates an ISOField associated with fldno within this ISOMsg
    void
    Set a field within this message
    void
    setDirection(int direction)
    Sets the direction information related to this message
    void
    setFieldNumber(int fieldNumber)
    changes this Component field number
    Use with care, this method does not change any reference held by a Composite.
    void
    setHeader(byte[] b)
    Sets an optional message header image
    void
    Sets the ISO header for this message.
    void
    Sets the message type indicator.
    void
    Sets the packager used to pack/unpack this message.
    void
    sets an appropriate response MTI.
    void
    sets an appropriate retransmission MTI
    void
    Let this ISOMsg object hold a weak reference to an ISOSource (usually used to carry a reference to the incoming ISOChannel)
    void
    setTrailer(byte[] trailer)
    Sets optional trailer data.
    void
    Don't call setValue on an ISOMsg.
     
    int
    unpack(byte[] b)
    Unpacks the raw byte array into this message.
    void
    Unpacks this component by reading from in.
    void
    unset(int fldno)
    Unset a field if it exists, otherwise ignore.
    void
    unset(int... flds)
    Unsets several fields at once
    void
    unset(String fpath)
    Unset a field referenced by a fpath if it exists, otherwise ignore.
    void
    unset(String... fpaths)
    Unset a a set of fields referenced by fpaths if any ot them exist, otherwise ignore.
    with(int fldno, byte[] value)
    Sets a top-level binary field and returns this message for fluent chaining.
    with(int fldno, String value)
    Sets a top-level character field and returns this message for fluent chaining.
    with(String fpath, byte[] value)
    Sets a binary field by path and returns this message for fluent chaining.
    with(String fpath, String value)
    Sets a character field by path and returns this message for fluent chaining.
    Sets a component by path and returns this message for fluent chaining.
    without(int... flds)
    Unsets one or more top-level fields and returns this message for fluent chaining.
    without(String... fpaths)
    Unsets one or more field paths, including nested composites and dataset elements, and returns this message for fluent chaining.
    protected void
    Serializes the message direction to the given ObjectOutput.
    void
     
    protected void
    Serializes the message header to the given ObjectOutput.
    protected void
    Serializes the packager class name to the given ObjectOutput.

    Methods inherited from class ISOComponent

    getBytes, pack
    Modifier and Type
    Method
    Description
    byte[]
    get Value as bytes (when possible)
    void
    Packs this component and writes it to out.

    Methods inherited from class Object

    equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface Loggeable

    dump
    Modifier and Type
    Method
    Description
    default void
    Dumps a representation of this object using the specified renderer type.
  • Field Details

    • fields

      protected Map<Integer,Object> fields
      Map of field number to field value.
    • maxField

      protected int maxField
      Highest field number currently set in this message.
    • packager

      protected ISOPackager packager
      The packager used to pack/unpack this message.
    • dirty

      protected boolean dirty
      Dirty flags for tracking state changes.
    • maxFieldDirty

      protected boolean maxFieldDirty
      Dirty flags for tracking state changes.
    • direction

      protected int direction
      Message direction: INCOMING or OUTGOING.
    • trailer

      protected byte[] trailer
      Optional trailer bytes appended to the packed message.
    • fieldNumber

      protected int fieldNumber
      Field number of this message when nested inside another ISOMsg.
    • INCOMING

      public static final int INCOMING
      Constant indicating an incoming message direction.
      See Also:
    • OUTGOING

      public static final int OUTGOING
      Constant indicating an outgoing message direction.
      See Also:
  • Constructor Details

    • ISOMsg

      public ISOMsg()
      Creates an ISOMsg
    • ISOMsg

      public ISOMsg(int fieldNumber)
      Creates a nested ISOMsg
      Parameters:
      fieldNumber - (in the outer ISOMsg) of this nested message
    • ISOMsg

      public ISOMsg(String mti)
      Creates an ISOMsg with given mti
      Parameters:
      mti - Msg's MTI
  • Method Details

    • setFieldNumber

      public void setFieldNumber(int fieldNumber)
      changes this Component field number
      Use with care, this method does not change any reference held by a Composite.
      Specified by:
      setFieldNumber in class ISOComponent
      Parameters:
      fieldNumber - new field number
    • setDirection

      public void setDirection(int direction)
      Sets the direction information related to this message
      Parameters:
      direction - can be either ISOMsg.INCOMING or ISOMsg.OUTGOING
    • setHeader

      public void setHeader(byte[] b)
      Sets an optional message header image
      Parameters:
      b - header image
    • setHeader

      public void setHeader(ISOHeader header)
      Sets the ISO header for this message.
      Parameters:
      header - the ISOHeader to set on this message
    • getHeader

      public byte[] getHeader()
      get optional message header image
      Returns:
      message header image (may be null)
    • setTrailer

      public void setTrailer(byte[] trailer)
      Sets optional trailer data.

      Note: The trailer data requires a customised channel that explicitly handles the trailer data from the ISOMsg.

      Parameters:
      trailer - The trailer data.
      See Also:
    • getTrailer

      public byte[] getTrailer()
      Get optional trailer image.
      Returns:
      message trailer image (may be null)
    • getISOHeader

      Return this messages ISOHeader
      Returns:
      header associated with this ISOMsg, can be null
    • getDirection

      public int getDirection()
      Returns the message direction.
      Returns:
      the direction (ISOMsg.INCOMING or ISOMsg.OUTGOING)
      See Also:
    • isIncoming

      public boolean isIncoming()
      Returns true if this message was received from a channel.
      Returns:
      true if this is an incoming message
      See Also:
    • isOutgoing

      public boolean isOutgoing()
      Returns true if this message is to be sent via a channel.
      Returns:
      true if this is an outgoing message
      See Also:
    • getMaxField

      public int getMaxField()
      Returns the highest field number present in this message.
      Overrides:
      getMaxField in class ISOComponent
      Returns:
      the max field number
    • setPackager

      public void setPackager(ISOPackager p)
      Sets the packager used to pack/unpack this message.
      Parameters:
      p - - a peer packager
    • getPackager

      Returns the packager associated with this message.
      Returns:
      the peer packager
    • set

      public void set(ISOComponent c) throws ISOException
      Set a field within this message
      Overrides:
      set in class ISOComponent
      Parameters:
      c - - a component
      Throws:
      ISOException - always thrown by leaves; composites override this
    • set

      public void set(int fldno, String value)
      Creates an ISOField associated with fldno within this ISOMsg.
      Parameters:
      fldno - field number
      value - field value
    • with

      public ISOMsg with(int fldno, String value)
      Sets a top-level character field and returns this message for fluent chaining.
      Parameters:
      fldno - field number
      value - field value
      Returns:
      this message
    • set

      public void set(String fpath, String value)
      Creates an ISOField associated with fldno within this ISOMsg.
      Parameters:
      fpath - dot-separated field path (i.e. 63.2)
      value - field value
    • with

      public ISOMsg with(String fpath, String value)
      Sets a character field by path and returns this message for fluent chaining.
      Parameters:
      fpath - dot-separated field path
      value - field value
      Returns:
      this message
    • set

      public void set(String fpath, ISOComponent c) throws ISOException
      Creates an ISOField associated with fldno within this ISOMsg
      Parameters:
      fpath - dot-separated field path (i.e. 63.2)
      c - component
      Throws:
      ISOException - on error
    • with

      public ISOMsg with(String fpath, ISOComponent c) throws ISOException
      Sets a component by path and returns this message for fluent chaining.
      Parameters:
      fpath - dot-separated field path
      c - component to store
      Returns:
      this message
      Throws:
      ISOException - on path or component errors
    • set

      public void set(String fpath, byte[] value)
      Creates an ISOField associated with fldno within this ISOMsg.
      Parameters:
      fpath - dot-separated field path (i.e. 63.2)
      value - binary field value
    • with

      public ISOMsg with(int fldno, byte[] value)
      Sets a top-level binary field and returns this message for fluent chaining.
      Parameters:
      fldno - field number
      value - field value
      Returns:
      this message
    • with

      public ISOMsg with(String fpath, byte[] value)
      Sets a binary field by path and returns this message for fluent chaining.
      Parameters:
      fpath - dot-separated field path
      value - field value
      Returns:
      this message
    • set

      public void set(int fldno, byte[] value)
      Creates an ISOBinaryField associated with fldno within this ISOMsg.
      Parameters:
      fldno - field number
      value - field value
    • unset

      public void unset(int fldno)
      Unset a field if it exists, otherwise ignore.
      Overrides:
      unset in class ISOComponent
      Parameters:
      fldno - - the field number
    • unset

      public void unset(int... flds)
      Unsets several fields at once
      Parameters:
      flds - - array of fields to be unset from this ISOMsg
    • unset

      public void unset(String fpath)
      Unset a field referenced by a fpath if it exists, otherwise ignore.
      Parameters:
      fpath - dot-separated field path (i.e. 63.2)
    • unset

      public void unset(String... fpaths)
      Unset a a set of fields referenced by fpaths if any ot them exist, otherwise ignore.
      Parameters:
      fpaths - dot-separated field paths (i.e. 63.2)
    • without

      public ISOMsg without(int... flds)
      Unsets one or more top-level fields and returns this message for fluent chaining.
      Parameters:
      flds - field numbers to remove
      Returns:
      this message
    • without

      public ISOMsg without(String... fpaths)
      Unsets one or more field paths, including nested composites and dataset elements, and returns this message for fluent chaining.
      Parameters:
      fpaths - field paths to remove
      Returns:
      this message
    • getComposite

      In order to interchange Composites and Leafs we use getComposite(). A Composite component returns itself and a Leaf returns null.
      Overrides:
      getComposite in class ISOComponent
      Returns:
      ISOComponent
    • recalcBitMap

      public void recalcBitMap() throws ISOException
      setup BitMap
      Throws:
      ISOException - on error
    • getChildren

      public Map getChildren()
      clone fields
      Overrides:
      getChildren in class ISOComponent
      Returns:
      copy of fields
    • pack

      public byte[] pack() throws ISOException
      Packs this message using the configured packager.
      Specified by:
      pack in class ISOComponent
      Returns:
      the packed message
      Throws:
      ISOException - on packing error
    • unpack

      public int unpack(byte[] b) throws ISOException
      Unpacks the raw byte array into this message.
      Specified by:
      unpack in class ISOComponent
      Parameters:
      b - - raw message
      Returns:
      consumed bytes
      Throws:
      ISOException - on unpacking error
    • unpack

      public void unpack(InputStream in) throws IOException, ISOException
      Unpacks this component by reading from in.
      Specified by:
      unpack in class ISOComponent
      Parameters:
      in - source stream
      Throws:
      IOException - on I/O failure
      ISOException - on unpacking error
    • dump

      public void dump(PrintStream p, String indent)
      dump the message to a PrintStream. The output is sorta XML, intended to be easily parsed.
      Each component is responsible for its own dump function, ISOMsg just calls dump on every valid field.
      Specified by:
      dump in interface Loggeable
      Specified by:
      dump in class ISOComponent
      Parameters:
      p - - print stream
      indent - - optional indent string
    • getComponent

      public ISOComponent getComponent(int fldno)
      get the component associated with the given field number
      Parameters:
      fldno - the Field Number
      Returns:
      the Component
    • getValue

      public Object getValue(int fldno)
      Return the object value associated with the given field number
      Parameters:
      fldno - the Field Number
      Returns:
      the field Object
    • getValue

      public Object getValue(String fpath) throws ISOException
      Return the object value associated with the given field path
      Parameters:
      fpath - field path
      Returns:
      the field Object (may be null)
      Throws:
      ISOException - on error
    • getComponent

      get the component associated with the given field number
      Parameters:
      fpath - field path
      Returns:
      the Component
      Throws:
      ISOException - on error
    • getString

      public String getString(int fldno)
      Return the String value associated with the given ISOField number
      Parameters:
      fldno - the Field Number
      Returns:
      field's String value
    • getString

      public String getString(String fpath)
      Return the String value associated with the given field path
      Parameters:
      fpath - field path
      Returns:
      field's String value (may be null)
    • getBytes

      public byte[] getBytes(int fldno)
      Return the byte[] value associated with the given ISOField number
      Parameters:
      fldno - the Field Number
      Returns:
      field's byte[] value or null if ISOException or UnsupportedEncodingException happens
    • getBytes

      public byte[] getBytes(String fpath)
      Return the String value associated with the given field path
      Parameters:
      fpath - field path
      Returns:
      field's byte[] value (may be null)
    • hasField

      public boolean hasField(int fldno)
      Check if a given field is present
      Parameters:
      fldno - the Field Number
      Returns:
      boolean indicating the existence of the field
    • hasFields

      public boolean hasFields(int[] fields)
      Check if all fields are present
      Parameters:
      fields - an array of fields to check for presence
      Returns:
      true if all fields are present
    • hasAny

      public boolean hasAny(int[] fields)
      Check if the message has any of these fields
      Parameters:
      fields - an array of fields to check for presence
      Returns:
      true if at least one field is present
    • hasAny

      public boolean hasAny(String... fields)
      Check if the message has any of these fields
      Parameters:
      fields - to check for presence
      Returns:
      true if at least one field is present
    • hasField

      public boolean hasField(String fpath)
      Check if a field indicated by a fpath is present
      Parameters:
      fpath - dot-separated field path (i.e. 63.2)
      Returns:
      true if field present
    • hasFields

      public boolean hasFields()
      Returns true if this message has at least one field set.
      Returns:
      true if at least one field is present
    • setValue

      public void setValue(Object obj) throws ISOException
      Don't call setValue on an ISOMsg. You'll sure get an ISOException. It's intended to be used on Leafs
      Specified by:
      setValue in class ISOComponent
      Parameters:
      obj - value to set (not supported on ISOMsg)
      Throws:
      ISOException - always
      See Also:
    • clone

      public Object clone()
      Overrides:
      clone in class Object
    • clone

      public Object clone(int... fields)
      Partially clone an ISOMsg
      Parameters:
      fields - int array of fields to go
      Returns:
      new ISOMsg instance
    • clone

      public ISOMsg clone(String... fpaths)
      Partially clone an ISOMsg by field paths
      Parameters:
      fpaths - string array of field paths to copy
      Returns:
      new ISOMsg instance
    • merge

      public void merge(ISOMsg m, boolean mergeHeader)
      Merges the content of the specified ISOMsg into this ISOMsg instance. It iterates over the fields of the input message and, for each field that is present, sets the corresponding component in this message to the value from the input message. This operation includes all fields that are present in the input message, but does not remove any existing fields from this message unless they are explicitly overwritten by the input message.

      If the input message contains a header (non-null), this method also clones the header and sets it as the header of this message.

      Parameters:
      m - The ISOMsg to merge into this ISOMsg. It must not be null. The method does nothing if m is null.
      mergeHeader - A boolean flag indicating whether to merge the header of the input message into this message.
    • merge

      public void merge(ISOMsg m)
      Merges the content of the specified ISOMsg into this ISOMsg instance, excluding the header. This method is a convenience wrapper around merge(ISOMsg, boolean) with the mergeHeader parameter set to false for backward compatibility, indicating that the header of the input message will not be merged.
      Parameters:
      m - the ISOMsg to merge into this message
    • toString

      public String toString()
      Overrides:
      toString in class Object
      Returns:
      a string suitable for a log
    • getKey

      public Object getKey() throws ISOException
      Description copied from class: ISOComponent
      valid on Leafs only. The value returned is used by ISOMsg as a key to this field.
      Overrides:
      getKey in class ISOComponent
      Returns:
      object representing the field number
      Throws:
      ISOException - thrown by composites; leaves return their key
    • getValue

      public Object getValue()
      Returns this message itself as its value.
      Overrides:
      getValue in class ISOComponent
      Returns:
      this ISOMsg
    • isInner

      public boolean isInner()
      Returns true if this is an inner (sub-) message.
      Returns:
      true on inner messages
    • setMTI

      public void setMTI(String mti) throws ISOException
      Sets the message type indicator.
      Parameters:
      mti - new MTI
      Throws:
      ISOException - if message is inner message
    • move

      public void move(int oldFieldNumber, int newFieldNumber) throws ISOException
      moves a field (renumber)
      Parameters:
      oldFieldNumber - old field number
      newFieldNumber - new field number
      Throws:
      ISOException - on error
    • getFieldNumber

      public int getFieldNumber()
      Description copied from class: ISOComponent
      Returns the field number this component occupies within its container.
      Specified by:
      getFieldNumber in class ISOComponent
      Returns:
      the field number
    • hasMTI

      public boolean hasMTI() throws ISOException
      Returns true if this message has an MTI field (field 0) set.
      Returns:
      true if MTI is present
      Throws:
      ISOException - if this is an inner message
    • getMTI

      public String getMTI() throws ISOException
      Returns the message type indicator.
      Returns:
      current MTI
      Throws:
      ISOException - on inner message or MTI not set
    • isRequest

      public boolean isRequest() throws ISOException
      Returns true if the MTI suggests this is a request message.
      Returns:
      true if message "seems to be" a request
      Throws:
      ISOException - on MTI not set
    • isResponse

      public boolean isResponse() throws ISOException
      Returns true if the MTI suggests this is a response message.
      Returns:
      true if message "seems not to be" a request
      Throws:
      ISOException - on MTI not set
    • isAuthorization

      public boolean isAuthorization() throws ISOException
      Returns true if this is an authorization message (MTI second digit = 1).
      Returns:
      true if message class is "authorization"
      Throws:
      ISOException - on MTI not set
    • isFinancial

      public boolean isFinancial() throws ISOException
      Returns true if this is a financial message (MTI second digit = 2).
      Returns:
      true if message class is "financial"
      Throws:
      ISOException - on MTI not set
    • isFileAction

      public boolean isFileAction() throws ISOException
      Returns true if this is a file action message (MTI second digit = 3).
      Returns:
      true if message class is "file action"
      Throws:
      ISOException - on MTI not set
    • isReversal

      public boolean isReversal() throws ISOException
      Returns true if this is a reversal message (MTI second digit = 4, last digit 0 or 1).
      Returns:
      true if message class is "reversal"
      Throws:
      ISOException - on MTI not set
    • isChargeback

      public boolean isChargeback() throws ISOException
      Returns true if this is a chargeback message (MTI second digit = 4, last digit 2 or 3).
      Returns:
      true if message class is "chargeback"
      Throws:
      ISOException - on MTI not set
    • isReconciliation

      public boolean isReconciliation() throws ISOException
      Returns true if this is a reconciliation message (MTI second digit = 5).
      Returns:
      true if message class is "reconciliation"
      Throws:
      ISOException - on MTI not set
    • isAdministrative

      public boolean isAdministrative() throws ISOException
      Returns true if this is an administrative message (MTI second digit = 6).
      Returns:
      true if message class is "administrative"
      Throws:
      ISOException - on MTI not set
    • isFeeCollection

      public boolean isFeeCollection() throws ISOException
      Returns true if this is a fee collection message (MTI second digit = 7).
      Returns:
      true if message class is "fee collection"
      Throws:
      ISOException - on MTI not set
    • isNetworkManagement

      public boolean isNetworkManagement() throws ISOException
      Returns true if this is a network management message (MTI second digit = 8).
      Returns:
      true if message class is "network management"
      Throws:
      ISOException - on MTI not set
    • isRetransmission

      public boolean isRetransmission() throws ISOException
      Returns true if this is a retransmission (MTI last digit = 1).
      Returns:
      true if message is a retransmission
      Throws:
      ISOException - on MTI not set
    • setResponseMTI

      public void setResponseMTI() throws ISOException
      sets an appropriate response MTI. i.e. 0100 becomes 0110
      i.e. 0201 becomes 0210
      i.e. 1201 becomes 1210
      Throws:
      ISOException - on MTI not set or it is not a request
    • setRetransmissionMTI

      public void setRetransmissionMTI() throws ISOException
      sets an appropriate retransmission MTI
      Throws:
      ISOException - on MTI not set or it is not a request
    • writeHeader

      protected void writeHeader(ObjectOutput out) throws IOException
      Serializes the message header to the given ObjectOutput.
      Parameters:
      out - the ObjectOutput to write to
      Throws:
      IOException - on write error
    • readHeader

      Deserializes the message header from the given ObjectInput.
      Parameters:
      in - the ObjectInput to read from
      Throws:
      IOException - on read error
      ClassNotFoundException - if a referenced class cannot be found
    • writePackager

      protected void writePackager(ObjectOutput out) throws IOException
      Serializes the packager class name to the given ObjectOutput.
      Parameters:
      out - the ObjectOutput to write to
      Throws:
      IOException - on write error
    • readPackager

      Deserializes the packager from the given ObjectInput.
      Parameters:
      in - the ObjectInput to read from
      Throws:
      IOException - on read error
      ClassNotFoundException - if the packager class cannot be found
    • writeDirection

      protected void writeDirection(ObjectOutput out) throws IOException
      Serializes the message direction to the given ObjectOutput.
      Parameters:
      out - the ObjectOutput to write to
      Throws:
      IOException - on write error
    • readDirection

      Deserializes the message direction from the given ObjectInput.
      Parameters:
      in - the ObjectInput to read from
      Throws:
      IOException - on read error
      ClassNotFoundException - if a class cannot be found
    • writeExternal

      public void writeExternal(ObjectOutput out) throws IOException
      Specified by:
      writeExternal in interface Externalizable
      Throws:
      IOException
    • readExternal

    • setSource

      public void setSource(ISOSource source)
      Let this ISOMsg object hold a weak reference to an ISOSource (usually used to carry a reference to the incoming ISOChannel)
      Parameters:
      source - an ISOSource
    • getSource

      public ISOSource getSource()
      Returns the associated ISOSource (e.g. the channel that received this message).
      Returns:
      an ISOSource or null