package org.zstack.header.host;

import org.zstack.header.message.NeedReplyMessage;
import org.zstack.header.vm.VmInstanceInventory;

public class MigrateVmOnHypervisorMsg extends NeedReplyMessage implements HostMessage {
    public static enum StorageMigrationPolicy {
        FullCopy,
        IncCopy
    }

    private VmInstanceInventory vmInventory;
    private HostInventory destHostInventory;
    private String srcHostUuid;
    private StorageMigrationPolicy storageMigrationPolicy;
    private boolean migrateFromDestination;

    public StorageMigrationPolicy getStorageMigrationPolicy() {
        return storageMigrationPolicy;
    }

    public void setStorageMigrationPolicy(StorageMigrationPolicy storageMigrationPolicy) {
        this.storageMigrationPolicy = storageMigrationPolicy;
    }

    public VmInstanceInventory getVmInventory() {
        return vmInventory;
    }

    public void setVmInventory(VmInstanceInventory vmInventory) {
        this.vmInventory = vmInventory;
    }

    public HostInventory getDestHostInventory() {
        return destHostInventory;
    }

    public void setDestHostInventory(HostInventory destHostInventory) {
        this.destHostInventory = destHostInventory;
    }

    @Override
    public String getHostUuid() {
        return getSrcHostUuid();
    }

    public String getSrcHostUuid() {
        return srcHostUuid;
    }

    public void setSrcHostUuid(String srcHostUuid) {
        this.srcHostUuid = srcHostUuid;
    }

    public boolean isMigrateFromDestination() {
        return migrateFromDestination;
    }

    public void setMigrateFromDestination(boolean migrateFromDestination) {
        this.migrateFromDestination = migrateFromDestination;
    }
}

@@ -26,16 +26,58 @@
 .host;%0A%0A
+import org.zstack.header.core.ApiTimeout;%0A
 import o
@@ -151,29 +151,124 @@
 .vm.
-VmInstanceInventory;%0A
+APIMigrateVmMsg;%0Aimport org.zstack.header.vm.VmInstanceInventory;%0A%0A@ApiTimeout(apiClasses = %7BAPIMigrateVmMsg.class%7D)
 %0Apub

add missing timeout decoration