Class ISOMsgRef.Ref

All Implemented Interfaces:
Externalizable, Serializable, Cloneable, OffsetIndexedComposite, Loggeable
Enclosing class:
ISOMsgRef

public class ISOMsgRef.Ref extends ISOMsg implements OffsetIndexedComposite
See Also:
  • Method Details

    • incOffset

      public void incOffset()
      Specified by:
      incOffset in interface OffsetIndexedComposite
    • setOffset

      public void setOffset(int offset)
      Specified by:
      setOffset in interface OffsetIndexedComposite
    • resetOffset

      public void resetOffset()
      Specified by:
      resetOffset in interface OffsetIndexedComposite
    • getOffset

      public int getOffset()
      Specified by:
      getOffset in interface OffsetIndexedComposite
    • 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 ISOMsg
      Returns:
      object representing the field number
      Throws:
      ISOException
    • setFieldNumber

      public void setFieldNumber(int fieldNumber)
      Description copied from class: ISOMsg
      changes this Component field number
      Use with care, this method does not change any reference held by a Composite.
      Overrides:
      setFieldNumber in class ISOMsg
      Parameters:
      fieldNumber - new field number
    • setValue

      public void setValue(Object obj) throws ISOException
      Description copied from class: ISOMsg
      Don't call setValue on an ISOMsg. You'll sure get an ISOException. It's intended to be used on Leafs
      Overrides:
      setValue in class ISOMsg
      Parameters:
      obj -
      Throws:
      ISOException
      See Also:
    • set

      public void set(ISOComponent c) throws ISOException
      Description copied from class: ISOMsg
      Set a field within this message
      Overrides:
      set in class ISOMsg
      Parameters:
      c - - a component
      Throws:
      ISOException
    • unset

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

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

      public Object getValue()
      Description copied from class: ISOComponent
      valid on Leafs only.
      Overrides:
      getValue in class ISOMsg
      Returns:
      object representing the field value
    • getBytes

      public byte[] getBytes() throws ISOException
      Description copied from class: ISOComponent
      get Value as bytes (when possible)
      Overrides:
      getBytes in class ISOComponent
      Returns:
      byte[] representing this field
      Throws:
      ISOException
    • getMaxField

      public int getMaxField()
      Description copied from class: ISOComponent
      a Composite must override this function
      Overrides:
      getMaxField in class ISOMsg
      Returns:
      the max field number associated with this message
    • getChildren

      public Map getChildren()
      Description copied from class: ISOMsg
      clone fields
      Overrides:
      getChildren in class ISOMsg
      Returns:
      copy of fields
    • pack

      public void pack(OutputStream out) throws IOException, ISOException
      Overrides:
      pack in class ISOComponent
      Throws:
      IOException
      ISOException
    • dump

      public void dump(PrintStream p, String indent)
      Description copied from class: ISOMsg
      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
      Overrides:
      dump in class ISOMsg
      Parameters:
      p - - print stream
      indent - - optional indent string
    • pack

      public byte[] pack() throws ISOException
      Description copied from class: ISOMsg
      pack the message with the current packager
      Overrides:
      pack in class ISOMsg
      Returns:
      the packed message
      Throws:
      ISOException
    • unpack

      public int unpack(byte[] b) throws ISOException
      Description copied from class: ISOMsg
      unpack a message
      Overrides:
      unpack in class ISOMsg
      Parameters:
      b - - raw message
      Returns:
      consumed bytes
      Throws:
      ISOException
    • unpack

      public void unpack(InputStream in) throws IOException, ISOException
      Overrides:
      unpack in class ISOMsg
      Throws:
      IOException
      ISOException
    • setDirection

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

      public void setHeader(byte[] b)
      Description copied from class: ISOMsg
      Sets an optional message header image
      Overrides:
      setHeader in class ISOMsg
      Parameters:
      b - header image
    • setHeader

      public void setHeader(ISOHeader header)
      Overrides:
      setHeader in class ISOMsg
    • getHeader

      public byte[] getHeader()
      Description copied from class: ISOMsg
      get optional message header image
      Overrides:
      getHeader in class ISOMsg
      Returns:
      message header image (may be null)
    • getISOHeader

      Description copied from class: ISOMsg
      Return this messages ISOHeader
      Overrides:
      getISOHeader in class ISOMsg
      Returns:
      header associated with this ISOMsg, can be null
    • getDirection

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

      public boolean isIncoming()
      Overrides:
      isIncoming in class ISOMsg
      Returns:
      true if this message is an incoming message
      See Also:
    • isOutgoing

      public boolean isOutgoing()
      Overrides:
      isOutgoing in class ISOMsg
      Returns:
      true if this message is an outgoing message
      See Also:
    • setPackager

      public void setPackager(ISOPackager p)
      Overrides:
      setPackager in class ISOMsg
      Parameters:
      p - - a peer packager
    • getPackager

      Overrides:
      getPackager in class ISOMsg
      Returns:
      the peer packager
    • set

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

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

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

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

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

      public void unset(int[] flds)
      Description copied from class: ISOMsg
      Unsets several fields at once
      Overrides:
      unset in class ISOMsg
      Parameters:
      flds - - array of fields to be unset from this ISOMsg
    • unset

      public void unset(String fpath)
      Description copied from class: ISOMsg
      Unset a field referenced by a fpath if it exists, otherwise ignore.
      Overrides:
      unset in class ISOMsg
      Parameters:
      fpath - dot-separated field path (i.e. 63.2)
    • recalcBitMap

      public void recalcBitMap() throws ISOException
      Description copied from class: ISOMsg
      setup BitMap
      Overrides:
      recalcBitMap in class ISOMsg
      Throws:
      ISOException - on error
    • getComponent

      public ISOComponent getComponent(int fldno)
      Description copied from class: ISOMsg
      get the component associated with the given field number
      Overrides:
      getComponent in class ISOMsg
      Parameters:
      fldno - the Field Number
      Returns:
      the Component
    • getValue

      public Object getValue(int fldno)
      Description copied from class: ISOMsg
      Return the object value associated with the given field number
      Overrides:
      getValue in class ISOMsg
      Parameters:
      fldno - the Field Number
      Returns:
      the field Object
    • getValue

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

      Description copied from class: ISOMsg
      get the component associated with the given field number
      Overrides:
      getComponent in class ISOMsg
      Parameters:
      fpath - field path
      Returns:
      the Component
      Throws:
      ISOException - on error
    • getString

      public String getString(int fldno)
      Description copied from class: ISOMsg
      Return the String value associated with the given ISOField number
      Overrides:
      getString in class ISOMsg
      Parameters:
      fldno - the Field Number
      Returns:
      field's String value
    • getString

      public String getString(String fpath)
      Description copied from class: ISOMsg
      Return the String value associated with the given field path
      Overrides:
      getString in class ISOMsg
      Parameters:
      fpath - field path
      Returns:
      field's String value (may be null)
    • getBytes

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

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

      public boolean hasField(int fldno)
      Description copied from class: ISOMsg
      Check if a given field is present
      Overrides:
      hasField in class ISOMsg
      Parameters:
      fldno - the Field Number
      Returns:
      boolean indicating the existence of the field
    • hasFields

      public boolean hasFields(int[] fields)
      Description copied from class: ISOMsg
      Check if all fields are present
      Overrides:
      hasFields in class ISOMsg
      Parameters:
      fields - an array of fields to check for presence
      Returns:
      true if all fields are present
    • hasField

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

      public boolean hasFields()
      Overrides:
      hasFields in class ISOMsg
      Returns:
      true if ISOMsg has at least one field
    • clone

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

      public Object clone(int[] fields)
      Description copied from class: ISOMsg
      Partially clone an ISOMsg
      Overrides:
      clone in class ISOMsg
      Parameters:
      fields - int array of fields to go
      Returns:
      new ISOMsg instance
    • merge

      public void merge(ISOMsg m)
      Overrides:
      merge in class ISOMsg
    • toString

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

      public boolean isInner()
      Overrides:
      isInner in class ISOMsg
      Returns:
      true on inner messages
    • setMTI

      public void setMTI(String mti) throws ISOException
      Overrides:
      setMTI in class ISOMsg
      Parameters:
      mti - new MTI
      Throws:
      ISOException - if message is inner message
    • move

      public void move(int oldFieldNumber, int newFieldNumber) throws ISOException
      Description copied from class: ISOMsg
      moves a field (renumber)
      Overrides:
      move in class ISOMsg
      Parameters:
      oldFieldNumber - old field number
      newFieldNumber - new field number
      Throws:
      ISOException - on error
    • getMTI

      public String getMTI() throws ISOException
      Overrides:
      getMTI in class ISOMsg
      Returns:
      current MTI
      Throws:
      ISOException - on inner message or MTI not set
    • isRequest

      public boolean isRequest() throws ISOException
      Overrides:
      isRequest in class ISOMsg
      Returns:
      true if message "seems to be" a request
      Throws:
      ISOException - on MTI not set