فهرست منبع

Changed for JDK 8

Paul Lisewski 5 سال پیش
والد
کامیت
213fc33317
26فایلهای تغییر یافته به همراه2051 افزوده شده و 387 حذف شده
  1. 5 1
      .gitignore
  2. 16 14
      IPMReader/nbproject/build-impl.xml
  3. 2 2
      IPMReader/nbproject/genfiles.properties
  4. 1 1
      IPMReader/nbproject/private/private.properties
  5. 3 7
      IPMReader/nbproject/private/private.xml
  6. 7 5
      IPMReader/nbproject/project.properties
  7. 14 0
      IPMReader/src/META-INF/persistence.xml
  8. 0 37
      IPMReader/src/ipmreader/DataElement.java
  9. 1171 0
      IPMReader/src/ipmreader/FirstPresentment.java
  10. 364 0
      IPMReader/src/ipmreader/IPMFileHistory.java
  11. 27 21
      IPMReader/src/ipmreader/IPMReader.java
  12. 0 277
      IPMReader/src/ipmreader/IpmDataElements.java
  13. 17 0
      IsoProcessor/build.gradle
  14. 7 0
      IsoProcessor/gradle.properties
  15. 1 0
      IsoProcessor/settings.gradle
  16. 40 0
      IsoProcessor/src/main/java/com/cloudsoft/service/IsoProcessor/Main.java
  17. 17 0
      MastercardFileReader/build.gradle
  18. 7 0
      MastercardFileReader/gradle.properties
  19. 1 0
      MastercardFileReader/settings.gradle
  20. 37 0
      MastercardFileReader/src/main/java/com/cloudsoft/MastercardFileReader/DataElement.java
  21. 1 1
      MastercardFileReader/src/main/java/com/cloudsoft/MastercardFileReader/DataElementLengthData.java
  22. 24 18
      MastercardFileReader/src/main/java/com/cloudsoft/MastercardFileReader/IPMInputStream.java
  23. 150 0
      MastercardFileReader/src/main/java/com/cloudsoft/MastercardFileReader/IpmDataElements.java
  24. 3 3
      MastercardFileReader/src/main/java/com/cloudsoft/MastercardFileReader/IpmSpecificationConstants.java
  25. 21 0
      MastercardFileReader/src/main/java/com/cloudsoft/MastercardFileReader/IsoElement.java
  26. 115 0
      MastercardFileReader/src/main/java/com/cloudsoft/MastercardFileReader/Main.java

+ 5 - 1
.gitignore

@@ -1,2 +1,6 @@
 /IPMReader/build/
-/IPMReader/dist/
+/IPMReader/dist/
+/MastercardFileReader/.gradle/
+/MastercardFileReader/build/
+/IsoProcessor/.gradle/
+/IsoProcessor/build/

+ 16 - 14
IPMReader/nbproject/build-impl.xml

@@ -154,18 +154,6 @@ is divided into following sections:
                 <istrue value="${not.archive.disabled}"/>
             </or>
         </condition>
-        <condition property="do.mkdist">
-            <and>
-                <isset property="do.archive"/>
-                <isset property="libs.CopyLibs.classpath"/>
-                <not>
-                    <istrue value="${mkdist.disabled}"/>
-                </not>
-                <not>
-                    <istrue value="${modules.supported.internal}"/>
-                </not>
-            </and>
-        </condition>
         <condition property="do.archive+manifest.available">
             <and>
                 <isset property="manifest.available"/>
@@ -1193,13 +1181,27 @@ is divided into following sections:
             <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
         </manifest>
     </target>
-    <target depends="init,-init-macrodef-copylibs,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen" if="do.mkdist" name="-do-jar-copylibs">
+    <target depends="init,compile" name="-check-do-mkdist">
+        <condition property="do.mkdist">
+            <and>
+                <isset property="do.archive"/>
+                <isset property="libs.CopyLibs.classpath"/>
+                <not>
+                    <istrue value="${mkdist.disabled}"/>
+                </not>
+                <not>
+                    <available file="${build.classes.dir}/module-info.class"/>
+                </not>
+            </and>
+        </condition>
+    </target>
+    <target depends="init,-init-macrodef-copylibs,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen,-check-do-mkdist" if="do.mkdist" name="-do-jar-copylibs">
         <j2seproject3:copylibs manifest="${tmp.manifest.file}"/>
         <echo level="info">To run this application from the command line without Ant, try:</echo>
         <property location="${dist.jar}" name="dist.jar.resolved"/>
         <echo level="info">java -jar "${dist.jar.resolved}"</echo>
     </target>
-    <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen" if="do.archive" name="-do-jar-jar" unless="do.mkdist">
+    <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen,-check-do-mkdist" if="do.archive" name="-do-jar-jar" unless="do.mkdist">
         <j2seproject1:jar manifest="${tmp.manifest.file}"/>
         <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
         <property location="${dist.jar}" name="dist.jar.resolved"/>

+ 2 - 2
IPMReader/nbproject/genfiles.properties

@@ -4,5 +4,5 @@ build.xml.stylesheet.CRC32=f85dc8f2@1.92.0.48
 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
 # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
 nbproject/build-impl.xml.data.CRC32=284e85f4
-nbproject/build-impl.xml.script.CRC32=acccef40
-nbproject/build-impl.xml.stylesheet.CRC32=3a2fa800@1.92.0.48
+nbproject/build-impl.xml.script.CRC32=a922de2c
+nbproject/build-impl.xml.stylesheet.CRC32=f89f7d21@1.93.0.48

+ 1 - 1
IPMReader/nbproject/private/private.properties

@@ -1,2 +1,2 @@
 compile.on.save=true
-user.properties.file=C:\\Users\\Lisewski\\AppData\\Roaming\\NetBeans\\11.1\\build.properties
+user.properties.file=C:\\Users\\paul\\AppData\\Roaming\\NetBeans\\11.2\\build.properties

+ 3 - 7
IPMReader/nbproject/private/private.xml

@@ -3,13 +3,9 @@
     <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
     <open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
         <group>
-            <file>file:/C:/java/IPMReader/src/ipmreader/IPMInputStream.java</file>
-            <file>file:/C:/java/IPMReader/src/ipmreader/DataElement.java</file>
-            <file>file:/C:/java/IPMReader/src/ipmreader/DataElementLengthData.java</file>
-            <file>file:/C:/java/IPMReader/src/ipmreader/IpmDataElements.java</file>
-            <file>file:/C:/java/IPMReader/src/ipmreader/IPMReader.java</file>
-            <file>file:/C:/java/IPMReader/src/ipmreader/IpmSpecificationConstants.java</file>
-            <file>file:/C:/java/IPMReader/res/TrailerNotTheLastRecord.txt</file>
+            <file>file:/C:/Users/paul/repos/java/IPMReader/src/ipmreader/IPMReader.java</file>
+            <file>file:/C:/Users/paul/repos/java/IPMReader/src/ipmreader/FirstPresentment.java</file>
+            <file>file:/C:/Users/paul/repos/java/IPMReader/src/ipmreader/IPMFileHistory.java</file>
         </group>
     </open-files>
 </project-private>

+ 7 - 5
IPMReader/nbproject/project.properties

@@ -1,6 +1,6 @@
 annotation.processing.enabled=true
 annotation.processing.enabled.in.editor=false
-annotation.processing.processor.options=
+annotation.processing.processor.options=-Aeclipselink.canonicalmodel.use_static_factory=false
 annotation.processing.processors.list=
 annotation.processing.run.all.processors=true
 annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
@@ -35,7 +35,8 @@ dist.jlink.output=${dist.jlink.dir}/IPMReader
 excludes=
 includes=**
 jar.compress=false
-javac.classpath=
+javac.classpath=\
+    ${libs.eclipselink.classpath}
 # Space-separated list of extra javac options
 javac.compilerargs=
 javac.deprecation=false
@@ -43,9 +44,10 @@ javac.external.vm=true
 javac.modulepath=
 javac.processormodulepath=
 javac.processorpath=\
-    ${javac.classpath}
-javac.source=11
-javac.target=11
+    ${javac.classpath}:\
+    ${libs.eclipselinkmodelgen.classpath}
+javac.source=1.8
+javac.target=1.8
 javac.test.classpath=\
     ${javac.classpath}:\
     ${build.classes.dir}

+ 14 - 0
IPMReader/src/META-INF/persistence.xml

@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
+  <persistence-unit name="IPMReaderPU" transaction-type="RESOURCE_LOCAL">
+    <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
+    <class>ipmreader.IPMFileHistory</class>
+    <class>ipmreader.FirstPresentment</class>
+    <properties>
+      <property name="javax.persistence.jdbc.url" value="jdbc:sqlserver://localhost;databaseName=AlexisPTSTest"/>
+      <property name="javax.persistence.jdbc.user" value="gpspl"/>
+      <property name="javax.persistence.jdbc.driver" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
+      <property name="javax.persistence.jdbc.password" value="yW2S6KXdY8"/>
+    </properties>
+  </persistence-unit>
+</persistence>

+ 0 - 37
IPMReader/src/ipmreader/DataElement.java

@@ -1,37 +0,0 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-package ipmreader;
-
-/**
- *
- * @author Lisewski
- */
-public class DataElement {
-  int Index;
-         DataElementLengthData LengthData;
-         String Name;
-         IpmSpecificationConstants.DataElementFormat Format;
-         boolean IsBitmap;
-         Integer BitmapStartIndex;
-public DataElement(int index, DataElementLengthData lengthData, String name, IpmSpecificationConstants.DataElementFormat format)
-        {
-            Index = index;
-            LengthData = lengthData;
-            Name = name;
-            Format = format;
-            IsBitmap = false;
-            BitmapStartIndex = null;
-        }
-public DataElement(int index, DataElementLengthData lengthData, String name, IpmSpecificationConstants.DataElementFormat format, boolean isBitmap, int bitmapStartIndex)
-        {
-            Index = index;
-            LengthData = lengthData;
-            Name = name;
-            Format = format;
-            IsBitmap = isBitmap;
-            BitmapStartIndex = bitmapStartIndex;
-        }
-}

+ 1171 - 0
IPMReader/src/ipmreader/FirstPresentment.java

