package Juno2;
import java.io.*;
import java.util.HashMap;

public class CmdAccountListImpl {


	public CmdAccountListImpl() {}


	public AccountListCVO doAccountList(String userId, String userPassword) throws Exception
	{


		AccountListCVO alcvo = new AccountListCVO();
		
        ////If session already exists call session.invalidate();
		CmdDAOFactory daoFactory = CmdDAOFactory.getInstance();
        CmdDAO cdao = daoFactory.getDAO();
		alcvo.setLoginVO(cdao.getLogin(userId, userPassword));


		if(alcvo.getLoginState()) {
			alcvo.setAccountList(cdao.getAccountList(alcvo.getUserId()));	     
        }
        //// in the event of error return alcvo with the bad login state
        ////else
        ////{
        ////    throw new CmdException("Fatal error Session and Request user conflict.");
        ////}


		return(alcvo);        
 	}


}



