D:\CreditRepair\CreditRepair_PM_Structure\Development\Source\SourcePackages\CreditRepairProject\DynamicBusinessRulesFramework\src\java\applications_process_mapping\ProcessMapper.java
  1 /*
  2  * To change this template, choose Tools | Templates
  3  * and open the template in the editor.
  4  */
  5 
  6 package applications_process_mapping;
  7 
  8 import java.util.*;
  9 import applications_processes.*;
 10 import loaders_business_rules_abstract_factory.*;
 11 import trans_union_fixed_format_inquiry_FFI_processes.*;
 12 import constants.*;
 13 import util.*;
 14 import business_rules_manager.*;
 15 import business_rules_data_objects.*;
 16 
 17 /**
 18  *
 19  * @author sameldin
 20  */
 21 public class ProcessMapper
 22 {
 23     Map<Integer, TransUnionRuleProcessesInterface> classTU_ProcessesHashMap = null;
 24     Map<Integer,  Set> classTU_SetOfProcessesStructuralRulesDO_HashMap = null;
 25     Map<Integer,  Set> classTU_SetOfProcessesFunctionalRulesDO_HashMap = null;
 26     Map<Integer,  Set> classTU_SetOfProcessesMiscellaneousRulesDO_HashMap = null;
 27 
 28 
 29     public ProcessMapper()
 30     {
 31         classTU_ProcessesHashMap = new HashMap<Integer, TransUnionRuleProcessesInterface>();
 32     }
 33     public ProcessMapper(Hashtable<String, String> dynamic_processRulesNameKeyListHashTable,
 34                         Hashtable<String, Integer> static_processNameIndexValuetHashTable,
 35                         BusinessRulesManager passedBusinessRulesManager)
 36     {
 37         if(     (null == dynamic_processRulesNameKeyListHashTable)
 38            ||   (null == static_processNameIndexValuetHashTable)
 39            )
 40         {
 41             // exception
 42             return;
 43         }
 44         classTU_ProcessesHashMap = new HashMap<Integer, TransUnionRuleProcessesInterface>();
 45         Enumeration localEnumeration = dynamic_processRulesNameKeyListHashTable.keys();
 46         while (localEnumeration.hasMoreElements())
 47         {
 48           String processNameKey = (String)localEnumeration.nextElement();
 49           String static_processNameKey  = dynamic_processRulesNameKeyListHashTable.get(processNameKey);
 50           Integer processID = (Integer)static_processNameIndexValuetHashTable.get(static_processNameKey );
 51             //System.out.println(nextElement());.nextElement());
 52             int processIndex = processID.intValue();
 53             switch(processIndex)
 54             {
 55                 case Constants.TU_FFI_SEGMENT_START_END_LENGTH_PROCESS_INDEX:
 56                     classTU_ProcessesHashMap.put(processID, new TU_FFI_SegmentStartEndLengthProcess());
 57                     Set localStructuralProcessesRuleDOHashSet = passedBusinessRulesManager.getStructuralProcessesRuleDOset(processIndex);
 58                     Set localFunctionalProcessesRuleDOHashSet = passedBusinessRulesManager.getFunctionalProcessesRuleDOset(processIndex);
 59                     Set localMiscellaneousProcessesRuleDOHashSet = passedBusinessRulesManager.getMiscellaneousProcessesRuleDOset(processIndex);
 60                     classTU_SetOfProcessesStructuralRulesDO_HashMap.put(processID, localStructuralProcessesRuleDOHashSet);
 61                     classTU_SetOfProcessesFunctionalRulesDO_HashMap.put(processID,localFunctionalProcessesRuleDOHashSet);
 62                     classTU_SetOfProcessesMiscellaneousRulesDO_HashMap.put(processID, localMiscellaneousProcessesRuleDOHashSet);
 63                     break;
 64                 case Constants.TU_FFI_PERSONAL_INFORMATION_SEGMENT_PROCESS_INDEX:
 65                         classTU_ProcessesHashMap.put(processID, new TU_FFI_PersonalInformationProcess());
 66                     break;
 67                 case Constants.TU_FFI_ADDRESS_PHONE_NUMBER_SEGMENT_PROCESS_INDEX:
 68                         classTU_ProcessesHashMap.put(processID, new TU_FFI_AddressPhoneNumberProcess());
 69                     break;
 70                 case Constants.TU_FFI_REQUEST_SERVICE_SEGMENT_PROCESS_INDEX:
 71                         classTU_ProcessesHashMap.put(processID, new TU_FFI_RequestServiceProcess());
 72                     break;
 73                 case Constants.TU_FFI_OPTIONAL_REQUEST_SEGMENT_PROCESS_INDEX:
 74                         classTU_ProcessesHashMap.put(processID, new TU_FFI_OptionalRequestProcess());
 75                     break;
 76                 case Constants.TU_FFI_ADDITIONAL_INFORMATION_SEGMENT_PROCESS_INDEX:
 77                         classTU_ProcessesHashMap.put(processID, new TU_FFI_AdditionalInformationProcess());
 78                     break;
 79                 case Constants.TU_FFI_TRANSACTION_ERROR_RESPONSE_SEGMENT_PROCESS_INDEX:
 80                         classTU_ProcessesHashMap.put(processID, new TU_FFI_TransactionalErrorProcess());
 81                     break;
 82                 case Constants.TU_FFI_CREDIT_CARDS_SEGMENT_PROCESS_INDEX:
 83                         classTU_ProcessesHashMap.put(processID, new TU_FFI_CreditCardProcess());
 84                     break;
 85                 case Constants.TU_FFI_EMPLOYMENT_SEGMENT_PROCESS_INDEX:
 86                         classTU_ProcessesHashMap.put(processID, new TU_FFI_EmploymentProcess());
 87                     break;
 88                 case Constants.TU_FFI_VENDOR_INFORMATION_SEGMENT_PROCESS_INDEX:
 89                         classTU_ProcessesHashMap.put(processID, new TU_FFI_VenderInfomationProcess());
 90                     break;
 91                 case Constants.TU_FFI_REPORT_SEGMENT_PROCESS_INDEX:
 92                         classTU_ProcessesHashMap.put(processID, new TU_FFI_ReportProcess());
 93                     break;
 94                 case Constants.TU_FFI_CREDITOR_CONTACT_SEGMENT_PROCESS_INDEX:
 95                         classTU_ProcessesHashMap.put(processID, new TU_FFI_CreditorContactProcess());
 96                     break;
 97                 case Constants.TU_FFI_CAR_LOANS_SEGMENT_PROCESS_INDEX:
 98                         classTU_ProcessesHashMap.put(processID, new TU_FFI_AutoLoansProcess());
 99                     break;
100                 case Constants.TU_FFI_GOVERNMENT_REPORT_SEGMENT_PROCESS_INDEX:
101                         classTU_ProcessesHashMap.put(processID, new TU_FFI_GovernmentReportProcess());
102                     break;
103                 default:
104             }
105         }
106     }
107     /*
108      *
109      */
110     public Map<Integer, TransUnionRuleProcessesInterface> getProcessesMap()
111     {        
112         return (classTU_ProcessesHashMap);
113     }
114     /*
115      *
116      */
117     public Map<Integer,  Set> getTU_SetOfProcessesStructuralRulesDO_HashMap()
118     {
119         return (classTU_SetOfProcessesStructuralRulesDO_HashMap);
120     }
121     /*
122      *
123      */
124     public Map<Integer,  Set> getTU_SetOfProcessesFunctionalRulesDO_HashMap()
125     {
126         return (classTU_SetOfProcessesFunctionalRulesDO_HashMap);
127     }
128     /*
129      *
130      */
131 
132 }
133 
134