@@ -0,0 +1,1171 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package ipmreader;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.util.Date;
+import javax.persistence.Basic;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.NamedQueries;
+import javax.persistence.NamedQuery;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+import javax.xml.bind.annotation.XmlRootElement;
+
+/**
+ *
+ * @author paul
+ */
+@Entity
+@Table(name = "FirstPresentment")
+@XmlRootElement
+@NamedQueries({
+    @NamedQuery(name = "FirstPresentment.findAll", query = "SELECT f FROM FirstPresentment f"),
+    @NamedQuery(name = "FirstPresentment.findByPresentmentID", query = "SELECT f FROM FirstPresentment f WHERE f.presentmentID = :presentmentID"),
+    @NamedQuery(name = "FirstPresentment.findByMtid", query = "SELECT f FROM FirstPresentment f WHERE f.mtid = :mtid"),
+    @NamedQuery(name = "FirstPresentment.findByPan002", query = "SELECT f FROM FirstPresentment f WHERE f.pan002 = :pan002"),
+    @NamedQuery(name = "FirstPresentment.findByProcessingCode003", query = "SELECT f FROM FirstPresentment f WHERE f.processingCode003 = :processingCode003"),
+    @NamedQuery(name = "FirstPresentment.findByAmountTransaction004", query = "SELECT f FROM FirstPresentment f WHERE f.amountTransaction004 = :amountTransaction004"),
+    @NamedQuery(name = "FirstPresentment.findByAmountReconciliation005", query = "SELECT f FROM FirstPresentment f WHERE f.amountReconciliation005 = :amountReconciliation005"),
+    @NamedQuery(name = "FirstPresentment.findByAmountCardHolderBilling006", query = "SELECT f FROM FirstPresentment f WHERE f.amountCardHolderBilling006 = :amountCardHolderBilling006"),
+    @NamedQuery(name = "FirstPresentment.findByConversionRateReconciliation009", query = "SELECT f FROM FirstPresentment f WHERE f.conversionRateReconciliation009 = :conversionRateReconciliation009"),
+    @NamedQuery(name = "FirstPresentment.findByConversionRateCardHolderBilling010", query = "SELECT f FROM FirstPresentment f WHERE f.conversionRateCardHolderBilling010 = :conversionRateCardHolderBilling010"),
+    @NamedQuery(name = "FirstPresentment.findByLocalTransactionTime012", query = "SELECT f FROM FirstPresentment f WHERE f.localTransactionTime012 = :localTransactionTime012"),
+    @NamedQuery(name = "FirstPresentment.findByDateExpiration014", query = "SELECT f FROM FirstPresentment f WHERE f.dateExpiration014 = :dateExpiration014"),
+    @NamedQuery(name = "FirstPresentment.findByPOSDataCode22", query = "SELECT f FROM FirstPresentment f WHERE f.pOSDataCode22 = :pOSDataCode22"),
+    @NamedQuery(name = "FirstPresentment.findByCardSequenceNumber023", query = "SELECT f FROM FirstPresentment f WHERE f.cardSequenceNumber023 = :cardSequenceNumber023"),
+    @NamedQuery(name = "FirstPresentment.findByFunctionCode024", query = "SELECT f FROM FirstPresentment f WHERE f.functionCode024 = :functionCode024"),
+    @NamedQuery(name = "FirstPresentment.findByMessageReasonCode025", query = "SELECT f FROM FirstPresentment f WHERE f.messageReasonCode025 = :messageReasonCode025"),
+    @NamedQuery(name = "FirstPresentment.findByCardAcceptorBusinessCode026", query = "SELECT f FROM FirstPresentment f WHERE f.cardAcceptorBusinessCode026 = :cardAcceptorBusinessCode026"),
+    @NamedQuery(name = "FirstPresentment.findByAmountsOriginal030", query = "SELECT f FROM FirstPresentment f WHERE f.amountsOriginal030 = :amountsOriginal030"),
+    @NamedQuery(name = "FirstPresentment.findByAcquirerReferenceData031", query = "SELECT f FROM FirstPresentment f WHERE f.acquirerReferenceData031 = :acquirerReferenceData031"),
+    @NamedQuery(name = "FirstPresentment.findByAid032", query = "SELECT f FROM FirstPresentment f WHERE f.aid032 = :aid032"),
+    @NamedQuery(name = "FirstPresentment.findByFid033", query = "SELECT f FROM FirstPresentment f WHERE f.fid033 = :fid033"),
+    @NamedQuery(name = "FirstPresentment.findByRetrievalReferenceNumber037", query = "SELECT f FROM FirstPresentment f WHERE f.retrievalReferenceNumber037 = :retrievalReferenceNumber037"),
+    @NamedQuery(name = "FirstPresentment.findByApprovalCode038", query = "SELECT f FROM FirstPresentment f WHERE f.approvalCode038 = :approvalCode038"),
+    @NamedQuery(name = "FirstPresentment.findByServiceCode040", query = "SELECT f FROM FirstPresentment f WHERE f.serviceCode040 = :serviceCode040"),
+    @NamedQuery(name = "FirstPresentment.findByCardAcceptorTerminalID041", query = "SELECT f FROM FirstPresentment f WHERE f.cardAcceptorTerminalID041 = :cardAcceptorTerminalID041"),
+    @NamedQuery(name = "FirstPresentment.findByCardAcceptorIDCode042", query = "SELECT f FROM FirstPresentment f WHERE f.cardAcceptorIDCode042 = :cardAcceptorIDCode042"),
+    @NamedQuery(name = "FirstPresentment.findByCardAcceptorNameLocation043", query = "SELECT f FROM FirstPresentment f WHERE f.cardAcceptorNameLocation043 = :cardAcceptorNameLocation043"),
+    @NamedQuery(name = "FirstPresentment.findByAdditionalData048", query = "SELECT f FROM FirstPresentment f WHERE f.additionalData048 = :additionalData048"),
+    @NamedQuery(name = "FirstPresentment.findByCurrencyCodeTransactionDE049", query = "SELECT f FROM FirstPresentment f WHERE f.currencyCodeTransactionDE049 = :currencyCodeTransactionDE049"),
+    @NamedQuery(name = "FirstPresentment.findByCurrencyCodeReconciliationDE050", query = "SELECT f FROM FirstPresentment f WHERE f.currencyCodeReconciliationDE050 = :currencyCodeReconciliationDE050"),
+    @NamedQuery(name = "FirstPresentment.findByCurrencyCodeCardHolderBillingDE051", query = "SELECT f FROM FirstPresentment f WHERE f.currencyCodeCardHolderBillingDE051 = :currencyCodeCardHolderBillingDE051"),
+    @NamedQuery(name = "FirstPresentment.findByAdditionalAmountsDE054", query = "SELECT f FROM FirstPresentment f WHERE f.additionalAmountsDE054 = :additionalAmountsDE054"),
+    @NamedQuery(name = "FirstPresentment.findByICCSystemRelatedDataDE055", query = "SELECT f FROM FirstPresentment f WHERE f.iCCSystemRelatedDataDE055 = :iCCSystemRelatedDataDE055"),
+    @NamedQuery(name = "FirstPresentment.findByAdditionalData2DE062", query = "SELECT f FROM FirstPresentment f WHERE f.additionalData2DE062 = :additionalData2DE062"),
+    @NamedQuery(name = "FirstPresentment.findByTransactionLifeCycleIDDE063", query = "SELECT f FROM FirstPresentment f WHERE f.transactionLifeCycleIDDE063 = :transactionLifeCycleIDDE063"),
+    @NamedQuery(name = "FirstPresentment.findByMessageNumberDE071", query = "SELECT f FROM FirstPresentment f WHERE f.messageNumberDE071 = :messageNumberDE071"),
+    @NamedQuery(name = "FirstPresentment.findByTransactionDestinationInstitutionIDCodeDE093", query = "SELECT f FROM FirstPresentment f WHERE f.transactionDestinationInstitutionIDCodeDE093 = :transactionDestinationInstitutionIDCodeDE093"),
+    @NamedQuery(name = "FirstPresentment.findByTransactionOriginatorInstitutionIDCodeDE094", query = "SELECT f FROM FirstPresentment f WHERE f.transactionOriginatorInstitutionIDCodeDE094 = :transactionOriginatorInstitutionIDCodeDE094"),
+    @NamedQuery(name = "FirstPresentment.findByReceivingInstitutionIDCodeDE100", query = "SELECT f FROM FirstPresentment f WHERE f.receivingInstitutionIDCodeDE100 = :receivingInstitutionIDCodeDE100"),
+    @NamedQuery(name = "FirstPresentment.findByAmountCurrencyConversion111", query = "SELECT f FROM FirstPresentment f WHERE f.amountCurrencyConversion111 = :amountCurrencyConversion111"),
+    @NamedQuery(name = "FirstPresentment.findByAdditionalData3DE123", query = "SELECT f FROM FirstPresentment f WHERE f.additionalData3DE123 = :additionalData3DE123"),
+    @NamedQuery(name = "FirstPresentment.findByAdditionalData4DE124", query = "SELECT f FROM FirstPresentment f WHERE f.additionalData4DE124 = :additionalData4DE124"),
+    @NamedQuery(name = "FirstPresentment.findByAdditionalData5DE125", query = "SELECT f FROM FirstPresentment f WHERE f.additionalData5DE125 = :additionalData5DE125"),
+    @NamedQuery(name = "FirstPresentment.findByFileIDPDS0105", query = "SELECT f FROM FirstPresentment f WHERE f.fileIDPDS0105 = :fileIDPDS0105"),
+    @NamedQuery(name = "FirstPresentment.findByFileProcessDate", query = "SELECT f FROM FirstPresentment f WHERE f.fileProcessDate = :fileProcessDate"),
+    @NamedQuery(name = "FirstPresentment.findByCleared", query = "SELECT f FROM FirstPresentment f WHERE f.cleared = :cleared"),
+    @NamedQuery(name = "FirstPresentment.findByStatus", query = "SELECT f FROM FirstPresentment f WHERE f.status = :status"),
+    @NamedQuery(name = "FirstPresentment.findByRccPds1012", query = "SELECT f FROM FirstPresentment f WHERE f.rccPds1012 = :rccPds1012"),
+    @NamedQuery(name = "FirstPresentment.findByStmtNarrativePDS1015", query = "SELECT f FROM FirstPresentment f WHERE f.stmtNarrativePDS1015 = :stmtNarrativePDS1015"),
+    @NamedQuery(name = "FirstPresentment.findByReconDate", query = "SELECT f FROM FirstPresentment f WHERE f.reconDate = :reconDate"),
+    @NamedQuery(name = "FirstPresentment.findByReconCycle", query = "SELECT f FROM FirstPresentment f WHERE f.reconCycle = :reconCycle"),
+    @NamedQuery(name = "FirstPresentment.findBySettlementDate", query = "SELECT f FROM FirstPresentment f WHERE f.settlementDate = :settlementDate"),
+    @NamedQuery(name = "FirstPresentment.findBySettlementCycle", query = "SELECT f FROM FirstPresentment f WHERE f.settlementCycle = :settlementCycle"),
+    @NamedQuery(name = "FirstPresentment.findByFileHeaderID", query = "SELECT f FROM FirstPresentment f WHERE f.fileHeaderID = :fileHeaderID"),
+    @NamedQuery(name = "FirstPresentment.findByCardIssuerReferenceData095", query = "SELECT f FROM FirstPresentment f WHERE f.cardIssuerReferenceData095 = :cardIssuerReferenceData095"),
+    @NamedQuery(name = "FirstPresentment.findByDataRecord072", query = "SELECT f FROM FirstPresentment f WHERE f.dataRecord072 = :dataRecord072"),
+    @NamedQuery(name = "FirstPresentment.findByFlSecondPresentment", query = "SELECT f FROM FirstPresentment f WHERE f.flSecondPresentment = :flSecondPresentment"),
+    @NamedQuery(name = "FirstPresentment.findByAmountCCA", query = "SELECT f FROM FirstPresentment f WHERE f.amountCCA = :amountCCA"),
+    @NamedQuery(name = "FirstPresentment.findByTxnTypeProcCode", query = "SELECT f FROM FirstPresentment f WHERE f.txnTypeProcCode = :txnTypeProcCode"),
+    @NamedQuery(name = "FirstPresentment.findByAccountFrom", query = "SELECT f FROM FirstPresentment f WHERE f.accountFrom = :accountFrom"),
+    @NamedQuery(name = "FirstPresentment.findByAccountTo", query = "SELECT f FROM FirstPresentment f WHERE f.accountTo = :accountTo"),
+    @NamedQuery(name = "FirstPresentment.findByTraceidLifecycle", query = "SELECT f FROM FirstPresentment f WHERE f.traceidLifecycle = :traceidLifecycle"),
+    @NamedQuery(name = "FirstPresentment.findByPant", query = "SELECT f FROM FirstPresentment f WHERE f.pant = :pant"),
+    @NamedQuery(name = "FirstPresentment.findByPaymentTokenId", query = "SELECT f FROM FirstPresentment f WHERE f.paymentTokenId = :paymentTokenId"),
+    @NamedQuery(name = "FirstPresentment.findByMerchTel", query = "SELECT f FROM FirstPresentment f WHERE f.merchTel = :merchTel"),
+    @NamedQuery(name = "FirstPresentment.findByMerchContact", query = "SELECT f FROM FirstPresentment f WHERE f.merchContact = :merchContact"),
+    @NamedQuery(name = "FirstPresentment.findByMerchNameOther", query = "SELECT f FROM FirstPresentment f WHERE f.merchNameOther = :merchNameOther"),
+    @NamedQuery(name = "FirstPresentment.findByMerchURL", query = "SELECT f FROM FirstPresentment f WHERE f.merchURL = :merchURL"),
+    @NamedQuery(name = "FirstPresentment.findByMerchNetID", query = "SELECT f FROM FirstPresentment f WHERE f.merchNetID = :merchNetID"),
+    @NamedQuery(name = "FirstPresentment.findByMerchTaxID", query = "SELECT f FROM FirstPresentment f WHERE f.merchTaxID = :merchTaxID"),
+    @NamedQuery(name = "FirstPresentment.findByPOSCardholderPresent", query = "SELECT f FROM FirstPresentment f WHERE f.pOSCardholderPresent = :pOSCardholderPresent"),
+    @NamedQuery(name = "FirstPresentment.findByPOSCardPresent", query = "SELECT f FROM FirstPresentment f WHERE f.pOSCardPresent = :pOSCardPresent"),
+    @NamedQuery(name = "FirstPresentment.findByPOSCardInput", query = "SELECT f FROM FirstPresentment f WHERE f.pOSCardInput = :pOSCardInput"),
+    @NamedQuery(name = "FirstPresentment.findByPOSCardholderAuthenMethod1", query = "SELECT f FROM FirstPresentment f WHERE f.pOSCardholderAuthenMethod1 = :pOSCardholderAuthenMethod1"),
+    @NamedQuery(name = "FirstPresentment.findByPOSCardholderAuthenEntity1", query = "SELECT f FROM FirstPresentment f WHERE f.pOSCardholderAuthenEntity1 = :pOSCardholderAuthenEntity1"),
+    @NamedQuery(name = "FirstPresentment.findByPOSCardholderAuthenMethod2", query = "SELECT f FROM FirstPresentment f WHERE f.pOSCardholderAuthenMethod2 = :pOSCardholderAuthenMethod2"),
+    @NamedQuery(name = "FirstPresentment.findByPOSCardholderAuthenEntity2", query = "SELECT f FROM FirstPresentment f WHERE f.pOSCardholderAuthenEntity2 = :pOSCardholderAuthenEntity2"),
+    @NamedQuery(name = "FirstPresentment.findByPOSChipFallback", query = "SELECT f FROM FirstPresentment f WHERE f.pOSChipFallback = :pOSChipFallback"),
+    @NamedQuery(name = "FirstPresentment.findByCardDeviceType", query = "SELECT f FROM FirstPresentment f WHERE f.cardDeviceType = :cardDeviceType"),
+    @NamedQuery(name = "FirstPresentment.findByPOSSecurityCardholder2merchant", query = "SELECT f FROM FirstPresentment f WHERE f.pOSSecurityCardholder2merchant = :pOSSecurityCardholder2merchant"),
+    @NamedQuery(name = "FirstPresentment.findByEmvAtc", query = "SELECT f FROM FirstPresentment f WHERE f.emvAtc = :emvAtc"),
+    @NamedQuery(name = "FirstPresentment.findByEMVCVMCode", query = "SELECT f FROM FirstPresentment f WHERE f.eMVCVMCode = :eMVCVMCode"),
+    @NamedQuery(name = "FirstPresentment.findByEMVCVMResult", query = "SELECT f FROM FirstPresentment f WHERE f.eMVCVMResult = :eMVCVMResult"),
+    @NamedQuery(name = "FirstPresentment.findByEMVTxnCode", query = "SELECT f FROM FirstPresentment f WHERE f.eMVTxnCode = :eMVTxnCode"),
+    @NamedQuery(name = "FirstPresentment.findByPOSCapCardInput", query = "SELECT f FROM FirstPresentment f WHERE f.pOSCapCardInput = :pOSCapCardInput"),
+    @NamedQuery(name = "FirstPresentment.findByPOSCapCardholderAuthen", query = "SELECT f FROM FirstPresentment f WHERE f.pOSCapCardholderAuthen = :pOSCapCardholderAuthen"),
+    @NamedQuery(name = "FirstPresentment.findByPOSCapCardCapture", query = "SELECT f FROM FirstPresentment f WHERE f.pOSCapCardCapture = :pOSCapCardCapture"),
+    @NamedQuery(name = "FirstPresentment.findByPOSCapAttended", query = "SELECT f FROM FirstPresentment f WHERE f.pOSCapAttended = :pOSCapAttended"),
+    @NamedQuery(name = "FirstPresentment.findByPOSCapEnvironment", query = "SELECT f FROM FirstPresentment f WHERE f.pOSCapEnvironment = :pOSCapEnvironment"),
+    @NamedQuery(name = "FirstPresentment.findByPOSCapCardOutput", query = "SELECT f FROM FirstPresentment f WHERE f.pOSCapCardOutput = :pOSCapCardOutput"),
+    @NamedQuery(name = "FirstPresentment.findByPOSCapTerminalOutput", query = "SELECT f FROM FirstPresentment f WHERE f.pOSCapTerminalOutput = :pOSCapTerminalOutput"),
+    @NamedQuery(name = "FirstPresentment.findByPOSCapPINCapture", query = "SELECT f FROM FirstPresentment f WHERE f.pOSCapPINCapture = :pOSCapPINCapture"),
+    @NamedQuery(name = "FirstPresentment.findByPOSCapTerminalType", query = "SELECT f FROM FirstPresentment f WHERE f.pOSCapTerminalType = :pOSCapTerminalType"),
+    @NamedQuery(name = "FirstPresentment.findByEMVTermType", query = "SELECT f FROM FirstPresentment f WHERE f.eMVTermType = :eMVTermType"),
+    @NamedQuery(name = "FirstPresentment.findByEMVTermCap", query = "SELECT f FROM FirstPresentment f WHERE f.eMVTermCap = :eMVTermCap"),
+    @NamedQuery(name = "FirstPresentment.findByBusinessActivityPDS0158", query = "SELECT f FROM FirstPresentment f WHERE f.businessActivityPDS0158 = :businessActivityPDS0158"),
+    @NamedQuery(name = "FirstPresentment.findByInstantFundingNetwork", query = "SELECT f FROM FirstPresentment f WHERE f.instantFundingNetwork = :instantFundingNetwork"),
+    @NamedQuery(name = "FirstPresentment.findByMultiPartNumber", query = "SELECT f FROM FirstPresentment f WHERE f.multiPartNumber = :multiPartNumber"),
+    @NamedQuery(name = "FirstPresentment.findByMultiPartCount", query = "SELECT f FROM FirstPresentment f WHERE f.multiPartCount = :multiPartCount"),
+    @NamedQuery(name = "FirstPresentment.findByDCCIndicator", query = "SELECT f FROM FirstPresentment f WHERE f.dCCIndicator = :dCCIndicator")})
+public class FirstPresentment implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Basic(optional = false)
+    @Column(name = "Presentment_ID")
+    private Long presentmentID;
+    @Column(name = "MTID")
+    private String mtid;
+    @Column(name = "PAN_002")
+    private String pan002;
+    @Column(name = "Processing_Code_003")
+    private String processingCode003;
+    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
+    @Column(name = "Amount_Transaction_004")
+    private BigDecimal amountTransaction004;
+    @Column(name = "Amount_Reconciliation_005")
+    private BigDecimal amountReconciliation005;
+    @Column(name = "Amount_CardHolderBilling_006")
+    private BigDecimal amountCardHolderBilling006;
+    @Column(name = "Conversion_Rate_Reconciliation_009")
+    private String conversionRateReconciliation009;
+    @Column(name = "Conversion_Rate_CardHolderBilling_010")
+    private String conversionRateCardHolderBilling010;
+    @Column(name = "Local_Transaction_Time_012")
+    private String localTransactionTime012;
+    @Column(name = "Date_Expiration_014")
+    private String dateExpiration014;
+    @Column(name = "POS_Data_Code_22")
+    private String pOSDataCode22;
+    @Column(name = "Card_Sequence_Number_023")
+    private String cardSequenceNumber023;
+    @Column(name = "Function_Code_024")
+    private String functionCode024;
+    @Column(name = "Message_Reason_Code_025")
+    private String messageReasonCode025;
+    @Column(name = "Card_Acceptor_Business_Code_026")
+    private String cardAcceptorBusinessCode026;
+    @Column(name = "Amounts_Original_030")
+    private String amountsOriginal030;
+    @Column(name = "Acquirer_Reference_Data_031")
+    private String acquirerReferenceData031;
+    @Column(name = "AID_032")
+    private String aid032;
+    @Column(name = "FID_033")
+    private String fid033;
+    @Column(name = "Retrieval_Reference_Number_037")
+    private String retrievalReferenceNumber037;
+    @Column(name = "Approval_Code_038")
+    private String approvalCode038;
+    @Column(name = "Service_Code_040")
+    private String serviceCode040;
+    @Column(name = "Card_Acceptor_Terminal_ID_041")
+    private String cardAcceptorTerminalID041;
+    @Column(name = "Card_Acceptor_ID_Code_042")
+    private String cardAcceptorIDCode042;
+    @Column(name = "Card_Acceptor_Name_Location_043")
+    private String cardAcceptorNameLocation043;
+    @Column(name = "Additional_Data_048")
+    private String additionalData048;
+    @Column(name = "Currency_Code_Transaction_DE049")
+    private String currencyCodeTransactionDE049;
+    @Column(name = "Currency_Code_Reconciliation_DE050")
+    private String currencyCodeReconciliationDE050;
+    @Column(name = "Currency_Code_CardHolderBilling_DE051")
+    private String currencyCodeCardHolderBillingDE051;
+    @Column(name = "Additional_Amounts_DE054")
+    private String additionalAmountsDE054;
+    @Column(name = "ICC_System_Related_Data_DE055")
+    private String iCCSystemRelatedDataDE055;
+    @Column(name = "Additional_Data_2_DE062")
+    private String additionalData2DE062;
+    @Column(name = "Transaction_Life_Cycle_ID_DE063")
+    private String transactionLifeCycleIDDE063;
+    @Column(name = "Message_Number_DE071")
+    private String messageNumberDE071;
+    @Column(name = "Transaction_Destination_Institution_ID_Code_DE093")
+    private String transactionDestinationInstitutionIDCodeDE093;
+    @Column(name = "Transaction_Originator_Institution_ID_Code_DE094")
+    private String transactionOriginatorInstitutionIDCodeDE094;
+    @Column(name = "Receiving_Institution_ID_Code_DE100")
+    private String receivingInstitutionIDCodeDE100;
+    @Column(name = "Amount_CurrencyConversion_111")
+    private String amountCurrencyConversion111;
+    @Column(name = "Additional_Data_3_DE123")
+    private String additionalData3DE123;
+    @Column(name = "Additional_Data_4_DE124")
+    private String additionalData4DE124;
+    @Column(name = "Additional_Data_5_DE125")
+    private String additionalData5DE125;
+    @Column(name = "File_ID_PDS0105")
+    private String fileIDPDS0105;
+    @Basic(optional = false)
+    @Column(name = "FileProcessDate")
+    @Temporal(TemporalType.TIMESTAMP)
+    private Date fileProcessDate;
+    @Column(name = "Cleared")
+    private Boolean cleared;
+    @Column(name = "Status")
+    private Character status;
+    @Column(name = "RCC_PDS1012")
+    private String rccPds1012;
+    @Column(name = "StmtNarrative_PDS1015")
+    private String stmtNarrativePDS1015;
+    @Column(name = "reconDate")
+    @Temporal(TemporalType.TIMESTAMP)
+    private Date reconDate;
+    @Column(name = "reconCycle")
+    private String reconCycle;
+    @Column(name = "SettlementDate")
+    @Temporal(TemporalType.TIMESTAMP)
+    private Date settlementDate;
+    @Column(name = "SettlementCycle")
+    private String settlementCycle;
+    @Column(name = "FileHeaderID")
+    private Integer fileHeaderID;
+    @Column(name = "Card_Issuer_Reference_Data_095")
+    private String cardIssuerReferenceData095;
+    @Column(name = "DataRecord_072")
+    private String dataRecord072;
+    @Column(name = "flSecondPresentment")
+    private Boolean flSecondPresentment;
+    @Column(name = "Amount_CCA")
+    private BigDecimal amountCCA;
+    @Column(name = "TxnTypeProcCode")
+    private String txnTypeProcCode;
+    @Column(name = "Account_From")
+    private String accountFrom;
+    @Column(name = "Account_To")
+    private String accountTo;
+    @Column(name = "traceid_lifecycle")
+    private String traceidLifecycle;
+    @Column(name = "PANT")
+    private BigInteger pant;
+    @Column(name = "payment_token_id")
+    private Integer paymentTokenId;
+    @Column(name = "Merch_Tel")
+    private String merchTel;
+    @Column(name = "Merch_Contact")
+    private String merchContact;
+    @Column(name = "Merch_Name_Other")
+    private String merchNameOther;
+    @Column(name = "Merch_URL")
+    private String merchURL;
+    @Column(name = "Merch_Net_ID")
+    private String merchNetID;
+    @Column(name = "Merch_Tax_ID")
+    private String merchTaxID;
+    @Column(name = "POS_Cardholder_Present")
+    private Character pOSCardholderPresent;
+    @Column(name = "POS_Card_Present")
+    private Character pOSCardPresent;
+    @Column(name = "POS_Card_Input")
+    private Character pOSCardInput;
+    @Column(name = "POS_Cardholder_Authen_Method1")
+    private Character pOSCardholderAuthenMethod1;
+    @Column(name = "POS_Cardholder_Authen_Entity1")
+    private Character pOSCardholderAuthenEntity1;
+    @Column(name = "POS_Cardholder_Authen_Method2")
+    private Character pOSCardholderAuthenMethod2;
+    @Column(name = "POS_Cardholder_Authen_Entity2")
+    private Character pOSCardholderAuthenEntity2;
+    @Column(name = "POS_Chip_Fallback")
+    private Character pOSChipFallback;
+    @Column(name = "Card_Device_Type")
+    private String cardDeviceType;
+    @Column(name = "POS_Security_Cardholder2merchant")
+    private Character pOSSecurityCardholder2merchant;
+    @Column(name = "EMV_ATC")
+    private Integer emvAtc;
+    @Column(name = "EMV_CVMCode")
+    private Integer eMVCVMCode;
+    @Column(name = "EMV_CVMResult")
+    private Integer eMVCVMResult;
+    @Column(name = "EMV_TxnCode")
+    private String eMVTxnCode;
+    @Column(name = "POSCap_Card_Input")
+    private String pOSCapCardInput;
+    @Column(name = "POSCap_Cardholder_Authen")
+    private String pOSCapCardholderAuthen;
+    @Column(name = "POSCap_Card_Capture")
+    private Character pOSCapCardCapture;
+    @Column(name = "POSCap_Attended")
+    private Character pOSCapAttended;
+    @Column(name = "POSCap_Environment")
+    private Character pOSCapEnvironment;
+    @Column(name = "POSCap_Card_Output")
+    private Character pOSCapCardOutput;
+    @Column(name = "POSCap_Terminal_Output")
+    private Character pOSCapTerminalOutput;
+    @Column(name = "POSCap_PIN_Capture")
+    private Character pOSCapPINCapture;
+    @Column(name = "POSCap_Terminal_Type")
+    private Character pOSCapTerminalType;
+    @Column(name = "EMV_TermType")
+    private String eMVTermType;
+    @Column(name = "EMV_TermCap")
+    private String eMVTermCap;
+    @Column(name = "BusinessActivity_PDS0158")
+    private String businessActivityPDS0158;
+    @Column(name = "Instant_Funding_Network")
+    private Boolean instantFundingNetwork;
+    @Column(name = "multi_part_number")
+    private Integer multiPartNumber;
+    @Column(name = "multi_part_count")
+    private Integer multiPartCount;
+    @Column(name = "DCC_Indicator")
+    private Boolean dCCIndicator;
+
+    public FirstPresentment() {
+    }
+
+    public FirstPresentment(Long presentmentID) {
+        this.presentmentID = presentmentID;
+    }
+
+    public FirstPresentment(Long presentmentID, Date fileProcessDate) {
+        this.presentmentID = presentmentID;
+        this.fileProcessDate = fileProcessDate;
+    }
+
+    public Long getPresentmentID() {
+        return presentmentID;
+    }
+
+    public void setPresentmentID(Long presentmentID) {
+        this.presentmentID = presentmentID;
+    }
+
+    public String getMtid() {
+        return mtid;
+    }
+
+    public void setMtid(String mtid) {
+        this.mtid = mtid;
+    }
+
+    public String getPan002() {
+        return pan002;
+    }
+
+    public void setPan002(String pan002) {
+        this.pan002 = pan002;
+    }
+
+    public String getProcessingCode003() {
+        return processingCode003;
+    }
+
+    public void setProcessingCode003(String processingCode003) {
+        this.processingCode003 = processingCode003;
+    }
+
+    public BigDecimal getAmountTransaction004() {
+        return amountTransaction004;
+    }
+
+    public void setAmountTransaction004(BigDecimal amountTransaction004) {
+        this.amountTransaction004 = amountTransaction004;
+    }
+
+    public BigDecimal getAmountReconciliation005() {
+        return amountReconciliation005;
+    }
+
+    public void setAmountReconciliation005(BigDecimal amountReconciliation005) {
+        this.amountReconciliation005 = amountReconciliation005;
+    }
+
+    public BigDecimal getAmountCardHolderBilling006() {
+        return amountCardHolderBilling006;
+    }
+
+    public void setAmountCardHolderBilling006(BigDecimal amountCardHolderBilling006) {
+        this.amountCardHolderBilling006 = amountCardHolderBilling006;
+    }
+
+    public String getConversionRateReconciliation009() {
+        return conversionRateReconciliation009;
+    }
+
+    public void setConversionRateReconciliation009(String conversionRateReconciliation009) {
+        this.conversionRateReconciliation009 = conversionRateReconciliation009;
+    }
+
+    public String getConversionRateCardHolderBilling010() {
+        return conversionRateCardHolderBilling010;
+    }
+
+    public void setConversionRateCardHolderBilling010(String conversionRateCardHolderBilling010) {
+        this.conversionRateCardHolderBilling010 = conversionRateCardHolderBilling010;
+    }
+
+    public String getLocalTransactionTime012() {
+        return localTransactionTime012;
+    }
+
+    public void setLocalTransactionTime012(String localTransactionTime012) {
+        this.localTransactionTime012 = localTransactionTime012;
+    }
+
+    public String getDateExpiration014() {
+        return dateExpiration014;
+    }
+
+    public void setDateExpiration014(String dateExpiration014) {
+        this.dateExpiration014 = dateExpiration014;
+    }
+
+    public String getPOSDataCode22() {
+        return pOSDataCode22;
+    }
+
+    public void setPOSDataCode22(String pOSDataCode22) {
+        this.pOSDataCode22 = pOSDataCode22;
+    }
+
+    public String getCardSequenceNumber023() {
+        return cardSequenceNumber023;
+    }
+
+    public void setCardSequenceNumber023(String cardSequenceNumber023) {
+        this.cardSequenceNumber023 = cardSequenceNumber023;
+    }
+
+    public String getFunctionCode024() {
+        return functionCode024;
+    }
+
+    public void setFunctionCode024(String functionCode024) {
+        this.functionCode024 = functionCode024;
+    }
+
+    public String getMessageReasonCode025() {
+        return messageReasonCode025;
+    }
+
+    public void setMessageReasonCode025(String messageReasonCode025) {
+        this.messageReasonCode025 = messageReasonCode025;
+    }
+
+    public String getCardAcceptorBusinessCode026() {
+        return cardAcceptorBusinessCode026;
+    }
+
+    public void setCardAcceptorBusinessCode026(String cardAcceptorBusinessCode026) {
+        this.cardAcceptorBusinessCode026 = cardAcceptorBusinessCode026;
+    }
+
+    public String getAmountsOriginal030() {
+        return amountsOriginal030;
+    }
+
+    public void setAmountsOriginal030(String amountsOriginal030) {
+        this.amountsOriginal030 = amountsOriginal030;
+    }
+
+    public String getAcquirerReferenceData031() {
+        return acquirerReferenceData031;
+    }
+
+    public void setAcquirerReferenceData031(String acquirerReferenceData031) {
+        this.acquirerReferenceData031 = acquirerReferenceData031;
+    }
+
+    public String getAid032() {
+        return aid032;
+    }
+
+    public void setAid032(String aid032) {
+        this.aid032 = aid032;
+    }
+
+    public String getFid033() {
+        return fid033;
+    }
+
+    public void setFid033(String fid033) {
+        this.fid033 = fid033;
+    }
+
+    public String getRetrievalReferenceNumber037() {
+        return retrievalReferenceNumber037;
+    }
+
+    public void setRetrievalReferenceNumber037(String retrievalReferenceNumber037) {
+        this.retrievalReferenceNumber037 = retrievalReferenceNumber037;
+    }
+
+    public String getApprovalCode038() {
+        return approvalCode038;
+    }
+
+    public void setApprovalCode038(String approvalCode038) {
+        this.approvalCode038 = approvalCode038;
+    }
+
+    public String getServiceCode040() {
+        return serviceCode040;
+    }
+
+    public void setServiceCode040(String serviceCode040) {
+        this.serviceCode040 = serviceCode040;
+    }
+
+    public String getCardAcceptorTerminalID041() {
+        return cardAcceptorTerminalID041;
+    }
+
+    public void setCardAcceptorTerminalID041(String cardAcceptorTerminalID041) {
+        this.cardAcceptorTerminalID041 = cardAcceptorTerminalID041;
+    }
+
+    public String getCardAcceptorIDCode042() {
+        return cardAcceptorIDCode042;
+    }
+
+    public void setCardAcceptorIDCode042(String cardAcceptorIDCode042) {
+        this.cardAcceptorIDCode042 = cardAcceptorIDCode042;
+    }
+
+    public String getCardAcceptorNameLocation043() {
+        return cardAcceptorNameLocation043;
+    }
+
+    public void setCardAcceptorNameLocation043(String cardAcceptorNameLocation043) {
+        this.cardAcceptorNameLocation043 = cardAcceptorNameLocation043;
+    }
+
+    public String getAdditionalData048() {
+        return additionalData048;
+    }
+
+    public void setAdditionalData048(String additionalData048) {
+        this.additionalData048 = additionalData048;
+    }
+
+    public String getCurrencyCodeTransactionDE049() {
+        return currencyCodeTransactionDE049;
+    }
+
+    public void setCurrencyCodeTransactionDE049(String currencyCodeTransactionDE049) {
+        this.currencyCodeTransactionDE049 = currencyCodeTransactionDE049;
+    }
+
+    public String getCurrencyCodeReconciliationDE050() {
+        return currencyCodeReconciliationDE050;
+    }
+
+    public void setCurrencyCodeReconciliationDE050(String currencyCodeReconciliationDE050) {
+        this.currencyCodeReconciliationDE050 = currencyCodeReconciliationDE050;
+    }
+
+    public String getCurrencyCodeCardHolderBillingDE051() {
+        return currencyCodeCardHolderBillingDE051;
+    }
+
+    public void setCurrencyCodeCardHolderBillingDE051(String currencyCodeCardHolderBillingDE051) {
+        this.currencyCodeCardHolderBillingDE051 = currencyCodeCardHolderBillingDE051;
+    }
+
+    public String getAdditionalAmountsDE054() {
+        return additionalAmountsDE054;
+    }
+
+    public void setAdditionalAmountsDE054(String additionalAmountsDE054) {
+        this.additionalAmountsDE054 = additionalAmountsDE054;
+    }
+
+    public String getICCSystemRelatedDataDE055() {
+        return iCCSystemRelatedDataDE055;
+    }
+
+    public void setICCSystemRelatedDataDE055(String iCCSystemRelatedDataDE055) {
+        this.iCCSystemRelatedDataDE055 = iCCSystemRelatedDataDE055;
+    }
+
+    public String getAdditionalData2DE062() {
+        return additionalData2DE062;
+    }
+
+    public void setAdditionalData2DE062(String additionalData2DE062) {
+        this.additionalData2DE062 = additionalData2DE062;
+    }
+
+    public String getTransactionLifeCycleIDDE063() {
+        return transactionLifeCycleIDDE063;
+    }
+
+    public void setTransactionLifeCycleIDDE063(String transactionLifeCycleIDDE063) {
+        this.transactionLifeCycleIDDE063 = transactionLifeCycleIDDE063;
+    }
+
+    public String getMessageNumberDE071() {
+        return messageNumberDE071;
+    }
+
+    public void setMessageNumberDE071(String messageNumberDE071) {
+        this.messageNumberDE071 = messageNumberDE071;
+    }
+
+    public String getTransactionDestinationInstitutionIDCodeDE093() {
+        return transactionDestinationInstitutionIDCodeDE093;
+    }
+
+    public void setTransactionDestinationInstitutionIDCodeDE093(String transactionDestinationInstitutionIDCodeDE093) {
+        this.transactionDestinationInstitutionIDCodeDE093 = transactionDestinationInstitutionIDCodeDE093;
+    }
+
+    public String getTransactionOriginatorInstitutionIDCodeDE094() {
+        return transactionOriginatorInstitutionIDCodeDE094;
+    }
+
+    public void setTransactionOriginatorInstitutionIDCodeDE094(String transactionOriginatorInstitutionIDCodeDE094) {
+        this.transactionOriginatorInstitutionIDCodeDE094 = transactionOriginatorInstitutionIDCodeDE094;
+    }
+
+    public String getReceivingInstitutionIDCodeDE100() {
+        return receivingInstitutionIDCodeDE100;
+    }
+
+    public void setReceivingInstitutionIDCodeDE100(String receivingInstitutionIDCodeDE100) {
+        this.receivingInstitutionIDCodeDE100 = receivingInstitutionIDCodeDE100;
+    }
+
+    public String getAmountCurrencyConversion111() {
+        return amountCurrencyConversion111;
+    }
+
+    public void setAmountCurrencyConversion111(String amountCurrencyConversion111) {
+        this.amountCurrencyConversion111 = amountCurrencyConversion111;
+    }
+
+    public String getAdditionalData3DE123() {
+        return additionalData3DE123;
+    }
+
+    public void setAdditionalData3DE123(String additionalData3DE123) {
+        this.additionalData3DE123 = additionalData3DE123;
+    }
+
+    public String getAdditionalData4DE124() {
+        return additionalData4DE124;
+    }
+
+    public void setAdditionalData4DE124(String additionalData4DE124) {
+        this.additionalData4DE124 = additionalData4DE124;
+    }
+
+    public String getAdditionalData5DE125() {
+        return additionalData5DE125;
+    }
+
+    public void setAdditionalData5DE125(String additionalData5DE125) {
+        this.additionalData5DE125 = additionalData5DE125;
+    }
+
+    public String getFileIDPDS0105() {
+        return fileIDPDS0105;
+    }
+
+    public void setFileIDPDS0105(String fileIDPDS0105) {
+        this.fileIDPDS0105 = fileIDPDS0105;
+    }
+
+    public Date getFileProcessDate() {
+        return fileProcessDate;
+    }
+
+    public void setFileProcessDate(Date fileProcessDate) {
+        this.fileProcessDate = fileProcessDate;
+    }
+
+    public Boolean getCleared() {
+        return cleared;
+    }
+
+    public void setCleared(Boolean cleared) {
+        this.cleared = cleared;
+    }
+
+    public Character getStatus() {
+        return status;
+    }
+
+    public void setStatus(Character status) {
+        this.status = status;
+    }
+
+    public String getRccPds1012() {
+        return rccPds1012;
+    }
+
+    public void setRccPds1012(String rccPds1012) {
+        this.rccPds1012 = rccPds1012;
+    }
+
+    public String getStmtNarrativePDS1015() {
+        return stmtNarrativePDS1015;
+    }
+
+    public void setStmtNarrativePDS1015(String stmtNarrativePDS1015) {
+        this.stmtNarrativePDS1015 = stmtNarrativePDS1015;
+    }
+
+    public Date getReconDate() {
+        return reconDate;
+    }
+
+    public void setReconDate(Date reconDate) {
+        this.reconDate = reconDate;
+    }
+
+    public String getReconCycle() {
+        return reconCycle;
+    }
+
+    public void setReconCycle(String reconCycle) {
+        this.reconCycle = reconCycle;
+    }
+
+    public Date getSettlementDate() {
+        return settlementDate;
+    }
+
+    public void setSettlementDate(Date settlementDate) {
+        this.settlementDate = settlementDate;
+    }
+
+    public String getSettlementCycle() {
+        return settlementCycle;
+    }
+
+    public void setSettlementCycle(String settlementCycle) {
+        this.settlementCycle = settlementCycle;
+    }
+
+    public Integer getFileHeaderID() {
+        return fileHeaderID;
+    }
+
+    public void setFileHeaderID(Integer fileHeaderID) {
+        this.fileHeaderID = fileHeaderID;
+    }
+
+    public String getCardIssuerReferenceData095() {
+        return cardIssuerReferenceData095;
+    }
+
+    public void setCardIssuerReferenceData095(String cardIssuerReferenceData095) {
+        this.cardIssuerReferenceData095 = cardIssuerReferenceData095;
+    }
+
+    public String getDataRecord072() {
+        return dataRecord072;
+    }
+
+    public void setDataRecord072(String dataRecord072) {
+        this.dataRecord072 = dataRecord072;
+    }
+
+    public Boolean getFlSecondPresentment() {
+        return flSecondPresentment;
+    }
+
+    public void setFlSecondPresentment(Boolean flSecondPresentment) {
+        this.flSecondPresentment = flSecondPresentment;
+    }
+
+    public BigDecimal getAmountCCA() {
+        return amountCCA;
+    }
+
+    public void setAmountCCA(BigDecimal amountCCA) {
+        this.amountCCA = amountCCA;
+    }
+
+    public String getTxnTypeProcCode() {
+        return txnTypeProcCode;
+    }
+
+    public void setTxnTypeProcCode(String txnTypeProcCode) {
+        this.txnTypeProcCode = txnTypeProcCode;
+    }
+
+    public String getAccountFrom() {
+        return accountFrom;
+    }
+
+    public void setAccountFrom(String accountFrom) {
+        this.accountFrom = accountFrom;
+    }
+
+    public String getAccountTo() {
+        return accountTo;
+    }
+
+    public void setAccountTo(String accountTo) {
+        this.accountTo = accountTo;
+    }
+
+    public String getTraceidLifecycle() {
+        return traceidLifecycle;
+    }
+
+    public void setTraceidLifecycle(String traceidLifecycle) {
+        this.traceidLifecycle = traceidLifecycle;
+    }
+
+    public BigInteger getPant() {
+        return pant;
+    }
+
+    public void setPant(BigInteger pant) {
+        this.pant = pant;
+    }
+
+    public Integer getPaymentTokenId() {
+        return paymentTokenId;
+    }
+
+    public void setPaymentTokenId(Integer paymentTokenId) {
+        this.paymentTokenId = paymentTokenId;
+    }
+
+    public String getMerchTel() {
+        return merchTel;
+    }
+
+    public void setMerchTel(String merchTel) {
+        this.merchTel = merchTel;
+    }
+
+    public String getMerchContact() {
+        return merchContact;
+    }
+
+    public void setMerchContact(String merchContact) {
+        this.merchContact = merchContact;
+    }
+
+    public String getMerchNameOther() {
+        return merchNameOther;
+    }
+
+    public void setMerchNameOther(String merchNameOther) {
+        this.merchNameOther = merchNameOther;
+    }
+
+    public String getMerchURL() {
+        return merchURL;
+    }
+
+    public void setMerchURL(String merchURL) {
+        this.merchURL = merchURL;
+    }
+
+    public String getMerchNetID() {
+        return merchNetID;
+    }
+
+    public void setMerchNetID(String merchNetID) {
+        this.merchNetID = merchNetID;
+    }
+
+    public String getMerchTaxID() {
+        return merchTaxID;
+    }
+
+    public void setMerchTaxID(String merchTaxID) {
+        this.merchTaxID = merchTaxID;
+    }
+
+    public Character getPOSCardholderPresent() {
+        return pOSCardholderPresent;
+    }
+
+    public void setPOSCardholderPresent(Character pOSCardholderPresent) {
+        this.pOSCardholderPresent = pOSCardholderPresent;
+    }
+
+    public Character getPOSCardPresent() {
+        return pOSCardPresent;
+    }
+
+    public void setPOSCardPresent(Character pOSCardPresent) {
+        this.pOSCardPresent = pOSCardPresent;
+    }
+
+    public Character getPOSCardInput() {
+        return pOSCardInput;
+    }
+
+    public void setPOSCardInput(Character pOSCardInput) {
+        this.pOSCardInput = pOSCardInput;
+    }
+
+    public Character getPOSCardholderAuthenMethod1() {
+        return pOSCardholderAuthenMethod1;
+    }
+
+    public void setPOSCardholderAuthenMethod1(Character pOSCardholderAuthenMethod1) {
+        this.pOSCardholderAuthenMethod1 = pOSCardholderAuthenMethod1;
+    }
+
+    public Character getPOSCardholderAuthenEntity1() {
+        return pOSCardholderAuthenEntity1;
+    }
+
+    public void setPOSCardholderAuthenEntity1(Character pOSCardholderAuthenEntity1) {
+        this.pOSCardholderAuthenEntity1 = pOSCardholderAuthenEntity1;
+    }
+
+    public Character getPOSCardholderAuthenMethod2() {
+        return pOSCardholderAuthenMethod2;
+    }
+
+    public void setPOSCardholderAuthenMethod2(Character pOSCardholderAuthenMethod2) {
+        this.pOSCardholderAuthenMethod2 = pOSCardholderAuthenMethod2;
+    }
+
+    public Character getPOSCardholderAuthenEntity2() {
+        return pOSCardholderAuthenEntity2;
+    }
+
+    public void setPOSCardholderAuthenEntity2(Character pOSCardholderAuthenEntity2) {
+        this.pOSCardholderAuthenEntity2 = pOSCardholderAuthenEntity2;
+    }
+
+    public Character getPOSChipFallback() {
+        return pOSChipFallback;
+    }
+
+    public void setPOSChipFallback(Character pOSChipFallback) {
+        this.pOSChipFallback = pOSChipFallback;
+    }
+
+    public String getCardDeviceType() {
+        return cardDeviceType;
+    }
+
+    public void setCardDeviceType(String cardDeviceType) {
+        this.cardDeviceType = cardDeviceType;
+    }
+
+    public Character getPOSSecurityCardholder2merchant() {
+        return pOSSecurityCardholder2merchant;
+    }
+
+    public void setPOSSecurityCardholder2merchant(Character pOSSecurityCardholder2merchant) {
+        this.pOSSecurityCardholder2merchant = pOSSecurityCardholder2merchant;
+    }
+
+    public Integer getEmvAtc() {
+        return emvAtc;
+    }
+
+    public void setEmvAtc(Integer emvAtc) {
+        this.emvAtc = emvAtc;
+    }
+
+    public Integer getEMVCVMCode() {
+        return eMVCVMCode;
+    }
+
+    public void setEMVCVMCode(Integer eMVCVMCode) {
+        this.eMVCVMCode = eMVCVMCode;
+    }
+
+    public Integer getEMVCVMResult() {
+        return eMVCVMResult;
+    }
+
+    public void setEMVCVMResult(Integer eMVCVMResult) {
+        this.eMVCVMResult = eMVCVMResult;
+    }
+
+    public String getEMVTxnCode() {
+        return eMVTxnCode;
+    }
+
+    public void setEMVTxnCode(String eMVTxnCode) {
+        this.eMVTxnCode = eMVTxnCode;
+    }
+
+    public String getPOSCapCardInput() {
+        return pOSCapCardInput;
+    }
+
+    public void setPOSCapCardInput(String pOSCapCardInput) {
+        this.pOSCapCardInput = pOSCapCardInput;
+    }
+
+    public String getPOSCapCardholderAuthen() {
+        return pOSCapCardholderAuthen;
+    }
+
+    public void setPOSCapCardholderAuthen(String pOSCapCardholderAuthen) {
+        this.pOSCapCardholderAuthen = pOSCapCardholderAuthen;
+    }
+
+    public Character getPOSCapCardCapture() {
+        return pOSCapCardCapture;
+    }
+
+    public void setPOSCapCardCapture(Character pOSCapCardCapture) {
+        this.pOSCapCardCapture = pOSCapCardCapture;
+    }
+
+    public Character getPOSCapAttended() {
+        return pOSCapAttended;
+    }
+
+    public void setPOSCapAttended(Character pOSCapAttended) {
+        this.pOSCapAttended = pOSCapAttended;
+    }
+
+    public Character getPOSCapEnvironment() {
+        return pOSCapEnvironment;
+    }
+
+    public void setPOSCapEnvironment(Character pOSCapEnvironment) {
+        this.pOSCapEnvironment = pOSCapEnvironment;
+    }
+
+    public Character getPOSCapCardOutput() {
+        return pOSCapCardOutput;
+    }
+
+    public void setPOSCapCardOutput(Character pOSCapCardOutput) {
+        this.pOSCapCardOutput = pOSCapCardOutput;
+    }
+
+    public Character getPOSCapTerminalOutput() {
+        return pOSCapTerminalOutput;
+    }
+
+    public void setPOSCapTerminalOutput(Character pOSCapTerminalOutput) {
+        this.pOSCapTerminalOutput = pOSCapTerminalOutput;
+    }
+
+    public Character getPOSCapPINCapture() {
+        return pOSCapPINCapture;
+    }
+
+    public void setPOSCapPINCapture(Character pOSCapPINCapture) {
+        this.pOSCapPINCapture = pOSCapPINCapture;
+    }
+
+    public Character getPOSCapTerminalType() {
+        return pOSCapTerminalType;
+    }
+
+    public void setPOSCapTerminalType(Character pOSCapTerminalType) {
+        this.pOSCapTerminalType = pOSCapTerminalType;
+    }
+
+    public String getEMVTermType() {
+        return eMVTermType;
+    }
+
+    public void setEMVTermType(String eMVTermType) {
+        this.eMVTermType = eMVTermType;
+    }
+
+    public String getEMVTermCap() {
+        return eMVTermCap;
+    }
+
+    public void setEMVTermCap(String eMVTermCap) {
+        this.eMVTermCap = eMVTermCap;
+    }
+
+    public String getBusinessActivityPDS0158() {
+        return businessActivityPDS0158;
+    }
+
+    public void setBusinessActivityPDS0158(String businessActivityPDS0158) {
+        this.businessActivityPDS0158 = businessActivityPDS0158;
+    }
+
+    public Boolean getInstantFundingNetwork() {
+        return instantFundingNetwork;
+    }
+
+    public void setInstantFundingNetwork(Boolean instantFundingNetwork) {
+        this.instantFundingNetwork = instantFundingNetwork;
+    }
+
+    public Integer getMultiPartNumber() {
+        return multiPartNumber;
+    }
+
+    public void setMultiPartNumber(Integer multiPartNumber) {
+        this.multiPartNumber = multiPartNumber;
+    }
+
+    public Integer getMultiPartCount() {
+        return multiPartCount;
+    }
+
+    public void setMultiPartCount(Integer multiPartCount) {
+        this.multiPartCount = multiPartCount;
+    }
+
+    public Boolean getDCCIndicator() {
+        return dCCIndicator;
+    }
+
+    public void setDCCIndicator(Boolean dCCIndicator) {
+        this.dCCIndicator = dCCIndicator;
+    }
+
+    @Override
+    public int hashCode() {
+        int hash = 0;
+        hash += (presentmentID != null ? presentmentID.hashCode() : 0);
+        return hash;
+    }
+
+    @Override
+    public boolean equals(Object object) {
+        // TODO: Warning - this method won't work in the case the id fields are not set
+        if (!(object instanceof FirstPresentment)) {
+            return false;
+        }
+        FirstPresentment other = (FirstPresentment) object;
+        if ((this.presentmentID == null && other.presentmentID != null) || (this.presentmentID != null && !this.presentmentID.equals(other.presentmentID))) {
+            return false;
+        }
+        return true;
+    }
+
+    @Override
+    public String toString() {
+        return "ipmreader.FirstPresentment[ presentmentID=" + presentmentID + " ]";
+    }
+}

