mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
Renamed Start2 to Start
This commit is contained in:
parent
e613ecaba0
commit
a7a4d92739
@ -121,8 +121,8 @@ import com.cloud.agent.api.ReadyCommand;
|
||||
import com.cloud.agent.api.RebootAnswer;
|
||||
import com.cloud.agent.api.RebootCommand;
|
||||
import com.cloud.agent.api.RebootRouterCommand;
|
||||
import com.cloud.agent.api.Start2Answer;
|
||||
import com.cloud.agent.api.Start2Command;
|
||||
import com.cloud.agent.api.StartAnswer;
|
||||
import com.cloud.agent.api.StartCommand;
|
||||
import com.cloud.agent.api.StartupCommand;
|
||||
import com.cloud.agent.api.StartupRoutingCommand;
|
||||
import com.cloud.agent.api.StopAnswer;
|
||||
@ -1100,8 +1100,8 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv
|
||||
return execute((DeleteStoragePoolCommand) cmd);
|
||||
} else if (cmd instanceof FenceCommand ) {
|
||||
return execute((FenceCommand) cmd);
|
||||
} else if (cmd instanceof Start2Command ) {
|
||||
return execute((Start2Command) cmd);
|
||||
} else if (cmd instanceof StartCommand ) {
|
||||
return execute((StartCommand) cmd);
|
||||
} else if (cmd instanceof RoutingCommand) {
|
||||
return _virtRouterResource.executeRequest(cmd);
|
||||
} else if (cmd instanceof CheckSshCommand) {
|
||||
@ -2390,7 +2390,7 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv
|
||||
}
|
||||
|
||||
|
||||
protected synchronized Start2Answer execute(Start2Command cmd) {
|
||||
protected synchronized StartAnswer execute(StartCommand cmd) {
|
||||
VirtualMachineTO vmSpec = cmd.getVirtualMachine();
|
||||
String vmName = vmSpec.getName();
|
||||
LibvirtVMDef vm = null;
|
||||
@ -2438,11 +2438,11 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv
|
||||
}
|
||||
}
|
||||
state = State.Running;
|
||||
return new Start2Answer(cmd);
|
||||
return new StartAnswer(cmd);
|
||||
} catch (Exception e) {
|
||||
s_logger.warn("Exception ", e);
|
||||
handleVmStartFailure(vmName, vm);
|
||||
return new Start2Answer(cmd, e.getMessage());
|
||||
return new StartAnswer(cmd, e.getMessage());
|
||||
} finally {
|
||||
synchronized (_vms) {
|
||||
if (state != State.Stopped) {
|
||||
|
||||
@ -22,7 +22,7 @@ import com.cloud.agent.api.to.VirtualMachineTO;
|
||||
/**
|
||||
* This command carries information to start a VM.
|
||||
*/
|
||||
public class Start2Command extends Command {
|
||||
public class StartCommand extends Command {
|
||||
VirtualMachineTO vm;
|
||||
|
||||
public VirtualMachineTO getVirtualMachine() {
|
||||
@ -34,10 +34,10 @@ public class Start2Command extends Command {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected Start2Command() {
|
||||
protected StartCommand() {
|
||||
}
|
||||
|
||||
public Start2Command(VirtualMachineTO vm) {
|
||||
public StartCommand(VirtualMachineTO vm) {
|
||||
this.vm = vm;
|
||||
}
|
||||
}
|
||||
@ -1,21 +0,0 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package com.cloud.agent.api;
|
||||
|
||||
public class Start2Answer extends Answer {
|
||||
protected Start2Answer() {
|
||||
}
|
||||
|
||||
public Start2Answer(Start2Command cmd, String msg) {
|
||||
super(cmd, false, msg);
|
||||
}
|
||||
|
||||
public Start2Answer(Start2Command cmd, Exception e) {
|
||||
super(cmd, false, e.getMessage());
|
||||
}
|
||||
|
||||
public Start2Answer(Start2Command cmd) {
|
||||
super(cmd, true, null);
|
||||
}
|
||||
}
|
||||
21
core/src/com/cloud/agent/api/StartAnswer.java
Normal file
21
core/src/com/cloud/agent/api/StartAnswer.java
Normal file
@ -0,0 +1,21 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package com.cloud.agent.api;
|
||||
|
||||
public class StartAnswer extends Answer {
|
||||
protected StartAnswer() {
|
||||
}
|
||||
|
||||
public StartAnswer(StartCommand cmd, String msg) {
|
||||
super(cmd, false, msg);
|
||||
}
|
||||
|
||||
public StartAnswer(StartCommand cmd, Exception e) {
|
||||
super(cmd, false, e.getMessage());
|
||||
}
|
||||
|
||||
public StartAnswer(StartCommand cmd) {
|
||||
super(cmd, true, null);
|
||||
}
|
||||
}
|
||||
@ -106,8 +106,8 @@ import com.cloud.agent.api.RebootCommand;
|
||||
import com.cloud.agent.api.RebootRouterCommand;
|
||||
import com.cloud.agent.api.SetupAnswer;
|
||||
import com.cloud.agent.api.SetupCommand;
|
||||
import com.cloud.agent.api.Start2Answer;
|
||||
import com.cloud.agent.api.Start2Command;
|
||||
import com.cloud.agent.api.StartAnswer;
|
||||
import com.cloud.agent.api.StartCommand;
|
||||
import com.cloud.agent.api.StartupCommand;
|
||||
import com.cloud.agent.api.StartupRoutingCommand;
|
||||
import com.cloud.agent.api.StartupStorageCommand;
|
||||
@ -429,8 +429,8 @@ public abstract class CitrixResourceBase implements ServerResource {
|
||||
return execute((ModifySshKeysCommand) cmd);
|
||||
} else if (cmd instanceof PoolEjectCommand) {
|
||||
return execute((PoolEjectCommand) cmd);
|
||||
} else if (cmd instanceof Start2Command) {
|
||||
return execute((Start2Command)cmd);
|
||||
} else if (cmd instanceof StartCommand) {
|
||||
return execute((StartCommand)cmd);
|
||||
} else if (cmd instanceof RemoteAccessVpnCfgCommand) {
|
||||
return execute((RemoteAccessVpnCfgCommand)cmd);
|
||||
} else if (cmd instanceof VpnUsersCfgCommand) {
|
||||
@ -775,7 +775,7 @@ public abstract class CitrixResourceBase implements ServerResource {
|
||||
return new CheckSshAnswer(cmd);
|
||||
}
|
||||
|
||||
protected Start2Answer execute(Start2Command cmd) {
|
||||
protected StartAnswer execute(StartCommand cmd) {
|
||||
Connection conn = getConnection();
|
||||
VirtualMachineTO vmSpec = cmd.getVirtualMachine();
|
||||
String vmName = vmSpec.getName();
|
||||
@ -837,11 +837,11 @@ public abstract class CitrixResourceBase implements ServerResource {
|
||||
}
|
||||
|
||||
state = State.Running;
|
||||
return new Start2Answer(cmd);
|
||||
return new StartAnswer(cmd);
|
||||
} catch (Exception e) {
|
||||
s_logger.warn("Catch Exception: " + e.getClass().toString() + " due to " + e.toString(), e);
|
||||
String msg = handleVmStartFailure(conn, vmName, vm, "", e);
|
||||
return new Start2Answer(cmd, msg);
|
||||
return new StartAnswer(cmd, msg);
|
||||
} finally {
|
||||
synchronized (_vms) {
|
||||
if (state != State.Stopped) {
|
||||
|
||||
@ -19,8 +19,8 @@ package com.cloud.resource.hypervisor;
|
||||
|
||||
import com.cloud.agent.api.RebootAnswer;
|
||||
import com.cloud.agent.api.RebootCommand;
|
||||
import com.cloud.agent.api.Start2Answer;
|
||||
import com.cloud.agent.api.Start2Command;
|
||||
import com.cloud.agent.api.StartAnswer;
|
||||
import com.cloud.agent.api.StartCommand;
|
||||
import com.cloud.agent.api.StopAnswer;
|
||||
import com.cloud.agent.api.StopCommand;
|
||||
import com.cloud.resource.ServerResource;
|
||||
@ -37,7 +37,7 @@ public interface HypervisorResource extends ServerResource {
|
||||
* @param cmd carries all the information necessary to start a VM
|
||||
* @return Start2Answer answer.
|
||||
*/
|
||||
Start2Answer execute(Start2Command cmd);
|
||||
StartAnswer execute(StartCommand cmd);
|
||||
|
||||
/**
|
||||
* Stops a VM. Must return true as long as the VM does not exist.
|
||||
|
||||
@ -40,7 +40,7 @@ import com.cloud.agent.api.MaintainCommand;
|
||||
import com.cloud.agent.api.MigrateCommand;
|
||||
import com.cloud.agent.api.PingTestCommand;
|
||||
import com.cloud.agent.api.ReadyCommand;
|
||||
import com.cloud.agent.api.Start2Command;
|
||||
import com.cloud.agent.api.StartCommand;
|
||||
import com.cloud.agent.api.StopCommand;
|
||||
import com.cloud.agent.api.storage.CreateCommand;
|
||||
import com.cloud.agent.transport.Request;
|
||||
@ -100,7 +100,7 @@ public abstract class AgentAttache {
|
||||
public final static String[] s_commandsAllowedInMaintenanceMode =
|
||||
new String[] { MaintainCommand.class.toString(), MigrateCommand.class.toString(), StopCommand.class.toString(), CheckVirtualMachineCommand.class.toString(), PingTestCommand.class.toString(), CheckHealthCommand.class.toString(), ReadyCommand.class.toString() };
|
||||
protected final static String[] s_commandsNotAllowedInConnectingMode =
|
||||
new String[] { Start2Command.class.toString(), CreateCommand.class.toString() };
|
||||
new String[] { StartCommand.class.toString(), CreateCommand.class.toString() };
|
||||
static {
|
||||
Arrays.sort(s_commandsAllowedInMaintenanceMode);
|
||||
Arrays.sort(s_commandsNotAllowedInConnectingMode);
|
||||
|
||||
@ -31,7 +31,7 @@ import org.apache.log4j.Logger;
|
||||
import com.cloud.agent.AgentManager;
|
||||
import com.cloud.agent.AgentManager.OnError;
|
||||
import com.cloud.agent.api.Answer;
|
||||
import com.cloud.agent.api.Start2Command;
|
||||
import com.cloud.agent.api.StartCommand;
|
||||
import com.cloud.agent.api.StopAnswer;
|
||||
import com.cloud.agent.api.StopCommand;
|
||||
import com.cloud.agent.api.to.VirtualMachineTO;
|
||||
@ -422,7 +422,7 @@ public class VirtualMachineManagerImpl implements VirtualMachineManager, Cluster
|
||||
VirtualMachineTO vmTO = hvGuru.implement(vmProfile);
|
||||
|
||||
Commands cmds = new Commands(OnError.Revert);
|
||||
cmds.addCommand(new Start2Command(vmTO));
|
||||
cmds.addCommand(new StartCommand(vmTO));
|
||||
|
||||
vmGuru.finalizeDeployment(cmds, vmProfile, dest, context);
|
||||
try {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user