/* * @(#)RetirementSpecialistsImpl * Copyright 2002 Sun Microsystems, Inc. All rights reserved. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * */ package com.sun.eportal.retirement; import com.sun.eportal.FundInfo; import com.sun.eportal.EmployeeInfo; import java.util.Vector; /** * Pan American Retirement Service provider implementation.For demonstration * purposes and not to compilcate, available funds are hard coded and * implementation is kept simple * */ public class PanAmericanRSImpl implements RetirementServiceIF { public String providerName="PanAmerican"; private Vector availableFunds = null; /** * PanAmericanRSImpl constructor. Available funds are populated ( hard * coded ) */ public PanAmericanRSImpl( ) { availableFunds = new Vector(); availableFunds.addElement("Old age funds"); availableFunds.addElement("Happy old days funds"); availableFunds.addElement("Sunrise funds"); } /** * Method giving the funds supported by the Pan American Retirement * Service Provider */ public String[] getAvailableFunds ( ) { if ( availableFunds == null ) { return null; } String[] aFunds = new String[ availableFunds.size() ]; availableFunds.copyInto( (Object[])aFunds ); return aFunds; } /** * getQuote gives the quote from the provider, if the provider can service * all the funds requested. If all the requested funds are available then * quote is returned as 3.0 otherwise 0 is returned as quote. * @param reqFunds fund array containing the user requested fund names * @param monthlyInvestment user choosen monthly invetment amount */ public double getQuote( FundInfo[] rFunds, double monthlyInvestment ) { if ( rFunds == null ) { System.out.println("ERROR : Requested Funds null" ); return 0; } for ( int i=0; i " + ei.getEmployeeId() ); System.out.println("Employee FirstName -> " + ei.getFirstName() ); System.out.println("Employee Id -> " + ei.getLastName() ); return "Fund Request confirmed and email will be sent as confirmation"; } /** * updateEmployeeInfo method is used to update Employee Information on the * provider side. To keep things simple some information is printed onto * console * @param ei EmployeeInfo object containing updated Employee Information * such as name, address, email etc * @return boolean true if update successful or false if update fails */ public boolean updateEmployeeInfo ( EmployeeInfo ei ) { System.out.println("[PanAmerican ] Update Employee Information " + " request received"); System.out.println("Employee Id -> " + ei.getEmployeeId() ); System.out.println("Employee FirstName -> " + ei.getFirstName() ); System.out.println("Employee Id -> " + ei.getLastName() ); return true; } }