Skip to content

ISOMessage

Mohsen Beiranvand edited this page Oct 7, 2019 · 1 revision

ISOMessage Class Documentation

public class ISOMessage

ISO Message Entity

  • Author: Mohsen Beiranvand

public byte[] getPrimaryBitmap()

Get primary bitmap

  • Returns: returns primary byte array
  • Since: 1.0.4-SNAPSHOT

public int length()

Message length

  • Returns: returns message length

public byte[] getField(int fieldNo) throws ISOException

Get field value in byte array format

  • Parameters: fieldNo — field number
  • Returns: returns field value in byte array format
  • Exceptions: ISOException — throws exception

public byte[] getField(FIELDS field)

Get field value in byte array format

  • Parameters: field — field in {@link FIELDS} format
  • Returns: returns field value in byte array format

public String getStringField(int fieldNo) throws ISOException

Get field value in string format

  • Parameters: fieldNo — field number
  • Returns: returns field value in String format
  • Exceptions: ISOException — throws exception

public String getStringField(FIELDS field) throws ISOException

Get field value in string format

  • Parameters:
  • field — field in {@link FIELDS} format
  • asciiFix — set true if you want result in ASCII format
  • Returns: returns field value in String format
  • Exceptions: ISOException — throws exception

public String getStringField(int fieldNo, boolean asciiFix) throws ISOException

Get field value in string format

  • Parameters:
  • fieldNo — field number
  • asciiFix — set true if you want result in ASCII format
  • Returns: returns field value in String format
  • Exceptions: ISOException — throws exception

public String getStringField(FIELDS field, boolean asciiFix) throws ISOException

Get field value in string format

  • Parameters:
  • field — field in {@link FIELDS} format
  • asciiFix — set true if you want result in ASCII format
  • Returns: returns field value in String format
  • Exceptions: ISOException — throws exception

public ISOMessage setMessage(byte[] message, boolean headerAvailable) throws ISOException

Set and parse ISO8583 message from buffer

  • Parameters:
  • message — ISO8583 in byte array format
  • headerAvailable — set true if header is available in buffer
  • Returns: returns ISO8583 message in ISOMessage type
  • Exceptions: ISOException — throws exception

public ISOMessage setMessage(byte[] message) throws ISOException

Set and parse ISO8583 message from buffer

  • Parameters: message — ISO8583 in byte array format
  • Returns: returns ISO8583 message in ISOMessage type
  • Exceptions: ISOException — throws exception

public Set<Map.Entry<Integer, byte[]>> getEntrySet()

Get EntrySet

  • Returns: returns data elements entry set

public boolean fieldExits(FIELDS field)

Check Field exists by {@link FIELDS} enum

  • Parameters: field — field enum
  • Returns: Returns true if field has value in message

public boolean fieldExits(int no)

Check Field exists field number

  • Parameters: no — field number
  • Returns: Returns true if field has value in message

public String getMti()

Get Message MTI

  • Returns: returns MTI in String format

public int getMsgClass()

Get message class

  • Returns: returns message class

public int getMsgFunction()

Get message function

  • Returns: returns message function

public int getMsgOrigin()

Get message origin

  • Returns: returns message origin

public boolean validateMac(ISOMacGenerator isoMacGenerator) throws ISOException

Validate mac it's useful method to validate response MAC

  • Parameters: isoMacGenerator — implementation of {@link ISOMacGenerator}
  • Returns: returns true if response message MAC is valid
  • Exceptions: ISOException — throws exception

public String toString()

Convert ISOMessage to String

  • Returns: ISOMessage in String format

public String fieldsToString()

Convert all fields in String format

  • Returns: returns strings of fields

public void clear()

Clean up message