+ 364 - 0
IPMReader/src/ipmreader/IPMFileHistory.java

@@ -0,0 +1,364 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package ipmreader;
+
+import java.io.Serializable;
+import java.util.Date;
+import javax.persistence.Basic;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.NamedQueries;
+import javax.persistence.NamedQuery;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+import javax.xml.bind.annotation.XmlRootElement;
+
+/**
+ *
+ * @author paul
+ */
+@Entity
+@Table(name = "IPMFileHistory")
+@XmlRootElement
+@NamedQueries({
+    @NamedQuery(name = "IPMFileHistory.findAll", query = "SELECT i FROM IPMFileHistory i"),
+    @NamedQuery(name = "IPMFileHistory.findById", query = "SELECT i FROM IPMFileHistory i WHERE i.id = :id"),
+    @NamedQuery(name = "IPMFileHistory.findByIPMFileName", query = "SELECT i FROM IPMFileHistory i WHERE i.iPMFileName = :iPMFileName"),
+    @NamedQuery(name = "IPMFileHistory.findByFileID", query = "SELECT i FROM IPMFileHistory i WHERE i.fileID = :fileID"),
+    @NamedQuery(name = "IPMFileHistory.findByFileProcessDate", query = "SELECT i FROM IPMFileHistory i WHERE i.fileProcessDate = :fileProcessDate"),
+    @NamedQuery(name = "IPMFileHistory.findByReceived", query = "SELECT i FROM IPMFileHistory i WHERE i.received = :received"),
+    @NamedQuery(name = "IPMFileHistory.findByFirstPresentment", query = "SELECT i FROM IPMFileHistory i WHERE i.firstPresentment = :firstPresentment"),
+    @NamedQuery(name = "IPMFileHistory.findBySecondPresentment", query = "SELECT i FROM IPMFileHistory i WHERE i.secondPresentment = :secondPresentment"),
+    @NamedQuery(name = "IPMFileHistory.findByFeeCollection", query = "SELECT i FROM IPMFileHistory i WHERE i.feeCollection = :feeCollection"),
+    @NamedQuery(name = "IPMFileHistory.findByChargeBack", query = "SELECT i FROM IPMFileHistory i WHERE i.chargeBack = :chargeBack"),
+    @NamedQuery(name = "IPMFileHistory.findByCurrencyUpdate", query = "SELECT i FROM IPMFileHistory i WHERE i.currencyUpdate = :currencyUpdate"),
+    @NamedQuery(name = "IPMFileHistory.findByFileCurrencySummary", query = "SELECT i FROM IPMFileHistory i WHERE i.fileCurrencySummary = :fileCurrencySummary"),
+    @NamedQuery(name = "IPMFileHistory.findByFinancialDetailAddendum", query = "SELECT i FROM IPMFileHistory i WHERE i.financialDetailAddendum = :financialDetailAddendum"),
+    @NamedQuery(name = "IPMFileHistory.findByFinancialPosition", query = "SELECT i FROM IPMFileHistory i WHERE i.financialPosition = :financialPosition"),
+    @NamedQuery(name = "IPMFileHistory.findByFundsTransferFeeCollection", query = "SELECT i FROM IPMFileHistory i WHERE i.fundsTransferFeeCollection = :fundsTransferFeeCollection"),
+    @NamedQuery(name = "IPMFileHistory.findByMessageExceptionFileReject", query = "SELECT i FROM IPMFileHistory i WHERE i.messageExceptionFileReject = :messageExceptionFileReject"),
+    @NamedQuery(name = "IPMFileHistory.findByRetrievalRequest", query = "SELECT i FROM IPMFileHistory i WHERE i.retrievalRequest = :retrievalRequest"),
+    @NamedQuery(name = "IPMFileHistory.findBySettlementPositionDetail", query = "SELECT i FROM IPMFileHistory i WHERE i.settlementPositionDetail = :settlementPositionDetail"),
+    @NamedQuery(name = "IPMFileHistory.findByTextMessage", query = "SELECT i FROM IPMFileHistory i WHERE i.textMessage = :textMessage"),
+    @NamedQuery(name = "IPMFileHistory.findByTotalCount", query = "SELECT i FROM IPMFileHistory i WHERE i.totalCount = :totalCount"),
+    @NamedQuery(name = "IPMFileHistory.findByFlCompleted", query = "SELECT i FROM IPMFileHistory i WHERE i.flCompleted = :flCompleted"),
+    @NamedQuery(name = "IPMFileHistory.findByMatchingStatus", query = "SELECT i FROM IPMFileHistory i WHERE i.matchingStatus = :matchingStatus"),
+    @NamedQuery(name = "IPMFileHistory.findByMatchingCompletedDate", query = "SELECT i FROM IPMFileHistory i WHERE i.matchingCompletedDate = :matchingCompletedDate"),
+    @NamedQuery(name = "IPMFileHistory.findBySource", query = "SELECT i FROM IPMFileHistory i WHERE i.source = :source")})
+public class IPMFileHistory implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Basic(optional = false)
+    @Column(name = "ID")
+    private Integer id;
+    @Column(name = "IPMFileName")
+    private String iPMFileName;
+    @Column(name = "FileID")
+    private String fileID;
+    @Basic(optional = false)
+    @Column(name = "FileProcessDate")
+    @Temporal(TemporalType.TIMESTAMP)
+    private Date fileProcessDate;
+    @Basic(optional = false)
+    @Column(name = "Received")
+    private boolean received;
+    @Basic(optional = false)
+    @Column(name = "FirstPresentment")
+    private int firstPresentment;
+    @Basic(optional = false)
+    @Column(name = "SecondPresentment")
+    private int secondPresentment;
+    @Basic(optional = false)
+    @Column(name = "FeeCollection")
+    private int feeCollection;
+    @Basic(optional = false)
+    @Column(name = "ChargeBack")
+    private int chargeBack;
+    @Basic(optional = false)
+    @Column(name = "CurrencyUpdate")
+    private int currencyUpdate;
+    @Basic(optional = false)
+    @Column(name = "FileCurrencySummary")
+    private int fileCurrencySummary;
+    @Basic(optional = false)
+    @Column(name = "FinancialDetailAddendum")
+    private int financialDetailAddendum;
+    @Basic(optional = false)
+    @Column(name = "FinancialPosition")
+    private int financialPosition;
+    @Basic(optional = false)
+    @Column(name = "FundsTransferFeeCollection")
+    private int fundsTransferFeeCollection;
+    @Basic(optional = false)
+    @Column(name = "MessageExceptionFileReject")
+    private int messageExceptionFileReject;
+    @Basic(optional = false)
+    @Column(name = "RetrievalRequest")
+    private int retrievalRequest;
+    @Basic(optional = false)
+    @Column(name = "SettlementPositionDetail")
+    private int settlementPositionDetail;
+    @Basic(optional = false)
+    @Column(name = "TextMessage")
+    private int textMessage;
+    @Basic(optional = false)
+    @Column(name = "TotalCount")
+    private int totalCount;
+    @Column(name = "flCompleted")
+    private Short flCompleted;
+    @Basic(optional = false)
+    @Column(name = "MatchingStatus")
+    private short matchingStatus;
+    @Column(name = "MatchingCompletedDate")
+    @Temporal(TemporalType.TIMESTAMP)
+    private Date matchingCompletedDate;
+    @Column(name = "Source")
+    private String source;
+
+    public IPMFileHistory() {
+    }
+
+    public IPMFileHistory(Integer id) {
+        this.id = id;
+    }
+
+    public IPMFileHistory(Integer id, Date fileProcessDate, boolean received, int firstPresentment, int secondPresentment, int feeCollection, int chargeBack, int currencyUpdate, int fileCurrencySummary, int financialDetailAddendum, int financialPosition, int fundsTransferFeeCollection, int messageExceptionFileReject, int retrievalRequest, int settlementPositionDetail, int textMessage, int totalCount, short matchingStatus) {
+        this.id = id;
+        this.fileProcessDate = fileProcessDate;
+        this.received = received;
+        this.firstPresentment = firstPresentment;
+        this.secondPresentment = secondPresentment;
+        this.feeCollection = feeCollection;
+        this.chargeBack = chargeBack;
+        this.currencyUpdate = currencyUpdate;
+        this.fileCurrencySummary = fileCurrencySummary;
+        this.financialDetailAddendum = financialDetailAddendum;
+        this.financialPosition = financialPosition;
+        this.fundsTransferFeeCollection = fundsTransferFeeCollection;
+        this.messageExceptionFileReject = messageExceptionFileReject;
+        this.retrievalRequest = retrievalRequest;
+        this.settlementPositionDetail = settlementPositionDetail;
+        this.textMessage = textMessage;
+        this.totalCount = totalCount;
+        this.matchingStatus = matchingStatus;
+    }
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getIPMFileName() {
+        return iPMFileName;
+    }
+
+    public void setIPMFileName(String iPMFileName) {
+        this.iPMFileName = iPMFileName;
+    }
+
+    public String getFileID() {
+        return fileID;
+    }
+
+    public void setFileID(String fileID) {
+        this.fileID = fileID;
+    }
+
+    public Date getFileProcessDate() {
+        return fileProcessDate;
+    }
+
+    public void setFileProcessDate(Date fileProcessDate) {
+        this.fileProcessDate = fileProcessDate;
+    }
+
+    public boolean getReceived() {
+        return received;
+    }
+
+    public void setReceived(boolean received) {
+        this.received = received;
+    }
+
+    public int getFirstPresentment() {
+        return firstPresentment;
+    }
+
+    public void setFirstPresentment(int firstPresentment) {
+        this.firstPresentment = firstPresentment;
+    }
+
+    public int getSecondPresentment() {
+        return secondPresentment;
+    }
+
+    public void setSecondPresentment(int secondPresentment) {
+        this.secondPresentment = secondPresentment;
+    }
+
+    public int getFeeCollection() {
+        return feeCollection;
+    }
+
+    public void setFeeCollection(int feeCollection) {
+        this.feeCollection = feeCollection;
+    }
+
+    public int getChargeBack() {
+        return chargeBack;
+    }
+
+    public void setChargeBack(int chargeBack) {
+        this.chargeBack = chargeBack;
+    }
+
+    public int getCurrencyUpdate() {
+        return currencyUpdate;
+    }
+
+    public void setCurrencyUpdate(int currencyUpdate) {
+        this.currencyUpdate = currencyUpdate;
+    }
+
+    public int getFileCurrencySummary() {
+        return fileCurrencySummary;
+    }
+
+    public void setFileCurrencySummary(int fileCurrencySummary) {
+        this.fileCurrencySummary = fileCurrencySummary;
+    }
+
+    public int getFinancialDetailAddendum() {
+        return financialDetailAddendum;
+    }
+
+    public void setFinancialDetailAddendum(int financialDetailAddendum) {
+        this.financialDetailAddendum = financialDetailAddendum;
+    }
+
+    public int getFinancialPosition() {
+        return financialPosition;
+    }
+
+    public void setFinancialPosition(int financialPosition) {
+        this.financialPosition = financialPosition;
+    }
+
+    public int getFundsTransferFeeCollection() {
+        return fundsTransferFeeCollection;
+    }
+
+    public void setFundsTransferFeeCollection(int fundsTransferFeeCollection) {
+        this.fundsTransferFeeCollection = fundsTransferFeeCollection;
+    }
+
+    public int getMessageExceptionFileReject() {
+        return messageExceptionFileReject;
+    }
+
+    public void setMessageExceptionFileReject(int messageExceptionFileReject) {
+        this.messageExceptionFileReject = messageExceptionFileReject;
+    }
+
+    public int getRetrievalRequest() {
+        return retrievalRequest;
+    }
+
+    public void setRetrievalRequest(int retrievalRequest) {
+        this.retrievalRequest = retrievalRequest;
+    }
+
+    public int getSettlementPositionDetail() {
+        return settlementPositionDetail;
+    }
+
+    public void setSettlementPositionDetail(int settlementPositionDetail) {
+        this.settlementPositionDetail = settlementPositionDetail;
+    }
+
+    public int getTextMessage() {
+        return textMessage;
+    }
+
+    public void setTextMessage(int textMessage) {
+        this.textMessage = textMessage;
+    }
+
+    public int getTotalCount() {
+        return totalCount;
+    }
+
+    public void setTotalCount(int totalCount) {
+        this.totalCount = totalCount;
+    }
+
+    public Short getFlCompleted() {
+        return flCompleted;
+    }
+
+    public void setFlCompleted(Short flCompleted) {
+        this.flCompleted = flCompleted;
+    }
+
+    public short getMatchingStatus() {
+        return matchingStatus;
+    }
+
+    public void setMatchingStatus(short matchingStatus) {
+        this.matchingStatus = matchingStatus;
+    }
+
+    public Date getMatchingCompletedDate() {
+        return matchingCompletedDate;
+    }
+
+    public void setMatchingCompletedDate(Date matchingCompletedDate) {
+        this.matchingCompletedDate = matchingCompletedDate;
+    }
+
+    public String getSource() {
+        return source;
+    }
+
+    public void setSource(String source) {
+        this.source = source;
+    }
+
+    @Override
+    public int hashCode() {
+        int hash = 0;
+        hash += (id != null ? id.hashCode() : 0);
+        return hash;
+    }
+
+    @Override
+    public boolean equals(Object object) {
+        // TODO: Warning - this method won't work in the case the id fields are not set
+        if (!(object instanceof IPMFileHistory)) {
+            return false;
+        }
+        IPMFileHistory other = (IPMFileHistory) object;
+        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
+            return false;
+        }
+        return true;
+    }
+
+    @Override
+    public String toString() {
+        return "ipmreader.IPMFileHistory[ id=" + id + " ]";
+    }
+    
+}

