mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
bitkeeper revision 1.263 (3f044553Casub9OwqMoobhkY4qWGpQ)
Apply Composite pattern to add recursive command parsing; this allows commands to be in groups so that the user interface isn't quite so unwieldy. In order to make this sensible, rename the domain classes to indicate better what they are.
This commit is contained in:
1 parent
e754439838
commit
9ef2e22b2b
15 files changed
+220
-126
No files matched your search
@@ -17,20 +17,21 @@
|
||||
3eb781fcabCKRogwxJA3-jJKstw9Vg tools/control/domctl.xml
|
||||
3f042c35FzVap5QW0UBPnZ2ZM0l3QA tools/control/src/org/xenoserver/cmdline/CommandParser.java
|
||||
3eb781fdNQvEJW3tNvovjqoN7GlePA tools/control/src/org/xenoserver/cmdline/Main.java
|
||||
3f042c35-TPgpCQViIaJzLts2-CnBw tools/control/src/org/xenoserver/cmdline/ParseDestroy.java
|
||||
3f042c35-TPgpCQViIaJzLts2-CnBw tools/control/src/org/xenoserver/cmdline/ParseDomainDestroy.java
|
||||
3f042c35h9GAWRu7wimPjBpCi09nUA tools/control/src/org/xenoserver/cmdline/ParseDomainList.java
|
||||
3f042c359mRNaxBYXFwVsmv5-J_DJA tools/control/src/org/xenoserver/cmdline/ParseDomainNew.java
|
||||
3f042c35bMvqLB4Yc-0Dxs4WlYHHpw tools/control/src/org/xenoserver/cmdline/ParseDomainStart.java
|
||||
3f042c35Lc-JegNavF6Bj6coM486Ig tools/control/src/org/xenoserver/cmdline/ParseDomainStop.java
|
||||
3f042c35UhRkvblwKSx0KW2QHUn3Fw tools/control/src/org/xenoserver/cmdline/ParseFailedException.java
|
||||
3f0445524oTSyogDGmCAyKMM665Rxg tools/control/src/org/xenoserver/cmdline/ParseGroup.java
|
||||
3f042c35Inw0LzkOzXo9ncbEHZzUHA tools/control/src/org/xenoserver/cmdline/ParseHelp.java
|
||||
3f042c35h9GAWRu7wimPjBpCi09nUA tools/control/src/org/xenoserver/cmdline/ParseList.java
|
||||
3f042c359mRNaxBYXFwVsmv5-J_DJA tools/control/src/org/xenoserver/cmdline/ParseNew.java
|
||||
3f042c35bMvqLB4Yc-0Dxs4WlYHHpw tools/control/src/org/xenoserver/cmdline/ParseStart.java
|
||||
3f042c35Lc-JegNavF6Bj6coM486Ig tools/control/src/org/xenoserver/cmdline/ParseStop.java
|
||||
3f042c35V-Bf3dlIe1r5mZs8ZTPSvA tools/control/src/org/xenoserver/control/Command.java
|
||||
3f042c35U_4O2eovLKUgo2avPPHKUw tools/control/src/org/xenoserver/control/CommandDestroy.java
|
||||
3f042c35U_4O2eovLKUgo2avPPHKUw tools/control/src/org/xenoserver/control/CommandDomainDestroy.java
|
||||
3f042c3570VRwuzl94tEozOIVBycNg tools/control/src/org/xenoserver/control/CommandDomainList.java
|
||||
3f042c35xVm-ucJAVdvC3acD6ZEe2Q tools/control/src/org/xenoserver/control/CommandDomainNew.java
|
||||
3f042c36GqoXJJj_BvWGwBeKwEzgvg tools/control/src/org/xenoserver/control/CommandDomainStart.java
|
||||
3f042c36bmZJD0xrxURD075avUlIUg tools/control/src/org/xenoserver/control/CommandDomainStop.java
|
||||
3f042c35hdwL__Airzyz4HutOgGRqQ tools/control/src/org/xenoserver/control/CommandFailedException.java
|
||||
3f042c3570VRwuzl94tEozOIVBycNg tools/control/src/org/xenoserver/control/CommandList.java
|
||||
3f042c35xVm-ucJAVdvC3acD6ZEe2Q tools/control/src/org/xenoserver/control/CommandNew.java
|
||||
3f042c36GqoXJJj_BvWGwBeKwEzgvg tools/control/src/org/xenoserver/control/CommandStart.java
|
||||
3f042c36bmZJD0xrxURD075avUlIUg tools/control/src/org/xenoserver/control/CommandStop.java
|
||||
3eb781fdBRXfSlWzK6GXlIQIlHFoaQ tools/control/src/org/xenoserver/control/Defaults.java
|
||||
3ec41f7cQ7Ug739JBDrsVH-7KJ5MvQ tools/control/src/org/xenoserver/control/Domain.java
|
||||
3eb781fdDeZEopemXIVg_ARCGKSmBw tools/control/src/org/xenoserver/control/InetAddressPattern.java
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
package org.xenoserver.cmdline;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import org.xenoserver.control.Command;
|
||||
import org.xenoserver.control.CommandFailedException;
|
||||
import org.xenoserver.control.Defaults;
|
||||
@@ -20,51 +24,64 @@ public abstract class CommandParser {
|
||||
* @throws ParseFailedException if the arguments are not suitable.
|
||||
* @throws CommandFailedException if the command did not execute successfully.
|
||||
*/
|
||||
public abstract void parse(Defaults d, String args[]) throws ParseFailedException, CommandFailedException;
|
||||
public abstract void parse(Defaults d, LinkedList args)
|
||||
throws ParseFailedException, CommandFailedException;
|
||||
|
||||
/** Return the command name which will be matched on the command line. */
|
||||
public abstract String getName();
|
||||
/** Return the command name which will be matched on the command line. */
|
||||
public abstract String getName();
|
||||
/** Return a usage string for this command. */
|
||||
public abstract String getUsage();
|
||||
/** Return the help text for this command. */
|
||||
public abstract String getHelpText();
|
||||
|
||||
public String getStringParameter(String args[], char key, String def)
|
||||
|
||||
/** Print a usage string for this command. */
|
||||
public void printUsage(String prefix)
|
||||
{
|
||||
String r = getParameter (args, key);
|
||||
String name = getName();
|
||||
if ( prefix != null )
|
||||
name = prefix + " " + name;
|
||||
String usage = getUsage();
|
||||
while (name.length() < 16)
|
||||
name = name + " ";
|
||||
System.out.println(" " + name + usage);
|
||||
}
|
||||
|
||||
/** Prints the help text for this command. */
|
||||
public void printHelpText(LinkedList args)
|
||||
{
|
||||
System.out.println(getName() + " " + getUsage());
|
||||
System.out.println();
|
||||
System.out.println(getHelpText());
|
||||
}
|
||||
|
||||
public String getStringParameter(List args, char key, String def) {
|
||||
String r = getParameter(args, key);
|
||||
return (r == null) ? def : r;
|
||||
}
|
||||
|
||||
public int getIntParameter(String args[], char key, int def)
|
||||
{
|
||||
String r = getParameter (args, key);
|
||||
return (r == null) ? def : (Integer.parseInt (r));
|
||||
public int getIntParameter(List args, char key, int def) {
|
||||
String r = getParameter(args, key);
|
||||
return (r == null) ? def : (Integer.parseInt(r));
|
||||
}
|
||||
|
||||
public boolean getFlagParameter(String args[], char key)
|
||||
{
|
||||
String r = getParameter (args, key);
|
||||
public boolean getFlagParameter(List args, char key) {
|
||||
String r = getParameter(args, key);
|
||||
return (r == null) ? false : true;
|
||||
}
|
||||
|
||||
protected String getParameter (String args[], char key)
|
||||
{
|
||||
int i;
|
||||
protected String getParameter(List args, char key) {
|
||||
String result = null;
|
||||
for (i = 0; i < args.length; i ++)
|
||||
{
|
||||
if (args[i].startsWith("-" + key))
|
||||
{
|
||||
if (args[i].length() > 2)
|
||||
{
|
||||
result = args[i].substring(2, args[i].length());
|
||||
Iterator i = args.iterator();
|
||||
while ( i.hasNext() ) {
|
||||
String arg = (String) i.next();
|
||||
if (arg.startsWith("-" + key)) {
|
||||
if (arg.length() > 2) {
|
||||
result = arg.substring(2);
|
||||
} else {
|
||||
result = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
result = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -1,46 +1,46 @@
|
||||
package org.xenoserver.cmdline;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import org.xenoserver.control.CommandFailedException;
|
||||
import org.xenoserver.control.Defaults;
|
||||
|
||||
public class Main {
|
||||
private static ParseHelp help = new ParseHelp();
|
||||
static CommandParser commands[] =
|
||||
static final ParseHelp help = new ParseHelp();
|
||||
static final CommandParser domaincommands[] =
|
||||
{ new ParseDomainNew(),
|
||||
new ParseDomainStart(),
|
||||
new ParseDomainStop(),
|
||||
new ParseDomainDestroy(),
|
||||
new ParseDomainList()
|
||||
};
|
||||
static final CommandParser commands[] =
|
||||
{ help,
|
||||
new ParseNew(),
|
||||
new ParseStart(),
|
||||
new ParseStop(),
|
||||
new ParseDestroy(),
|
||||
new ParseList() };
|
||||
new ParseGroup( "domain", domaincommands )
|
||||
};
|
||||
static final CommandParser parser = new ParseGroup( null, commands );
|
||||
|
||||
public static void main(String[] args) {
|
||||
Defaults d = new Defaults();
|
||||
int ec = -1;
|
||||
LinkedList arglist = new LinkedList();
|
||||
for ( int i=0; i<args.length; i++ )
|
||||
arglist.add( args[i] );
|
||||
|
||||
if (args.length == 0) {
|
||||
help.parse(d, args);
|
||||
help.parse(d, arglist);
|
||||
} else {
|
||||
String c = args[0];
|
||||
int i;
|
||||
for (i = 0; i < commands.length; i++) {
|
||||
if (commands[i].getName().equals(c)) {
|
||||
if (commands[i].getFlagParameter(args, '?')) {
|
||||
help.doHelpFor(commands[i]);
|
||||
} else {
|
||||
try {
|
||||
commands[i].parse(d, args);
|
||||
ec = 0;
|
||||
} catch (ParseFailedException e) {
|
||||
System.err.println( e.getMessage() );
|
||||
} catch (CommandFailedException e) {
|
||||
System.err.println( e.getMessage() );
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (i == commands.length) {
|
||||
System.out.println("Unknown command " + c);
|
||||
try
|
||||
{
|
||||
parser.parse(d, arglist);
|
||||
ec = 0;
|
||||
} catch (ParseFailedException e) {
|
||||
System.err.println( e.getMessage() );
|
||||
} catch (CommandFailedException e) {
|
||||
System.err.println( e.getMessage() );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+7
-4
@@ -1,12 +1,15 @@
|
||||
package org.xenoserver.cmdline;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import org.xenoserver.control.Command;
|
||||
import org.xenoserver.control.CommandDestroy;
|
||||
import org.xenoserver.control.CommandDomainDestroy;
|
||||
import org.xenoserver.control.CommandFailedException;
|
||||
import org.xenoserver.control.Defaults;
|
||||
|
||||
public class ParseDestroy extends CommandParser {
|
||||
public void parse(Defaults d, String[] args) throws ParseFailedException, CommandFailedException {
|
||||
public class ParseDomainDestroy extends CommandParser {
|
||||
public void parse(Defaults d, LinkedList args) throws ParseFailedException, CommandFailedException {
|
||||
int domain_id = getIntParameter(args, 'n', 0);
|
||||
boolean force = getFlagParameter(args, 'f');
|
||||
|
||||
@@ -14,7 +17,7 @@ public class ParseDestroy extends CommandParser {
|
||||
throw new ParseFailedException("Expected -n<domain_id>");
|
||||
}
|
||||
|
||||
String output = new CommandDestroy(d, domain_id, force).execute();
|
||||
String output = new CommandDomainDestroy(d, domain_id, force).execute();
|
||||
if ( output != null )
|
||||
System.out.println( output );
|
||||
}
|
||||
+7
-4
@@ -1,15 +1,18 @@
|
||||
package org.xenoserver.cmdline;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import org.xenoserver.control.Command;
|
||||
import org.xenoserver.control.CommandFailedException;
|
||||
import org.xenoserver.control.CommandList;
|
||||
import org.xenoserver.control.CommandDomainList;
|
||||
import org.xenoserver.control.Defaults;
|
||||
import org.xenoserver.control.Domain;
|
||||
|
||||
public class ParseList extends CommandParser {
|
||||
public class ParseDomainList extends CommandParser {
|
||||
|
||||
public void parse(Defaults d, String[] args) throws ParseFailedException, CommandFailedException {
|
||||
CommandList list = new CommandList(d);
|
||||
public void parse(Defaults d, LinkedList args) throws ParseFailedException, CommandFailedException {
|
||||
CommandDomainList list = new CommandDomainList(d);
|
||||
String output = list.execute();
|
||||
if ( output != null )
|
||||
System.out.println( output );
|
||||
+7
-4
@@ -1,13 +1,16 @@
|
||||
package org.xenoserver.cmdline;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import org.xenoserver.control.Command;
|
||||
import org.xenoserver.control.CommandFailedException;
|
||||
import org.xenoserver.control.CommandNew;
|
||||
import org.xenoserver.control.CommandDomainNew;
|
||||
import org.xenoserver.control.Defaults;
|
||||
|
||||
public class ParseNew extends CommandParser {
|
||||
public class ParseDomainNew extends CommandParser {
|
||||
|
||||
public void parse(Defaults d, String[] args) throws ParseFailedException, CommandFailedException {
|
||||
public void parse(Defaults d, LinkedList args) throws ParseFailedException, CommandFailedException {
|
||||
String name = getStringParameter(args, 'n', d.domainName);
|
||||
int size = getIntParameter(args, 'k', d.domainSizeKB);
|
||||
String image = getStringParameter(args, 'i', d.domainImage);
|
||||
@@ -24,7 +27,7 @@ public class ParseNew extends CommandParser {
|
||||
|
||||
d.describe();
|
||||
|
||||
CommandNew c = new CommandNew(d, name, size, image, initrd, vifs,
|
||||
CommandDomainNew c = new CommandDomainNew(d, name, size, image, initrd, vifs,
|
||||
bargs, root_dev, nfs_root_path,
|
||||
nw_ip, nw_gw, nw_mask, nw_nfs_server, nw_host);
|
||||
c.execute();
|
||||
+7
-4
@@ -1,20 +1,23 @@
|
||||
package org.xenoserver.cmdline;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import org.xenoserver.control.Command;
|
||||
import org.xenoserver.control.CommandFailedException;
|
||||
import org.xenoserver.control.CommandStart;
|
||||
import org.xenoserver.control.CommandDomainStart;
|
||||
import org.xenoserver.control.Defaults;
|
||||
|
||||
public class ParseStart extends CommandParser {
|
||||
public class ParseDomainStart extends CommandParser {
|
||||
|
||||
public void parse(Defaults d, String[] args) throws ParseFailedException, CommandFailedException {
|
||||
public void parse(Defaults d, LinkedList args) throws ParseFailedException, CommandFailedException {
|
||||
int domain_id = getIntParameter(args, 'n', 0);
|
||||
|
||||
if (domain_id == 0) {
|
||||
throw new ParseFailedException("Expected -n<domain_id>");
|
||||
}
|
||||
|
||||
String output = new CommandStart(d, domain_id).execute();
|
||||
String output = new CommandDomainStart(d, domain_id).execute();
|
||||
if ( output != null )
|
||||
System.out.println( output );
|
||||
}
|
||||
+7
-4
@@ -1,20 +1,23 @@
|
||||
package org.xenoserver.cmdline;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import org.xenoserver.control.Command;
|
||||
import org.xenoserver.control.CommandFailedException;
|
||||
import org.xenoserver.control.CommandStop;
|
||||
import org.xenoserver.control.CommandDomainStop;
|
||||
import org.xenoserver.control.Defaults;
|
||||
|
||||
public class ParseStop extends CommandParser {
|
||||
public class ParseDomainStop extends CommandParser {
|
||||
|
||||
public void parse(Defaults d, String[] args) throws ParseFailedException, CommandFailedException {
|
||||
public void parse(Defaults d, LinkedList args) throws ParseFailedException, CommandFailedException {
|
||||
int domain_id = getIntParameter(args, 'n', 0);
|
||||
|
||||
if (domain_id == 0) {
|
||||
throw new ParseFailedException("Expected -n<domain_id>");
|
||||
}
|
||||
|
||||
String output = new CommandStop(d, domain_id).execute();
|
||||
String output = new CommandDomainStop(d, domain_id).execute();
|
||||
if ( output != null )
|
||||
System.out.println( output );
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
package org.xenoserver.cmdline;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import org.xenoserver.control.CommandFailedException;
|
||||
import org.xenoserver.control.Defaults;
|
||||
|
||||
public class ParseGroup extends CommandParser {
|
||||
private final String name;
|
||||
private final CommandParser[] commands;
|
||||
|
||||
/**
|
||||
* Constructor for ParseGroup.
|
||||
* @param name Name of this group of commands
|
||||
* @param commands Array of commands to include
|
||||
*/
|
||||
public ParseGroup(String name, CommandParser[] commands) {
|
||||
this.name = name;
|
||||
this.commands = commands;
|
||||
}
|
||||
|
||||
public void parse(Defaults d, LinkedList args) throws ParseFailedException, CommandFailedException {
|
||||
int i;
|
||||
String c = (String) args.removeFirst();
|
||||
for (i = 0; i < commands.length; i++) {
|
||||
if (commands[i].getName().equals(c)) {
|
||||
if (getFlagParameter(args, '?')) {
|
||||
commands[i].printHelpText(null);
|
||||
} else {
|
||||
commands[i].parse(d, args);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (i == commands.length) {
|
||||
throw new ParseFailedException("Unknown command " + c);
|
||||
}
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getUsage() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getHelpText() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
public void printUsage(String prefix) {
|
||||
if ( prefix == null )
|
||||
prefix = name;
|
||||
else
|
||||
prefix += " " + name;
|
||||
for ( int i=0; i<commands.length; i++ )
|
||||
commands[i].printUsage(prefix);
|
||||
}
|
||||
|
||||
public void printHelpText(LinkedList args) {
|
||||
if ( name != null )
|
||||
System.out.print( name + " " );
|
||||
int i;
|
||||
String c = (String) args.removeFirst();
|
||||
for (i = 0; i < commands.length; i++) {
|
||||
if (commands[i].getName().equals(c)) {
|
||||
commands[i].printHelpText(args);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,41 +1,25 @@
|
||||
package org.xenoserver.cmdline;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import org.xenoserver.control.Command;
|
||||
import org.xenoserver.control.Defaults;
|
||||
|
||||
public class ParseHelp extends CommandParser {
|
||||
|
||||
public void parse(Defaults d, String[] args) {
|
||||
if (args.length <= 1) {
|
||||
public void parse(Defaults d, LinkedList args) {
|
||||
if (args.size() == 0) {
|
||||
System.out.println("Usage:");
|
||||
for (int i = 0; i < Main.commands.length; i++) {
|
||||
String name = Main.commands[i].getName();
|
||||
String usage = Main.commands[i].getUsage();
|
||||
while (name.length() < 12)
|
||||
name = name + " ";
|
||||
System.out.println(" " + name + usage);
|
||||
}
|
||||
Main.parser.printUsage(null);
|
||||
} else {
|
||||
for (int i = 0; i < Main.commands.length; i++) {
|
||||
String name = Main.commands[i].getName();
|
||||
String usage = Main.commands[i].getUsage();
|
||||
if (name.equals(args[1])) {
|
||||
doHelpFor(Main.commands[i]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
System.out.print("xenctl ");
|
||||
Main.parser.printHelpText(args);
|
||||
}
|
||||
|
||||
System.out.println("");
|
||||
}
|
||||
|
||||
public void doHelpFor(CommandParser c)
|
||||
{
|
||||
System.out.println ("xenctl " + c.getName() + " " + c.getUsage());
|
||||
System.out.println ();
|
||||
System.out.println (c.getHelpText ());
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return "help";
|
||||
|
||||
+3
-3
@@ -3,19 +3,19 @@ package org.xenoserver.control;
|
||||
/**
|
||||
* Destroys a domain.
|
||||
*/
|
||||
public class CommandDestroy extends Command {
|
||||
public class CommandDomainDestroy extends Command {
|
||||
private Defaults d;
|
||||
private int domain_id;
|
||||
private boolean force;
|
||||
|
||||
/**
|
||||
* Constructor for CommandDestroy.
|
||||
* Constructor for CommandDomainDestroy.
|
||||
*
|
||||
* @param d Defaults object to use.
|
||||
* @param domain_id Domain ID number to destroy.
|
||||
* @param force Force destruction.
|
||||
*/
|
||||
public CommandDestroy(Defaults d, int domain_id, boolean force) {
|
||||
public CommandDomainDestroy(Defaults d, int domain_id, boolean force) {
|
||||
this.d = d;
|
||||
this.domain_id = domain_id;
|
||||
this.force = force;
|
||||
+3
-3
@@ -9,15 +9,15 @@ import java.util.Vector;
|
||||
* Lists details of all domains. After execute() has been called, call
|
||||
* domains() to get the array of domains.
|
||||
*/
|
||||
public class CommandList extends Command {
|
||||
public class CommandDomainList extends Command {
|
||||
private Defaults d;
|
||||
private Domain[] array;
|
||||
|
||||
/**
|
||||
* Constructor for CommandList.
|
||||
* Constructor for CommandDomainList.
|
||||
* @param d Defaults object to use.
|
||||
*/
|
||||
public CommandList(Defaults d) {
|
||||
public CommandDomainList(Defaults d) {
|
||||
this.d = d;
|
||||
}
|
||||
|
||||
+3
-3
@@ -14,7 +14,7 @@ import java.util.zip.GZIPInputStream;
|
||||
* Creates a new domain. As this command returns a multi-line result,
|
||||
* call output() to get an array of strings.
|
||||
*/
|
||||
public class CommandNew extends Command {
|
||||
public class CommandDomainNew extends Command {
|
||||
private Defaults d;
|
||||
private String name;
|
||||
private int size;
|
||||
@@ -36,7 +36,7 @@ public class CommandNew extends Command {
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor for CommandNew.
|
||||
* Constructor for CommandDomainNew.
|
||||
* @param d Defaults object to use.
|
||||
* @param name Name for the domain.
|
||||
* @param size Memory size for the domain.
|
||||
@@ -52,7 +52,7 @@ public class CommandNew extends Command {
|
||||
* @param nw_nfs_server NFS server to be used by the domain.
|
||||
* @param nw_host Hostname to be used by the domain.
|
||||
*/
|
||||
public CommandNew(
|
||||
public CommandDomainNew(
|
||||
Defaults d,
|
||||
String name,
|
||||
int size,
|
||||
+3
-3
@@ -3,16 +3,16 @@ package org.xenoserver.control;
|
||||
/**
|
||||
* Starts a domain.
|
||||
*/
|
||||
public class CommandStart extends Command {
|
||||
public class CommandDomainStart extends Command {
|
||||
private Defaults d;
|
||||
private int domain_id;
|
||||
|
||||
/**
|
||||
* Constructor for CommandStart.
|
||||
* Constructor for CommandDomainStart.
|
||||
* @param d Defaults object to use.
|
||||
* @param domain_id Domain to start.
|
||||
*/
|
||||
public CommandStart(Defaults d, int domain_id) {
|
||||
public CommandDomainStart(Defaults d, int domain_id) {
|
||||
this.d = d;
|
||||
this.domain_id = domain_id;
|
||||
}
|
||||
+3
-3
@@ -3,16 +3,16 @@ package org.xenoserver.control;
|
||||
/**
|
||||
* Stops a domain.
|
||||
*/
|
||||
public class CommandStop extends Command {
|
||||
public class CommandDomainStop extends Command {
|
||||
private Defaults d;
|
||||
private int domain_id;
|
||||
|
||||
/**
|
||||
* Constructor for CommandStop.
|
||||
* Constructor for CommandDomainStop.
|
||||
* @param d The defaults object to use.
|
||||
* @param domain_id The domain to stop.
|
||||
*/
|
||||
public CommandStop(Defaults d, int domain_id) {
|
||||
public CommandDomainStop(Defaults d, int domain_id) {
|
||||
this.d = d;
|
||||
this.domain_id = domain_id;
|
||||
}
|
||||