?
Solved

Session Cookie & HighAvailability

Posted on 2008-11-11
2
Medium Priority
?
265 Views
Last Modified: 2013-11-23
We have a online loan application web page. People can apply for a loan online.
When they apply for a loan more then 3 times from the same machine/PC it goes into a queue. I need it not to go into a queue but allows them to get loand offers.

They say it has something to to with the HighAvailability set to ture I am not sure

Can you please assist with this

package text.text.bean.form;
 
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import java.util.StringTokenizer;
 
import javax.faces.context.FacesContext;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
 
import abil.abilweb.bean.WebUtil;
import abil.abilweb.bean.action.AffordabilityAction;
import abil.abilweb.bean.action.CreditRuleChecker;
import abil.abilweb.bean.action.LoanApplicationMaintanence;
import abil.abilweb.bean.action.OfferAction;
import abil.abilweb.bean.session.SessionState;
import abil.abilweb.converter.MoneyConverter;
import abil.abilweb.ejb.entity.LoanApp;
import abil.abilweb.exception.ApplicationException;
import abil.abilweb.view.Const;
import abil.interfaces.lookup.ILookup;
import abil.objectmodel.bean.affordability.AffordabilityResponse;
import abil.objectmodel.bean.creditrule.ClientCreditRuleData;
import abil.objectmodel.bean.exactus.ProductOfferBean;
import abil.objectmodel.bean.experian.BmResponse;
import abil.objectmodel.bean.web.entity.AddressPOJO;
import abil.objectmodel.bean.web.entity.BankingDetailPOJO;
import abil.objectmodel.bean.web.entity.GroupAddressPOJO;
import abil.objectmodel.bean.web.entity.GroupPOJO;
import abil.objectmodel.bean.web.entity.IndividualAddressPOJO;
import abil.objectmodel.bean.web.entity.IndividualAffordPOJO;
import abil.objectmodel.bean.web.entity.IndividualEmploymentPOJO;
import abil.objectmodel.bean.web.entity.IndividualPOJO;
import abil.util.email.EmailUtil;
/**
 * 
 * @author
 *
 */
public class LoanApplication extends Edit{
	private IndividualPOJO indi = new IndividualPOJO();
	private AddressPOJO address = new AddressPOJO();
	private IndividualAddressPOJO indiAddress = new IndividualAddressPOJO();
	private IndividualEmploymentPOJO indiEmployment = new IndividualEmploymentPOJO();
	private LoanApp loanApp = new LoanApp();
	private GroupPOJO employer = new GroupPOJO();
	private AddressPOJO employerAddress =new AddressPOJO();
	private GroupAddressPOJO employAddress = new GroupAddressPOJO();
	private BankingDetailPOJO bankingDetails = new BankingDetailPOJO();
	private IndividualAffordPOJO afford = new IndividualAffordPOJO();
	private ProductOfferBean selectedProduct = null;
	private boolean highAvailabilityMode = false;
	private String xiriusRef;
	private ClientCreditRuleData creditruledata;
	private CreditRuleChecker checker = new CreditRuleChecker();
	private AffordabilityResponse affordResponse; 
	private BmResponse experianResponse;
	private boolean idDisable = false;
	//offer specific
	private boolean isSettlementAvailable = false;
	private boolean offerUnavailableMessage = false;
	private double maxCapital = 50000;
	private double maxInstallment = 50000;
	private int maxTerm = 60;
	private double maxCapitalTmp = 50000;
	private double maxInstallmentTmp = 50000;
	private int maxTermTmp = 60;
	private double maxCapitalOrig;
	private double maxInstallmentOrig;
	private int maxTermOrig;
	private List<ProductOfferBean> offerResponseList = null;
	private List<ProductOfferBean> loOfferResponseList = null;
	private List<ProductOfferBean> loAndCcOfferResponseList = null;
	private List<ProductOfferBean> ccOfferResponseList = null;
	private String consent = null;
	private boolean cardonly = true;
	private boolean offercard = true;
	private int show = 1;
	private boolean ccRendered;
	private boolean loRendered;
	private boolean loAndCcRendered;
	