+ 27 - 21
IPMReader/src/ipmreader/IPMReader.java

@@ -5,6 +5,10 @@
  */
 package ipmreader;
 
+import com.cloudsoft.MastercardFileReader.IpmDataElements;
+import com.cloudsoft.MastercardFileReader.IpmSpecificationConstants;
+import com.cloudsoft.MastercardFileReader.IPMInputStream;
+
 /**
  *
  * @author Lisewski
@@ -15,7 +19,9 @@ public class IPMReader {
      * @param args the command line arguments
      */
     public static void main(String[] args) throws Exception {
-        IPMInputStream is = new IPMInputStream("c:/GPS/FileWatcherServiceTestFiles1.5/T112-1000k.ipm");
+//        IPMInputStream is = new IPMInputStream("c:/dev/T112.500K.ipm");
+        IPMInputStream is = new IPMInputStream("c:/dev/SimpleSmallFile.ipm");
+        
 //        var blockSize = 1012;
 //        var blockChar = 0x00;
 
@@ -28,36 +34,36 @@ public class IPMReader {
 //        System.out.println(Integer.toBinaryString(ba[3] & 0xFF));
 //        System.out.println(new String(ba, "Windows-1252"));
             // format is 00LL bytes 0 and 1 should be 0
-            var recordLength = 256 * (ba[2] & 0xFF) + (ba[3] & 0xFF);
+            int recordLength = 256 * (ba[2] & 0xFF) + (ba[3] & 0xFF);
             if (recordLength == 0) {
                 break;
             }
 //            System.out.println(recordLength);
             //ba = bais.readNBytes(recordLength);
 //            ByteArrayInputStream bais = new ByteArrayInputStream(ba);
-            var RecordBitmap = new Boolean[IpmSpecificationConstants.DataElementCount];
-            var RecordDataElements = new String[IpmSpecificationConstants.DataElementCount];
+            Boolean[] RecordBitmap = new Boolean[IpmSpecificationConstants.DataElementCount];
+            String[] RecordDataElements = new String[IpmSpecificationConstants.DataElementCount];
             RecordBitmap[0] = true;
 
-            var messageTypeIdBytes = is.readNBytes(4);
-            var messsageTypeId = new String(messageTypeIdBytes, "Windows-1252");
+            byte[] messageTypeIdBytes = is.readNBytes(4);
+            String messsageTypeId = new String(messageTypeIdBytes, "Windows-1252");
 //            System.out.format("Message Type : %s\n", messsageTypeId);
-            for (var i = 0; i < IpmSpecificationConstants.DataElementCount; i++) {
+            for (int i = 0; i < IpmSpecificationConstants.DataElementCount; i++) {
                 if (RecordBitmap[i]) {
                     StringBuilder sb = new StringBuilder();
-                    var elementLength = GetDataElementLength(is, i);
+                    int elementLength = GetDataElementLength(is, i);
                     ba = is.readNBytes(elementLength);
-                    var elementFormat = IpmDataElements.DataElements[i].Format;
+                    IpmSpecificationConstants.DataElementFormat elementFormat = IpmDataElements.DataElements[i].Format;
                     if (elementFormat == IpmSpecificationConstants.DataElementFormat.Binary || elementFormat == IpmSpecificationConstants.DataElementFormat.HexadecimalBinary) {
-                            for (var j = 0; j < elementLength; j++) {
-                                sb.append(String.format("%8s", Integer.toBinaryString(ba[j] & 0xFF)).replace(' ', '0'));
-                            }
-                            var binaryStringValue = sb.toString();
-                        var isBitmap = IpmDataElements.DataElements[i].IsBitmap;
-                       if (isBitmap) {
-                            var bitmapStartIndex = IpmDataElements.DataElements[i].BitmapStartIndex;
-                            for (var j = 0; j < binaryStringValue.length(); j++) {
-                                var c = binaryStringValue.charAt(j);
+                        for (int j = 0; j < elementLength; j++) {
+                            sb.append(String.format("%8s", Integer.toBinaryString(ba[j] & 0xFF)).replace(' ', '0'));
+                        }
+                        String binaryStringValue = sb.toString();
+                        boolean isBitmap = IpmDataElements.DataElements[i].IsBitmap;
+                        if (isBitmap) {
+                            int bitmapStartIndex = IpmDataElements.DataElements[i].BitmapStartIndex;
+                            for (int j = 0; j < binaryStringValue.length(); j++) {
+                                char c = binaryStringValue.charAt(j);
                                 RecordBitmap[j + bitmapStartIndex] = c == '1';
                             }
                         }
@@ -68,7 +74,7 @@ public class IPMReader {
                     }
                 }
             }
-            for (var i = 0; i < RecordDataElements.length; i++) {
+            for (int i = 0; i < RecordDataElements.length; i++) {
                 if (RecordBitmap[i]) {
 //                    System.out.format("%03d (%s): %s\n", i, IpmDataElements.DataElements[i].Name, RecordDataElements[i]);
                 }
@@ -77,13 +83,13 @@ public class IPMReader {
     }
 
     static int GetDataElementLength(IPMInputStream bais, int dataElementIndex) {
-        var elementSize = IpmDataElements.DataElements[dataElementIndex].LengthData.LllSize;
+        int elementSize = IpmDataElements.DataElements[dataElementIndex].LengthData.LllSize;
         if (elementSize == 0) {
             return IpmDataElements.DataElements[dataElementIndex].LengthData.MaximumLength;
         }
         String s = "";
         try {
-            var elementLengthBytes = bais.readNBytes(elementSize);
+            byte[] elementLengthBytes = bais.readNBytes(elementSize);
             s = new String(elementLengthBytes);
             return Integer.parseInt(s);
         } catch (Exception ex) {

+ 0 - 277
IPMReader/src/ipmreader/IpmDataElements.java

@@ -1,277 +0,0 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-package ipmreader;
-
-/**
- *
- * @author Lisewski
- */
-public class IpmDataElements {
- private static DataElement[] _DataElements =
-        {
-            new DataElement(0, new DataElementLengthData(8, 8, 0), "BIT MAP, PRIMARY", IpmSpecificationConstants.DataElementFormat.Binary, true, 1),
-
-            new DataElement(1, new DataElementLengthData(8, 8, 0), "BIT MAP, SECONDARY", IpmSpecificationConstants.DataElementFormat.Binary, true, 65),
-
-            new DataElement(2, new DataElementLengthData(6, 19, 2), "PRIMARY ACCOUNT NUMBER (PAN)", IpmSpecificationConstants.DataElementFormat.NumericSecure),
-
-            new DataElement(3, new DataElementLengthData(6, 6, 0),    "PROCESSING CODE", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(4, new DataElementLengthData(12, 12, 0),  "AMOUNT, TRANSACTION", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(5, new DataElementLengthData(12, 12, 0),  "AMOUNT, RECONCILIATION", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(6, new DataElementLengthData(12, 12, 0),  "AMOUNT, CARDHOLDER BILLING", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(7, new DataElementLengthData(10, 10, 0),  "DATE AND TIME, TRANSMISSION (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(8, new DataElementLengthData(8, 8, 0),    "AMOUNT, ICCR (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(9, new DataElementLengthData(8, 8, 0),    "CONVERSION RATE, RECONCILIATION", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(10, new DataElementLengthData(8, 8, 0),   "SYSTEMS TRACE AUDIT NUMBER (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(11, new DataElementLengthData(6, 6, 0),   "AMOUNT, TRANSACTION", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(12, new DataElementLengthData(12, 12, 0), "DATE AND TIME, LOCAL TRANSACTION", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(13, new DataElementLengthData(4, 4, 0),   "DATE, EFFECTIVE (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(14, new DataElementLengthData(4, 4, 0),   "DATE, EXPIRATION", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(15, new DataElementLengthData(6, 6, 0),   "DATE, SETTLEMENT (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(16, new DataElementLengthData(4, 4, 0),   "DATE, CONVERSION (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(17, new DataElementLengthData(4, 4, 0),   "DATE, CAPTURE (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(18, new DataElementLengthData(4, 4, 0),   "MERCHANT TYPE (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(19, new DataElementLengthData(3, 3, 0),   "COUNTRY CODE, ACQUIRING INSTITUTION (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(20, new DataElementLengthData(3, 3, 0),   "COUNTRY CODE, PRIMARY ACCOUNT NUMBER (PAN) (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(21, new DataElementLengthData(3, 3, 0),   "COUNTRY CODE, FORWARDING INSTITUTION (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(22, new DataElementLengthData(12, 12, 0), "POINT OF SERVICE DATA CODE", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
-
-            new DataElement(23, new DataElementLengthData(3, 3, 0),   "CARD SEQUENCE NUMBER", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(24, new DataElementLengthData(3, 3, 0),   "FUNCTION CODE", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(25, new DataElementLengthData(4, 4, 0),   "MESSAGE REASON CODE", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(26, new DataElementLengthData(4, 4, 0),   "CARD ACCEPTOR BUSINESS CODE (MCC)", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(27, new DataElementLengthData(1, 1, 0),   "APPROVAL CODE LENGTH (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(28, new DataElementLengthData(6, 6, 0),   "DATE, RECONCILIATION (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(29, new DataElementLengthData(3, 3, 0),   "RECONCILIATION INDICATOR (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(30, new DataElementLengthData(24, 24, 0), "AMOUNTS, ORIGINAL", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(31, new DataElementLengthData(23, 23, 2), "ACQUIRER REFERENCE DATA", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(32, new DataElementLengthData(1, 11, 2),  "ACQUIRING INSTITUTION IDENTIFICATION CODE", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(33, new DataElementLengthData(6, 11, 2),   "FORWARDING INSTITUTION IDENTIFICATION CODE", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(34, new DataElementLengthData(1, 28, 2),  "PRIMARY ACCOUNT NUMBER (PAN), EXTENDED (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(35, new DataElementLengthData(1, 37, 2),  "TRACK 2 DATA (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
-
-            new DataElement(36, new DataElementLengthData(1, 30, 3),  "TRACK 3 DATA (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
-
-            new DataElement(37, new DataElementLengthData(12, 12, 0), "RETRIEVAL REFERENCE NUMBER", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
-
-            new DataElement(38, new DataElementLengthData(6, 6, 0),   "APPROVAL CODE", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
-
-            new DataElement(39, new DataElementLengthData(3, 3, 0),   "ACTION CODE (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(40, new DataElementLengthData(3, 3, 0),   "SERVICE CODE", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(41, new DataElementLengthData(8, 8, 0),   "CARD ACCEPTOR TERMINAL ID", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
-
-            new DataElement(42, new DataElementLengthData(15, 15, 0), "CARD ACCEPTOR ID CODE", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
-
-            new DataElement(43, new DataElementLengthData(20, 99, 2), "CARD ACCEPTOR NAME/LOCATION", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
-
-            new DataElement(44, new DataElementLengthData(1, 99, 2),  "ADDITIONAL RESPONSE DATA (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
-
-            new DataElement(45, new DataElementLengthData(1, 76, 2),  "TRACK 1 DATA (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
-
-            new DataElement(46, new DataElementLengthData(1, 204, 3), "AMOUNTS, FEES (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
-
-            new DataElement(47, new DataElementLengthData(1, 999, 3), "ADDITIONAL DATA (NATIONAL) (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
-
-            new DataElement(48, new DataElementLengthData(8, 999, 3), "ADDITIONAL DATA (PRIVATE)", IpmSpecificationConstants.DataElementFormat.PrivateDataSubElement),
-
-            new DataElement(49, new DataElementLengthData(3, 3, 0), "CURRENCY CODE, TRANSACTION", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(50, new DataElementLengthData(3, 3, 0), "CURRENCY CODE, RECONCILIATION", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(51, new DataElementLengthData(3, 3, 0), "CURRENCY CODE, CARDHOLDER BILLING", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(52, new DataElementLengthData(8, 8, 0), "PERSONAL IDENTIFICATION NUMBER (PIN) DATA (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Binary),
-
-            new DataElement(53, new DataElementLengthData(1, 48, 2), "SECURITY RELATED CONTROL INFORMATION (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Binary),
-
-            new DataElement(54, new DataElementLengthData(20, 120, 3), "AMOUNTS, ADDITIONAL", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
-
-            new DataElement(55, new DataElementLengthData(1, 255, 3), "INTEGRATED CIRCUIT CARD (ICC) RELATED DATA", IpmSpecificationConstants.DataElementFormat.HexadecimalBinary),
-
-            new DataElement(56, new DataElementLengthData(1, 35, 2), "ORIGINAL DATA ELEMENTS (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(57, new DataElementLengthData(3, 3, 0), "AUTORIZATION LIFE CYCLE (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(58, new DataElementLengthData(1, 11, 2), "AUTHORIZING AGENT INSTITUTION ID CODE (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(59, new DataElementLengthData(1, 999, 3), "TRANSPORT DATA (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
-
-            new DataElement(60, new DataElementLengthData(1, 999, 3), "RESERVED (NATIONAL) (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
-
-            new DataElement(61, new DataElementLengthData(1, 999, 3), "RESERVED (NATIONAL) (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
-
-            new DataElement(62, new DataElementLengthData(8, 999, 3), "ADDITIONAL DATA 2", IpmSpecificationConstants.DataElementFormat.PrivateDataSubElement),
-
-            new DataElement(63, new DataElementLengthData(16, 16, 3), "TRANSACTION LIFE CYCLE ID", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
-
-            new DataElement(64, new DataElementLengthData(8, 8, 0), "MESSAGE AUTHENTICATION CODE (MAC) (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Binary),
-
-            // Going to treat this as not a BitMap, as it is currently not in use
-            new DataElement(65, new DataElementLengthData(8, 8, 0), "BITMAP, THIRD (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Binary),
-
-            new DataElement(66, new DataElementLengthData(1, 204, 3), "AMOUNTS, ORIGINAL FEES (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
-
-            new DataElement(67, new DataElementLengthData(2, 2, 0), "EXTENDED PAYMENT DATA (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(68, new DataElementLengthData(3, 3, 0), "COUNTRY CODE, RECEIVING INSTITUTION (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(69, new DataElementLengthData(3, 3, 0), "COUNTRY CODE, SETTLEMENT INSTITUTION (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(70, new DataElementLengthData(3, 3, 0), "COUNTRY CODE, AUTHORIZING AGENT INSTITUTION (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(71, new DataElementLengthData(8, 8, 0), "MESSAGE NUMBER", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(72, new DataElementLengthData(1, 999, 3), "RESERVED (NATIONAL) (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
-
-            new DataElement(73, new DataElementLengthData(6, 6, 0), "DATA RECORD", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(74, new DataElementLengthData(10, 10, 0), "DATE, ACTION", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(75, new DataElementLengthData(10, 10, 0), "CREDITS, NUMBER (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(76, new DataElementLengthData(10, 10, 0), "CREDITS, REVERSAL NUMBER (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(77, new DataElementLengthData(10, 10, 0), "DEBITS, NUMBER (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(78, new DataElementLengthData(10, 10, 0), "TRANSFERS, NUMBER (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(79, new DataElementLengthData(10, 10, 0), "TRANSFERS, REVERSAL NUMBER (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(80, new DataElementLengthData(10, 10, 0), "INQUIRIES, NUMBER (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(81, new DataElementLengthData(10, 10, 0), "AUTHORIZATIONS, NUMBER (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(82, new DataElementLengthData(10, 10, 0), "INQUIRIES, REVERSAL NUMBER (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(83, new DataElementLengthData(10, 10, 0), "PAYMENTS, NUMBER (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(84, new DataElementLengthData(10, 10, 0), "PAYMENTS, REVERSAL NUMBER (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(85, new DataElementLengthData(10, 10, 0), "FEE COLLECTIONS, NUMBER (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(86, new DataElementLengthData(16, 16, 0), "CREDITS, AMOUNT (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(87, new DataElementLengthData(16, 16, 0), "CREDITS, REVERSAL AMOUNT (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(88, new DataElementLengthData(16, 16, 0), "DEBITS, AMOUNT (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(89, new DataElementLengthData(16, 16, 0), "DEBITS, REVERSAL AMOUNT (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(90, new DataElementLengthData(10, 10, 0), "AUTHORIZATIONS, REVERSAL NUMBER (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(91, new DataElementLengthData(3, 3, 0), "COUNTRY CODE, TRANSACTION DESTINATION INST (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(92, new DataElementLengthData(3, 3, 0), "COUNTRY CODE, TRANSACTION ORIGINATOR INST (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(93, new DataElementLengthData(6, 11, 2), "TRANSACTION DESTINATION INSTITUTION ID CODE", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(94, new DataElementLengthData(6, 11, 2), "TRANSACTION ORIGINATOR INSTITUTION ID CODE", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(95, new DataElementLengthData(10, 10, 2), "CARD ISSUER REFERENCE DATA", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(96, new DataElementLengthData(1, 999, 3), "KEY MANAGEMENT DATA (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Binary),
-
-            new DataElement(97, new DataElementLengthData(17, 17, 0), "AMOUNT, NET RECONCILIATION (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
-
-            new DataElement(98, new DataElementLengthData(25, 25, 0), "PAYEE (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
-
-            new DataElement(99, new DataElementLengthData(1, 11, 2), "SETTLEMENT INSTITUTION ID CODE (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(100, new DataElementLengthData(6, 11, 2), "RECEIVING INSTITUTION ID CODE", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(101, new DataElementLengthData(1, 17, 2), "FILE NAME (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
-
-            new DataElement(102, new DataElementLengthData(1, 28, 2), "ACCOUNT ID 1 (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
-
-            new DataElement(103, new DataElementLengthData(1, 28, 2), "ACCOUNT ID 2 (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
-
-            new DataElement(104, new DataElementLengthData(1, 100, 3), "TRANSACTION DESCRIPTION (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
-
-            new DataElement(105, new DataElementLengthData(16, 16, 0), "CREDITS, CHARGEBACK AMOUNT (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(106, new DataElementLengthData(16, 16, 0), "DEBITS, CHARGEBACK AMOUNT (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(107, new DataElementLengthData(10, 10, 0), "CREDITS, CHARGEBACK NUMBER (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(108, new DataElementLengthData(10, 10, 0), "DEBITS, CHARGEBACK NUMBER (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(109, new DataElementLengthData(1, 84, 2), "CREDITS, FEE AMOUNTS (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
-
-            new DataElement(110, new DataElementLengthData(1, 84, 2), "DEBITS, FEE AMOUNTS (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
-
-            new DataElement(111, new DataElementLengthData(12, 12, 3), "AMOUNT, CCA", IpmSpecificationConstants.DataElementFormat.Numeric),
-
-            new DataElement(112, new DataElementLengthData(1, 999, 3), "RESERVED (ISO) (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
-
-            new DataElement(113, new DataElementLengthData(1, 999, 3), "RESERVED (ISO) (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
-
-            new DataElement(114, new DataElementLengthData(1, 999, 3), "RESERVED (ISO) (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
-
-            new DataElement(115, new DataElementLengthData(1, 999, 3), "RESERVED (ISO) (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
-
-            new DataElement(116, new DataElementLengthData(1, 999, 3), "RESERVED (NATIONAL) (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
-
-            new DataElement(117, new DataElementLengthData(1, 999, 3), "RESERVED (NATIONAL) (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
-
-            new DataElement(118, new DataElementLengthData(1, 999, 3), "RESERVED (NATIONAL) (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
-
-            new DataElement(119, new DataElementLengthData(1, 999, 3), "RESERVED (NATIONAL) (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
-
-            new DataElement(120, new DataElementLengthData(1, 999, 3), "RESERVED (NATIONAL) (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
-
-            new DataElement(121, new DataElementLengthData(1, 999, 3), "RESERVED (NATIONAL) (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
-
-            new DataElement(122, new DataElementLengthData(1, 999, 3), "RESERVED (NATIONAL) (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
-
-            new DataElement(123, new DataElementLengthData(8, 999, 3), "ADDITIONAL DATA 3", IpmSpecificationConstants.DataElementFormat.PrivateDataSubElement),
-
-            new DataElement(124, new DataElementLengthData(8, 999, 3), "ADDITIONAL DATA 4", IpmSpecificationConstants.DataElementFormat.PrivateDataSubElement),
-
-            new DataElement(125, new DataElementLengthData(8, 999, 3), "ADDITIONAL DATA 5", IpmSpecificationConstants.DataElementFormat.PrivateDataSubElement),
-
-            new DataElement(126, new DataElementLengthData(8, 999, 3), "CONVERSION DATA (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
-
-            new DataElement(127, new DataElementLengthData(8, 999, 3), "NETWORK DATA", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
-
-            new DataElement(128, new DataElementLengthData(8, 999, 3), "MSG AUTHENTICATION CODE (MAC) (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Binary)
-        };
-
-        public static DataElement[] DataElements  = _DataElements;
-   
-}

+ 17 - 0
IsoProcessor/build.gradle

@@ -0,0 +1,17 @@
+apply plugin: 'java'
+apply plugin: 'jacoco'
+apply plugin: 'application'
+
+    group = 'com.cloudsoft.service'
+
+mainClassName = 'com.cloudsoft.service.IsoProcessor.Main'
+
+repositories {
+    jcenter()
+}
+
+dependencies {
+    testCompile 'junit:junit:4.12'
+    implementation 'com.rabbitmq:amqp-client:5.8.0'
+
+}

+ 7 - 0
IsoProcessor/gradle.properties

@@ -0,0 +1,7 @@
+# Generally it is better to set the version only for release builds, build time
+# from command line using -Pversion=1.0.0
+#
+# Only use SNAPSHOT versions if you need to contribute your binaries to a
+# local Maven project.
+version=1.0.0
+

+ 1 - 0
IsoProcessor/settings.gradle

@@ -0,0 +1 @@
+rootProject.name = 'IsoProcessor'

+ 40 - 0
IsoProcessor/src/main/java/com/cloudsoft/service/IsoProcessor/Main.java

@@ -0,0 +1,40 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.cloudsoft.service.IsoProcessor;
+
+import com.rabbitmq.client.Channel;
+import com.rabbitmq.client.Connection;
+import com.rabbitmq.client.ConnectionFactory;
+import com.rabbitmq.client.DeliverCallback;
+/**
+ *
+ * @author paul
+ */
+public class Main {
+
+
+    private final static String QUEUE_NAME = "iso8583";
+    static int i = 0;
+    public static void main(String[] argv) throws Exception {
+        ConnectionFactory factory = new ConnectionFactory();
+        factory.setHost("localhost");
+        Connection connection = factory.newConnection();
+        Channel channel = connection.createChannel();
+
+        channel.queueDeclare(QUEUE_NAME, false, false, false, null);
+        System.out.println(" [*] Waiting for messages. To exit press CTRL+C");
+        
+        DeliverCallback deliverCallback = (consumerTag, delivery) -> {
+            String message = new String(delivery.getBody(), "UTF-8");
+            if (++i%10000 == 0){
+                System.out.println("Processed " + i);
+            }
+//            System.out.println(" [x] Received '" + message + "'");
+        };
+        channel.basicConsume(QUEUE_NAME, true, deliverCallback, consumerTag -> { });
+    }
+    
+}

+ 17 - 0
MastercardFileReader/build.gradle

@@ -0,0 +1,17 @@
+apply plugin: 'java'
+apply plugin: 'jacoco'
+apply plugin: 'application'
+
+    group = 'com.cloudsoft'
+
+mainClassName = 'com.cloudsoft.MastercardFileReader.Main'
+
+repositories {
+    jcenter()
+}
+
+dependencies {
+    testCompile 'junit:junit:4.12'
+    implementation 'com.rabbitmq:amqp-client:5.8.0'
+    implementation 'com.google.code.gson:gson:2.8.6'
+}

+ 7 - 0
MastercardFileReader/gradle.properties

@@ -0,0 +1,7 @@
+# Generally it is better to set the version only for release builds, build time
+# from command line using -Pversion=1.0.0
+#
+# Only use SNAPSHOT versions if you need to contribute your binaries to a
+# local Maven project.
+version=1.0.0
+

+ 1 - 0
MastercardFileReader/settings.gradle

@@ -0,0 +1 @@
+rootProject.name = 'MastercardFileReader'

+ 37 - 0
MastercardFileReader/src/main/java/com/cloudsoft/MastercardFileReader/DataElement.java

@@ -0,0 +1,37 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.cloudsoft.MastercardFileReader;
+/**
+ *
+ * @author Lisewski
+ */
+public class DataElement {
+
+    int Index;
+    DataElementLengthData LengthData;
+    String Name;
+    IpmSpecificationConstants.DataElementFormat Format;
+    boolean IsBitmap;
+    Integer BitmapStartIndex;
+
+    public DataElement(int index, DataElementLengthData lengthData, String name, IpmSpecificationConstants.DataElementFormat format) {
+        Index = index;
+        LengthData = lengthData;
+        Name = name;
+        Format = format;
+        IsBitmap = false;
+        BitmapStartIndex = null;
+    }
+
+    public DataElement(int index, DataElementLengthData lengthData, String name, IpmSpecificationConstants.DataElementFormat format, boolean isBitmap, int bitmapStartIndex) {
+        Index = index;
+        LengthData = lengthData;
+        Name = name;
+        Format = format;
+        IsBitmap = isBitmap;
+        BitmapStartIndex = bitmapStartIndex;
+    }
+}

+ 1 - 1
IPMReader/src/ipmreader/DataElementLengthData.java → MastercardFileReader/src/main/java/com/cloudsoft/MastercardFileReader/DataElementLengthData.java

@@ -3,7 +3,7 @@
  * To change this template file, choose Tools | Templates
  * and open the template in the editor.
  */
-package ipmreader;
+package com.cloudsoft.MastercardFileReader;
 
 /**
  *

+ 24 - 18
IPMReader/src/ipmreader/IPMInputStream.java → MastercardFileReader/src/main/java/com/cloudsoft/MastercardFileReader/IPMInputStream.java

@@ -3,7 +3,7 @@
  * To change this template file, choose Tools | Templates
  * and open the template in the editor.
  */
-package ipmreader;
+package com.cloudsoft.MastercardFileReader;
 
 import java.io.ByteArrayInputStream;
 import java.io.FileInputStream;
@@ -13,50 +13,56 @@ import java.io.FileInputStream;
  * @author Lisewski
  */
 public class IPMInputStream {
-    FileInputStream fis;
-    ByteArrayInputStream bais;
-    int blockSize = 1012;
-    char blockChar = 0x40;
-    byte[] ba = new byte[blockSize];
-    int bytesLeft = 0;
-    boolean lastBlock = false;
-    
-    public IPMInputStream(String fileName) throws Exception{
+
+    private final FileInputStream fis;
+    private ByteArrayInputStream bais;
+    private final int blockSize = 1012;
+    private final char blockChar = 0x40;
+    private final byte[] ba = new byte[blockSize];
+    private int bytesLeft = 0;
+    private boolean lastBlock = false;
+
+    public IPMInputStream(String fileName) throws Exception {
         fis = new FileInputStream(fileName);
     }
-    public byte[] readNBytes(int bytes) throws Exception{
+
+    public byte[] readNBytes(int bytes) throws Exception {
         byte[] tmp = new byte[bytes];
         int bytesRead = 0;
         if (bytesLeft < bytes) {
             // Read part of the bytes then get a new block
             if (bytesLeft > 0) {
-                bais.readNBytes(tmp, 0, bytesLeft);
+                bais.read(tmp, 0, bytesLeft);
                 bytesRead = bytesLeft;
             }
             readBlock();
         }
         if (bytesRead < bytes) {
-            bais.readNBytes(tmp, bytesRead, bytes - bytesRead);
+            bais.read(tmp, bytesRead, bytes - bytesRead);
             bytesLeft -= bytes - bytesRead;
         }
         return tmp;
     }
+
     public boolean lastBlock() {
         return lastBlock;
     }
+
     private void readBlock() throws Exception {
-        bytesLeft = fis.readNBytes(ba, 0, blockSize);
+        bytesLeft = fis.read(ba, 0, blockSize);
 //        System.out.println("bytesLeft : " + bytesLeft);
 //        bytesLeft = ba.length;
         bais = new ByteArrayInputStream(ba);
         if (bytesLeft == blockSize) {
             // Read Padding
-            byte[] padding = fis.readNBytes(2);
-            if (padding[0] != blockChar || padding[1] != blockChar)
-                System.out.println(String.format("Padding contains wrong characters %H%H. Expected %H%H",blockChar, blockChar, padding[0], padding[1]));
+            byte[] padding = new byte[2];
+            fis.read(padding, 0, 2);
+            if (padding[0] != blockChar || padding[1] != blockChar) {
+                System.out.println(String.format("Padding contains wrong characters %02X%02X. Expected %H%H", blockChar & 0xFF, blockChar & 0xFF, padding[0] & 0xFF, padding[1] & 0xFF));
+            }
         } else {
             lastBlock = true;
         }
     }
-    
+
 }

+ 150 - 0
MastercardFileReader/src/main/java/com/cloudsoft/MastercardFileReader/IpmDataElements.java

@@ -0,0 +1,150 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.cloudsoft.MastercardFileReader;
+
+/**
+ *
+ * @author Lisewski
+ */
+public class IpmDataElements {
+
+    private static DataElement[] _DataElements
+            = {
+                new DataElement(0, new DataElementLengthData(8, 8, 0), "BIT MAP, PRIMARY", IpmSpecificationConstants.DataElementFormat.Binary, true, 1),
+                new DataElement(1, new DataElementLengthData(8, 8, 0), "BIT MAP, SECONDARY", IpmSpecificationConstants.DataElementFormat.Binary, true, 65),
+                new DataElement(2, new DataElementLengthData(6, 19, 2), "PRIMARY ACCOUNT NUMBER (PAN)", IpmSpecificationConstants.DataElementFormat.NumericSecure),
+                new DataElement(3, new DataElementLengthData(6, 6, 0), "PROCESSING CODE", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(4, new DataElementLengthData(12, 12, 0), "AMOUNT, TRANSACTION", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(5, new DataElementLengthData(12, 12, 0), "AMOUNT, RECONCILIATION", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(6, new DataElementLengthData(12, 12, 0), "AMOUNT, CARDHOLDER BILLING", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(7, new DataElementLengthData(10, 10, 0), "DATE AND TIME, TRANSMISSION (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(8, new DataElementLengthData(8, 8, 0), "AMOUNT, ICCR (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(9, new DataElementLengthData(8, 8, 0), "CONVERSION RATE, RECONCILIATION", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(10, new DataElementLengthData(8, 8, 0), "SYSTEMS TRACE AUDIT NUMBER (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(11, new DataElementLengthData(6, 6, 0), "AMOUNT, TRANSACTION", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(12, new DataElementLengthData(12, 12, 0), "DATE AND TIME, LOCAL TRANSACTION", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(13, new DataElementLengthData(4, 4, 0), "DATE, EFFECTIVE (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(14, new DataElementLengthData(4, 4, 0), "DATE, EXPIRATION", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(15, new DataElementLengthData(6, 6, 0), "DATE, SETTLEMENT (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(16, new DataElementLengthData(4, 4, 0), "DATE, CONVERSION (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(17, new DataElementLengthData(4, 4, 0), "DATE, CAPTURE (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(18, new DataElementLengthData(4, 4, 0), "MERCHANT TYPE (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(19, new DataElementLengthData(3, 3, 0), "COUNTRY CODE, ACQUIRING INSTITUTION (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(20, new DataElementLengthData(3, 3, 0), "COUNTRY CODE, PRIMARY ACCOUNT NUMBER (PAN) (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(21, new DataElementLengthData(3, 3, 0), "COUNTRY CODE, FORWARDING INSTITUTION (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(22, new DataElementLengthData(12, 12, 0), "POINT OF SERVICE DATA CODE", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
+                new DataElement(23, new DataElementLengthData(3, 3, 0), "CARD SEQUENCE NUMBER", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(24, new DataElementLengthData(3, 3, 0), "FUNCTION CODE", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(25, new DataElementLengthData(4, 4, 0), "MESSAGE REASON CODE", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(26, new DataElementLengthData(4, 4, 0), "CARD ACCEPTOR BUSINESS CODE (MCC)", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(27, new DataElementLengthData(1, 1, 0), "APPROVAL CODE LENGTH (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(28, new DataElementLengthData(6, 6, 0), "DATE, RECONCILIATION (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(29, new DataElementLengthData(3, 3, 0), "RECONCILIATION INDICATOR (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(30, new DataElementLengthData(24, 24, 0), "AMOUNTS, ORIGINAL", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(31, new DataElementLengthData(23, 23, 2), "ACQUIRER REFERENCE DATA", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(32, new DataElementLengthData(1, 11, 2), "ACQUIRING INSTITUTION IDENTIFICATION CODE", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(33, new DataElementLengthData(6, 11, 2), "FORWARDING INSTITUTION IDENTIFICATION CODE", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(34, new DataElementLengthData(1, 28, 2), "PRIMARY ACCOUNT NUMBER (PAN), EXTENDED (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(35, new DataElementLengthData(1, 37, 2), "TRACK 2 DATA (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
+                new DataElement(36, new DataElementLengthData(1, 30, 3), "TRACK 3 DATA (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
+                new DataElement(37, new DataElementLengthData(12, 12, 0), "RETRIEVAL REFERENCE NUMBER", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
+                new DataElement(38, new DataElementLengthData(6, 6, 0), "APPROVAL CODE", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
+                new DataElement(39, new DataElementLengthData(3, 3, 0), "ACTION CODE (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(40, new DataElementLengthData(3, 3, 0), "SERVICE CODE", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(41, new DataElementLengthData(8, 8, 0), "CARD ACCEPTOR TERMINAL ID", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
+                new DataElement(42, new DataElementLengthData(15, 15, 0), "CARD ACCEPTOR ID CODE", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
+                new DataElement(43, new DataElementLengthData(20, 99, 2), "CARD ACCEPTOR NAME/LOCATION", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
+                new DataElement(44, new DataElementLengthData(1, 99, 2), "ADDITIONAL RESPONSE DATA (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
+                new DataElement(45, new DataElementLengthData(1, 76, 2), "TRACK 1 DATA (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
+                new DataElement(46, new DataElementLengthData(1, 204, 3), "AMOUNTS, FEES (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
+                new DataElement(47, new DataElementLengthData(1, 999, 3), "ADDITIONAL DATA (NATIONAL) (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
+                new DataElement(48, new DataElementLengthData(8, 999, 3), "ADDITIONAL DATA (PRIVATE)", IpmSpecificationConstants.DataElementFormat.PrivateDataSubElement),
+                new DataElement(49, new DataElementLengthData(3, 3, 0), "CURRENCY CODE, TRANSACTION", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(50, new DataElementLengthData(3, 3, 0), "CURRENCY CODE, RECONCILIATION", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(51, new DataElementLengthData(3, 3, 0), "CURRENCY CODE, CARDHOLDER BILLING", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(52, new DataElementLengthData(8, 8, 0), "PERSONAL IDENTIFICATION NUMBER (PIN) DATA (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Binary),
+                new DataElement(53, new DataElementLengthData(1, 48, 2), "SECURITY RELATED CONTROL INFORMATION (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Binary),
+                new DataElement(54, new DataElementLengthData(20, 120, 3), "AMOUNTS, ADDITIONAL", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
+                new DataElement(55, new DataElementLengthData(1, 255, 3), "INTEGRATED CIRCUIT CARD (ICC) RELATED DATA", IpmSpecificationConstants.DataElementFormat.HexadecimalBinary),
+                new DataElement(56, new DataElementLengthData(1, 35, 2), "ORIGINAL DATA ELEMENTS (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(57, new DataElementLengthData(3, 3, 0), "AUTORIZATION LIFE CYCLE (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(58, new DataElementLengthData(1, 11, 2), "AUTHORIZING AGENT INSTITUTION ID CODE (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(59, new DataElementLengthData(1, 999, 3), "TRANSPORT DATA (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
+                new DataElement(60, new DataElementLengthData(1, 999, 3), "RESERVED (NATIONAL) (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
+                new DataElement(61, new DataElementLengthData(1, 999, 3), "RESERVED (NATIONAL) (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
+                new DataElement(62, new DataElementLengthData(8, 999, 3), "ADDITIONAL DATA 2", IpmSpecificationConstants.DataElementFormat.PrivateDataSubElement),
+                new DataElement(63, new DataElementLengthData(16, 16, 3), "TRANSACTION LIFE CYCLE ID", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
+                new DataElement(64, new DataElementLengthData(8, 8, 0), "MESSAGE AUTHENTICATION CODE (MAC) (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Binary),
+                // Going to treat this as not a BitMap, as it is currently not in use
+                new DataElement(65, new DataElementLengthData(8, 8, 0), "BITMAP, THIRD (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Binary),
+                new DataElement(66, new DataElementLengthData(1, 204, 3), "AMOUNTS, ORIGINAL FEES (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
+                new DataElement(67, new DataElementLengthData(2, 2, 0), "EXTENDED PAYMENT DATA (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(68, new DataElementLengthData(3, 3, 0), "COUNTRY CODE, RECEIVING INSTITUTION (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(69, new DataElementLengthData(3, 3, 0), "COUNTRY CODE, SETTLEMENT INSTITUTION (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(70, new DataElementLengthData(3, 3, 0), "COUNTRY CODE, AUTHORIZING AGENT INSTITUTION (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(71, new DataElementLengthData(8, 8, 0), "MESSAGE NUMBER", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(72, new DataElementLengthData(1, 999, 3), "RESERVED (NATIONAL) (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
+                new DataElement(73, new DataElementLengthData(6, 6, 0), "DATA RECORD", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(74, new DataElementLengthData(10, 10, 0), "DATE, ACTION", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(75, new DataElementLengthData(10, 10, 0), "CREDITS, NUMBER (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(76, new DataElementLengthData(10, 10, 0), "CREDITS, REVERSAL NUMBER (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(77, new DataElementLengthData(10, 10, 0), "DEBITS, NUMBER (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(78, new DataElementLengthData(10, 10, 0), "TRANSFERS, NUMBER (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(79, new DataElementLengthData(10, 10, 0), "TRANSFERS, REVERSAL NUMBER (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(80, new DataElementLengthData(10, 10, 0), "INQUIRIES, NUMBER (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(81, new DataElementLengthData(10, 10, 0), "AUTHORIZATIONS, NUMBER (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(82, new DataElementLengthData(10, 10, 0), "INQUIRIES, REVERSAL NUMBER (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(83, new DataElementLengthData(10, 10, 0), "PAYMENTS, NUMBER (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(84, new DataElementLengthData(10, 10, 0), "PAYMENTS, REVERSAL NUMBER (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(85, new DataElementLengthData(10, 10, 0), "FEE COLLECTIONS, NUMBER (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(86, new DataElementLengthData(16, 16, 0), "CREDITS, AMOUNT (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(87, new DataElementLengthData(16, 16, 0), "CREDITS, REVERSAL AMOUNT (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(88, new DataElementLengthData(16, 16, 0), "DEBITS, AMOUNT (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(89, new DataElementLengthData(16, 16, 0), "DEBITS, REVERSAL AMOUNT (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(90, new DataElementLengthData(10, 10, 0), "AUTHORIZATIONS, REVERSAL NUMBER (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(91, new DataElementLengthData(3, 3, 0), "COUNTRY CODE, TRANSACTION DESTINATION INST (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(92, new DataElementLengthData(3, 3, 0), "COUNTRY CODE, TRANSACTION ORIGINATOR INST (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(93, new DataElementLengthData(6, 11, 2), "TRANSACTION DESTINATION INSTITUTION ID CODE", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(94, new DataElementLengthData(6, 11, 2), "TRANSACTION ORIGINATOR INSTITUTION ID CODE", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(95, new DataElementLengthData(10, 10, 2), "CARD ISSUER REFERENCE DATA", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(96, new DataElementLengthData(1, 999, 3), "KEY MANAGEMENT DATA (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Binary),
+                new DataElement(97, new DataElementLengthData(17, 17, 0), "AMOUNT, NET RECONCILIATION (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
+                new DataElement(98, new DataElementLengthData(25, 25, 0), "PAYEE (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
+                new DataElement(99, new DataElementLengthData(1, 11, 2), "SETTLEMENT INSTITUTION ID CODE (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(100, new DataElementLengthData(6, 11, 2), "RECEIVING INSTITUTION ID CODE", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(101, new DataElementLengthData(1, 17, 2), "FILE NAME (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
+                new DataElement(102, new DataElementLengthData(1, 28, 2), "ACCOUNT ID 1 (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
+                new DataElement(103, new DataElementLengthData(1, 28, 2), "ACCOUNT ID 2 (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
+                new DataElement(104, new DataElementLengthData(1, 100, 3), "TRANSACTION DESCRIPTION (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
+                new DataElement(105, new DataElementLengthData(16, 16, 0), "CREDITS, CHARGEBACK AMOUNT (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(106, new DataElementLengthData(16, 16, 0), "DEBITS, CHARGEBACK AMOUNT (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(107, new DataElementLengthData(10, 10, 0), "CREDITS, CHARGEBACK NUMBER (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(108, new DataElementLengthData(10, 10, 0), "DEBITS, CHARGEBACK NUMBER (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(109, new DataElementLengthData(1, 84, 2), "CREDITS, FEE AMOUNTS (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
+                new DataElement(110, new DataElementLengthData(1, 84, 2), "DEBITS, FEE AMOUNTS (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
+                new DataElement(111, new DataElementLengthData(12, 12, 3), "AMOUNT, CCA", IpmSpecificationConstants.DataElementFormat.Numeric),
+                new DataElement(112, new DataElementLengthData(1, 999, 3), "RESERVED (ISO) (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
+                new DataElement(113, new DataElementLengthData(1, 999, 3), "RESERVED (ISO) (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
+                new DataElement(114, new DataElementLengthData(1, 999, 3), "RESERVED (ISO) (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
+                new DataElement(115, new DataElementLengthData(1, 999, 3), "RESERVED (ISO) (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
+                new DataElement(116, new DataElementLengthData(1, 999, 3), "RESERVED (NATIONAL) (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
+                new DataElement(117, new DataElementLengthData(1, 999, 3), "RESERVED (NATIONAL) (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
+                new DataElement(118, new DataElementLengthData(1, 999, 3), "RESERVED (NATIONAL) (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
+                new DataElement(119, new DataElementLengthData(1, 999, 3), "RESERVED (NATIONAL) (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
+                new DataElement(120, new DataElementLengthData(1, 999, 3), "RESERVED (NATIONAL) (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
+                new DataElement(121, new DataElementLengthData(1, 999, 3), "RESERVED (NATIONAL) (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
+                new DataElement(122, new DataElementLengthData(1, 999, 3), "RESERVED (NATIONAL) (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
+                new DataElement(123, new DataElementLengthData(8, 999, 3), "ADDITIONAL DATA 3", IpmSpecificationConstants.DataElementFormat.PrivateDataSubElement),
+                new DataElement(124, new DataElementLengthData(8, 999, 3), "ADDITIONAL DATA 4", IpmSpecificationConstants.DataElementFormat.PrivateDataSubElement),
+                new DataElement(125, new DataElementLengthData(8, 999, 3), "ADDITIONAL DATA 5", IpmSpecificationConstants.DataElementFormat.PrivateDataSubElement),
+                new DataElement(126, new DataElementLengthData(8, 999, 3), "CONVERSION DATA (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
+                new DataElement(127, new DataElementLengthData(8, 999, 3), "NETWORK DATA", IpmSpecificationConstants.DataElementFormat.Alphanumeric),
+                new DataElement(128, new DataElementLengthData(8, 999, 3), "MSG AUTHENTICATION CODE (MAC) (NOT IN USE)", IpmSpecificationConstants.DataElementFormat.Binary)
+            };
+
+    public static DataElement[] DataElements = _DataElements;
+
+}

+ 3 - 3
IPMReader/src/ipmreader/IpmSpecificationConstants.java → MastercardFileReader/src/main/java/com/cloudsoft/MastercardFileReader/IpmSpecificationConstants.java

@@ -3,7 +3,7 @@
  * To change this template file, choose Tools | Templates
  * and open the template in the editor.
  */
-package ipmreader;
+package com.cloudsoft.MastercardFileReader;
 
 /**
  *
@@ -19,8 +19,8 @@ public class IpmSpecificationConstants {
 
     static final String FileTrailerMessageTypeId = "1644";
     static final String FileTrailerRecordDataElement24 = "695";
-     public enum DataElementFormat
-    {
+
+    public enum DataElementFormat {
         Binary,
         Numeric,
         Alphanumeric,

+ 21 - 0
MastercardFileReader/src/main/java/com/cloudsoft/MastercardFileReader/IsoElement.java

@@ -0,0 +1,21 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.cloudsoft.MastercardFileReader;
+
+/**
+ *
+ * @author paul
+ */
+public class IsoElement {
+    public int Index;
+    public String Name;
+    public String Value;
+    public IsoElement(int index, String name, String value) {
+        Index = index;
+        Name = name;
+        Value = value;
+    }
+}

+ 115 - 0
MastercardFileReader/src/main/java/com/cloudsoft/MastercardFileReader/Main.java

@@ -0,0 +1,115 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.cloudsoft.MastercardFileReader;
+
+import com.rabbitmq.client.ConnectionFactory;
+import com.rabbitmq.client.Connection;
+import com.rabbitmq.client.Channel;
+import com.google.gson.Gson;
+import java.math.BigInteger;
+import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+/**
+ *
+ * @author paul
+ */
+public class Main {
+    private final static String QUEUE_NAME = "iso8583";
+    /**
+     * @param args the command line arguments
+     */
+    public static void main(String[] args) throws Exception {
+        IPMInputStream is = new IPMInputStream("c:/dev/T112.500K.ipm");
+//        IPMInputStream is = new IPMInputStream("c:/dev/SimpleSmallFile.ipm");
+
+//        var blockSize = 1012;
+//        var blockChar = 0x00;
+        ConnectionFactory factory = new ConnectionFactory();
+        factory.setHost("localhost");
+        Connection connection = factory.newConnection();
+        Channel channel = connection.createChannel();
+        channel.queueDeclare(QUEUE_NAME, false, false, false, null);
+        while (!is.lastBlock()) {
+            byte[] ba = is.readNBytes(4);
+//            System.out.println(Integer.toBinaryString(ba[0]));
+//            System.out.println(Integer.toBinaryString(ba[1]));
+//        System.out.println(String.format("%8s", Integer.toBinaryString(ba[2])).replace(' ', '0'));
+//        System.out.println(String.format("%8s", Integer.toBinaryString(ba[3])).replace(' ', '0'));
+//        System.out.println(Integer.toBinaryString(ba[3] & 0xFF));
+//        System.out.println(new String(ba, "Windows-1252"));
+            // format is 00LL bytes 0 and 1 should be 0
+            int recordLength = 256 * (ba[2] & 0xFF) + (ba[3] & 0xFF);
+            if (recordLength == 0) {
+                System.exit(0);
+            }
+//            System.out.println(recordLength);
+            //ba = bais.readNBytes(recordLength);
+//            ByteArrayInputStream bais = new ByteArrayInputStream(ba);
+            Boolean[] RecordBitmap = new Boolean[IpmSpecificationConstants.DataElementCount];
+            String[] RecordDataElements = new String[IpmSpecificationConstants.DataElementCount];
+            RecordBitmap[0] = true;
+
+            byte[] messageTypeIdBytes = is.readNBytes(4);
+            String messsageTypeId = new String(messageTypeIdBytes, "Windows-1252");
+//            System.out.format("Message Type : %s\n", messsageTypeId);
+            for (int i = 0; i < IpmSpecificationConstants.DataElementCount; i++) {
+                if (RecordBitmap[i]) {
+                    StringBuilder sb = new StringBuilder();
+                    int elementLength = GetDataElementLength(is, i);
+                    ba = is.readNBytes(elementLength);
+                    IpmSpecificationConstants.DataElementFormat elementFormat = IpmDataElements.DataElements[i].Format;
+                    if (elementFormat == IpmSpecificationConstants.DataElementFormat.Binary) {
+                        for (int j = 0; j < elementLength; j++) {
+                            sb.append(String.format("%8s", Integer.toBinaryString(ba[j] & 0xFF)).replace(' ', '0'));
+                        }
+                        String binaryStringValue = sb.toString();
+                        boolean isBitmap = IpmDataElements.DataElements[i].IsBitmap;
+                        if (isBitmap) {
+                            int bitmapStartIndex = IpmDataElements.DataElements[i].BitmapStartIndex;
+                            for (int j = 0; j < binaryStringValue.length(); j++) {
+                                char c = binaryStringValue.charAt(j);
+                                RecordBitmap[j + bitmapStartIndex] = c == '1';
+                            }
+                        }
+                        RecordDataElements[i] = sb.toString();
+                    } else if (elementFormat == IpmSpecificationConstants.DataElementFormat.HexadecimalBinary) {
+                        RecordDataElements[i] = new BigInteger(ba).toString(16);
+                    } else {
+                        RecordDataElements[i] = new String(ba, "Windows-1252");
+                    }
+                }
+            }
+            // We have a whole messasge
+            Gson gson = new Gson();
+            ArrayList<IsoElement> elements = new ArrayList<IsoElement>();
+            for (int i = 0; i < RecordDataElements.length; i++) {
+                if (RecordBitmap[i]) {
+                    elements.add(new IsoElement(i, IpmDataElements.DataElements[i].Name, RecordDataElements[i]));
+//                    System.out.format("%03d (%s): %s\n", i, IpmDataElements.DataElements[i].Name, RecordDataElements[i]);
+                }
+            }
+            String message = gson.toJson(elements);
+            channel.basicPublish("", QUEUE_NAME, null, message.getBytes(StandardCharsets.UTF_8));
+        }
+    }
+
+    static int GetDataElementLength(IPMInputStream bais, int dataElementIndex) {
+        int elementSize = IpmDataElements.DataElements[dataElementIndex].LengthData.LllSize;
+        if (elementSize == 0) {
+            return IpmDataElements.DataElements[dataElementIndex].LengthData.MaximumLength;
+        }
+        String s = "";
+        try {
+            byte[] elementLengthBytes = bais.readNBytes(elementSize);
+            s = new String(elementLengthBytes);
+            return Integer.parseInt(s);
+        } catch (Exception ex) {
+            System.out.format("%03d: %s is not a number\n", dataElementIndex, s);
+            return 4;
+        }
+    }
+    
+}