// WSDL generated classes import edu.isi.www.fedd_types.*; import edu.isi.www.fedd_wsdl.*; import edu.isi.www.topdl.*; // The fault thrown by failed commands import org.apache.axis.AxisFault; // Sets and maps import java.util.*; class Ftopo extends FeddCommand { /** * Terminate the experiment with the menmonic name given on the command * line. */ public static void main(String args[]) throws javax.xml.rpc.ServiceException, java.net.MalformedURLException, java.rmi.RemoteException { String exptName = "test"; String urlString = "https://users.isi.deterlab.net:23235"; if (args.length > 0) exptName = args[0]; if (args.length > 1) urlString = args[1]; // Get the port and construct the (simple) request. FeddPortType port = getPort(urlString); InfoRequestType req = new InfoRequestType( new IDType(null, null, null, exptName, null), true, true); InfoResponseType resp = null; VtopoType vt = null; TopologyType top = null; try { /* Build the message and make the call */ resp = port.info(req); } catch (AxisFault f) { System.err.println("Error getting info: " + f); System.exit(20); } if (!resp.getExperimentStatus().equals(StatusType.active)) { System.err.println("Experiment not active"); System.exit(20); } // Walk the topdl description top = resp.getExperimentdescription().getTopdldescription(); if ( top == null ) { System.err.println("Bad response: no Topdl"); System.exit(20); } System.out.println("From Topdl (sampling)"); for (ElementType e: top.getElements()) { ComputerType c = e.getComputer(); if ( c != null) { System.out.println("\t" + c.getName()); for (String name : c.getLocalname()) System.out.println("\t\t" + name); for (AttributeType a: c.getAttribute()) System.out.println("\t\t" + a.getAttribute() + " " + a.getValue()); for ( InterfaceType i : c.get_interface()) { System.out.println("\t\tInterface " + i.getName() + ":"); for ( AttributeType a: i.getAttribute()) System.out.println("\t\t\t" + a.getAttribute() + " " + a.getValue()); } } } System.out.println(); // The visualization info is pretty straightforward System.out.println("Visualization info (Legacy Emulab):" ); for (VisnodeType v: resp.getVis()) System.out.println("\t" + v.getName() + ":" + v.getX() + ":" + v.getY() + ":" + v.getType()); System.out.println(); // The legacy emulab visualization information is in two lists, the // nodes and lans. System.out.println("Vtopo info (Legacy Emulab)"); vt = resp.getVtopo(); System.out.println("Nodes"); for (VtoponodeType vn: vt.getNode()) System.out.println("\t" + vn.getVname()+" "+vn.getIps()); System.out.println("Lans"); for (VtopolanType vl: vt.getLan()) System.out.println("\t" + vl.getVname() + " " + vl.getVnode() + " " + vl.getIp() + " " + vl.getBandwidth() + " " + vl.getDelay() + " " + vl.getMember()); } }