
package paqueteCMD;

import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import paqueteBL.*;
import paqueteView.PoolView;

public class cmdGeneral implements interfaceCMD{

    public String procesa(String accion,HttpServletRequest request, HttpServletResponse response) throws Exception
    {
        if (accion==null) return verTodo(request,response);
        if (accion.equals("verArbol")) return verArbol(request,response);
        else return verTodo(request,response);
    }

    public String verArbol(HttpServletRequest request, HttpServletResponse response) throws Exception
    {
        FvcBL fvc=new FvcBL();
        List<HostExt> hosts=fvc.loadHosts();
        List<VMext> vms=fvc.loadVMs();
        return PoolView.verArbol(request, hosts, vms);
    }
    
public String verTodo(HttpServletRequest request, HttpServletResponse response) throws Exception
{
    return "/viewPrincipal.jsp";
}


}