clienttest.java revision db3dbd0ed7eb69f804a8921fa23a1267ea01f46e
/*
* Sample client for the VirtualBox webservice, written in Java.
*
* Don't forget to run VBOX webserver
* with 'vboxwebsrv -t 1000' command, to calm down watchdog thread.
*
* Copyright (C) 2008 Sun Microsystems, Inc.
*
* Sun Microsystems, Inc. confidential
* All rights reserved
*/
import org.virtualbox.*;
public class clienttest
{
public clienttest()
{
}
public void disconnect()
{
}
class Desktop
{
Desktop(int n)
{
name = "Mach"+n;
}
{
return name;
}
{
return uuid;
}
}
public void test()
{
for (int i=0; i<100; i++)
{
"linux",
mgr.cleanupUnused();
}
}
public void test2()
{
bios.setIOAPICEnabled(true);
mach.saveSettings();
}
public void test3()
{
}
public void showVMs()
{
try
{
int i = 0;
{
}
}
catch (Exception e)
{
e.printStackTrace();
}
}
public void listHostInfo()
{
try
{
for (long i=0; i<uProcCount; i++)
{
}
for (IPerformanceMetric m : aMetrics)
{
}
}
catch (Exception e)
{
e.printStackTrace();
}
}
{
try
{
// first assume we were given a UUID
try
{
}
catch (Exception e)
{
try
{
}
{
}
}
{
}
else
{
uuid,
env);
if (rc != 0)
}
}
catch (Exception e)
{
e.printStackTrace();
}
finally
{
{
}
}
}
public void cleanup()
{
try
{
{
disconnect();
}
mgr.cleanupUnused();
}
catch (Exception e)
{
e.printStackTrace();
}
}
public static void printArgs()
{
"\nwith <mode> being:" +
"\n show vms list installed virtual machines" +
"\n list hostinfo list host info" +
"\n startvm <vmname|uuid> start the given virtual machine");
}
{
{
printArgs();
}
else
{
clienttest c = new clienttest();
{
{
c.showVMs();
else
}
else
}
{
{
c.listHostInfo();
else
}
else
}
{
{
}
else
}
{
c.test3();
}
else
c.cleanup();
}
}
}