public static EJBObject getLocalEJBConnection(String url, String jndiName, String factory)
      throws NamingException, RemoteException {
    EJBObject object = null;

    EBWLogger.logDebug(
        "com.tcs.ebw.ejb.EjbConnection ", " entering into the getLocalEJBConnection method ");
    if (localEjbMap == null) {
      localEjbMap = new LinkedHashMap();
    }

    if (!localEjbMap.containsKey(jndiName)) {

      //	System.out.println("key not found in hashmap ");
      Properties prop = new Properties();
      prop.put("java.naming.factory.initial", factory);
      prop.put("java.naming.provider.url", url);
      InitialContext ctx = new InitialContext(prop);
      EJBHome home = (EJBHome) ctx.lookup(jndiName);
      Class homeintf = home.getEJBMetaData().getHomeInterfaceClass();
      object = (EJBObject) invoke(homeintf, home, "create");
      if (object != null) localEjbMap.put(jndiName, object);
    } else object = (EJBObject) localEjbMap.get(jndiName);

    EBWLogger.logDebug("com.tcs.ebw.ejb.EjbConnection ", " The connection object is " + object);

    return object;
  }
  public static EJBObject getRemoteEJBConnection(String url, String jndiName, String factory)
      throws NamingException, RemoteException {
    EJBObject object = null;

    EBWLogger.logDebug(
        "com.tcs.ebw.ejb.EjbConnection ", " entering into the getRemoteEJBConnection method ");

    if (remoteEjbMap == null) {
      remoteEjbMap = new LinkedHashMap();
    }

    if (!remoteEjbMap.containsKey(jndiName)) {

      Properties prop = new Properties();
      prop.put("java.naming.factory.initial", factory);
      prop.put("java.naming.provider.url", url);
      InitialContext ctx = new InitialContext(prop);
      Object obj = ctx.lookup(jndiName);
      EJBHome home = (EJBHome) PortableRemoteObject.narrow(obj, EJBHome.class);
      Class homeintf = home.getEJBMetaData().getHomeInterfaceClass();
      object = (EJBObject) invoke(homeintf, home, "create");
      if (object != null) remoteEjbMap.put(jndiName, object);
    } else object = (EJBObject) remoteEjbMap.get(jndiName);

    EBWLogger.logDebug("com.tcs.ebw.ejb.EjbConnection ", " The connection object is " + object);

    return object;
  }
 /**
  * MS360 External Holiday List....
  *
  * @param serviceContext
  * @return
  * @throws Exception
  */
 public static ArrayList getACHHolidayList(ServiceContext serviceContext) throws Exception {
   Object objHolidayDaysId = null;
   ArrayList<Object> objHolidayDaysVal = new ArrayList<Object>();
   Boolean isDirectDBCall = true;
   try {
     CacheObject cacheObj = new CacheObject();
     objHolidayDaysId =
         cacheObj.getCacheData("getExternalHolidaysListObj", isDirectDBCall, serviceContext);
     objHolidayDaysVal = (ArrayList<Object>) objHolidayDaysId;
     EBWLogger.logDebug("WSDefaultInputsMap", "MS360 External Holiday List." + objHolidayDaysVal);
   } catch (Exception exception) {
     throw exception;
   }
   return objHolidayDaysVal;
 }
  /**
   * Get external account ...
   *
   * @param txnDetails
   * @param serviceContext
   * @throws Exception
   * @throws SQLException
   */
  public void getExternalAccounts(HashMap txnDetails, ServiceContext serviceContext)
      throws Exception, SQLException {
    EBWLogger.trace(this, "Getting the external accounts for the logged in client...");
    Object externalAccounts = null;
    Object thirdPartyExtAccounts = null;
    try {
      // Payment attributes mappings...
      Boolean isTxnCommitReq = Boolean.TRUE;
      DsOnloadAccDetailsTO objDsOnloadAccDetailsTO = new DsOnloadAccDetailsTO();
      if (txnDetails.containsKey("ExtAccKeyClientIds")) {
        objDsOnloadAccDetailsTO = (DsOnloadAccDetailsTO) txnDetails.get("ExtAccKeyClientIds");
      }

      // External Accounts StatementId's and TransferObjects
      String externalAccsStmntId = "getExternalAccounts";
      externalAccounts = executeQuery(externalAccsStmntId, objDsOnloadAccDetailsTO, isTxnCommitReq);
      EBWLogger.logDebug(this, "Execution Completed.... " + externalAccsStmntId);

      // Third Party External Accounts StatementId's and TransferObjects
      String thirdPartyExtAccsStmntId = "getThirdPartyExtAccounts";
      thirdPartyExtAccounts =
          executeQuery(thirdPartyExtAccsStmntId, objDsOnloadAccDetailsTO, isTxnCommitReq);
      EBWLogger.logDebug(this, "Execution Completed.... " + externalAccsStmntId);

      // Setting the external accounts in the HashMap.
      txnDetails.put("ExternalAccountsList", externalAccounts);
      txnDetails.put("ThirdPartyExtAccountsList", thirdPartyExtAccounts);
    } catch (SQLException sqlexception) {
      sqlexception.printStackTrace();
      throw sqlexception;
    } catch (Exception exception) {
      throw exception;
    } finally {

    }
  }
 /**
  * MS360 Approver Role Descriptions
  *
  * @param serviceContext
  * @return
  * @throws Exception
  */
 public static ArrayList getApprRoleDesc(ServiceContext serviceContext) throws Exception {
   Object objApprRoleDesc = null;
   ArrayList<Object> objApprRoleList = new ArrayList<Object>();
   Boolean isDirectDBCall = true;
   try {
     CacheObject cacheObj = new CacheObject();
     objApprRoleDesc =
         cacheObj.getCacheData("getApproverRoleDesc", isDirectDBCall, serviceContext);
     objApprRoleList = (ArrayList<Object>) objApprRoleDesc;
     EBWLogger.logDebug(
         "WSDefaultInputsMap", "MS360 Approver Role Description List." + objApprRoleList);
   } catch (Exception exception) {
     throw exception;
   }
   return objApprRoleList;
 }
 /**
  * MS360 Maximum dollar limit....
  *
  * @param serviceContext
  * @return
  * @throws Exception
  */
 public static String getMaxUntilDollarLimit(ServiceContext serviceContext) throws Exception {
   String amountId = "";
   Object objAmountId = null;
   ArrayList<Object> objAmountVal = new ArrayList<Object>();
   Boolean isDirectDBCall = true;
   try {
     CacheObject cacheObj = new CacheObject();
     objAmountId = cacheObj.getCacheData("getMaxUntilDollarLimit", isDirectDBCall, serviceContext);
     if (objAmountId != null) {
       objAmountVal = (ArrayList<Object>) objAmountId;
       if (!objAmountVal.isEmpty() && objAmountVal.get(1) != null) {
         amountId = (String) (((ArrayList) objAmountVal.get(1)).get(0));
       }
     }
     EBWLogger.logDebug("WSDefaultInputsMap", "MS360 Maximum dollar limit.." + amountId);
   } catch (Exception exception) {
     throw exception;
   }
   return amountId;
 }
 /**
  * InquiryNumId Input to Print Check...
  *
  * @param serviceContext
  * @return
  * @throws Exception
  */
 public static String getInquiryNum(ServiceContext serviceContext) throws Exception {
   String inquiryNumId = "";
   Object objInquiryNumId = null;
   ArrayList<Object> inquiryNumVal = new ArrayList<Object>();
   Boolean isDirectDBCall = true;
   try {
     CacheObject cacheObj = new CacheObject();
     objInquiryNumId = cacheObj.getCacheData("getInquiryNum", isDirectDBCall, serviceContext);
     if (objInquiryNumId != null) {
       inquiryNumVal = (ArrayList<Object>) objInquiryNumId;
       if (!inquiryNumVal.isEmpty() && inquiryNumVal.get(1) != null) {
         inquiryNumId = (String) (((ArrayList) inquiryNumVal.get(1)).get(0));
       }
     }
     EBWLogger.logDebug("WSDefaultInputsMap", "Inquiry for the Print Check " + inquiryNumId);
   } catch (Exception exception) {
     throw exception;
   }
   return inquiryNumId;
 }
 /**
  * printEncryptId Input to Print Check...
  *
  * @param serviceContext
  * @return
  * @throws Exception
  */
 public static String getPrintEncrypt(ServiceContext serviceContext) throws Exception {
   String printEncryptId = "";
   Object objPrintEncryptId = null;
   ArrayList<Object> printEncryptVal = new ArrayList<Object>();
   Boolean isDirectDBCall = true;
   try {
     CacheObject cacheObj = new CacheObject();
     objPrintEncryptId = cacheObj.getCacheData("getPrintEncrypt", isDirectDBCall, serviceContext);
     if (objPrintEncryptId != null) {
       printEncryptVal = (ArrayList<Object>) objPrintEncryptId;
       if (!printEncryptVal.isEmpty() && printEncryptVal.get(1) != null) {
         printEncryptId = (String) (((ArrayList) printEncryptVal.get(1)).get(0));
       }
     }
     EBWLogger.logDebug("WSDefaultInputsMap", "Encrypt for the Print Check " + printEncryptId);
   } catch (Exception exception) {
     throw exception;
   }
   return printEncryptId;
 }
 /**
  * Application ID Input to BR Web Service
  *
  * @param serviceContext
  * @return
  * @throws Exception
  */
 public static String getBusRuleCntrlAppID(ServiceContext serviceContext) throws Exception {
   String appId = "";
   Object objAppId = null;
   ArrayList<Object> appIdVal = new ArrayList<Object>();
   Boolean isDirectDBCall = true;
   try {
     CacheObject cacheObj = new CacheObject();
     objAppId = cacheObj.getCacheData("getBusRuleCntrlAppID", isDirectDBCall, serviceContext);
     if (objAppId != null) {
       appIdVal = (ArrayList<Object>) objAppId;
       if (!appIdVal.isEmpty() && appIdVal.get(1) != null) {
         appId = (String) (((ArrayList) appIdVal.get(1)).get(0));
       }
     }
     EBWLogger.logDebug("WSDefaultInputsMap", "Application ID Input to BR Web Service  " + appId);
   } catch (Exception exception) {
     throw exception;
   }
   return appId;
 }
 /**
  * MS360 Expiry Time....
  *
  * @param serviceContext
  * @return
  * @throws Exception
  */
 public static String getTxnExpiryPeriod(ServiceContext serviceContext) throws Exception {
   String expiryTimeId = "";
   Object objExpiryTimeId = null;
   ArrayList<Object> objExpiryTimeVal = new ArrayList<Object>();
   Boolean isDirectDBCall = true;
   try {
     CacheObject cacheObj = new CacheObject();
     objExpiryTimeId = cacheObj.getCacheData("getTxnExpiryPeriod", isDirectDBCall, serviceContext);
     if (objExpiryTimeId != null) {
       objExpiryTimeVal = (ArrayList<Object>) objExpiryTimeId;
       if (!objExpiryTimeVal.isEmpty() && objExpiryTimeVal.get(1) != null) {
         expiryTimeId = (String) (((ArrayList) objExpiryTimeVal.get(1)).get(0));
       }
     }
     EBWLogger.logDebug("WSDefaultInputsMap", "MS360 Expiry Time." + expiryTimeId);
   } catch (Exception exception) {
     throw exception;
   }
   return expiryTimeId;
 }
 /**
  * PlanCodeId Input
  *
  * @param serviceContext
  * @return
  * @throws Exception
  */
 public static String getCheckDefaultIRAPlanCode(ServiceContext serviceContext) throws Exception {
   String planCodeId = "";
   Object objPlanCodeId = null;
   ArrayList<Object> planCodeVal = new ArrayList<Object>();
   Boolean isDirectDBCall = true;
   try {
     CacheObject cacheObj = new CacheObject();
     objPlanCodeId =
         cacheObj.getCacheData("getCheckDefaultIRAPlanCode", isDirectDBCall, serviceContext);
     if (objPlanCodeId != null) {
       planCodeVal = (ArrayList<Object>) objPlanCodeId;
       if (!planCodeVal.isEmpty() && planCodeVal.get(1) != null) {
         planCodeId = (String) (((ArrayList) planCodeVal.get(1)).get(0));
       }
     }
     EBWLogger.logDebug("WSDefaultInputsMap", "DefaultPlanCode for IRA Checks" + planCodeId);
   } catch (Exception exception) {
     throw exception;
   }
   return planCodeId;
 }
 /**
  * LegalTxtLineId Input to Print Check...
  *
  * @param serviceContext
  * @return
  * @throws Exception
  */
 public static String getLegalTxtLine1(ServiceContext serviceContext) throws Exception {
   String legalTxtLineId = "";
   Object objLegalTxtLineId = null;
   ArrayList<Object> legalTxtLineVal = new ArrayList<Object>();
   Boolean isDirectDBCall = true;
   try {
     CacheObject cacheObj = new CacheObject();
     objLegalTxtLineId = cacheObj.getCacheData("getLegalTxtLine1", isDirectDBCall, serviceContext);
     if (objLegalTxtLineId != null) {
       legalTxtLineVal = (ArrayList<Object>) objLegalTxtLineId;
       if (!legalTxtLineVal.isEmpty() && legalTxtLineVal.get(1) != null) {
         legalTxtLineId = (String) (((ArrayList) legalTxtLineVal.get(1)).get(0));
       }
     }
     EBWLogger.logDebug(
         "WSDefaultInputsMap", "LegalTxt Line2 for the Print Check " + legalTxtLineId);
   } catch (Exception exception) {
     throw exception;
   }
   return legalTxtLineId;
 }
 /**
  * Server IP Input to Account plating Web Service
  *
  * @param serviceContext
  * @return
  * @throws Exception
  */
 public static String getAcntPlatingServerIP(ServiceContext serviceContext) throws Exception {
   String serverIp = "";
   Object objServerIp = null;
   ArrayList<Object> serverIdVal = new ArrayList<Object>();
   Boolean isDirectDBCall = true;
   try {
     CacheObject cacheObj = new CacheObject();
     objServerIp = cacheObj.getCacheData("getAcntPlatingServerIP", isDirectDBCall, serviceContext);
     if (objServerIp != null) {
       serverIdVal = (ArrayList<Object>) objServerIp;
       if (!serverIdVal.isEmpty() && serverIdVal.get(1) != null) {
         serverIp = (String) (((ArrayList) serverIdVal.get(1)).get(0));
       }
     }
     EBWLogger.logDebug(
         "WSDefaultInputsMap", "Server IP Input to Account plating Web Service " + serverIp);
   } catch (Exception exception) {
     throw exception;
   }
   return serverIp;
 }
 /**
  * callerAppId Input to Check number...
  *
  * @param serviceContext
  * @return
  * @throws Exception
  */
 public static String getCheckNumCallerAppId(ServiceContext serviceContext) throws Exception {
   String callerAppId = "";
   Object objcallerAppId = null;
   ArrayList<Object> callerAppVal = new ArrayList<Object>();
   Boolean isDirectDBCall = true;
   try {
     CacheObject cacheObj = new CacheObject();
     objcallerAppId =
         cacheObj.getCacheData("getCheckNumCallerAppId", isDirectDBCall, serviceContext);
     if (objcallerAppId != null) {
       callerAppVal = (ArrayList<Object>) objcallerAppId;
       if (!callerAppVal.isEmpty() && callerAppVal.get(1) != null) {
         callerAppId = (String) (((ArrayList) callerAppVal.get(1)).get(0));
       }
     }
     EBWLogger.logDebug("WSDefaultInputsMap", "Caller AppId for the Check Number " + callerAppId);
   } catch (Exception exception) {
     throw exception;
   }
   return callerAppId;
 }
 /**
  * MS360 Max Future Days for External Txn....
  *
  * @param serviceContext
  * @return
  * @throws Exception
  */
 public static String getACHTxnMaxFtrDts(ServiceContext serviceContext) throws Exception {
   String futureDaysId = "";
   Object objFutureDaysId = null;
   ArrayList<Object> objFutureDaysVal = new ArrayList<Object>();
   Boolean isDirectDBCall = true;
   try {
     CacheObject cacheObj = new CacheObject();
     objFutureDaysId = cacheObj.getCacheData("getMaxFtrDtsACH", isDirectDBCall, serviceContext);
     if (objFutureDaysId != null) {
       objFutureDaysVal = (ArrayList<Object>) objFutureDaysId;
       if (!objFutureDaysVal.isEmpty() && objFutureDaysVal.get(1) != null) {
         futureDaysId = (String) (((ArrayList) objFutureDaysVal.get(1)).get(0));
       }
     }
     EBWLogger.logDebug(
         "WSDefaultInputsMap", "MS360 Max Future Days for External Txn." + futureDaysId);
   } catch (Exception exception) {
     throw exception;
   }
   return futureDaysId;
 }
 /**
  * MS360 Client Interaction Center...
  *
  * @param serviceContext
  * @return
  * @throws Exception
  */
 public static String getMS360ContactCenter(ServiceContext serviceContext) throws Exception {
   String contactCenterId = "";
   Object objcontactCenterId = null;
   ArrayList<Object> objcontactCenterVal = new ArrayList<Object>();
   Boolean isDirectDBCall = true;
   try {
     CacheObject cacheObj = new CacheObject();
     objcontactCenterId =
         cacheObj.getCacheData("getMS360ContactCenter", isDirectDBCall, serviceContext);
     if (objcontactCenterId != null) {
       objcontactCenterVal = (ArrayList<Object>) objcontactCenterId;
       if (!objcontactCenterVal.isEmpty() && objcontactCenterVal.get(1) != null) {
         contactCenterId = (String) (((ArrayList) objcontactCenterVal.get(1)).get(0));
       }
     }
     EBWLogger.logDebug("WSDefaultInputsMap", "MS360 Client Interaction Center" + contactCenterId);
   } catch (Exception exception) {
     throw exception;
   }
   return contactCenterId;
 }
 /**
  * User ID Input to Account plating Web Service
  *
  * @param serviceContext
  * @return
  * @throws Exception
  */
 public static String getAcntPlatingUserID(ServiceContext serviceContext) throws Exception {
   String userId = "";
   Object objUserId = null;
   ArrayList<Object> userIdVal = new ArrayList<Object>();
   Boolean isDirectDBCall = true;
   try {
     CacheObject cacheObj = new CacheObject();
     objUserId = cacheObj.getCacheData("getAcntPlatingUserID", isDirectDBCall, serviceContext);
     if (objUserId != null) {
       userIdVal = (ArrayList<Object>) objUserId;
       if (!userIdVal.isEmpty() && userIdVal.get(1) != null) {
         userId = (String) (((ArrayList) userIdVal.get(1)).get(0));
       }
     }
     EBWLogger.logDebug(
         "WSDefaultInputsMap", "User ID Input to Account plating Web Service " + userId);
   } catch (Exception exception) {
     throw exception;
   }
   return userId;
 }
 /**
  * MS360 External Txn Cut off time......
  *
  * @param serviceContext
  * @return
  * @throws Exception
  */
 public static String getACHTxnCutOffTime(ServiceContext serviceContext) throws Exception {
   String cutOffTimeId = "";
   Object objCutOffTimeId = null;
   ArrayList<Object> objCutOffTimeVal = new ArrayList<Object>();
   Boolean isDirectDBCall = true;
   try {
     CacheObject cacheObj = new CacheObject();
     objCutOffTimeId =
         cacheObj.getCacheData("getExternalCutOffTime", isDirectDBCall, serviceContext);
     if (objCutOffTimeId != null) {
       objCutOffTimeVal = (ArrayList<Object>) objCutOffTimeId;
       if (!objCutOffTimeVal.isEmpty() && objCutOffTimeVal.get(1) != null) {
         cutOffTimeId = (String) (((ArrayList) objCutOffTimeVal.get(1)).get(0));
       }
     }
     EBWLogger.logDebug("WSDefaultInputsMap", "MS360 External Txn Cut off time.." + cutOffTimeId);
   } catch (Exception exception) {
     throw exception;
   }
   return cutOffTimeId;
 }
 /**
  * Cancel Transaction flag while system rejecting the transactions...
  *
  * @param serviceContext
  * @return
  * @throws Exception
  */
 public static String getCancelTxnFlag(ServiceContext serviceContext) throws Exception {
   String cancelTxnFlag = "";
   Object cancelTxnObj = null;
   ArrayList<Object> cancelTxnIndList = new ArrayList<Object>();
   Boolean isDirectDBCall = true;
   try {
     CacheObject cacheObj = new CacheObject();
     cancelTxnObj = cacheObj.getCacheData("getCancelTxnFlag", isDirectDBCall, serviceContext);
     if (cancelTxnObj != null) {
       cancelTxnIndList = (ArrayList<Object>) cancelTxnObj;
       if (!cancelTxnIndList.isEmpty() && cancelTxnIndList.get(1) != null) {
         cancelTxnFlag = (String) (((ArrayList) cancelTxnIndList.get(1)).get(0));
       }
     }
     EBWLogger.logDebug(
         "WSDefaultInputsMap",
         "Cancel Transaction flag for system reject transactions.." + cancelTxnFlag);
   } catch (Exception exception) {
     throw exception;
   }
   return cancelTxnFlag;
 }
 /**
  * Auth Verb Input to Merlin (Account View) Web Service
  *
  * @param serviceContext
  * @return
  * @throws Exception
  */
 public static String getAcntViewAuthVerb(ServiceContext serviceContext) throws Exception {
   String authVerb = "";
   Object objAuthVerb = null;
   ArrayList<Object> authVerbVal = new ArrayList<Object>();
   Boolean isDirectDBCall = true;
   try {
     CacheObject cacheObj = new CacheObject();
     objAuthVerb = cacheObj.getCacheData("getAcntViewAuthVerb", isDirectDBCall, serviceContext);
     if (objAuthVerb != null) {
       authVerbVal = (ArrayList<Object>) objAuthVerb;
       if (!authVerbVal.isEmpty() && authVerbVal.get(1) != null) {
         authVerb = (String) (((ArrayList) authVerbVal.get(1)).get(0));
       }
     }
     EBWLogger.logDebug(
         "WSDefaultInputsMap",
         "Auth Verb Input to Merlin (Account View) Web Service  " + authVerb);
   } catch (Exception exception) {
     throw exception;
   }
   return authVerb;
 }
 /**
  * Non Certified Check Application name..
  *
  * @param serviceContext
  * @return
  * @throws Exception
  */
 public static String getPrintNonCertifiedAppName(ServiceContext serviceContext) throws Exception {
   String nonCertAppName = "";
   Object objnonCertAppNameId = null;
   ArrayList<Object> objnonCertAppVal = new ArrayList<Object>();
   Boolean isDirectDBCall = true;
   try {
     CacheObject cacheObj = new CacheObject();
     objnonCertAppNameId =
         cacheObj.getCacheData("getPrintNonCertifiedAppName", isDirectDBCall, serviceContext);
     if (objnonCertAppNameId != null) {
       objnonCertAppVal = (ArrayList<Object>) objnonCertAppNameId;
       if (!objnonCertAppVal.isEmpty() && objnonCertAppVal.get(1) != null) {
         nonCertAppName = (String) (((ArrayList) objnonCertAppVal.get(1)).get(0));
       }
     }
     EBWLogger.logDebug(
         "WSDefaultInputsMap", "Application Name for NonCertified check.." + nonCertAppName);
   } catch (Exception exception) {
     throw exception;
   }
   return nonCertAppName;
 }
package com.tcs.ebw.serverside.query;
package com.tcs.ebw.serverside.query;