	//afford specific
	private double grossIncome=0;
	private double grossIncomeCents=0;
	private double commissionIncome=0;
	private double commissionIncomeCents=0;
	private double bonusIncome=0;
	private double bonusIncomeCents=0;
	private double overtimeIncome=0;
	private double overtimeIncomeCents=0;
	private double netIncome=0;
	private double netIncomeCents=0;
	private double maintenanceIncome=0;
	private double maintenanceIncomeCents=0;
	private double rentalIncome=0;
	private double rentalIncomeCents=0;
	private double otherIncome=0;
	private double otherIncomeCents=0;
	private double abilDeductions=0;
	private double abilDeductionsCents=0;
	private double totalExpense=0;
	private double totalExpenseCents=0;
	private String offercopy;
 
	public String next(){
		return logic();
	}
 
	private void save(){
		LoanApplicationMaintanence lam = new LoanApplicationMaintanence();
		lam.saveLoanApp(this);
	}
 
	private void process(){
		LoanApplicationMaintanence lam = new LoanApplicationMaintanence();
		lam.process(this);
	}
	
	public String previous(){
		super.previous(this);
		return "default";
	}
	
	public String exit(){
		super.next(this, 6);
		return "default";
	}
	
	public String returnApp(){
		super.previous(this, 1);
		return "default";
	}
	
	public String print(){
		super.cancel();
		WebUtil.getSession().removeAttribute("loanApp");
		WebUtil.getSession().setAttribute("loanApp", this);
		WebUtil.getSessionState().setPage_Id(135l);
		return "default2";
	}
	
	private void affordConversion(){
		afford.setGROSS_INCOME(MoneyConverter.randCents(grossIncome,grossIncomeCents));
		afford.setCOMMISION_INCOME(MoneyConverter.randCents(commissionIncome,commissionIncomeCents));
		afford.setBONUS_INCOME(MoneyConverter.randCents(bonusIncome,bonusIncomeCents));
		afford.setOVERTIME_INCOME(MoneyConverter.randCents(overtimeIncome,overtimeIncomeCents));
		afford.setNET_INCOME(MoneyConverter.randCents(netIncome,netIncomeCents));
		afford.setMAINTENANCE_INCOME(MoneyConverter.randCents(maintenanceIncome,maintenanceIncomeCents));
		afford.setRENTAL_INCOME(MoneyConverter.randCents(rentalIncome,rentalIncomeCents));
		afford.setOTHER_INCOME(MoneyConverter.randCents(otherIncome,otherIncomeCents));
		afford.setABIL_INSTALLMENTS(MoneyConverter.randCents(abilDeductions,abilDeductionsCents));
		afford.setTOTAL_EXPENSE(MoneyConverter.randCents(totalExpense,totalExpenseCents));
	}
	
	private String logic(){
		SessionState ss = WebUtil.getSessionState();
		switch (WebUtil.getSessionState().getOrderNo()) {
			case 1:
				idDisable=true;
				Calendar cal = Calendar.getInstance();
				cal.set(Calendar.DAY_OF_MONTH, Integer.parseInt(indi.getID_NUMBER().substring(4, 6)));
				cal.set(Calendar.MONTH, Integer.parseInt(indi.getID_NUMBER().substring(2, 4))-1);
				int year = Integer.parseInt(indi.getID_NUMBER().substring(0, 2));
				if(year<50){
					year+=2000;
				}else{
					year+=1900;
				}
				cal.set(Calendar.YEAR, year);
				indi.setDOB(cal.getTime());
				creditruledata = checker.initCreditRuleData(indi.getID_NUMBER());
				if (!(checker.doStep1(this))) {
					if(creditruledata.hasExistingQuote() || creditruledata.getIsStaffmember()){
						//set to redirect to credit rule failure page
						super.cancel();
						WebUtil.getSessionState().setPage_Id(new Long(129));
						return "default";
					}
					highAvailabilityMode=true;
				}
				indiAddress.setADDRESS_TYPE_CODE("PHY");
				indiAddress.setADDRESS_TYPE_ID(1l);
				save();
				checkCookie1();
				super.next(this);
				break;
			case 2:
				if(indi.getSURNAME().equals("")){
					super.previous(this);
					break;
				}
				save();
				super.next(this);
				break;
				
			case 3:
				if(employer.getNAME().equals("")||grossIncome==0){
					super.previous(this);
					break;
				}
				
			    String temp = checkCookie3();
				if (temp!=null){
					return temp;
				}
				affordConversion();
				if (!highAvailabilityMode){
					//affordability action
					AffordabilityAction aa = new AffordabilityAction(this);
					aa.process();
				}
				if (!highAvailabilityMode){
					//offer action
					new OfferAction(this);
				}
				//set highAvailabilityMode if no offers
				if(ss.getParams().containsKey("ptype")){
					String type = (String)ss.getParams().get("ptype");
					if(type.equalsIgnoreCase("card")){
						if (ccRendered){
							offercopy="You have requested a Credit Card. Please confirm your choice";
						} else{
							offercopy="You have requested a Credit Card. However at this time we can only offer you the following";
						}
					} else if(type.equalsIgnoreCase("loan")){
						if (loRendered){
							offercopy="You have requested a Personal Loan. Please confirm your choice";
						} else{
							offercopy="You have requested a Personal Loan. However at this time we can only offer you the following";
						}
					} else if(type.equalsIgnoreCase("combo")){
						if (loAndCcRendered){
							offercopy="You have requested a Combo. Please confirm your choice";
						} else{
							offercopy="You have requested a Combo. However at this time we can only offer you the following";
						}
					} else {
						offercopy="Please select an option below";
					}
				}
				save();
				
 
 
				if (highAvailabilityMode){
					process();
					super.next(this, 5);
				}else{
					super.next(this);					
				}
 
				break;
			case 4:
				if (afford.getGROSS_INCOME().compareTo(new BigDecimal(0))==0){
					super.previous(this);
					break;
				}
				save();
				process();				
				super.next(this);
				break;
		}
		return "default";
	}
 
