diff --git a/engine/storage/imagemotion/src/org/apache/cloudstack/storage/image/motion/DefaultImageMotionStrategy.java b/engine/storage/imagemotion/src/org/apache/cloudstack/storage/image/motion/DefaultImageMotionStrategy.java index 015d009ab44..91cacdb527d 100644 --- a/engine/storage/imagemotion/src/org/apache/cloudstack/storage/image/motion/DefaultImageMotionStrategy.java +++ b/engine/storage/imagemotion/src/org/apache/cloudstack/storage/image/motion/DefaultImageMotionStrategy.java @@ -30,6 +30,8 @@ import org.apache.cloudstack.storage.to.ImageOnPrimayDataStoreTO; import org.apache.cloudstack.storage.volume.TemplateOnPrimaryDataStoreInfo; import org.springframework.stereotype.Component; +import com.cloud.agent.api.Answer; + @Component public class DefaultImageMotionStrategy implements ImageMotionStrategy { @@ -71,16 +73,16 @@ public class DefaultImageMotionStrategy implements ImageMotionStrategy { ImageOnPrimayDataStoreTO imageTo = new ImageOnPrimayDataStoreTO(templateStore); CopyTemplateToPrimaryStorageCmd copyCommand = new CopyTemplateToPrimaryStorageCmd(imageTo); CreateTemplateContext context = new CreateTemplateContext(callback, templateStore); - AsyncCallbackDispatcher caller = AsyncCallbackDispatcher.create(this); + AsyncCallbackDispatcher caller = AsyncCallbackDispatcher.create(this); caller.setCallback(caller.getTarget().copyTemplateCallBack(null, null)) .setContext(context); ep.sendMessageAsync(copyCommand, caller); } - public Object copyTemplateCallBack(AsyncCallbackDispatcher callback, CreateTemplateContext context) { + public Object copyTemplateCallBack(AsyncCallbackDispatcher callback, CreateTemplateContext context) { AsyncCompletionCallback parentCall = context.getParentCallback(); - CopyTemplateToPrimaryStorageAnswer answer = callback.getResult(); + CopyTemplateToPrimaryStorageAnswer answer = (CopyTemplateToPrimaryStorageAnswer)callback.getResult(); CommandResult result = new CommandResult(); if (!answer.getResult()) {