// 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 { // Get the port and construct the (simple) request. FeddPortType port = getPort("https://users.isi.deterlab.net:23235"); InfoRequestType req = new InfoRequestType( new IDType(null, null, null, args[0], null)); InfoResponseType resp = null; Map > tbNodes = new TreeMap>(); 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); } // Put each embedding mapping (object containing embedding info) into a // List keyed by testbed. System.out.println("From embedding:"); for (EmbeddingMapType m: resp.getEmbedding()) { List al = null; if (tbNodes.containsKey(m.getTestbed())) { al = tbNodes.get(m.getTestbed()); } else { al = new ArrayList(); tbNodes.put(m.getTestbed(), al); } al.add(m); } for (String tb: tbNodes.keySet()) { System.out.println("Testbed: " + tb); for ( EmbeddingMapType m : tbNodes.get(tb)) { System.out.print("\t" + m.getToponame() + " "); for ( String pn : m.getPhysname()) System.out.print(pn + " " ); System.out.println(); } System.out.println(); } System.out.println(); // There's a topdl description in there, too 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 (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()); } }