cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ahu...@apache.org
Subject [46/50] [abbrv] Merged
Date Fri, 10 May 2013 23:33:29 GMT
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/30479293/api/src/com/cloud/server/ManagementService.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/30479293/api/src/org/apache/cloudstack/api/BaseCmd.java
----------------------------------------------------------------------
diff --cc api/src/org/apache/cloudstack/api/BaseCmd.java
index 46a9dfc,48d18d0..fc31cec
--- a/api/src/org/apache/cloudstack/api/BaseCmd.java
+++ b/api/src/org/apache/cloudstack/api/BaseCmd.java
@@@ -106,10 -112,9 +112,9 @@@ public abstract class BaseCmd 
      @Inject public VolumeApiService _volumeService;
      @Inject public ResourceService _resourceService;
      @Inject public NetworkService _networkService;
 -    @Inject public TemplateService _templateService;
 +    @Inject public TemplateApiService _templateService;
      @Inject public SecurityGroupService _securityGroupService;
 -    @Inject public SnapshotService _snapshotService;
 +    @Inject public SnapshotApiService _snapshotService;
-     @Inject public ConsoleProxyService _consoleProxyService;
      @Inject public VpcVirtualNetworkApplianceService _routerService;
      @Inject public ResponseGenerator _responseGenerator;
      @Inject public EntityManager _entityMgr;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/30479293/api/src/org/apache/cloudstack/api/ResponseGenerator.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/30479293/api/src/org/apache/cloudstack/api/command/user/iso/ListIsosCmd.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/30479293/api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotCmd.java
----------------------------------------------------------------------
diff --cc api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotCmd.java
index 25cdedd,0b33f56..73a7fc4
--- a/api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotCmd.java
@@@ -163,21 -163,17 +163,21 @@@ public class CreateSnapshotCmd extends 
  
      @Override
      public void execute() {
+         s_logger.info("VOLSS: createSnapshotCmd starts:" + System.currentTimeMillis());
          UserContext.current().setEventDetails("Volume Id: "+getVolumeId());
 -        Snapshot snapshot = _snapshotService.createSnapshot(getVolumeId(), getPolicyId(), getEntityId(), _accountService.getAccount(getEntityOwnerId()));
 -        if (snapshot != null) {
 -            SnapshotResponse response = _responseGenerator.createSnapshotResponse(snapshot);
 -            response.setResponseName(getCommandName());
 -            this.setResponseObject(response);
 -        } else {
 +        Snapshot snapshot;
 +        try {
 +            snapshot = _volumeService.takeSnapshot(this.getVolumeId(), this.getPolicyId(), this.getEntityId(), _accountService.getAccount(getEntityOwnerId()));
 +            if (snapshot != null) {
 +                SnapshotResponse response = _responseGenerator.createSnapshotResponse(snapshot);
 +                response.setResponseName(getCommandName());
 +                this.setResponseObject(response);
 +            } else {
 +                throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to create snapshot due to an internal error creating snapshot for volume " + volumeId);
 +            }
 +        } catch (Exception e) {
              throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to create snapshot due to an internal error creating snapshot for volume " + volumeId);
          }
-         
 -        s_logger.info("VOLSS:  backupSnapshotCmd finishes:" + System.currentTimeMillis());
      }
  
  

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/30479293/api/src/org/apache/cloudstack/api/command/user/template/ListTemplatesCmd.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/30479293/api/src/org/apache/cloudstack/api/response/TemplateResponse.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/30479293/api/src/org/apache/cloudstack/query/QueryService.java
----------------------------------------------------------------------
diff --cc api/src/org/apache/cloudstack/query/QueryService.java
index 4efbd1c,443c5df..6bb24b5
--- a/api/src/org/apache/cloudstack/query/QueryService.java
+++ b/api/src/org/apache/cloudstack/query/QueryService.java
@@@ -16,9 -16,9 +16,10 @@@
  // under the License.
  package org.apache.cloudstack.query;
  
+ import org.apache.cloudstack.affinity.AffinityGroupResponse;
  import org.apache.cloudstack.api.command.admin.host.ListHostsCmd;
  import org.apache.cloudstack.api.command.admin.router.ListRoutersCmd;
 +import org.apache.cloudstack.api.command.admin.storage.ListImageStoresCmd;
  import org.apache.cloudstack.api.command.admin.storage.ListStoragePoolsCmd;
  import org.apache.cloudstack.api.command.admin.user.ListUsersCmd;
  import org.apache.cloudstack.api.command.user.account.ListAccountsCmd;
@@@ -105,7 -99,6 +106,9 @@@ public interface QueryService 
  
      public ListResponse<ZoneResponse>  listDataCenters(ListZonesByCmd cmd);
  
 +    public ListResponse<TemplateResponse> listTemplates(ListTemplatesCmd cmd);
 +
 +    public ListResponse<TemplateResponse> listIsos(ListIsosCmd cmd);
+     public ListResponse<AffinityGroupResponse> listAffinityGroups(Long affinityGroupId, String affinityGroupName,
+             String affinityGroupType, Long vmId, Long startIndex, Long pageSize);
  }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/30479293/client/pom.xml
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/30479293/client/tomcatconf/applicationContext.xml.in
----------------------------------------------------------------------
diff --cc client/tomcatconf/applicationContext.xml.in
index 194b763,36f232c..bb46b23
--- a/client/tomcatconf/applicationContext.xml.in
+++ b/client/tomcatconf/applicationContext.xml.in
@@@ -718,9 -716,9 +721,10 @@@
    <bean id="agentMonitor" class="com.cloud.agent.manager.AgentMonitor" />
    <bean id="alertGenerator" class="com.cloud.event.AlertGenerator" />
    <bean id="ancientDataMotionStrategy" class="org.apache.cloudstack.storage.motion.AncientDataMotionStrategy" />
 +  <bean id="storageCacheManagerImpl" class="org.apache.cloudstack.storage.cache.manager.StorageCacheManagerImpl"  />
 +  <bean id="storageCacheRandomAllocator" class="org.apache.cloudstack.storage.cache.allocator.StorageCacheRandomAllocator" />
 +  <bean id="xenserverSnapshotStrategy" class="org.apache.cloudstack.storage.snapshot.XenserverSnapshotStrategy" />
+   <bean id="xenserverStorageMotionStrategy" class="org.apache.cloudstack.storage.motion.XenServerStorageMotionStrategy" />
 -  <bean id="ancientImageDataStoreProvider" class="org.apache.cloudstack.storage.image.store.AncientImageDataStoreProvider" />
 -  <bean id="ancientSnapshotStrategy" class="org.apache.cloudstack.storage.snapshot.strategy.AncientSnapshotStrategy" />
    <bean id="apiDBUtils" class="com.cloud.api.ApiDBUtils" />
    <bean id="apiDiscoveryServiceImpl" class="org.apache.cloudstack.discovery.ApiDiscoveryServiceImpl" />
    <bean id="apiDispatcher" class="com.cloud.api.ApiDispatcher" />
@@@ -737,18 -735,17 +741,17 @@@
    <bean id="dataObjectManagerImpl" class="org.apache.cloudstack.storage.datastore.DataObjectManagerImpl" />
    <bean id="dataStoreManagerImpl" class="org.apache.cloudstack.storage.datastore.DataStoreManagerImpl" />
    <bean id="defaultEndPointSelector" class="org.apache.cloudstack.storage.endpoint.DefaultEndPointSelector" />
 -  <bean id="defaultPrimaryDataStoreProviderManagerImpl" class="org.apache.cloudstack.storage.datastore.manager.DefaultPrimaryDataStoreProviderManagerImpl" />
 +  <bean id="primaryDataStoreProviderManagerImpl" class="org.apache.cloudstack.storage.datastore.manager.PrimaryDataStoreProviderManagerImpl" />
 +  <bean id="imageStoreProviderManagerImpl" class="org.apache.cloudstack.storage.image.manager.ImageStoreProviderManagerImpl" />  
    <bean id="eventUtils" class="com.cloud.event.EventUtils" />
-   <bean id="globalLoadBalancingRulesServiceImpl" class="org.apache.cloudstack.region.gslb.GlobalLoadBalancingRulesServiceImpl" />
-   <bean id="hypervsiorHostEndPointRpcServer" class="org.apache.cloudstack.storage.HypervsiorHostEndPointRpcServer" />
+   <bean id="hypervisorHostEndPointRpcServer" class="org.apache.cloudstack.storage.HypervisorHostEndPointRpcServer" />
    <bean id="iSCSI" class="org.apache.cloudstack.storage.datastore.type.ISCSI" />
    <bean id="ISO" class="org.apache.cloudstack.storage.image.format.ISO" />
 -  <bean id="imageDataFactoryImpl" class="org.apache.cloudstack.storage.image.ImageDataFactoryImpl" />
 +  <bean id="templateDataFactoryImpl" class="org.apache.cloudstack.storage.image.TemplateDataFactoryImpl" />
    <bean id="imageDataManagerImpl" class="org.apache.cloudstack.storage.image.manager.ImageDataManagerImpl" />
 -  <bean id="imageDataStoreHelper" class="org.apache.cloudstack.storage.image.datastore.ImageDataStoreHelper" />
 -  <bean id="imageDataStoreManagerImpl" class="org.apache.cloudstack.storage.image.manager.ImageDataStoreManagerImpl" />
 +  <bean id="imageStoreHelper" class="org.apache.cloudstack.storage.image.datastore.ImageStoreHelper" />
    <bean id="imageFormatHelper" class="org.apache.cloudstack.storage.image.format.ImageFormatHelper" />
 -  <bean id="imageServiceImpl" class="org.apache.cloudstack.storage.image.ImageServiceImpl" />
 +  <bean id="templateServiceImpl" class="org.apache.cloudstack.storage.image.TemplateServiceImpl" />
    <bean id="iso" class="org.apache.cloudstack.engine.subsystem.api.storage.type.Iso" />
    <bean id="networkFileSystem" class="org.apache.cloudstack.storage.datastore.type.NetworkFileSystem" />
    <bean id="networkRestService" class="org.apache.cloudstack.engine.rest.service.api.NetworkRestService" />

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/30479293/client/tomcatconf/commands.properties.in
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/30479293/core/src/com/cloud/agent/Listener.java
----------------------------------------------------------------------
diff --cc core/src/com/cloud/agent/Listener.java
index 0000000,47b9bc3..242f90c
mode 000000,100755..100755
--- a/core/src/com/cloud/agent/Listener.java
+++ b/core/src/com/cloud/agent/Listener.java
@@@ -1,0 -1,119 +1,119 @@@
+ // Licensed to the Apache Software Foundation (ASF) under one
+ // or more contributor license agreements.  See the NOTICE file
+ // distributed with this work for additional information
+ // regarding copyright ownership.  The ASF licenses this file
+ // to you under the Apache License, Version 2.0 (the
+ // "License"); you may not use this file except in compliance
+ // with the License.  You may obtain a copy of the License at
+ //
+ //   http://www.apache.org/licenses/LICENSE-2.0
+ //
+ // Unless required by applicable law or agreed to in writing,
+ // software distributed under the License is distributed on an
+ // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ // KIND, either express or implied.  See the License for the
+ // specific language governing permissions and limitations
+ // under the License.
+ package com.cloud.agent;
+ 
+ import com.cloud.agent.api.AgentControlAnswer;
+ import com.cloud.agent.api.AgentControlCommand;
+ import com.cloud.agent.api.Answer;
+ import com.cloud.agent.api.Command;
+ import com.cloud.agent.api.StartupCommand;
+ import com.cloud.exception.ConnectionException;
 -import com.cloud.host.HostVO;
