Implementing Migration and Maintenance for simulator hosts [Part 2]

Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/6fd6d797
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/6fd6d797
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/6fd6d797

Branch: refs/heads/vpc
Commit: 6fd6d797b20ea823142cf7859909eb9994024551
Parents: 87bcd8e
Author: Prasanna Santhanam <[email protected]>
Authored: Fri Aug 3 15:56:12 2012 +0530
Committer: Prasanna Santhanam <[email protected]>
Committed: Fri Aug 3 15:56:12 2012 +0530

----------------------------------------------------------------------
 .../cloud/agent/manager/SimulatorManagerImpl.java  |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6fd6d797/agent-simulator/src/com/cloud/agent/manager/SimulatorManagerImpl.java
----------------------------------------------------------------------
diff --git 
a/agent-simulator/src/com/cloud/agent/manager/SimulatorManagerImpl.java 
b/agent-simulator/src/com/cloud/agent/manager/SimulatorManagerImpl.java
index a36e093..a2d662f 100644
--- a/agent-simulator/src/com/cloud/agent/manager/SimulatorManagerImpl.java
+++ b/agent-simulator/src/com/cloud/agent/manager/SimulatorManagerImpl.java
@@ -19,7 +19,6 @@ package com.cloud.agent.manager;
 import java.sql.Connection;
 import java.sql.SQLException;
 import java.util.HashMap;
-import java.util.List;
 import java.util.Map;
 
 import javax.ejb.Local;
@@ -33,6 +32,7 @@ import com.cloud.agent.api.AttachVolumeCommand;
 import com.cloud.agent.api.BackupSnapshotCommand;
 import com.cloud.agent.api.CheckHealthCommand;
 import com.cloud.agent.api.CheckNetworkCommand;
+import com.cloud.agent.api.CheckVirtualMachineCommand;
 import com.cloud.agent.api.CleanupNetworkRulesCmd;
 import com.cloud.agent.api.ClusterSyncCommand;
 import com.cloud.agent.api.Command;
@@ -54,6 +54,7 @@ import com.cloud.agent.api.MigrateCommand;
 import com.cloud.agent.api.ModifyStoragePoolCommand;
 import com.cloud.agent.api.NetworkUsageCommand;
 import com.cloud.agent.api.PingTestCommand;
+import com.cloud.agent.api.PrepareForMigrationCommand;
 import com.cloud.agent.api.RebootCommand;
 import com.cloud.agent.api.SecStorageSetupCommand;
 import com.cloud.agent.api.SecStorageVMSetupCommand;
@@ -80,7 +81,6 @@ import com.cloud.agent.api.storage.DownloadCommand;
 import com.cloud.agent.api.storage.DownloadProgressCommand;
 import com.cloud.agent.api.storage.ListTemplateCommand;
 import com.cloud.agent.api.storage.PrimaryStorageDownloadCommand;
-import com.cloud.agent.mockvm.MockVm;
 import com.cloud.simulator.MockConfigurationVO;
 import com.cloud.simulator.MockHost;
 import com.cloud.simulator.MockVMVO;
@@ -197,12 +197,16 @@ public class SimulatorManagerImpl implements 
SimulatorManager {
                 return _mockAgentMgr.checkHealth((CheckHealthCommand)cmd);
             } else if (cmd instanceof PingTestCommand) {
                 return _mockAgentMgr.pingTest((PingTestCommand)cmd);
+            } else if (cmd instanceof PrepareForMigrationCommand) {
+               return 
_mockAgentMgr.prepareForMigrate((PrepareForMigrationCommand)cmd);
             } else if (cmd instanceof MigrateCommand) {
                 return _mockVmMgr.Migrate((MigrateCommand)cmd, info);
             } else if (cmd instanceof StartCommand) {
                 return _mockVmMgr.startVM((StartCommand)cmd, info);
             } else if (cmd instanceof CheckSshCommand) {
                 return _mockVmMgr.checkSshCommand((CheckSshCommand)cmd);
+            } else if (cmd instanceof CheckVirtualMachineCommand) {
+               return _mockVmMgr.checkVmState((CheckVirtualMachineCommand)cmd);
             } else if (cmd instanceof SetStaticNatRulesCommand) {
                 return 
_mockVmMgr.SetStaticNatRules((SetStaticNatRulesCommand)cmd);
             } else if (cmd instanceof SetFirewallRulesCommand) {
@@ -282,7 +286,7 @@ public class SimulatorManagerImpl implements 
SimulatorManager {
             } else if (cmd instanceof CreatePrivateTemplateFromVolumeCommand) {
                 return 
_mockStorageMgr.CreatePrivateTemplateFromVolume((CreatePrivateTemplateFromVolumeCommand)cmd);
             } else if (cmd instanceof MaintainCommand) {
-                return _mockAgentMgr.MaintainCommand((MaintainCommand)cmd);
+                return _mockAgentMgr.maintain((MaintainCommand)cmd);
             } else if (cmd instanceof GetVmStatsCommand) {
                 return _mockVmMgr.getVmStats((GetVmStatsCommand)cmd);
             } else if (cmd instanceof GetDomRVersionCmd) {

Reply via email to