Index: branches/APG_ES_Product/Java/nsight-product-availability/src/main/java/com/genpt/nsight/NSightCacheLoader.java =================================================================== diff -u -r255335 -r256082 --- branches/APG_ES_Product/Java/nsight-product-availability/src/main/java/com/genpt/nsight/NSightCacheLoader.java (.../NSightCacheLoader.java) (revision 255335) +++ branches/APG_ES_Product/Java/nsight-product-availability/src/main/java/com/genpt/nsight/NSightCacheLoader.java (.../NSightCacheLoader.java) (revision 256082) @@ -81,6 +81,8 @@ private String invDataSvcPilotStores; private String deliveryDataSvcPilotStores; private String nonNapaStores; + Map countryCodeMap; + @Autowired ConfigManagementService configManagementService; public void reset() { @@ -95,6 +97,7 @@ BuyerIDToSiteMap=null; displayNameMap=null; storeHoursMap=null; + countryCodeMap=null; //dontCallStoreSet=null; } @@ -110,7 +113,7 @@ loadBuyerID(); loadUAPDCs(); loadInventoryPilotStores(); - + loadCountryCodes(); } public void processSiteChanges() { @@ -123,6 +126,7 @@ loadBuyerID(); loadUAPDCs(); loadInventoryPilotStores(); + loadCountryCodes(); } public void reloadHQLineAbbrev( Map siteDTOMap) { @@ -132,6 +136,29 @@ loadStoreIPsNew(); } + private boolean loadCountryCodes(){ + boolean isSuccess = false; + Map countrCodeTempMap = new HashMap<>(); + long startTime = System.currentTimeMillis(); + LOGGER.info("Application: NSight , Loading CountryCode Map from Cassandra"); + SimpleStatement countryStatement = new SimpleStatement("select alpha_3_code, alpha_2_code from country_code;"); + int count = 0; + ResultSet rsSites = session.execute(countryStatement); + while (!rsSites.isExhausted()) { + Row row = rsSites.one(); + String alpha3Code = row.getString("alpha_3_code"); + String alpha2Code = row.getString("alpha_2_code"); + countrCodeTempMap.put(alpha3Code, alpha2Code); + count++; + } + LOGGER.info("Application: NSight , Loaded total {} Country Codes , total time: {} ", count, (System.currentTimeMillis() - startTime)); + if (count > 0) { + isSuccess = true; + countryCodeMap =countrCodeTempMap; + } + return isSuccess; + } + private boolean loadTimezoneID(){ boolean isSuccess = false; try {