++import com.cloud.host.Host;
+ import com.cloud.host.Status;
+ 
+ /**
+  * There are several types of events that the AgentManager forwards
 - * 
++ *
+  *   1. Agent Connect & Disconnect
+  *   2. Commands sent by the agent.
+  *   3. Answers sent by the agent.
+  */
+ public interface Listener {
+ 
 -	/**
 -	 * 
 -	 * @param agentId id of the agent
 -	 * @param seq sequence number return by the send() method.
 -	 * @param answers answers to the commands.
 -	 * @return true if processed.  false if not.
 -	 */
++    /**
++     *
++     * @param agentId id of the agent
++     * @param seq sequence number return by the send() method.
++     * @param answers answers to the commands.
++     * @return true if processed.  false if not.
++     */
+     boolean processAnswers(long agentId, long seq, Answer[] answers);
+ 
+     /**
+      * This method is called by the AgentManager when an agent sent
+      * a command to the server.  In order to process these commands,
+      * the Listener must be registered for host commands.
 -     * 
++     *
+      * @param agentId id of the agent.
+      * @param seq sequence number of the command sent.
+      * @param commands commands that were sent.
+      * @return true if you processed the commands.  false if not.
+      */
+     boolean processCommands(long agentId, long seq, Command[] commands);
 -    
++
+     /**
+      * process control command sent from agent under its management
+      * @param agentId
+      * @param cmd
+      * @return
+      */
+     AgentControlAnswer processControlCommand(long agentId, AgentControlCommand cmd);
+ 
+     /**
+      * This method is called by AgentManager when an agent made a
+      * connection to this server if the listener has
+      * been registered for host events.
+      * @param cmd command sent by the agent to the server on startup.
+      * @param forRebalance TODO
+      * @param agentId id of the agent
+      * @throws ConnectionException if host has problems and needs to put into maintenance state.
+      */
 -    void processConnect(HostVO host, StartupCommand cmd, boolean forRebalance) throws ConnectionException;
 -    
++    void processConnect(Host host, StartupCommand cmd, boolean forRebalance) throws ConnectionException;
++
+     /**
+      * This method is called by AgentManager when an agent disconnects
+      * from this server if the listener has been registered for host events.
 -     * 
++     *
+      * If the Listener is passed to the send() method, this method is
+      * also called by AgentManager if the agent disconnected.
 -     * 
++     *
+      * @param agentId id of the agent
+      * @param state the current state of the agent.
+      */
+     boolean processDisconnect(long agentId, Status state);
 -        
++
+     /**
+      * If this Listener is passed to the send() method, this method
+      * is called by AgentManager after processing an answer
+      * from the agent.  Returning true means you're expecting more
+      * answers from the agent using the same sequence number.
 -     * 
++     *
+      * @return true if expecting more answers using the same sequence number.
+      */
+     boolean isRecurring();
+ 
+     /**
+      * If the Listener is passed to the send() method, this method is
+      * called to determine how long to wait for the reply.  The value
+      * is in seconds.  -1 indicates to wait forever.  0 indicates to
+      * use the default timeout.  If the timeout is
+      * reached, processTimeout on this same Listener is called.
 -     * 
++     *
+      * @return timeout in seconds before processTimeout is called.
+      */
+     int getTimeout();
+ 
+     /**
+      * If the Listener is passed to the send() method, this method is
+      * called by the AgentManager to process a command timeout.
+      * @param agentId id of the agent
+      * @param seq sequence number returned by the send().
+      * @return true if processed; false if not.
+      */
+     boolean processTimeout(long agentId, long seq);
 -  
++
+ }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/30479293/core/src/com/cloud/agent/api/DeleteSnapshotBackupCommand.java
----------------------------------------------------------------------
diff --cc core/src/com/cloud/agent/api/DeleteSnapshotBackupCommand.java
index 0000000,128df84..c4f20ea
mode 000000,100644..100644
--- a/core/src/com/cloud/agent/api/DeleteSnapshotBackupCommand.java
+++ b/core/src/com/cloud/agent/api/DeleteSnapshotBackupCommand.java
@@@ -1,0 -1,96 +1,85 @@@
+ // Licensed to the Apache Software Foundation (ASF) under one
+ // or more contributor license agreements.  See the NOTICE file
+ // distributed with this work for additional information
+ // regarding copyright ownership.  The ASF licenses this file
+ // to you under the Apache License, Version 2.0 (the
+ // "License"); you may not use this file except in compliance
+ // with the License.  You may obtain a copy of the License at
+ //
+ //   http://www.apache.org/licenses/LICENSE-2.0
+ //
+ // Unless required by applicable law or agreed to in writing,
+ // software distributed under the License is distributed on an
+ // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ // KIND, either express or implied.  See the License for the
+ // specific language governing permissions and limitations
+ // under the License.
+ package com.cloud.agent.api;
+ 
+ import com.cloud.agent.api.LogLevel.Log4jLevel;
++import com.cloud.agent.api.to.DataStoreTO;
+ import com.cloud.agent.api.to.S3TO;
+ import com.cloud.agent.api.to.SwiftTO;
+ import com.cloud.storage.StoragePool;
+ 
+ /**
+  * This command encapsulates a primitive operation which enables coalescing the backed up VHD snapshots on the secondary server
+  * This currently assumes that the secondary storage are mounted on the XenServer.
+  */
+ public class DeleteSnapshotBackupCommand extends SnapshotCommand {
+     @LogLevel(Log4jLevel.Off)
 -    private SwiftTO swift;
 -    private S3TO s3;
++    private DataStoreTO store;
+     private Boolean all;
+ 
 -    public SwiftTO getSwift() {
 -        return swift;
 -    }
 -
+     public Boolean isAll() {
+         return all;
+     }
+ 
+     public void setAll(Boolean all) {
+         this.all = all;
+     }
+ 
 -    public void setSwift(SwiftTO swift) {
 -        this.swift = swift;
 -    }
 -
 -    public S3TO getS3() {
 -        return s3;
++    public DataStoreTO getDataStore(){
++        return store;
+     }
+ 
+     protected DeleteSnapshotBackupCommand() {
+     }
+ 
+     /**
+      * Given 2 VHD files on the secondary storage which are linked in a parent chain as follows:
+      * backupUUID = parent(childUUID)
+      * It gets another VHD
+      * previousBackupVHD = parent(backupUUID)
+      *
+      * And
+      * 1) it coalesces backupUuid into its parent.
+      * 2) It deletes the VHD file corresponding to backupUuid
+      * 3) It sets the parent VHD of childUUID to that of previousBackupUuid
+      *
+      * It takes care of the cases when
+      * 1) childUUID is null. - Step 3 is not done.
+      * 2) previousBackupUUID is null
+      *       - Merge childUUID into its parent backupUUID
+      *       - Set the UUID of the resultant VHD to childUUID
+      *       - Essentially we are deleting the oldest VHD file and setting the current oldest VHD to childUUID
+      *
+      * @param volumeName                  The name of the volume whose snapshot was taken (something like i-3-SV-ROOT)
+      * @param secondaryStoragePoolURL    This is what shows up in the UI when you click on Secondary storage.
+      *                                    In the code, it is present as: In the vmops.host_details table, there is a field mount.parent. This is the value of that field
+      *                                    If you have better ideas on how to get it, you are welcome.
+      * @param backupUUID                  The VHD which has to be deleted
+      * @param childUUID                   The child VHD file of the backup whose parent is reset to its grandparent.
+      */
 -    public DeleteSnapshotBackupCommand(StoragePool pool,
 -                                       SwiftTO swift,
 -                                       S3TO s3,
++    public DeleteSnapshotBackupCommand(DataStoreTO store,
+                                        String secondaryStoragePoolURL,
+                                        Long   dcId,
+                                        Long   accountId,
+                                        Long   volumeId,
+  String backupUUID, Boolean all)
+     {
 -        super(pool, secondaryStoragePoolURL, backupUUID, null, dcId, accountId, volumeId);
 -        setSwift(swift);
 -        this.s3 = s3;
++        super(null, secondaryStoragePoolURL, backupUUID, null, dcId, accountId, volumeId);
++        this.store = store;
+         setAll(all);
+     }
+ }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/30479293/core/src/com/cloud/agent/api/ModifyStoragePoolAnswer.java
----------------------------------------------------------------------
diff --cc core/src/com/cloud/agent/api/ModifyStoragePoolAnswer.java
index 0000000,df77985..ed7043a
mode 000000,100644..100644
--- a/core/src/com/cloud/agent/api/ModifyStoragePoolAnswer.java
+++ b/core/src/com/cloud/agent/api/ModifyStoragePoolAnswer.java
@@@ -1,0 -1,57 +1,57 @@@
+ // Licensed to the Apache Software Foundation (ASF) under one
+ // or more contributor license agreements.  See the NOTICE file
+ // distributed with this work for additional information
+ // regarding copyright ownership.  The ASF licenses this file
+ // to you under the Apache License, Version 2.0 (the
+ // "License"); you may not use this file except in compliance
+ // with the License.  You may obtain a copy of the License at
+ //
+ //   http://www.apache.org/licenses/LICENSE-2.0
+ //
+ // Unless required by applicable law or agreed to in writing,
+ // software distributed under the License is distributed on an
+ // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ // KIND, either express or implied.  See the License for the
+ // specific language governing permissions and limitations
+ // under the License.
+ package com.cloud.agent.api;
+ 
+ import java.util.Map;
+ 
 -import com.cloud.storage.template.TemplateInfo;
++import com.cloud.storage.template.TemplateProp;
+ 
+ public class ModifyStoragePoolAnswer extends Answer {
+     StoragePoolInfo poolInfo;
 -    Map<String, TemplateInfo> templateInfo;
++    Map<String, TemplateProp> templateInfo;
+ 
+     protected ModifyStoragePoolAnswer() {
+     }
+ 
 -    public ModifyStoragePoolAnswer(ModifyStoragePoolCommand cmd, long capacityBytes, long availableBytes, Map<String, TemplateInfo> tInfo) {
++    public ModifyStoragePoolAnswer(ModifyStoragePoolCommand cmd, long capacityBytes, long availableBytes, Map<String, TemplateProp> tInfo) {
+         super(cmd);
+         this.result = true;
+         this.poolInfo = new StoragePoolInfo(null,
+                 cmd.getPool().getHost(), cmd.getPool().getPath(), cmd.getLocalPath(),
+                 cmd.getPool().getType(), capacityBytes, availableBytes );
+ 
+         this.templateInfo = tInfo;
+     }
+ 
+     public StoragePoolInfo getPoolInfo() {
+        return poolInfo;
+     }
+ 
+     public void setPoolInfo(StoragePoolInfo poolInfo) {
+         this.poolInfo = poolInfo;
+     }
+ 
+ 
 -    public Map<String, TemplateInfo> getTemplateInfo() {
++    public Map<String, TemplateProp> getTemplateInfo() {
+         return templateInfo;
+     }
+ 
 -    public void setTemplateInfo(Map<String, TemplateInfo> templateInfo) {
++    public void setTemplateInfo(Map<String, TemplateProp> templateInfo) {
+         this.templateInfo = templateInfo;
+     }
+ 
+ }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/30479293/core/src/com/cloud/agent/api/SecStorageSetupCommand.java
----------------------------------------------------------------------
diff --cc core/src/com/cloud/agent/api/SecStorageSetupCommand.java
index 0000000,50c06cf..b1f3234
mode 000000,100644..100644
--- a/core/src/com/cloud/agent/api/SecStorageSetupCommand.java
+++ b/core/src/com/cloud/agent/api/SecStorageSetupCommand.java
@@@ -1,0 -1,83 +1,96 @@@
+ // Licensed to the Apache Software Foundation (ASF) under one
+ // or more contributor license agreements.  See the NOTICE file
+ // distributed with this work for additional information
+ // regarding copyright ownership.  The ASF licenses this file
+ // to you under the Apache License, Version 2.0 (the
+ // "License"); you may not use this file except in compliance
+ // with the License.  You may obtain a copy of the License at
+ //
+ //   http://www.apache.org/licenses/LICENSE-2.0
+ //
+ // Unless required by applicable law or agreed to in writing,
+ // software distributed under the License is distributed on an
+ // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ // KIND, either express or implied.  See the License for the
+ // specific language governing permissions and limitations
+ // under the License.
+ package com.cloud.agent.api;
+ 
+ import com.cloud.agent.api.LogLevel.Log4jLevel;
++import com.cloud.agent.api.to.DataStoreTO;
+ 
+ public class SecStorageSetupCommand extends Command {
++    private DataStoreTO store;
+ 	private String secUrl;
+ 	private Certificates certs;
+ 
+ 	public static class Certificates {
+ 	    @LogLevel(Log4jLevel.Off)
+ 		private String privKey;
+ 	    @LogLevel(Log4jLevel.Off)
+ 		private String privCert;
+ 	    @LogLevel(Log4jLevel.Off)
+ 		private String certChain;
+ 
+ 	    public Certificates() {
+ 
+ 	    }
+ 
+ 	    public Certificates(String prvKey, String privCert, String certChain) {
+ 	    	this.privKey = prvKey;
+ 	    	this.privCert = privCert;
+ 	    	this.certChain = certChain;
+ 	    }
+ 
+ 	    public String getPrivKey() {
+ 	    	return this.privKey;
+ 	    }
+ 
+ 	    public String getPrivCert() {
+ 	    	return this.privCert;
+ 	    }
+ 
+ 	    public String getCertChain() {
+ 	    	return this.certChain;
+ 	    }
+ 	}
+ 
+ 	public SecStorageSetupCommand() {
+ 		super();
+ 	}
+ 
 -	public SecStorageSetupCommand(String secUrl, Certificates certs) {
++	public SecStorageSetupCommand(DataStoreTO store, String secUrl, Certificates certs) {
+ 		super();
+ 		this.secUrl = secUrl;
+ 		this.certs = certs;
++		this.store = store;
+ 	}
+ 
+ 	@Override
+ 	public boolean executeInSequence() {
+ 		return true;
+ 	}
+ 
+     public String getSecUrl() {
+         return secUrl;
+     }
+ 
+     public Certificates getCerts() {
+     	return this.certs;
+     }
+ 
+     public void setSecUrl(String secUrl) {
+         this.secUrl = secUrl;
+ 
+     }
++
++    public DataStoreTO getDataStore() {
++        return store;
++    }
++
++    public void setDataStore(DataStoreTO store) {
++        this.store = store;
++    }
++
++
+ }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/30479293/core/src/com/cloud/agent/api/StartupStorageCommand.java
----------------------------------------------------------------------
diff --cc core/src/com/cloud/agent/api/StartupStorageCommand.java
index 0000000,3c3b058..52ed3ff
mode 000000,100755..100755
--- a/core/src/com/cloud/agent/api/StartupStorageCommand.java
+++ b/core/src/com/cloud/agent/api/StartupStorageCommand.java
@@@ -1,0 -1,110 +1,110 @@@
+ // Licensed to the Apache Software Foundation (ASF) under one
+ // or more contributor license agreements.  See the NOTICE file
+ // distributed with this work for additional information
+ // regarding copyright ownership.  The ASF licenses this file
+ // to you under the Apache License, Version 2.0 (the
+ // "License"); you may not use this file except in compliance
+ // with the License.  You may obtain a copy of the License at
+ //
+ //   http://www.apache.org/licenses/LICENSE-2.0
+ //
+ // Unless required by applicable law or agreed to in writing,
+ // software distributed under the License is distributed on an
+ // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ // KIND, either express or implied.  See the License for the
+ // specific language governing permissions and limitations
+ // under the License.
+ package com.cloud.agent.api;
+ 
+ import java.util.HashMap;
+ import java.util.Map;
+ 
+ import com.cloud.host.Host;
+ import com.cloud.storage.Storage;
+ import com.cloud.storage.Storage.StoragePoolType;
 -import com.cloud.storage.template.TemplateInfo;
++import com.cloud.storage.template.TemplateProp;
+ 
+ 
+ public class StartupStorageCommand extends StartupCommand {
+ 
+ 	String parent;
 -    Map<String, TemplateInfo> templateInfo;
++    Map<String, TemplateProp> templateInfo;
+     long totalSize;
+     StoragePoolInfo poolInfo;
+     Storage.StorageResourceType resourceType;
+     StoragePoolType fsType;
+     Map<String, String> hostDetails = new HashMap<String, String>();
+     String nfsShare;
+ 
+     public StartupStorageCommand() {
+         super(Host.Type.Storage);
+     }
+ 
 -    public StartupStorageCommand(String parent, StoragePoolType fsType, long totalSize, Map<String, TemplateInfo> info) {
++    public StartupStorageCommand(String parent, StoragePoolType fsType, long totalSize, Map<String, TemplateProp> info) {
+         super(Host.Type.Storage);
+         this.parent = parent;
+         this.totalSize = totalSize;
+         this.templateInfo = info;
+         this.poolInfo = null;
+         this.fsType = fsType;
+     }
+ 
+ 
 -    public StartupStorageCommand(String parent, StoragePoolType fsType, Map<String, TemplateInfo> templateInfo, StoragePoolInfo poolInfo) {
++    public StartupStorageCommand(String parent, StoragePoolType fsType, Map<String, TemplateProp> templateInfo, StoragePoolInfo poolInfo) {
+ 		super(Host.Type.Storage);
+ 		this.parent = parent;
+ 		this.templateInfo = templateInfo;
+ 		this.totalSize = poolInfo.capacityBytes;
+ 		this.poolInfo = poolInfo;
+ 		this.fsType = fsType;
+ 	}
+ 
+ 	public String getParent() {
+         return parent;
+     }
+ 
+ 	public void setParent(String parent) {
+         this.parent = parent;
+     }
+ 
+     public void setNfsShare(String nfsShare) {
+ 	    this.nfsShare = nfsShare;
+ 	}
+ 
+ 	public String getNfsShare() {
+ 	    return nfsShare;
+ 	}
+ 
+     public long getTotalSize() {
+         return totalSize;
+     }
+ 
 -	public Map<String, TemplateInfo> getTemplateInfo() {
++	public Map<String, TemplateProp> getTemplateInfo() {
+ 		return templateInfo;
+ 	}
+ 
 -	public void setTemplateInfo(Map<String, TemplateInfo> templateInfo) {
++	public void setTemplateInfo(Map<String, TemplateProp> templateInfo) {
+ 		this.templateInfo = templateInfo;
+ 	}
+ 
+ 	public StoragePoolInfo getPoolInfo() {
+ 		return poolInfo;
+ 	}
+ 
+ 	public void setPoolInfo(StoragePoolInfo poolInfo) {
+ 		this.poolInfo = poolInfo;
+ 	}
+ 
+ 	public Storage.StorageResourceType getResourceType() {
+ 		return resourceType;
+ 	}
+ 
+ 	public void setResourceType(Storage.StorageResourceType resourceType) {
+ 		this.resourceType = resourceType;
+ 	}
+ 
+ 	/*For secondary storage*/
+ 	public Map<String, String> getHostDetails() {
+ 		return hostDetails;
+ 	}
+ }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/30479293/core/src/com/cloud/agent/api/storage/AbstractDownloadCommand.java
----------------------------------------------------------------------
diff --cc core/src/com/cloud/agent/api/storage/AbstractDownloadCommand.java
index 0000000,04b3d43..248a419
mode 000000,100644..100644
--- a/core/src/com/cloud/agent/api/storage/AbstractDownloadCommand.java
+++ b/core/src/com/cloud/agent/api/storage/AbstractDownloadCommand.java
@@@ -1,0 -1,78 +1,78 @@@
+ // Licensed to the Apache Software Foundation (ASF) under one
+ // or more contributor license agreements.  See the NOTICE file
+ // distributed with this work for additional information
+ // regarding copyright ownership.  The ASF licenses this file
+ // to you under the Apache License, Version 2.0 (the
+ // "License"); you may not use this file except in compliance
+ // with the License.  You may obtain a copy of the License at
+ //
+ //   http://www.apache.org/licenses/LICENSE-2.0
+ //
+ // Unless required by applicable law or agreed to in writing,
+ // software distributed under the License is distributed on an
+ // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ // KIND, either express or implied.  See the License for the
+ // specific language governing permissions and limitations
+ // under the License.
+ package com.cloud.agent.api.storage;
+ 
+ import com.cloud.storage.Storage.ImageFormat;
+ 
+ public abstract class AbstractDownloadCommand extends ssCommand {
+ 
+     private String url;
+     private ImageFormat format;
+     private long accountId;
+     private String name;
+ 
+     protected AbstractDownloadCommand() {
+     }
+ 
 -    protected AbstractDownloadCommand(String name, String url, ImageFormat format, long accountId) {
++    protected AbstractDownloadCommand(String name, String url, ImageFormat format, Long accountId) {
+     	assert(url != null);
+     	url = url.replace('\\', '/');
+ 
+         this.url = url;
+         this.format = format;
+         this.accountId = accountId;
+         this.name = name;
+     }
+ 
+     protected AbstractDownloadCommand(AbstractDownloadCommand that) {
+         super(that);
+         assert(that.url != null);
+ 
+         this.url = that.url.replace('\\', '/');
+         this.format = that.format;
+         this.accountId = that.accountId;
+         this.name = that.name;
+     }
+ 
+     public String getUrl() {
+         return url;
+     }
+ 
+     public String getName() {
+         return name;
+     }
+ 
+     public ImageFormat getFormat() {
+         return format;
+     }
+ 
+     public long getAccountId() {
+         return accountId;
+     }
+ 
+     @Override
+     public boolean executeInSequence() {
+         return true;
+     }
+ 
+ 	public void setUrl(String url) {
+ 		assert(url != null);
+ 		url = url.replace('\\', '/');
+ 		this.url = url;
+ 	}
+ 
+ }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/30479293/core/src/com/cloud/agent/api/storage/DeleteTemplateCommand.java
----------------------------------------------------------------------
diff --cc core/src/com/cloud/agent/api/storage/DeleteTemplateCommand.java
index 0000000,69f465c..f72657c
mode 000000,100644..100644
--- a/core/src/com/cloud/agent/api/storage/DeleteTemplateCommand.java
+++ b/core/src/com/cloud/agent/api/storage/DeleteTemplateCommand.java
@@@ -1,0 -1,40 +1,62 @@@
+ // Licensed to the Apache Software Foundation (ASF) under one
+ // or more contributor license agreements.  See the NOTICE file
+ // distributed with this work for additional information
+ // regarding copyright ownership.  The ASF licenses this file
+ // to you under the Apache License, Version 2.0 (the
+ // "License"); you may not use this file except in compliance
+ // with the License.  You may obtain a copy of the License at
+ //
+ //   http://www.apache.org/licenses/LICENSE-2.0
+ //
+ // Unless required by applicable law or agreed to in writing,
+ // software distributed under the License is distributed on an
+ // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ // KIND, either express or implied.  See the License for the
+ // specific language governing permissions and limitations
+ // under the License.
+ package com.cloud.agent.api.storage;
+ 
++import com.cloud.agent.api.to.DataStoreTO;
++
+ 
+ public class DeleteTemplateCommand extends ssCommand {
++    private DataStoreTO store;
+ 	private String templatePath;
++	private Long templateId;
++	private Long accountId;
+ 
+ 
+ 	public DeleteTemplateCommand() {
+ 	}
+ 
 -	public DeleteTemplateCommand(String secUrl, String templatePath) {
 -	    this.setSecUrl(secUrl);
++
++	public DeleteTemplateCommand(DataStoreTO store, String templatePath, Long templateId, Long accountId) {
+     	this.templatePath = templatePath;
++    	this.templateId = templateId;
++    	this.accountId = accountId;
++    	this.store = store;
+     }
+ 
+ 	@Override
+     public boolean executeInSequence() {
+         return true;
+     }
+ 
+ 	public String getTemplatePath() {
+ 		return templatePath;
+ 	}
++
++    public Long getTemplateId() {
++        return templateId;
++    }
++
++    public Long getAccountId() {
++        return accountId;
++    }
++
++    public DataStoreTO getDataStore() {
++        return store;
++    }
++
++
+ }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/30479293/core/src/com/cloud/agent/api/storage/DeleteVolumeCommand.java
----------------------------------------------------------------------
diff --cc core/src/com/cloud/agent/api/storage/DeleteVolumeCommand.java
index 0000000,949af01..49f0a21
mode 000000,100755..100755
--- a/core/src/com/cloud/agent/api/storage/DeleteVolumeCommand.java
+++ b/core/src/com/cloud/agent/api/storage/DeleteVolumeCommand.java
@@@ -1,0 -1,38 +1,54 @@@
+ // Licensed to the Apache Software Foundation (ASF) under one
+ // or more contributor license agreements.  See the NOTICE file
+ // distributed with this work for additional information
+ // regarding copyright ownership.  The ASF licenses this file
+ // to you under the Apache License, Version 2.0 (the
+ // "License"); you may not use this file except in compliance
+ // with the License.  You may obtain a copy of the License at
+ //
+ //   http://www.apache.org/licenses/LICENSE-2.0
+ //
+ // Unless required by applicable law or agreed to in writing,
+ // software distributed under the License is distributed on an
+ // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ // KIND, either express or implied.  See the License for the
+ // specific language governing permissions and limitations
+ // under the License.
+ package com.cloud.agent.api.storage;
+ 
++import com.cloud.agent.api.to.DataStoreTO;
++
+ public class DeleteVolumeCommand extends ssCommand {
++    private DataStoreTO store;
+ 	private String volumePath;
++	private Long volumeId;
+ 
+ 	public DeleteVolumeCommand() {
+ 	}
+ 
 -	public DeleteVolumeCommand(String secUrl, String volumePath) {
 -	    this.setSecUrl(secUrl);
++	public DeleteVolumeCommand(DataStoreTO store, Long volumeId, String volumePath) {
++	    this.store = store;
++	    this.volumeId = volumeId;
+     	this.volumePath = volumePath;
+     }
+ 
+ 	@Override
+     public boolean executeInSequence() {
+         return true;
+     }
+ 
+ 	public String getVolumePath() {
+ 		return volumePath;
+ 	}
++
++    public DataStoreTO getDataStore() {
++        return store;
++    }
++
++    public Long getVolumeId() {
++        return volumeId;
++    }
++
++
++
+ }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/30479293/core/src/com/cloud/agent/api/storage/ListTemplateAnswer.java
----------------------------------------------------------------------
diff --cc core/src/com/cloud/agent/api/storage/ListTemplateAnswer.java
index 0000000,a4e2e25..4155a63
mode 000000,100644..100644
--- a/core/src/com/cloud/agent/api/storage/ListTemplateAnswer.java
+++ b/core/src/com/cloud/agent/api/storage/ListTemplateAnswer.java
@@@ -1,0 -1,53 +1,53 @@@
+ // Licensed to the Apache Software Foundation (ASF) under one
+ // or more contributor license agreements.  See the NOTICE file
+ // distributed with this work for additional information
+ // regarding copyright ownership.  The ASF licenses this file
+ // to you under the Apache License, Version 2.0 (the
+ // "License"); you may not use this file except in compliance
+ // with the License.  You may obtain a copy of the License at
+ //
+ //   http://www.apache.org/licenses/LICENSE-2.0
+ //
+ // Unless required by applicable law or agreed to in writing,
+ // software distributed under the License is distributed on an
+ // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ // KIND, either express or implied.  See the License for the
+ // specific language governing permissions and limitations
+ // under the License.
+ package com.cloud.agent.api.storage;
+ 
+ import java.util.Map;
+ 
+ import com.cloud.agent.api.Answer;
 -import com.cloud.storage.template.TemplateInfo;
++import com.cloud.storage.template.TemplateProp;
+ 
+ public class ListTemplateAnswer extends Answer  {
+     private String secUrl;
 -    private Map<String, TemplateInfo> templateInfos;
++    private Map<String, TemplateProp> templateInfos;
+ 
+ 	public ListTemplateAnswer() {
+ 
+ 	}
+ 
 -	public ListTemplateAnswer(String secUrl, Map<String, TemplateInfo> templateInfos) {
++	public ListTemplateAnswer(String secUrl, Map<String, TemplateProp> templateInfos) {
+ 	    super(null, true, "success");
+ 	    this.setSecUrl(secUrl);
+ 	    this.templateInfos = templateInfos;
+ 	}
+ 
 -	public Map<String, TemplateInfo> getTemplateInfo() {
++	public Map<String, TemplateProp> getTemplateInfo() {
+ 	    return templateInfos;
+ 	}
+ 
 -	public void setTemplateInfo(Map<String, TemplateInfo> templateInfos) {
++	public void setTemplateInfo(Map<String, TemplateProp> templateInfos) {
+ 	    this.templateInfos = templateInfos;
+ 	}
+ 
+     public void setSecUrl(String secUrl) {
+         this.secUrl = secUrl;
+     }
+ 
+     public String getSecUrl() {
+         return secUrl;
+     }
+ }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/30479293/core/src/com/cloud/agent/api/storage/ListTemplateCommand.java
----------------------------------------------------------------------
diff --cc core/src/com/cloud/agent/api/storage/ListTemplateCommand.java
index 0000000,da25ed5..e5339f2
mode 000000,100644..100644
--- a/core/src/com/cloud/agent/api/storage/ListTemplateCommand.java
+++ b/core/src/com/cloud/agent/api/storage/ListTemplateCommand.java
@@@ -1,0 -1,54 +1,47 @@@
+ // Licensed to the Apache Software Foundation (ASF) under one
+ // or more contributor license agreements.  See the NOTICE file
+ // distributed with this work for additional information
+ // regarding copyright ownership.  The ASF licenses this file
+ // to you under the Apache License, Version 2.0 (the
+ // "License"); you may not use this file except in compliance
+ // with the License.  You may obtain a copy of the License at
+ //
+ //   http://www.apache.org/licenses/LICENSE-2.0
+ //
+ // Unless required by applicable law or agreed to in writing,
+ // software distributed under the License is distributed on an
+ // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ // KIND, either express or implied.  See the License for the
+ // specific language governing permissions and limitations
+ // under the License.
+ package com.cloud.agent.api.storage;
+ 
 -import com.cloud.agent.api.LogLevel;
 -import com.cloud.agent.api.LogLevel.Log4jLevel;
 -import com.cloud.agent.api.to.SwiftTO;
++import com.cloud.agent.api.to.DataStoreTO;
+ 
+ public class ListTemplateCommand extends StorageCommand {
 -    private String secUrl;
 -    @LogLevel(Log4jLevel.Off)
 -    private SwiftTO swift;
++    private DataStoreTO store;
++    //private String secUrl;
+ 
+     public ListTemplateCommand() {
+     }
+ 
 -	public ListTemplateCommand(String secUrl) {
 -	    this.secUrl = secUrl;
 -        this.swift = null;
++	public ListTemplateCommand(DataStoreTO store) {
++        this.store = store;
++//        this.secUrl = url;
+ 	}
+ 
 -    public ListTemplateCommand(SwiftTO swift) {
 -        this.secUrl = null;
 -        this.swift = swift;
 -    }
 -
+     @Override
+     public boolean executeInSequence() {
+         return true;
+     }
+ 
 -    public String getSecUrl() {
 -        return secUrl;
 -    }
+ 
 -    public SwiftTO getSwift() {
 -        return swift;
++    public DataStoreTO getDataStore() {
++        return store;
+     }
+ 
++ //   public String getSecUrl() {
++ //       return secUrl;
++ //   }
++
+ }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/30479293/core/src/com/cloud/agent/api/storage/ListVolumeAnswer.java
----------------------------------------------------------------------
diff --cc core/src/com/cloud/agent/api/storage/ListVolumeAnswer.java
index 0000000,6bbb2e8..31ea09b
mode 000000,100755..100755
--- a/core/src/com/cloud/agent/api/storage/ListVolumeAnswer.java
+++ b/core/src/com/cloud/agent/api/storage/ListVolumeAnswer.java
@@@ -1,0 -1,53 +1,53 @@@
+ // Licensed to the Apache Software Foundation (ASF) under one
+ // or more contributor license agreements.  See the NOTICE file
+ // distributed with this work for additional information
+ // regarding copyright ownership.  The ASF licenses this file
+ // to you under the Apache License, Version 2.0 (the
+ // "License"); you may not use this file except in compliance
+ // with the License.  You may obtain a copy of the License at
+ //
+ //   http://www.apache.org/licenses/LICENSE-2.0
+ //
+ // Unless required by applicable law or agreed to in writing,
+ // software distributed under the License is distributed on an
+ // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ // KIND, either express or implied.  See the License for the
+ // specific language governing permissions and limitations
+ // under the License.
+ package com.cloud.agent.api.storage;
+ 
+ import java.util.Map;
+ 
+ import com.cloud.agent.api.Answer;
 -import com.cloud.storage.template.TemplateInfo;
++import com.cloud.storage.template.TemplateProp;
+ 
+ public class ListVolumeAnswer extends Answer {
+ 	private String secUrl;
 -    private Map<Long, TemplateInfo> templateInfos;
++    private Map<Long, TemplateProp> templateInfos;
+ 
+ 	public ListVolumeAnswer() {
+ 
+ 	}
+ 
 -	public ListVolumeAnswer(String secUrl, Map<Long, TemplateInfo> templateInfos) {
++	public ListVolumeAnswer(String secUrl, Map<Long, TemplateProp> templateInfos) {
+ 	    super(null, true, "success");
+ 	    this.setSecUrl(secUrl);
+ 	    this.templateInfos = templateInfos;
+ 	}
+ 
 -	public Map<Long, TemplateInfo> getTemplateInfo() {
++	public Map<Long, TemplateProp> getTemplateInfo() {
+ 	    return templateInfos;
+ 	}
+ 
 -	public void setTemplateInfo(Map<Long, TemplateInfo> templateInfos) {
++	public void setTemplateInfo(Map<Long, TemplateProp> templateInfos) {
+ 	    this.templateInfos = templateInfos;
+ 	}
+ 
+     public void setSecUrl(String secUrl) {
+         this.secUrl = secUrl;
+     }
+ 
+     public String getSecUrl() {
+         return secUrl;
+     }
+ }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/30479293/core/src/com/cloud/agent/api/storage/ListVolumeCommand.java
----------------------------------------------------------------------
diff --cc core/src/com/cloud/agent/api/storage/ListVolumeCommand.java
index 0000000,63c5b62..0de44de
mode 000000,100755..100755
--- a/core/src/com/cloud/agent/api/storage/ListVolumeCommand.java
+++ b/core/src/com/cloud/agent/api/storage/ListVolumeCommand.java
@@@ -1,0 -1,40 +1,47 @@@
+ // Licensed to the Apache Software Foundation (ASF) under one
+ // or more contributor license agreements.  See the NOTICE file
+ // distributed with this work for additional information
+ // regarding copyright ownership.  The ASF licenses this file
+ // to you under the Apache License, Version 2.0 (the
+ // "License"); you may not use this file except in compliance
+ // with the License.  You may obtain a copy of the License at
+ //
+ //   http://www.apache.org/licenses/LICENSE-2.0
+ //
+ // Unless required by applicable law or agreed to in writing,
+ // software distributed under the License is distributed on an
+ // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ // KIND, either express or implied.  See the License for the
+ // specific language governing permissions and limitations
+ // under the License.
+ package com.cloud.agent.api.storage;
+ 
++import com.cloud.agent.api.to.DataStoreTO;
++
+ 
+ public class ListVolumeCommand extends StorageCommand {
+ 
++    private DataStoreTO store;
+     private String secUrl;
+ 
+     public ListVolumeCommand() {
+     }
+ 
 -	public ListVolumeCommand(String secUrl) {
++	public ListVolumeCommand(DataStoreTO store, String secUrl) {
++	    this.store = store;
+ 	    this.secUrl = secUrl;
+ 	}
+ 
+     @Override
+     public boolean executeInSequence() {
+         return true;
+     }
+ 
+     public String getSecUrl() {
+         return secUrl;
+     }
+ 
++    public DataStoreTO getDataStore() {
++        return store;
++    }
+ }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/30479293/core/src/com/cloud/agent/api/storage/PrimaryStorageDownloadCommand.java
----------------------------------------------------------------------
diff --cc core/src/com/cloud/agent/api/storage/PrimaryStorageDownloadCommand.java
index 0000000,8d955bb..b0d0fdf
mode 000000,100644..100644
--- a/core/src/com/cloud/agent/api/storage/PrimaryStorageDownloadCommand.java
+++ b/core/src/com/cloud/agent/api/storage/PrimaryStorageDownloadCommand.java
@@@ -1,0 -1,87 +1,96 @@@
+ // Licensed to the Apache Software Foundation (ASF) under one
+ // or more contributor license agreements.  See the NOTICE file
+ // distributed with this work for additional information
+ // regarding copyright ownership.  The ASF licenses this file
+ // to you under the Apache License, Version 2.0 (the
+ // "License"); you may not use this file except in compliance
+ // with the License.  You may obtain a copy of the License at
+ //
+ //   http://www.apache.org/licenses/LICENSE-2.0
+ //
+ // Unless required by applicable law or agreed to in writing,
+ // software distributed under the License is distributed on an
+ // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ // KIND, either express or implied.  See the License for the
+ // specific language governing permissions and limitations
+ // under the License.
+ package com.cloud.agent.api.storage;
+ 
+ import com.cloud.agent.api.to.StorageFilerTO;
+ import com.cloud.storage.Storage.ImageFormat;
+ import com.cloud.storage.StoragePool;
+ 
+ /**
+  *
+  */
+ public class PrimaryStorageDownloadCommand extends AbstractDownloadCommand {
+ 	String localPath;
+ 	String poolUuid;
+ 	long poolId;
+ 
+     StorageFilerTO primaryPool;
+ 
+ 	String secondaryStorageUrl;
+ 	String primaryStorageUrl;
+ 
+     protected PrimaryStorageDownloadCommand() {
++        
+ 	}
++    
++    public PrimaryStorageDownloadCommand(String url, StoragePool pool, int wait) {
++        super(null, url, null, null);
++        this.poolId = pool.getId();
++        this.poolUuid = pool.getUuid();
++        this.primaryPool = new StorageFilerTO(pool);
++        setWait(wait);
++    }
+ 
+     public PrimaryStorageDownloadCommand(String name, String url, ImageFormat format, long accountId, StoragePool pool, int wait) {
+         super(name, url, format, accountId);
+         this.poolId = pool.getId();
+         this.poolUuid = pool.getUuid();
+         this.primaryPool = new StorageFilerTO(pool);
+         setWait(wait);
+     }
+ 
+     public String getPoolUuid() {
+         return poolUuid;
+     }
+ 
+     public long getPoolId() {
+         return poolId;
+     }
+ 
+     public StorageFilerTO getPool() {
+         return primaryPool;
+     }
+     
+     public void setLocalPath(String path) {
+     	this.localPath = path;
+     }
+ 
+     public String getLocalPath() {
+     	return localPath;
+     }
+ 
+     public void setSecondaryStorageUrl(String url) {
+     	secondaryStorageUrl = url;
+     }
+ 
+     public String getSecondaryStorageUrl() {
+     	return secondaryStorageUrl;
+     }
+ 
+     public void setPrimaryStorageUrl(String url) {
+     	primaryStorageUrl = url;
+     }
+ 
+     public String getPrimaryStorageUrl() {
+     	return primaryStorageUrl;
+     }
+ 
+     @Override
+     public boolean executeInSequence() {
+         return true;
+     }
+ }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/30479293/core/src/com/cloud/agent/api/storage/UploadCommand.java
----------------------------------------------------------------------
diff --cc core/src/com/cloud/agent/api/storage/UploadCommand.java
index 0000000,473bd5b..9b893e2
mode 000000,100644..100644
--- a/core/src/com/cloud/agent/api/storage/UploadCommand.java
+++ b/core/src/com/cloud/agent/api/storage/UploadCommand.java
@@@ -1,0 -1,145 +1,144 @@@
+ // Licensed to the Apache Software Foundation (ASF) under one
+ // or more contributor license agreements.  See the NOTICE file
+ // distributed with this work for additional information
+ // regarding copyright ownership.  The ASF licenses this file
+ // to you under the Apache License, Version 2.0 (the
+ // "License"); you may not use this file except in compliance
+ // with the License.  You may obtain a copy of the License at
+ //
+ //   http://www.apache.org/licenses/LICENSE-2.0
+ //
+ // Unless required by applicable law or agreed to in writing,
+ // software distributed under the License is distributed on an
+ // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ // KIND, either express or implied.  See the License for the
+ // specific language governing permissions and limitations
+ // under the License.
+ package com.cloud.agent.api.storage;
+ 
+ import org.apache.cloudstack.api.InternalIdentity;
+ 
 -import com.cloud.agent.api.storage.DownloadCommand.PasswordAuth;
+ import com.cloud.agent.api.to.TemplateTO;
+ import com.cloud.storage.Upload.Type;
+ import com.cloud.template.VirtualMachineTemplate;
+ 
+ 
+ public class UploadCommand extends AbstractUploadCommand implements InternalIdentity {
+ 
+ 	private TemplateTO template;
+ 	private String url;
+ 	private String installPath;
+ 	private boolean hvm;
+ 	private String description;
+ 	private String checksum;
+ 	private PasswordAuth auth;
+ 	private long templateSizeInBytes;
+ 	private long id;
+ 	private Type type;
+ 
+ 	public UploadCommand(VirtualMachineTemplate template, String url, String installPath, long sizeInBytes) {
+ 
+ 		this.template = new TemplateTO(template);
+ 		this.url = url;
+ 		this.installPath = installPath;
+ 		this.checksum = template.getChecksum();
+ 		this.id = template.getId();
+ 		this.templateSizeInBytes = sizeInBytes;
+ 
+ 	}
+ 
+ 	public UploadCommand(String url, long id, long sizeInBytes, String installPath, Type type){
+ 		this.template = null;
+ 		this.url = url;
+ 		this.installPath = installPath;
+ 		this.id = id;
+ 		this.type = type;
+ 		this.templateSizeInBytes = sizeInBytes;
+ 	}
+ 
+ 	protected UploadCommand() {
+ 	}
+ 
+ 	public UploadCommand(UploadCommand that) {
+ 		this.template = that.template;
+ 		this.url = that.url;
+ 		this.installPath = that.installPath;
+ 		this.checksum = that.getChecksum();
+ 		this.id = that.id;
+ 	}
+ 
+ 	public String getDescription() {
+ 		return description;
+ 	}
+ 
+ 
+ 	public TemplateTO getTemplate() {
+ 		return template;
+ 	}
+ 
+ 	public void setTemplate(TemplateTO template) {
+ 		this.template = template;
+ 	}
+ 
+ 	@Override
+     public String getUrl() {
+ 		return url;
+ 	}
+ 
+ 	@Override
+     public void setUrl(String url) {
+ 		this.url = url;
+ 	}
+ 
+ 	public boolean isHvm() {
+ 		return hvm;
+ 	}
+ 
+ 	public void setHvm(boolean hvm) {
+ 		this.hvm = hvm;
+ 	}
+ 
+ 	public PasswordAuth getAuth() {
+ 		return auth;
+ 	}
+ 
+ 	public void setAuth(PasswordAuth auth) {
+ 		this.auth = auth;
+ 	}
+ 
+ 	public Long getTemplateSizeInBytes() {
+ 		return templateSizeInBytes;
+ 	}
+ 
+ 	public void setTemplateSizeInBytes(Long templateSizeInBytes) {
+ 		this.templateSizeInBytes = templateSizeInBytes;
+ 	}
+ 
+ 	public long getId() {
+ 		return id;
+ 	}
+ 
+ 	public void setId(long id) {
+ 		this.id = id;
+ 	}
+ 
+ 	public void setInstallPath(String installPath) {
+ 		this.installPath = installPath;
+ 	}
+ 
+ 	public void setDescription(String description) {
+ 		this.description = description;
+ 	}
+ 
+ 	public void setChecksum(String checksum) {
+ 		this.checksum = checksum;
+ 	}
+ 
+ 	public String getInstallPath() {
+ 		return installPath;
+ 	}
+ 
+ 	public String getChecksum() {
+ 		return checksum;
+ 	}
+ }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/30479293/core/src/org/apache/cloudstack/storage/command/DownloadCommand.java
----------------------------------------------------------------------
diff --cc core/src/org/apache/cloudstack/storage/command/DownloadCommand.java
index 0000000,0000000..7e3d65c
new file mode 100644
--- /dev/null
+++ b/core/src/org/apache/cloudstack/storage/command/DownloadCommand.java
@@@ -1,0 -1,0 +1,184 @@@
++// Licensed to the Apache Software Foundation (ASF) under one
++// or more contributor license agreements.  See the NOTICE file
++// distributed with this work for additional information
++// regarding copyright ownership.  The ASF licenses this file
++// to you under the Apache License, Version 2.0 (the
++// "License"); you may not use this file except in compliance
++// with the License.  You may obtain a copy of the License at
++//
++//   http://www.apache.org/licenses/LICENSE-2.0
++//
++// Unless required by applicable law or agreed to in writing,
++// software distributed under the License is distributed on an
++// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
++// KIND, either express or implied.  See the License for the
++// specific language governing permissions and limitations
++// under the License.
++package org.apache.cloudstack.storage.command;
++
++import org.apache.cloudstack.api.InternalIdentity;
++import org.apache.cloudstack.storage.to.TemplateObjectTO;
++import org.apache.cloudstack.storage.to.VolumeObjectTO;
++
++import com.cloud.agent.api.storage.AbstractDownloadCommand;
++import com.cloud.agent.api.storage.PasswordAuth;
++import com.cloud.agent.api.storage.Proxy;
++import com.cloud.agent.api.to.DataStoreTO;
++import com.cloud.agent.api.to.NfsTO;
++import com.cloud.storage.Storage.ImageFormat;
++import com.cloud.storage.Volume;
++
++
++public class DownloadCommand extends AbstractDownloadCommand implements InternalIdentity {
++
++    public static enum ResourceType {
++        VOLUME, TEMPLATE
++    }
++
++	private boolean hvm;
++	private String description;
++	private String checksum;
++	private PasswordAuth auth;
++	private Proxy _proxy;
++	private Long maxDownloadSizeInBytes = null;
++	private long id;
++	private ResourceType resourceType = ResourceType.TEMPLATE;
++	private String installPath;
++	private DataStoreTO _store;
++
++	protected DownloadCommand() {
++	}
++
++
++	public DownloadCommand(DownloadCommand that) {
++	    super(that);
++	    this.hvm = that.hvm;
++	    this.checksum = that.checksum;
++	    this.id = that.id;
++	    this.description = that.description;
++	    this.auth = that.getAuth();
++	    this.setSecUrl(that.getSecUrl());
++	    this.maxDownloadSizeInBytes = that.getMaxDownloadSizeInBytes();
++	    this.resourceType = that.resourceType;
++	    this.installPath = that.installPath;
++	    this._store = that._store;
++	}
++
++	public DownloadCommand(TemplateObjectTO template, Long maxDownloadSizeInBytes) {
++
++	    super(template.getName(), template.getOrigUrl(), template.getFormat(), template.getAccountId());
++	    this._store = template.getDataStore();
++	    this.installPath = template.getPath();
++	    this.hvm = template.isRequiresHvm();
++	    this.checksum = template.getChecksum();
++	    this.id = template.getId();
++	    this.description = template.getDescription();
++        if (_store instanceof NfsTO) {
++            this.setSecUrl(((NfsTO) _store).getUrl());
++        }
++	    this.maxDownloadSizeInBytes = maxDownloadSizeInBytes;
++	}
++
++	public DownloadCommand(TemplateObjectTO template, String user, String passwd, Long maxDownloadSizeInBytes) {
++	    this(template, maxDownloadSizeInBytes);
++		auth = new PasswordAuth(user, passwd);
++	}
++
++    public DownloadCommand(VolumeObjectTO volume, Long maxDownloadSizeInBytes, String checkSum, String url, ImageFormat format) {
++        super(volume.getName(), url, format, volume.getAccountId());
++        this.checksum = checkSum;
++        this.id = volume.getVolumeId();
++        this.installPath = volume.getPath();
++        this._store = volume.getDataStore();
++        this.maxDownloadSizeInBytes = maxDownloadSizeInBytes;
++        this.resourceType = ResourceType.VOLUME;
++    }
++	@Override
++    public long getId() {
++	    return id;
++	}
++
++	public void setHvm(boolean hvm) {
++		this.hvm = hvm;
++	}
++
++	public boolean isHvm() {
++		return hvm;
++	}
++
++	public String getDescription() {
++		return description;
++	}
++
++	public String getChecksum() {
++		return checksum;
++	}
++
++    public void setDescription(String description) {
++		this.description = description;
++	}
++
++	public void setChecksum(String checksum) {
++		this.checksum = checksum;
++	}
++
++    @Override
++    public boolean executeInSequence() {
++        return false;
++    }
++
++
++	public PasswordAuth getAuth() {
++		return auth;
++	}
++
++	public void setCreds(String userName, String passwd) {
++		auth = new PasswordAuth(userName, passwd);
++	}
++
++	public Proxy getProxy() {
++		return _proxy;
++	}
++
++	public void setProxy(Proxy proxy) {
++		_proxy = proxy;
++	}
++
++	public Long getMaxDownloadSizeInBytes() {
++		return maxDownloadSizeInBytes;
++	}
++
++
++	public ResourceType getResourceType() {
++		return resourceType;
++	}
++
++
++	public void setResourceType(ResourceType resourceType) {
++		this.resourceType = resourceType;
++	}
++
++
++    public DataStoreTO getDataStore() {
++        return _store;
++    }
++
++
++    public void setDataStore(DataStoreTO _store) {
++        this._store = _store;
++    }
++
++
++    public String getInstallPath() {
++        return installPath;
++    }
++
++
++    public void setInstallPath(String installPath) {
++        this.installPath = installPath;
++    }
++
++
++
++
++}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/30479293/core/src/org/apache/cloudstack/storage/command/DownloadProgressCommand.java
----------------------------------------------------------------------
diff --cc core/src/org/apache/cloudstack/storage/command/DownloadProgressCommand.java
index 0000000,0000000..72ca901
new file mode 100644
--- /dev/null
+++ b/core/src/org/apache/cloudstack/storage/command/DownloadProgressCommand.java
@@@ -1,0 -1,0 +1,49 @@@
++// Licensed to the Apache Software Foundation (ASF) under one
++// or more contributor license agreements.  See the NOTICE file
++// distributed with this work for additional information
++// regarding copyright ownership.  The ASF licenses this file
++// to you under the Apache License, Version 2.0 (the
++// "License"); you may not use this file except in compliance
++// with the License.  You may obtain a copy of the License at
++//
++//   http://www.apache.org/licenses/LICENSE-2.0
++//
++// Unless required by applicable law or agreed to in writing,
++// software distributed under the License is distributed on an
++// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
++// KIND, either express or implied.  See the License for the
++// specific language governing permissions and limitations
++// under the License.
++package org.apache.cloudstack.storage.command;
++
++
++
++
++public class DownloadProgressCommand extends DownloadCommand {
++	public static enum RequestType {GET_STATUS, ABORT, RESTART, PURGE, GET_OR_RESTART}
++	private String jobId;
++	private RequestType request;
++
++	protected DownloadProgressCommand() {
++		super();
++	}
++
++	public DownloadProgressCommand(DownloadCommand cmd, String jobId, RequestType req) {
++	    super(cmd);
++
++		this.jobId = jobId;
++		this.setRequest(req);
++	}
++
++	public String getJobId() {
++		return jobId;
++	}
++
++	public void setRequest(RequestType request) {
++		this.request = request;
++	}
++
++	public RequestType getRequest() {
++		return request;
++	}
++}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/30479293/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataMotionService.java
----------------------------------------------------------------------
diff --cc engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataMotionService.java
index adeeecb,0000000..40d6814
mode 100644,000000..100644
--- a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataMotionService.java
+++ b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataMotionService.java
@@@ -1,26 -1,0 +1,36 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *   http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.cloudstack.engine.subsystem.api.storage;
 +
++
++import java.util.Map;
++
 +import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
 +
++import com.cloud.agent.api.to.VirtualMachineTO;
++import com.cloud.host.Host;
++
 +public interface DataMotionService {
 +    public void copyAsync(DataObject srcData, DataObject destData,
 +            AsyncCompletionCallback<CopyCommandResult> callback);
++
++    public void copyAsync(Map<VolumeInfo, DataStore> volumeMap, VirtualMachineTO vmTo,
++            Host srcHost, Host destHost, AsyncCompletionCallback<CopyCommandResult> callback);
++
 +}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/30479293/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataMotionStrategy.java
----------------------------------------------------------------------
diff --cc engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataMotionStrategy.java
index e2cc2a0,0000000..d2d35b7
mode 100644,000000..100644
--- a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataMotionStrategy.java
+++ b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataMotionStrategy.java
@@@ -1,28 -1,0 +1,41 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *   http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.cloudstack.engine.subsystem.api.storage;
 +
++
++import java.util.Map;
++
 +import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
 +
++import com.cloud.agent.api.to.VirtualMachineTO;
++import com.cloud.host.Host;
++
++
 +public interface DataMotionStrategy {
 +    public boolean canHandle(DataObject srcData, DataObject destData);
 +
++    public boolean canHandle(Map<VolumeInfo, DataStore> volumeMap, Host srcHost, Host destHost);
++
 +    public Void copyAsync(DataObject srcData, DataObject destData,
 +            AsyncCompletionCallback<CopyCommandResult> callback);
++
++    public Void copyAsync(Map<VolumeInfo, DataStore> volumeMap, VirtualMachineTO vmTo, Host srcHost, Host destHost,
++            AsyncCompletionCallback<CopyCommandResult> callback);
++
 +}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/30479293/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/EndPoint.java
----------------------------------------------------------------------
diff --cc engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/EndPoint.java
index 4966419,2ff45b1..34cb139
--- a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/EndPoint.java
+++ b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/EndPoint.java
@@@ -24,8 -23,6 +23,7 @@@ import com.cloud.agent.api.Command
  
  public interface EndPoint {
      public long getId();
 +    public String getHostAddr();
  	public Answer sendMessage(Command cmd);
  	public void sendMessageAsync(Command cmd, AsyncCompletionCallback<Answer> callback);
- 	void sendMessageAsyncWithListener(Command cmd, Listener listner);
  }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/30479293/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/VolumeService.java
----------------------------------------------------------------------
diff --cc engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/VolumeService.java
index 0f6caa3,3a1fe6a..3f725e1
--- a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/VolumeService.java
+++ b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/VolumeService.java
@@@ -18,15 -18,15 +18,17 @@@
   */
  package org.apache.cloudstack.engine.subsystem.api.storage;
  
+ import java.util.Map;
  import org.apache.cloudstack.engine.cloud.entity.api.VolumeEntity;
  import org.apache.cloudstack.framework.async.AsyncCallFuture;
 +import org.apache.cloudstack.storage.command.CommandResult;
 +
+ import com.cloud.agent.api.to.VirtualMachineTO;
  import com.cloud.exception.ConcurrentOperationException;
- 
+ import com.cloud.host.Host;
  
  public interface VolumeService {
 -    
 +
      public class VolumeApiResult extends CommandResult {
          private final VolumeInfo volume;
          public VolumeApiResult(VolumeInfo volume) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/30479293/engine/api/src/org/apache/cloudstack/storage/command/CommandResult.java
----------------------------------------------------------------------
diff --cc engine/api/src/org/apache/cloudstack/storage/command/CommandResult.java
index c1a97ad,0000000..129f6f8
mode 100644,000000..100644
--- a/engine/api/src/org/apache/cloudstack/storage/command/CommandResult.java
+++ b/engine/api/src/org/apache/cloudstack/storage/command/CommandResult.java
@@@ -1,52 -1,0 +1,52 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one
 + * or more contributor license agreements.  See the NOTICE file
 + * distributed with this work for additional information
 + * regarding copyright ownership.  The ASF licenses this file
 + * to you under the Apache License, Version 2.0 (the
 + * "License"); you may not use this file except in compliance
 + * with the License.  You may obtain a copy of the License at
 + *
 + *   http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing,
 + * software distributed under the License is distributed on an
 + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 + * KIND, either express or implied.  See the License for the
 + * specific language governing permissions and limitations
 + * under the License.
 + */
 +package org.apache.cloudstack.storage.command;
 +
 +public class CommandResult {
 +    private boolean success;
 +    private String result;
 +    public CommandResult() {
 +        this.success = true;
 +        this.result = "";
 +    }
 +   
 +    public boolean isSuccess() {
 +        return this.success;
 +    }
 +    
 +    public boolean isFailed() {
 +        return !this.success;
 +    }
 +    
-     public void setSucess(boolean success) {
++    public void setSuccess(boolean success) {
 +        this.success = success;
 +    }
 +    
 +    public String getResult() {
 +        return this.result;
 +    }
 +    
 +    public void setResult(String result) {
 +        this.result = result;
 +        if (result != null) {
 +            this.success = false;
 +        }
 +    }
 +}
 + 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/30479293/engine/pom.xml
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/30479293/engine/schema/src/com/cloud/storage/SnapshotVO.java
----------------------------------------------------------------------
diff --cc engine/schema/src/com/cloud/storage/SnapshotVO.java
index 0000000,78b96ec..4fc195c
mode 000000,100644..100644
--- a/engine/schema/src/com/cloud/storage/SnapshotVO.java
+++ b/engine/schema/src/com/cloud/storage/SnapshotVO.java
@@@ -1,0 -1,298 +1,228 @@@
+ // Licensed to the Apache Software Foundation (ASF) under one
+ // or more contributor license agreements.  See the NOTICE file
+ // distributed with this work for additional information
+ // regarding copyright ownership.  The ASF licenses this file
+ // to you under the Apache License, Version 2.0 (the
+ // "License"); you may not use this file except in compliance
+ // with the License.  You may obtain a copy of the License at
+ //
+ //   http://www.apache.org/licenses/LICENSE-2.0
+ //
+ // Unless required by applicable law or agreed to in writing,
+ // software distributed under the License is distributed on an
+ // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ // KIND, either express or implied.  See the License for the
+ // specific language governing permissions and limitations
+ // under the License.
+ package com.cloud.storage;
+ 
+ import com.cloud.hypervisor.Hypervisor.HypervisorType;
+ import com.cloud.utils.db.GenericDao;
+ import com.google.gson.annotations.Expose;
+ 
+ import javax.persistence.*;
+ import java.util.Date;
+ import java.util.UUID;
+ 
+ @Entity
+ @Table(name="snapshots")
+ public class SnapshotVO implements Snapshot {
+ 
+     @Id
+     @GeneratedValue(strategy=GenerationType.IDENTITY)
+     @Column(name="id")
+     private long id;
+ 
+     @Column(name="data_center_id")
+     long dataCenterId;
+ 
+     @Column(name="account_id")
+     long accountId;
+ 
+     @Column(name="domain_id")
+     long domainId;
+ 
+     @Column(name="volume_id")
+     Long volumeId;
+ 
+     @Column(name="disk_offering_id")
+     Long diskOfferingId;
+ 
+     @Expose
 -    @Column(name="path")
 -    String path;
 -
 -    @Expose
+     @Column(name="name")
+     String name;
+ 
+     @Expose
+     @Column(name="status", updatable = true, nullable=false)
+     @Enumerated(value=EnumType.STRING)
+     private State state;
+ 
+     @Column(name="snapshot_type")
+     short snapshotType;
+ 
+     @Column(name="type_description")
+     String typeDescription;
+ 
+     @Column(name="size")
+     long size;
+ 
+     @Column(name=GenericDao.CREATED_COLUMN)
+     Date created;
+ 
+     @Column(name=GenericDao.REMOVED_COLUMN)
+     Date removed;
+ 
 -    @Column(name="backup_snap_id")
 -    String backupSnapshotId;
 -
 -    @Column(name="swift_id")
 -    Long swiftId;
 -
 -    @Column(name="s3_id")
 -    Long s3Id;
 -
 -    @Column(name="sechost_id")
 -    Long secHostId;
 -
 -    @Column(name="prev_snap_id")
 -    long prevSnapshotId;
 -
+     @Column(name="hypervisor_type")
+     @Enumerated(value=EnumType.STRING)
+     HypervisorType  hypervisorType;
+ 
+     @Expose
+     @Column(name="version")
+     String version;
+ 
+     @Column(name="uuid")
+     String uuid;
+ 
+     public SnapshotVO() {
+         this.uuid = UUID.randomUUID().toString();
+     }
+ 
 -    public SnapshotVO(long dcId, long accountId, long domainId, Long volumeId, Long diskOfferingId, String path, String name, short snapshotType, String typeDescription, long size, HypervisorType hypervisorType ) {
++    public SnapshotVO(long dcId, long accountId, long domainId, Long volumeId, Long diskOfferingId, String name, short snapshotType, String typeDescription, long size, HypervisorType hypervisorType ) {
+         this.dataCenterId = dcId;
+         this.accountId = accountId;
+         this.domainId = domainId;
+         this.volumeId = volumeId;
+         this.diskOfferingId = diskOfferingId;
 -        this.path = path;
+         this.name = name;
+         this.snapshotType = snapshotType;
+         this.typeDescription = typeDescription;
+         this.size = size;
+         this.state = State.Allocated;
 -        this.prevSnapshotId = 0;
+         this.hypervisorType = hypervisorType;
+         this.version = "2.2";
+         this.uuid = UUID.randomUUID().toString();
+     }
+ 
+     @Override
+     public long getId() {
+         return id;
+     }
+ 
+     public long getDataCenterId() {
+         return dataCenterId;
+     }
+ 
+     @Override
+     public long getAccountId() {
+         return accountId;
+     }
+ 
+     @Override
+     public long getDomainId() {
+         return domainId;
+     }
+ 
+     @Override
+     public long getVolumeId() {
+         return volumeId;
+     }
+ 
+     public long getDiskOfferingId() {
+         return diskOfferingId;
+     }
+ 
+     public void setVolumeId(Long volumeId) {
+         this.volumeId = volumeId;
+     }
+ 
 -    @Override
 -    public String getPath() {
 -        return path;
 -    }
 -
 -    public void setPath(String path) {
 -        this.path = path;
 -    }
+ 
+     @Override
+     public String getName() {
+         return name;
+     }
+     @Override
+     public short getsnapshotType() {
+         return snapshotType;
+     }
+ 
+     @Override
+     public Type getRecurringType() {
+         if (snapshotType < 0 || snapshotType >= Type.values().length) {
+             return null;
+         }
+         return Type.values()[snapshotType];
+     }
+ 
 -    public Long getSwiftId() {
 -        return swiftId;
 -    }
 -
 -    public void setSwiftId(Long swiftId) {
 -        this.swiftId = swiftId;
 -    }
 -
 -    public Long getSecHostId() {
 -        return secHostId;
 -    }
 -
 -    public void setSecHostId(Long secHostId) {
 -        this.secHostId = secHostId;
 -    }
 -
+     @Override
+     public HypervisorType getHypervisorType() {
+         return hypervisorType;
+     }
+ 
+     public void setSnapshotType(short snapshotType) {
+         this.snapshotType = snapshotType;
+     }
+ 
+     @Override
+     public boolean isRecursive(){
+         if ( snapshotType >= Type.HOURLY.ordinal() && snapshotType <= Type.MONTHLY.ordinal() ) {
+             return true;
+         }
+         return false;
+     }
+ 
+     public long getSize() {
+         return size;
+     }
+ 
+     public String getTypeDescription() {
+         return typeDescription;
+     }
+     public void setTypeDescription(String typeDescription) {
+         this.typeDescription = typeDescription;
+     }
+ 
+     public String getVersion() {
+         return version;
+     }
+ 
+     public void setVersion(String version) {
+         this.version = version;
+     }
+ 
+     @Override
+     public Date getCreated() {
+         return created;
+     }
+ 
+     public Date getRemoved() {
+         return removed;
+     }
+ 
+     @Override
+     public State getState() {
+         return state;
+     }
+ 
+ 
+ 	public void setState(State state) {
+         this.state = state;
+     }
+ 
 -    public String getBackupSnapshotId(){
 -        return backupSnapshotId;
 -    }
 -
 -    public long getPrevSnapshotId(){
 -        return prevSnapshotId;
 -    }
 -
 -    public void setBackupSnapshotId(String backUpSnapshotId){
 -        this.backupSnapshotId = backUpSnapshotId;
 -    }
 -
 -    public void setPrevSnapshotId(long prevSnapshotId){
 -        this.prevSnapshotId = prevSnapshotId;
 -    }
 -
+     public static Type getSnapshotType(String snapshotType) {
+         for ( Type type : Type.values()) {
+             if ( type.equals(snapshotType)) {
+                 return type;
+             }
+         }
+         return null;
+     }
+ 
+     @Override
+     public String getUuid() {
+         return this.uuid;
+     }
+ 
+     public void setUuid(String uuid) {
+         this.uuid = uuid;
+     }
 -
 -    public Long getS3Id() {
 -        return s3Id;
 -    }
 -
 -    public void setS3Id(Long s3Id) {
 -        this.s3Id = s3Id;
 -    }
 -
+ }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/30479293/engine/schema/src/com/cloud/storage/UploadVO.java
----------------------------------------------------------------------
diff --cc engine/schema/src/com/cloud/storage/UploadVO.java
index 0000000,d761bf1..fe8b812
mode 000000,100755..100755
--- a/engine/schema/src/com/cloud/storage/UploadVO.java
+++ b/engine/schema/src/com/cloud/storage/UploadVO.java
@@@ -1,0 -1,268 +1,268 @@@
+ // Licensed to the Apache Software Foundation (ASF) under one
+ // or more contributor license agreements.  See the NOTICE file
+ // distributed with this work for additional information
+ // regarding copyright ownership.  The ASF licenses this file
+ // to you under the Apache License, Version 2.0 (the
+ // "License"); you may not use this file except in compliance
+ // with the License.  You may obtain a copy of the License at
+ //
+ //   http://www.apache.org/licenses/LICENSE-2.0
+ //
+ // Unless required by applicable law or agreed to in writing,
+ // software distributed under the License is distributed on an
+ // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ // KIND, either express or implied.  See the License for the
+ // specific language governing permissions and limitations
+ // under the License.
+ package com.cloud.storage;
+ 
+ import java.util.Date;
+ import java.util.UUID;
+ 
+ import javax.persistence.Column;
+ import javax.persistence.Entity;
+ import javax.persistence.EnumType;
+ import javax.persistence.Enumerated;
+ import javax.persistence.GeneratedValue;
+ import javax.persistence.GenerationType;
+ import javax.persistence.Id;
+ import javax.persistence.Table;
+ import javax.persistence.Temporal;
+ import javax.persistence.TemporalType;
+ 
+ import com.cloud.utils.NumbersUtil;
+ import com.cloud.utils.db.GenericDaoBase;
 -import org.apache.cloudstack.api.InternalIdentity;
+ 
+ @Entity
+ @Table(name="upload")
+ public class UploadVO implements Upload {
+ 	@Id
+ 	@GeneratedValue(strategy=GenerationType.IDENTITY)
+ 	long id;
+ 
+     @Column(name="uuid")
+ 	private String uuid;
+ 
+ 	@Column(name="host_id")
 -	private long hostId;
++	private long storeId;
+ 
+ 	@Column(name="type_id")
+ 	private long typeId;
+ 
+ 	@Column(name=GenericDaoBase.CREATED_COLUMN)
+ 	private Date created = null;
+ 
+ 	@Column(name="last_updated")
+ 	@Temporal(value=TemporalType.TIMESTAMP)
+ 	private Date lastUpdated = null;
+ 
+ 	@Column (name="upload_pct")
+ 	private int uploadPercent;
+ 
+ 	@Column (name="type")
+ 	@Enumerated(EnumType.STRING)
+ 	private Type type;
+ 
+ 	@Column (name="mode")
+     @Enumerated(EnumType.STRING)
+     private Mode mode = Mode.FTP_UPLOAD;
+ 
+ 	@Column (name="upload_state")
+ 	@Enumerated(EnumType.STRING)
+ 	private Status uploadState;
+ 
+ 	@Column (name="error_str")
+ 	private String errorString;
+ 
+ 	@Column (name="job_id")
+ 	private String jobId;
+ 
+ 	@Column (name="url")
+ 	private String uploadUrl;
+ 
+ 	@Column (name="install_path")
+ 	private String installPath;
+ 
+ 	@Override
 -    public long getHostId() {
 -		return hostId;
++    public long getDataStoreId() {
++		return storeId;
+ 	}
+ 
 -	public void setHostId(long hostId) {
 -		this.hostId = hostId;
++	public void setDataStoreId(long hostId) {
++		this.storeId = hostId;
+ 	}
+ 
+ 	@Override
+     public long getId() {
+ 		return id;
+ 	}
+ 
+ 
 -	public String getUuid() {
++	@Override
++    public String getUuid() {
+         return uuid;
+     }
+ 
+     @Override
+     public Date getCreated() {
+ 		return created;
+ 	}
+ 
+ 	@Override
+     public Date getLastUpdated() {
+ 		return lastUpdated;
+ 	}
+ 
+ 	public void setLastUpdated(Date date) {
+ 	    lastUpdated = date;
+ 	}
+ 
+ 	public UploadVO(long hostId, long templateId) {
+ 		super();
 -		this.hostId = hostId;
++		this.storeId = hostId;
+ 		this.typeId = templateId;
+ 		this.uuid = UUID.randomUUID().toString();
+ 	}
+ 
+ 	public UploadVO(long hostId, long typeId, Date lastUpdated,
+ 			Status uploadState, Type type,
+ 			String uploadUrl, Mode mode) {
+ 		super();
 -		this.hostId = hostId;
++		this.storeId = hostId;
+ 		this.typeId = typeId;
+ 		this.lastUpdated = lastUpdated;
+ 		this.uploadState = uploadState;
+ 		this.mode = mode;
+ 		this.type = type;
+ 		this.uploadUrl = uploadUrl;
+         this.uuid = UUID.randomUUID().toString();
+ 	}
+ 
+ 	public UploadVO(long hostId, long typeId, Date lastUpdated,
+             Status uploadState, int uploadPercent, Type type,
+             Mode mode) {
+         super();
 -        this.hostId = hostId;
++        this.storeId = hostId;
+         this.typeId = typeId;
+         this.lastUpdated = lastUpdated;
+         this.uploadState = uploadState;
+         this.uploadPercent = uploadPercent;
+         this.type = type;
+         this.mode = mode;
+         this.uuid = UUID.randomUUID().toString();
+ 
+     }
+ 
+ 	protected UploadVO() {
+ 	}
+ 
+ 	public UploadVO(Long uploadId) {
+ 		this.id = uploadId;
+ 	}
+ 
+ 	public void setErrorString(String errorString) {
+ 		this.errorString = errorString;
+ 	}
+ 
+ 	@Override
+     public String getErrorString() {
+ 		return errorString;
+ 	}
+ 
+ 	public void setJobId(String jobId) {
+ 		this.jobId = jobId;
+ 	}
+ 
+ 	@Override
+     public String getJobId() {
+ 		return jobId;
+ 	}
+ 
+ 	@Override
+ 	public boolean equals(Object obj) {
+ 		if (obj instanceof UploadVO) {
+ 			UploadVO other = (UploadVO)obj;
 -		   return (this.typeId==other.getTypeId() && this.hostId==other.getHostId() && this.type == other.getType());
++		   return (this.typeId==other.getTypeId() && this.storeId==other.getDataStoreId() && this.type == other.getType());
+ 		}
+ 		return false;
+ 	}
+ 
+ 	@Override
+ 	public int hashCode() {
+ 		return NumbersUtil.hash(id);
+ 	}
+ 
+ 	@Override
+     public int getUploadPercent() {
+ 		return uploadPercent;
+ 	}
+ 
+ 	public void setUploadPercent(int uploadPercent) {
+ 		this.uploadPercent = uploadPercent;
+ 	}
+ 
+ 	@Override
+     public Status getUploadState() {
+ 		return uploadState;
+ 	}
+ 
+ 	public void setUploadState(Status uploadState) {
+ 		this.uploadState = uploadState;
+ 	}
+ 
+ 	@Override
+     public long getTypeId() {
+ 		return typeId;
+ 	}
+ 
+ 	public void setTypeId(long typeId) {
+ 		this.typeId = typeId;
+ 	}
+ 
+ 	@Override
+     public Type getType() {
+ 		return type;
+ 	}
+ 
+ 	public void setType(Type type) {
+ 		this.type = type;
+ 	}
+ 
+ 	@Override
+     public Mode getMode() {
+         return mode;
+     }
+ 
+     public void setMode(Mode mode) {
+         this.mode = mode;
+     }
+ 
+     @Override
+     public String getUploadUrl() {
+ 		return uploadUrl;
+ 	}
+ 
+ 	public void setUploadUrl(String uploadUrl) {
+ 		this.uploadUrl = uploadUrl;
+ 	}
+ 
+ 	@Override
+     public void setId(Long id) {
+ 		this.id = id;
+ 	}
+ 
+ 	@Override
+     public void setCreated(Date created) {
+ 		this.created = created;
+ 	}
+ 
+     @Override
+     public String getInstallPath() {
+         return installPath;
+     }
+ 
+     @Override
+     public void setInstallPath(String installPath) {
+         this.installPath = installPath;
+     }
+ }


Mime
View raw message