	private void checkCookie1() {
		FacesContext fc = FacesContext.getCurrentInstance();
		String cookieName = null;
		int counter = 0;
		boolean cflag = false;
		boolean hflag = false;
 
		if (!isHighAvailabilityMode()){
			HttpServletResponse resp = (HttpServletResponse)fc.getExternalContext().getResponse();
			Cookie cookie[] = ((HttpServletRequest) fc.getExternalContext().getRequest()).getCookies();
			if (cookie != null && cookie.length > 0) {
				for (int i = 0; i < cookie.length; i++) {
					cookieName = cookie[i].getName();
					if (cookieName.equals("offer")) {
						cflag=true;
					} else if(cookieName.equals("history")){
						hflag=true;
					}
				}
			} else{
				//redirect to say cookies ain't enabled
				try {
					resp.sendRedirect("cookie.jsf");
				} catch (Exception e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
			if (!cflag){
				Cookie counterCookie = new Cookie("offer",Integer.toString(counter));
				counterCookie.setMaxAge(7*24*60*60);
				resp.addCookie(counterCookie);
			}
			if (!hflag){
				Cookie historyCookie = new Cookie("history","");
				historyCookie.setMaxAge(7*24*60*60);
				resp.addCookie(historyCookie);
			}
		}
	}
 
	private String checkCookie3() {
		FacesContext fc = FacesContext.getCurrentInstance();
		HttpServletResponse resp = (HttpServletResponse)fc.getExternalContext().getResponse();
		String idnumber = indi.getID_NUMBER();
		String cookieName = null;
		int counter = 0;
		String tries;
		Cookie cookie[] = ((HttpServletRequest) fc.getExternalContext().getRequest()).getCookies();
		String session = ((HttpServletRequest) fc.getExternalContext().getRequest()).getRequestedSessionId();
		Cookie offer = null;
		Cookie hist = null;
		String ipaddress = ((HttpServletRequest) fc.getExternalContext().getRequest()).getRemoteAddr();
		if(!getExclusions().contains(ipaddress) && !isHighAvailabilityMode()){
			if (cookie != null && cookie.length > 0) {
				for (int i = 0; i < cookie.length; i++) {
					cookieName = cookie[i].getName();
					if (cookieName.equals("offer")) {
						offer=cookie[i];
					} else if(cookieName.equals("history")){
						hist=cookie[i];
					}
				}
				if (offer==null || hist==null){
					//cookie has been wiped
					return "cookiemissing";
				} else if(offer!=null && hist!=null){
					String history = hist.getValue();
					if (!history.equals("")){
						history+=","+idnumber;
					}else{
						history=idnumber;
					}
					tries = offer.getValue();
					try{
						counter = Integer.parseInt(tries);
					}catch(Exception e){
						//data has been modified
						//what should I do about it? play idiot and reset counter to zero
						//or go missing data page
						return "cookiemissing";
					}
					counter = Integer.parseInt(tries);
						counter++;
				if (counter>2){
						if(getIds(history)==1){
							sendMailSameID(indi,ipaddress,session);
							return "attempts";
						} else {
							//set high availablity mode
							setHighAvailabilityMode(true);
							sendMailDiffID(indi,ipaddress,session,history);
						}
					}
					offer.setValue(Integer.toString(counter));
					hist.setValue(history);
					offer.setMaxAge(7*24*60*60);
					hist.setMaxAge(7*24*60*60);
					resp.addCookie(offer);
					resp.addCookie(hist);
				}
				return null;
			} else {
				//all cookies have been wiped
				return "cookiemissing";
			}
		}else{
			return null;
		}
	
	}
 
	private void sendMailDiffID(IndividualPOJO indi, String ip, String session, String history){
    	EmailUtil emailUtil = new EmailUtil(Const.EMAIL_HOST);
        emailUtil.sendMail(Const.EMAIL_FROM_ADDRESS, System.getProperty("WEBMASTER"), "Same PC and different ID", 
        		"IP Address : "+ip+"\nSession ID : "+session+"\n\r"
        		+"Name : "+indi.getFIRST_NAME()+"\n\rSurname : "+indi.getSURNAME()+"\n\r"
        		+"ID number : "+indi.getID_NUMBER()+"\n\rCell : "+indi.getCELLPHONE_CODE()+" "+indi.getCELLPHONE()+"\n\r"
        		+"Home Tel : "+indi.getTELEPHONE_CODE()+" "+indi.getTELEPHONE()+"\n\rE-mail : "+indi.getEMAIL()+"\n\r"
        		+"\nID numbers tried by this computer : "+history);
	}
	
	private void sendMailSameID(IndividualPOJO indi, String ip, String session){
    	EmailUtil emailUtil = new EmailUtil(Const.EMAIL_HOST);
        emailUtil.sendMail(Const.EMAIL_FROM_ADDRESS, System.getProperty("WEBMASTER"), "same PC and same ID",
        		"IP Address : "+ip+"\n\rSession ID : "+session+"\n\r"
        		+"Name : "+indi.getFIRST_NAME()+"\n\r"+"Surname : "+indi.getSURNAME()+"\n\r"
        		+"ID number : "+indi.getID_NUMBER()+"\n\rCell : "+indi.getCELLPHONE_CODE()+" "+indi.getCELLPHONE()+"\n\r"
        		+"Home Tel : "+indi.getTELEPHONE_CODE()+" "+indi.getTELEPHONE()+"\n\rE-mail : "+indi.getEMAIL());
	}
 
	private int getIds(String hist){
		ArrayList arr = new ArrayList();
		StringTokenizer st = new StringTokenizer(hist,",");
		if(st.countTokens()>0){
			while(st.hasMoreTokens()){
				String temp = st.nextToken();
				if (!arr.contains(temp)){
					arr.add(temp);
				}
			}
			return arr.size();
		} else {
			return 1;
		}
	}
 
	private List getExclusions(){
		try {
			InitialContext ictx = new InitialContext();
			ILookup session = (ILookup)ictx.lookup("ABILWEB-EAR/ExclusionLookupSession/local");
			return session.getList();
		} catch (NamingException e) {
			throw new ApplicationException("Error getting Exclusion List: " 
					+ e.getMessage(), e);
		}
//		return  null; 
	}
 
	public String acceptLO() {
		String selected = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("selected");
		for(ProductOfferBean temp : loOfferResponseList){
			if (temp.toString().equals(selected)){
				selectedProduct=temp;
			}
		}
		return this.next();
	}
	
	public String acceptCombo() {
		String selected = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("selected");
		for(ProductOfferBean temp : loAndCcOfferResponseList){
			if (temp.toString().equals(selected)){
				selectedProduct=temp;
			}
		}
		return this.next();
	}
	
	public String acceptCC() {
		String selected = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("selected");
		for(ProductOfferBean temp : ccOfferResponseList){
			if (temp.toString().equals(selected)){
				selectedProduct=temp;
			}
		}
		return this.next();
	}
	
	public String getOffers(){
		show=5;
		new OfferAction(this);
		return "default";
	}
 
	@Override
	protected void finalize() throws Throwable {
	    save();
		super.finishSet();
	    super.finalize();
	}
 
	public IndividualPOJO getIndi() {
    	return indi;
    }
 
	public void setIndi(IndividualPOJO indi) {
    	this.indi = indi;
    }
 
	public AddressPOJO getAddress() {
    	return address;
    }
 
	public void setAddress(AddressPOJO address) {
    	this.address = address;
    }
 
	public IndividualAddressPOJO getIndiAddress() {
    	return indiAddress;
    }
 
	public void setIndiAddress(IndividualAddressPOJO indiAddress) {
    	this.indiAddress = indiAddress;
    }
 
	public IndividualEmploymentPOJO getIndiEmployment() {
    	return indiEmployment;
    }
 
	public void setIndiEmployment(IndividualEmploymentPOJO indiEmployment) {
    	this.indiEmployment = indiEmployment;
    }
 
	public LoanApp getLoanApp() {
    	return loanApp;
    }
 
	public void setLoanApp(LoanApp loanApp) {
    	this.loanApp = loanApp;
    }
 
	public GroupPOJO getEmployer() {
    	return employer;
    }
 
	public void setEmployer(GroupPOJO employer) {
    	this.employer = employer;
    }
 
	public AddressPOJO getEmployerAddress() {
    	return employerAddress;
    }
 
	public void setEmployerAddress(AddressPOJO employerAddress) {
    	this.employerAddress = employerAddress;
    }
 
	public GroupAddressPOJO getEmployAddress() {
    	return employAddress;
    }
 
	public void setEmployAddress(GroupAddressPOJO employAddress) {
    	this.employAddress = employAddress;
    }
 
	public BankingDetailPOJO getBankingDetails() {
    	return bankingDetails;
    }
 
	public void setBankingDetails(BankingDetailPOJO bankingDetails) {
    	this.bankingDetails = bankingDetails;
    }
 
	public IndividualAffordPOJO getAfford() {
    	return afford;
    }
 
	public void setAfford(IndividualAffordPOJO afford) {
    	this.afford = afford;
    }
 
	public ProductOfferBean getSelectedProduct() {
    	return selectedProduct;
    }
 
	public void setSelectedProduct(ProductOfferBean selectedProduct) {
    	this.selectedProduct = selectedProduct;
    }
 
	public boolean isHighAvailabilityMode() {
    	return highAvailabilityMode;
    }
 
	public void setHighAvailabilityMode(boolean highAvailabilityMode) {
    	this.highAvailabilityMode = highAvailabilityMode;
    }
 
	public String getXiriusRef() {
    	return xiriusRef;
    }
 
	public void setXiriusRef(String xiriusRef) {
    	this.xiriusRef = xiriusRef;
    }
 
	public ClientCreditRuleData getCreditruledata() {
    	return creditruledata;
    }
 
	public void setCreditruledata(ClientCreditRuleData creditruledata) {
    	this.creditruledata = creditruledata;
    }
 
	public CreditRuleChecker getChecker() {
    	return checker;
    }
 
	public void setChecker(CreditRuleChecker checker) {
    	this.checker = checker;
    }
 
	public AffordabilityResponse getAffordResponse() {
    	return affordResponse;
    }
 
	public void setAffordResponse(AffordabilityResponse affordResponse) {
    	this.affordResponse = affordResponse;
    }
 
	public BmResponse getExperianResponse() {
    	return experianResponse;
    }
 
	public void setExperianResponse(BmResponse experianResponse) {
    	this.experianResponse = experianResponse;
    }
 
	public double getGrossIncome() {
    	return grossIncome;
    }
 
	public void setGrossIncome(double grossIncome) {
    	this.grossIncome = grossIncome;
    }
 
	public double getGrossIncomeCents() {
    	return grossIncomeCents;
    }
 
	public void setGrossIncomeCents(double grossIncomeCents) {
    	this.grossIncomeCents = grossIncomeCents;
    }
 
	public double getCommissionIncome() {
    	return commissionIncome;
    }
 
	public void setCommissionIncome(double commissionIncome) {
    	this.commissionIncome = commissionIncome;
    }
 
	public double getCommissionIncomeCents() {
    	return commissionIncomeCents;
    }
 
	public void setCommissionIncomeCents(double commissionIncomeCents) {
    	this.commissionIncomeCents = commissionIncomeCents;
    }
 
	public double getBonusIncome() {
    	return bonusIncome;
    }
 
	public void setBonusIncome(double bonusIncome) {
    	this.bonusIncome = bonusIncome;
    }
 
	public double getBonusIncomeCents() {
    	return bonusIncomeCents;
    }
 
	public void setBonusIncomeCents(double bonusIncomeCents) {
    	this.bonusIncomeCents = bonusIncomeCents;
    }
 
	public double getOvertimeIncome() {
    	return overtimeIncome;
    }
 
	public void setOvertimeIncome(double overtimeIncome) {
    	this.overtimeIncome = overtimeIncome;
    }
 
	public double getOvertimeIncomeCents() {
    	return overtimeIncomeCents;
    }
 
	public void setOvertimeIncomeCents(double overtimeIncomeCents) {
    	this.overtimeIncomeCents = overtimeIncomeCents;
    }
 
	public double getNetIncome() {
    	return netIncome;
    }
 
	public void setNetIncome(double netIncome) {
    	this.netIncome = netIncome;
    }
 
	public double getNetIncomeCents() {
    	return netIncomeCents;
    }
 
	public void setNetIncomeCents(double netIncomeCents) {
    	this.netIncomeCents = netIncomeCents;
    }
 
	public double getMaintenanceIncome() {
    	return maintenanceIncome;
    }
 
	public void setMaintenanceIncome(double maintenanceIncome) {
    	this.maintenanceIncome = maintenanceIncome;
    }
 
	public double getMaintenanceIncomeCents() {
    	return maintenanceIncomeCents;
    }
 
	public void setMaintenanceIncomeCents(double maintenanceIncomeCents) {
    	this.maintenanceIncomeCents = maintenanceIncomeCents;
    }
 
	public double getRentalIncome() {
    	return rentalIncome;
    }
 
	public void setRentalIncome(double rentalIncome) {
    	this.rentalIncome = rentalIncome;
    }
 
	public double getRentalIncomeCents() {
    	return rentalIncomeCents;
    }
 
	public void setRentalIncomeCents(double rentalIncomeCents) {
    	this.rentalIncomeCents = rentalIncomeCents;
    }
 
	public double getOtherIncome() {
    	return otherIncome;
    }
 
	public void setOtherIncome(double otherIncome) {
    	this.otherIncome = otherIncome;
    }
 
	public double getOtherIncomeCents() {
    	return otherIncomeCents;
    }
 
	public void setOtherIncomeCents(double otherIncomeCents) {
    	this.otherIncomeCents = otherIncomeCents;
    }
 
	public double getAbilDeductions() {
    	return abilDeductions;
    }
 
	public void setAbilDeductions(double abilDeductions) {
    	this.abilDeductions = abilDeductions;
    }
 
	public double getAbilDeductionsCents() {
    	return abilDeductionsCents;
    }
 
	public void setAbilDeductionsCents(double abilDeductionsCents) {
    	this.abilDeductionsCents = abilDeductionsCents;
    }
 
	public double getTotalExpense() {
    	return totalExpense;
    }
 
	public void setTotalExpense(double totalExpense) {
    	this.totalExpense = totalExpense;
    }
 
	public double getTotalExpenseCents() {
    	return totalExpenseCents;
    }
 
	public void setTotalExpenseCents(double totalExpenseCents) {
    	this.totalExpenseCents = totalExpenseCents;
    }
 
	public boolean isSettlementAvailable() {
    	return isSettlementAvailable;
    }
 
	public void setSettlementAvailable(boolean isSettlementAvailable) {
    	this.isSettlementAvailable = isSettlementAvailable;
    }
 
	public boolean isOfferUnavailableMessage() {
    	return offerUnavailableMessage;
    }
 
	public void setOfferUnavailableMessage(boolean offerUnavailableMessage) {
    	this.offerUnavailableMessage = offerUnavailableMessage;
    }
 
	public double getMaxCapital() {
    	return maxCapital;
    }
 
	public void setMaxCapital(double maxCapital) {
    	this.maxCapital = maxCapital;
    }
 
	public double getMaxInstallment() {
    	return maxInstallment;
    }
 
	public void setMaxInstallment(double maxInstallment) {
    	this.maxInstallment = maxInstallment;
    }
 
	public int getMaxTerm() {
    	return maxTerm;
    }
 
	public void setMaxTerm(int maxTerm) {
    	this.maxTerm = maxTerm;
    }
 
	public double getMaxCapitalTmp() {
    	return maxCapitalTmp;
    }
 
	public void setMaxCapitalTmp(double maxCapitalTmp) {
    	this.maxCapitalTmp = maxCapitalTmp;
    }
 
	public double getMaxInstallmentTmp() {
    	return maxInstallmentTmp;
    }
 
	public void setMaxInstallmentTmp(double maxInstallmentTmp) {
    	this.maxInstallmentTmp = maxInstallmentTmp;
    }
 
	public int getMaxTermTmp() {
    	return maxTermTmp;
    }
 
	public void setMaxTermTmp(int maxTermTmp) {
    	this.maxTermTmp = maxTermTmp;
    }
 
	public double getMaxCapitalOrig() {
    	return maxCapitalOrig;
    }
 
	public void setMaxCapitalOrig(double maxCapitalOrig) {
    	this.maxCapitalOrig = maxCapitalOrig;
    }
 
	public double getMaxInstallmentOrig() {
    	return maxInstallmentOrig;
    }
 
	public void setMaxInstallmentOrig(double maxInstallmentOrig) {
    	this.maxInstallmentOrig = maxInstallmentOrig;
    }
 
	public int getMaxTermOrig() {
    	return maxTermOrig;
    }
 
	public void setMaxTermOrig(int maxTermOrig) {
    	this.maxTermOrig = maxTermOrig;
    }
 
	public List<ProductOfferBean> getOfferResponseList() {
    	return offerResponseList;
    }
 
	public void setOfferResponseList(List<ProductOfferBean> offerResponseList) {
    	this.offerResponseList = offerResponseList;
    }
 
	public List getLoOfferResponseList() {
    	return loOfferResponseList;
    }
 
	public void setLoOfferResponseList(List loOfferResponseList) {
    	this.loOfferResponseList = loOfferResponseList;
    }
 
	public List getLoAndCcOfferResponseList() {
    	return loAndCcOfferResponseList;
    }
 
	public void setLoAndCcOfferResponseList(List loAndCcOfferResponseList) {
    	this.loAndCcOfferResponseList = loAndCcOfferResponseList;
    }
 
	public boolean isCcRendered() {
    	return ccRendered;
    }
 
	public void setCcRendered(boolean ccRendered) {
    	this.ccRendered = ccRendered;
    }
 
	public boolean isLoRendered() {
    	return loRendered;
    }
 
	public void setLoRendered(boolean loRendered) {
    	this.loRendered = loRendered;
    }
 
	public List getCcOfferResponseList() {
    	return ccOfferResponseList;
    }
 
	public void setCcOfferResponseList(List ccOfferResponseList) {
    	this.ccOfferResponseList = ccOfferResponseList;
    }
 
	public boolean isLoAndCcRendered() {
    	return loAndCcRendered;
    }
 
	public void setLoAndCcRendered(boolean loAndCcRendered) {
    	this.loAndCcRendered = loAndCcRendered;
    }
 
	public String getConsent() {
    	return consent;
    }
 
	public void setConsent(String consent) {
    	this.consent = consent;
    }
 
	public boolean isCardonly() {
    	return cardonly;
    }
 
	public void setCardonly(boolean cardonly) {
    	this.cardonly = cardonly;
    }
 
	public boolean isOffercard() {
    	return offercard;
    }
 
	public void setOffercard(boolean offercard) {
    	this.offercard = offercard;
    }
 
	public int getShow() {
    	return show;
    }
 
	public void setShow(int show) {
    	this.show = show;
    }
 
	public String getOffercopy() {
    	return offercopy;
    }
 
	public void setOffercopy(String offercopy) {
    	this.offercopy = offercopy;
    }
 
	public boolean isIdDisable() {
    	return idDisable;
    }
 
	public void setIdDisable(boolean idDisable) {
    	this.idDisable = idDisable;
    }
}

Open in new window

0
Comment
Question by:ablsysadmin
2 Comments
 

Assisted Solution

by:dalemcbane
dalemcbane earned 500 total points
ID: 23005647
Try commenting out setHighAvailabilityMode(true); in your code below and try again.  It looks like it will still send an email, but not sure if that's what you want.

 
if (counter>2){
      if(getIds(history)==1){
       sendMailSameID(indi,ipaddress,session);
       return "attempts";
      } else {
       //set high availablity mode
--       setHighAvailabilityMode(true);
      sendMailDiffID(indi,ipaddress,session,history);
      }
     }


0
 

Accepted Solution

by:
ablsysadmin earned 0 total points
ID: 23010776
Hi

THanks its works
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses
Course of the Month16 days, 11 hours left to enroll

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question